Decompiled source of Bozoros v2.2.5

BepInEx/plugins/Bozoros.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AntlerShed.SkinRegistry;
using AntlerShed.SkinRegistry.Events;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using Bozoros.Behaviours;
using Bozoros.Compatibility;
using Bozoros.NetcodePatcher;
using Bozoros.Patches;
using Bozoros.Skins;
using DunGen;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLevelLoader;
using Microsoft.CodeAnalysis;
using Mimics;
using Mimics.API;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.VFX;
using WeatherRegistry;
using WeatherRegistry.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Bozoros")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Plugin for LethalMatt's Bozoros, adds configuration and some additional stuff.")]
[assembly: AssemblyFileVersion("2.2.5.0")]
[assembly: AssemblyInformationalVersion("2.2.5")]
[assembly: AssemblyProduct("Bozoros")]
[assembly: AssemblyTitle("Bozoros")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.2.5.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<float>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<float>();
	}
}
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;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Bozoros
{
	public class Config
	{
		public ConfigEntry<bool> STREAMER_FRIENDLY { get; private set; }

		public ConfigEntry<float> FIREWORK_PARTICLES { get; private set; }

		public ConfigEntry<float> CONFETTI_PARTICLES { get; private set; }

		public ConfigEntry<float> BALLOON_PARTICLES { get; private set; }

		public ConfigEntry<float> FIREWORK_MUSIC_VOLUME { get; private set; }

		public ConfigEntry<float> FIREWORK_EXPLOSION_VOLUME { get; private set; }

		public ConfigEntry<float> ANNOUNCER_VOLUME { get; private set; }

		public ConfigEntry<float> TENT_MUSIC_VOLUME { get; private set; }

		public ConfigEntry<string> GOOFY_PUFFER_NAMES { get; private set; }

		public ConfigEntry<string> CLOWN_GIANT_NAMES { get; private set; }

		public ConfigEntry<string> SANTA_BUTLER_NAMES { get; private set; }

		public ConfigEntry<bool> BALLOON_INSTRUCTIONS { get; private set; }

		public ConfigEntry<int> BALLOON_PRICE { get; private set; }

		public ConfigEntry<bool> MODIFY_SHIP_NODE { get; private set; }

		public ConfigEntry<bool> CIRCUS_FACILITY_MIMICS { get; private set; }

		public Config(ConfigFile cfg)
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Expected O, but got Unknown
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Expected O, but got Unknown
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Expected O, but got Unknown
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Expected O, but got Unknown
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Expected O, but got Unknown
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Expected O, but got Unknown
			cfg.SaveOnConfigSet = false;
			STREAMER_FRIENDLY = cfg.Bind<bool>("General", "StreamerFriendly", true, "Whether the music is streamer-friendly or not.");
			FIREWORK_PARTICLES = cfg.Bind<float>("Particles", "FireworkParticles", 1f, new ConfigDescription("Intensity of firework particles at the end of a clear day.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			CONFETTI_PARTICLES = cfg.Bind<float>("Particles", "ConfettiParticles", 1f, new ConfigDescription("Intensity of confetti particles during eclipsed weather.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			BALLOON_PARTICLES = cfg.Bind<float>("Particles", "BalloonParticles", 1f, new ConfigDescription("Intensity of balloon particles during stormy weather.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			FIREWORK_MUSIC_VOLUME = cfg.Bind<float>("Audio", "FireworkMusicVolume", 1f, new ConfigDescription("Volume level for the firework music at the end of a clear day.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>()));
			FIREWORK_EXPLOSION_VOLUME = cfg.Bind<float>("Audio", "FireworkExplosionVolume", 1f, new ConfigDescription("Volume level for the firework explosion sound effects at the end of a clear day.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>()));
			ANNOUNCER_VOLUME = cfg.Bind<float>("Audio", "AnnouncerVolume", 2f, new ConfigDescription("Volume level for the announcer voice at the end of each day.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>()));
			TENT_MUSIC_VOLUME = cfg.Bind<float>("Audio", "TentMusicVolume", 1f, new ConfigDescription("Volume level for the circus tent music near every entrance.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>()));
			GOOFY_PUFFER_NAMES = cfg.Bind<string>("Enemies", "GoofyPufferNames", "Steve,Krusty,Ronald,Arthur,Toodles,Jingles,Dusty,Dumbo,Bingo,Whistle,Mittens,Pancake,Freckles,Chester,Oddball,Snuggles,Charlie,Bashful,Flower,Jumbo,Jimbo,Snickers,Pogo,Giggles,Loofy,Blinky,Ruffles,Dinky,Beebo", "A comma-separated list of names for Spore Lizard enemy variants to show in their scan node. Requires restart.");
			CLOWN_GIANT_NAMES = cfg.Bind<string>("Enemies", "ClownGiantNames", "Penn,Teller,Houdini,Dante,Copperfield,Blaine,Angel,Borden,Angier,Merlin,Kaito,Oz,Zatara,Mysterio,Riddler,Eisenheim,Gallico,Splendini", "A comma-separated list of names for Forest Giant enemy variants to show in their scan node. Requires restart.");
			SANTA_BUTLER_NAMES = cfg.Bind<string>("Enemies", "SantaButlerNames", "Santa Claus,St. Nicholas,Joulupukki,Sinterklaas,Ded Moroz,Julenisse,Mikulás,Shengdan Laoren,Père Noël,Krampus,Knecht Ruprecht,Kriss Kringle", "A comma-separated list of names for Santa Butler enemy variants to show in their scan node. Requires restart.");
			BALLOON_INSTRUCTIONS = cfg.Bind<bool>("Mechanics", "BalloonInstructions", true, "Show a one-time notification with instructions on how to operate balloons. Shows once per session, until the game is reopened.");
			BALLOON_PRICE = cfg.Bind<int>("Mechanics", "BalloonPrice", 15, new ConfigDescription("Credits required to purchase a one-time balloon shortcut from one of the balloon stands around the map. Can be set to -1 to disable (if you HATE fun).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(-1, 1000), Array.Empty<object>()));
			MODIFY_SHIP_NODE = cfg.Bind<bool>("Other", "ModifyShipNode", false, "Increase (subjective) accuracy of the ship's scan node.");
			CIRCUS_FACILITY_MIMICS = cfg.Bind<bool>("Compatibility", "CircusFacilityMimics", true, "Allow x753's Mimics to spawn in Circus Facility.");
			ClearOrphanedEntries(cfg);
			cfg.SaveOnConfigSet = true;
			cfg.Save();
		}

		private void ClearOrphanedEntries(ConfigFile config)
		{
			PropertyInfo propertyInfo = AccessTools.Property(typeof(ConfigFile), "OrphanedEntries");
			((Dictionary<ConfigDefinition, string>)propertyInfo.GetValue(config))?.Clear();
		}
	}
	[BepInPlugin("LethalMatt.Bozoros", "BozorosPlugin", "2.2.5")]
	[BepInDependency("imabatby.lethallevelloader", "1.3.13")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Event <>9__28_2;

			public static Event <>9__28_3;

			public static Action <>9__28_4;

			public static Event <>9__28_5;

			public static Action<ExtendedMod> <>9__28_0;

			public static Action<AssetBundle> <>9__28_1;

			public static Func<Type, bool> <>9__29_0;

			internal void <LoadAssets>b__28_0(ExtendedMod bozorosExtended)
			{
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: Expected O, but got Unknown
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: Expected O, but got Unknown
				//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ff: Expected O, but got Unknown
				ExtendedLevel obj = bozorosExtended.ExtendedLevels[0];
				if (obj != null)
				{
					ExtendedEvent onLevelLoaded = obj.LevelEvents.onLevelLoaded;
					object obj2 = <>9__28_2;
					if (obj2 == null)
					{
						Event val = delegate
						{
							OnBozoros = true;
						};
						<>9__28_2 = val;
						obj2 = (object)val;
					}
					onLevelLoaded.AddListener((Event)obj2);
				}
				ExtendedLevel obj3 = bozorosExtended.ExtendedLevels[0];
				if (obj3 != null)
				{
					ExtendedEvent onShipLeave = obj3.LevelEvents.onShipLeave;
					object obj4 = <>9__28_3;
					if (obj4 == null)
					{
						Event val2 = delegate
						{
							SoundManager.Instance.currentLevelAmbience = null;
							OnBozoros = false;
						};
						<>9__28_3 = val2;
						obj4 = (object)val2;
					}
					onShipLeave.AddListener((Event)obj4);
				}
				ExtendedDungeonFlow obj5 = bozorosExtended.ExtendedDungeonFlows[0];
				if (obj5 != null)
				{
					obj5.DungeonEvents.onBeforeDungeonGenerate.AddListener((Action)delegate
					{
						InCircusFacility = true;
					});
				}
				ExtendedDungeonFlow obj6 = bozorosExtended.ExtendedDungeonFlows[0];
				if (obj6 == null)
				{
					return;
				}
				ExtendedEvent onShipLeave2 = obj6.DungeonEvents.onShipLeave;
				object obj7 = <>9__28_5;
				if (obj7 == null)
				{
					Event val3 = delegate
					{
						InCircusFacility = false;
					};
					<>9__28_5 = val3;
					obj7 = (object)val3;
				}
				onShipLeave2.AddListener((Event)obj7);
			}

			internal void <LoadAssets>b__28_2()
			{
				OnBozoros = true;
			}

			internal void <LoadAssets>b__28_3()
			{
				SoundManager.Instance.currentLevelAmbience = null;
				OnBozoros = false;
			}

			internal void <LoadAssets>b__28_4()
			{
				InCircusFacility = true;
			}

			internal void <LoadAssets>b__28_5()
			{
				InCircusFacility = false;
			}

			internal void <LoadAssets>b__28_1(AssetBundle assetBundle)
			{
				BozorosIcon = assetBundle.LoadAsset<Texture2D>("BozorosIcon.png");
				GameObject val = assetBundle.LoadAsset<GameObject>("Xmas_GrabbableBalloon.prefab");
				if ((Object)(object)val != (Object)null)
				{
					LethalLevelLoaderNetworkManager.RegisterNetworkPrefab(val);
				}
			}

			internal bool <NetcodePatcher>b__29_0(Type type)
			{
				return type != null;
			}
		}

		internal const string GUID = "LethalMatt.Bozoros";

		internal const string PLUGIN_NAME = "BozorosPlugin";

		internal const string VERSION = "2.2.5";

		internal static ManualLogSource? StaticLogger { get; private set; }

		internal static Harmony? Harmony { get; private set; }

		public static Config? Settings { get; private set; }

		public static Texture2D? BozorosIcon { get; private set; }

		public static bool OnBozoros { get; internal set; }

		public static bool InCircusFacility { get; internal set; }

		private void Awake()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			StaticLogger = ((BaseUnityPlugin)this).Logger;
			try
			{
				Settings = new Config(((BaseUnityPlugin)this).Config);
				Harmony = new Harmony("LethalMatt.Bozoros");
				NetcodePatcher();
				LoadAssets();
				Harmony.PatchAll(typeof(LoadPatch));
				Harmony.PatchAll(typeof(PopcornNestPatch));
				if (WeatherRegistryCompatibility.Enabled)
				{
					Harmony.PatchAll(typeof(WeatherRegistryCompatibility));
				}
				ManualLogSource? staticLogger = StaticLogger;
				if (staticLogger != null)
				{
					staticLogger.LogInfo((object)"'BozorosPlugin' loaded!");
				}
			}
			catch (Exception arg)
			{
				StaticLogger.LogError((object)string.Format("Error while initializing '{0}': {1}", "BozorosPlugin", arg));
			}
		}

		private void LoadAssets()
		{
			AssetBundleLoader.AddOnExtendedModLoadedListener((Action<ExtendedMod>)delegate(ExtendedMod bozorosExtended)
			{
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: Expected O, but got Unknown
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: Expected O, but got Unknown
				//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ff: Expected O, but got Unknown
				ExtendedLevel obj = bozorosExtended.ExtendedLevels[0];
				if (obj != null)
				{
					ExtendedEvent onLevelLoaded = obj.LevelEvents.onLevelLoaded;
					object obj2 = <>c.<>9__28_2;
					if (obj2 == null)
					{
						Event val2 = delegate
						{
							OnBozoros = true;
						};
						<>c.<>9__28_2 = val2;
						obj2 = (object)val2;
					}
					onLevelLoaded.AddListener((Event)obj2);
				}
				ExtendedLevel obj3 = bozorosExtended.ExtendedLevels[0];
				if (obj3 != null)
				{
					ExtendedEvent onShipLeave = obj3.LevelEvents.onShipLeave;
					object obj4 = <>c.<>9__28_3;
					if (obj4 == null)
					{
						Event val3 = delegate
						{
							SoundManager.Instance.currentLevelAmbience = null;
							OnBozoros = false;
						};
						<>c.<>9__28_3 = val3;
						obj4 = (object)val3;
					}
					onShipLeave.AddListener((Event)obj4);
				}
				ExtendedDungeonFlow obj5 = bozorosExtended.ExtendedDungeonFlows[0];
				if (obj5 != null)
				{
					obj5.DungeonEvents.onBeforeDungeonGenerate.AddListener((Action)delegate
					{
						InCircusFacility = true;
					});
				}
				ExtendedDungeonFlow obj6 = bozorosExtended.ExtendedDungeonFlows[0];
				if (obj6 != null)
				{
					ExtendedEvent onShipLeave2 = obj6.DungeonEvents.onShipLeave;
					object obj7 = <>c.<>9__28_5;
					if (obj7 == null)
					{
						Event val4 = delegate
						{
							InCircusFacility = false;
						};
						<>c.<>9__28_5 = val4;
						obj7 = (object)val4;
					}
					onShipLeave2.AddListener((Event)obj7);
				}
			}, "LethalMatt", "Bozoros");
			AssetBundleLoader.AddOnLethalBundleLoadedListener((Action<AssetBundle>)delegate(AssetBundle assetBundle)
			{
				BozorosIcon = assetBundle.LoadAsset<Texture2D>("BozorosIcon.png");
				GameObject val = assetBundle.LoadAsset<GameObject>("Xmas_GrabbableBalloon.prefab");
				if ((Object)(object)val != (Object)null)
				{
					LethalLevelLoaderNetworkManager.RegisterNetworkPrefab(val);
				}
			}, "bozoros.lethalbundle");
			if (EnemySkinRegistryCompatibility.Enabled)
			{
				EnemySkinRegistryCompatibility.RegisterSkins();
			}
			if (MimicsCompatibility.Enabled)
			{
				MimicsCompatibility.RegisterCircusMimic();
			}
		}

		private static void NetcodePatcher()
		{
			Type[] array;
			try
			{
				array = Assembly.GetExecutingAssembly().GetTypes();
			}
			catch (ReflectionTypeLoadException ex)
			{
				array = ex.Types.Where((Type type) => type != null).ToArray();
			}
			Type[] array2 = array;
			foreach (Type type2 in array2)
			{
				MethodInfo[] methods = type2.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				foreach (MethodInfo methodInfo in methods)
				{
					if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
		}
	}
}
namespace Bozoros.Skins
{
	internal class CircusMimic : MimicEventHandler
	{
		public static GameObject? CircusMimicPrefab { get; internal set; }

		public override string ModGUID => "LethalMatt.Bozoros";

		public override bool IsMyInteriorLoaded => Plugin.InCircusFacility;

		public override int Priority => 100;

		public override bool OverrideDefaultImperfectionCreation(MimicDoor mimicDoor, Doorway doorway)
		{
			return false;
		}

		public override void OnMimicCreated(MimicDoor mimicDoor, Doorway doorway)
		{
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: 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)
			((MimicEventHandler)this).OnMimicCreated(mimicDoor, doorway);
			if (!((Object)(object)CircusMimicPrefab == (Object)null))
			{
				Object.Instantiate<GameObject>(CircusMimicPrefab, ((Component)mimicDoor).transform);
				Transform obj = ((Component)mimicDoor).transform.Find("Armature/Frame");
				GameObject val = ((obj != null) ? ((Component)obj).gameObject : null);
				if (val != null)
				{
					val.transform.SetLocalPositionAndRotation(new Vector3(0f, -0.65f, 0f), Quaternion.Euler(new Vector3(90f, 0f, 0f)));
				}
				((Component)mimicDoor).transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity);
				Transform obj2 = ((Component)mimicDoor).transform.Find("Armature/Door");
				if (obj2 != null)
				{
					((Component)obj2).gameObject.SetActive(false);
				}
				Transform obj3 = ((Component)mimicDoor).transform.Find("Light");
				if (obj3 != null)
				{
					((Component)obj3).gameObject.SetActive(false);
				}
			}
		}

		public override void OnMimicCreateImperfections(MimicDoor mimicDoor)
		{
			((MimicEventHandler)this).OnMimicCreateImperfections(mimicDoor);
		}

		public override void OnMimicAttackStart(MimicDoor mimicDoor, PlayerControllerB playerToAttack)
		{
			((MimicEventHandler)this).OnMimicAttackStart(mimicDoor, playerToAttack);
			Transform obj = ((Component)mimicDoor).transform.Find("CircusWallDoorMimic(Clone)");
			if (obj != null)
			{
				Transform child = obj.GetChild(0);
				Animator val = default(Animator);
				if (((child != null) ? new bool?(((Component)child.GetChild(1)).TryGetComponent<Animator>(ref val)) : null) == true)
				{
					val.SetTrigger("Attack");
				}
			}
		}

		public override void OnMimicAttackEnd(MimicDoor mimicDoor)
		{
			((MimicEventHandler)this).OnMimicAttackEnd(mimicDoor);
		}
	}
	internal class ClownGiant : Skin, Skinner
	{
		public string Label => "Clown Giant";

		public string Id => "LethalMatt.Bozoros.ClownGiant";

		public string EnemyId => "LethalCompany.ForestKeeper";

		public Texture2D Icon => Plugin.BozorosIcon ?? Texture2D.blackTexture;

		public static Material? ClownGiantMaterial { get; internal set; }

		public static GameObject? ClownHair { get; internal set; }

		public static GameObject? ClownNose { get; internal set; }

		public static List<string> ClownGiantNames { get; internal set; } = new List<string>();


		public static Random? Random { get; internal set; }

		public Skinner CreateSkinner()
		{
			return (Skinner)(object)new ClownGiant();
		}

		public void Apply(GameObject enemy)
		{
			if (Random != null && ClownGiantNames.Count > 0)
			{
				Transform child = enemy.transform.GetChild(1);
				ScanNodeProperties val = default(ScanNodeProperties);
				if (child != null && ((Component)child).TryGetComponent<ScanNodeProperties>(ref val))
				{
					val.headerText = ClownGiantNames[Random.Next(0, ClownGiantNames.Count)] ?? "";
					val.subText = "Clown Giant";
				}
			}
			Transform val2 = enemy.transform.Find("FGiantModelContainer");
			SkinnedMeshRenderer val3 = default(SkinnedMeshRenderer);
			for (int i = 0; i < 3; i++)
			{
				if (val2 != null)
				{
					Transform child2 = val2.GetChild(i);
					if (((child2 != null) ? new bool?(((Component)child2).TryGetComponent<SkinnedMeshRenderer>(ref val3)) : null) == true)
					{
						((Renderer)val3).sharedMaterial = ClownGiantMaterial;
					}
				}
			}
			Transform val4 = ((val2 != null) ? val2.Find("AnimContainer/metarig/spine/spine.003") : null);
			Object.Instantiate<GameObject>(ClownHair, val4);
			Object.Instantiate<GameObject>(ClownNose, val4);
		}

		public void Remove(GameObject enemy)
		{
		}
	}
	internal class GoofyPuffer : Skin, Skinner
	{
		public string Label => "Goofy Puffer";

		public string Id => "LethalMatt.Bozoros.GoofyPuffer";

		public string EnemyId => "LethalCompany.SporeLizard";

		public Texture2D Icon => Plugin.BozorosIcon ?? Texture2D.blackTexture;

		public static Material? GoofyPufferMaterial { get; internal set; }

		public static List<string> GoofyPufferNames { get; internal set; } = new List<string>();


		public static Random? Random { get; internal set; }

		public Skinner CreateSkinner()
		{
			return (Skinner)(object)new GoofyPuffer();
		}

		public void Apply(GameObject enemy)
		{
			if (Random != null && GoofyPufferNames.Count > 0)
			{
				Transform child = enemy.transform.GetChild(1);
				ScanNodeProperties val = default(ScanNodeProperties);
				if (child != null && ((Component)child).TryGetComponent<ScanNodeProperties>(ref val))
				{
					val.headerText = GoofyPufferNames[Random.Next(0, GoofyPufferNames.Count)] ?? "";
					val.subText = "Goofy Puffer";
				}
			}
			Transform obj = enemy.transform.Find("PufferModel/BezierCurve");
			SkinnedMeshRenderer val2 = default(SkinnedMeshRenderer);
			if (obj != null && ((Component)obj).TryGetComponent<SkinnedMeshRenderer>(ref val2))
			{
				((Renderer)val2).sharedMaterial = GoofyPufferMaterial;
			}
		}

		public void Remove(GameObject enemy)
		{
		}
	}
	internal class SantaButler : Skin, Skinner, ButlerEventHandler, EnemyEventHandler
	{
		public string Label => "Santa Butler";

		public string Id => "LethalMatt.Bozoros.SantaButler";

		public string EnemyId => "LethalCompany.Butler";

		public Texture2D Icon => Plugin.BozorosIcon ?? Texture2D.blackTexture;

		public static Mesh? CandyCaneMesh { get; internal set; }

		public static Material? CandyCaneMaterial { get; internal set; }

		public static GameObject? CandyCaneKnife { get; internal set; }

		public static Material? SantaMaterial { get; internal set; }

		public static GameObject? SantaHat { get; internal set; }

		public static Texture2D? GrinchHornetsTexture { get; internal set; }

		public static List<string> SantaButlerNames { get; internal set; } = new List<string>();


		public static Random? Random { get; internal set; }

		public Skinner CreateSkinner()
		{
			return (Skinner)(object)new SantaButler();
		}

		public void Apply(GameObject enemy)
		{
			ButlerEnemyAI val = default(ButlerEnemyAI);
			if (!enemy.TryGetComponent<ButlerEnemyAI>(ref val))
			{
				return;
			}
			ScanNodeProperties val2 = default(ScanNodeProperties);
			if (Random != null && SantaButlerNames.Count > 0 && ((Component)((Component)val).transform.Find("ScanNode")).TryGetComponent<ScanNodeProperties>(ref val2))
			{
				val2.headerText = SantaButlerNames[Random.Next(0, SantaButlerNames.Count)] ?? "";
			}
			Transform val3 = ((Component)val).transform.Find("MeshContainer");
			SkinnedMeshRenderer val4 = default(SkinnedMeshRenderer);
			for (int i = 0; i < 3; i++)
			{
				if (val3 != null)
				{
					Transform child = val3.GetChild(i);
					if (((child != null) ? new bool?(((Component)child).TryGetComponent<SkinnedMeshRenderer>(ref val4)) : null) == true)
					{
						((Renderer)val4).sharedMaterial = SantaMaterial;
					}
				}
			}
			Transform val5 = ((val3 != null) ? val3.Find("Rig 1/Arms/RightArm/upperRightArmContainer/upper_arm.R_target/Knife") : null);
			MeshFilter val6 = default(MeshFilter);
			MeshRenderer val7 = default(MeshRenderer);
			if (val5 != null && ((Component)val5).TryGetComponent<MeshFilter>(ref val6) && ((Component)val5).TryGetComponent<MeshRenderer>(ref val7))
			{
				val6.sharedMesh = CandyCaneMesh;
				((Renderer)val7).sharedMaterial = CandyCaneMaterial;
			}
			if ((Object)(object)CandyCaneKnife != (Object)null)
			{
				Object.Destroy((Object)(object)((Component)((Component)val).transform.Find("BloodStabParticle")).gameObject);
				GameObject val8 = Object.Instantiate<GameObject>(((Component)CandyCaneKnife.transform.GetChild(2)).gameObject, ((Component)val).transform, false);
				val.stabBloodParticle = val8.GetComponent<ParticleSystem>();
				val.knifePrefab = CandyCaneKnife;
			}
			Object.Instantiate<GameObject>(SantaHat, (val3 != null) ? val3.Find("metarig/spine/spine.001/NeckContainer/spine.004/face") : null);
			EnemySkinRegistry.RegisterEnemyEventHandler((EnemyAI)(object)val, (EnemyEventHandler)(object)this);
		}

		public void OnSpawnHornets(ButlerEnemyAI instance, ButlerBeesEnemyAI hornets)
		{
			Transform child = ((Component)hornets).transform.GetChild(0);
			ScanNodeProperties val = default(ScanNodeProperties);
			if (child != null && ((Component)child).TryGetComponent<ScanNodeProperties>(ref val))
			{
				val.headerText = "Grinch Particles";
			}
			VisualEffect val2 = default(VisualEffect);
			if ((Object)(object)GrinchHornetsTexture != (Object)null && ((Component)((Component)hornets).transform.Find("BugSwarmParticle")).TryGetComponent<VisualEffect>(ref val2))
			{
				val2.SetTexture("BugTexture", (Texture)(object)GrinchHornetsTexture);
			}
		}

		public void Remove(GameObject enemy)
		{
		}
	}
}
namespace Bozoros.Patches
{
	[HarmonyPatch(typeof(RoundManager), "FinishGeneratingLevel")]
	internal class LoadPatch
	{
		public static event Action? OnFinishGeneratingLevelPost;

		[HarmonyPostfix]
		private static void FinishGeneratingLevelPost()
		{
			LoadPatch.OnFinishGeneratingLevelPost?.Invoke();
		}
	}
	[HarmonyPatch]
	internal class PopcornNestPatch
	{
		public static List<Nest> AvailableNestLocations { get; internal set; } = new List<Nest>();


		public static PopcornNests? PopcornNestsInstance { get; internal set; } = null;


		[HarmonyPatch(typeof(RedLocustBees), "Start")]
		[HarmonyPostfix]
		private static void RelocateNest(RedLocustBees __instance, GrabbableObject ___hive)
		{
			//IL_00de: 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)
			if (!Plugin.OnBozoros)
			{
				return;
			}
			Transform child = ((Component)__instance).transform.GetChild(0);
			ScanNodeProperties val = default(ScanNodeProperties);
			if (child != null && ((Component)child).TryGetComponent<ScanNodeProperties>(ref val))
			{
				val.headerText = "Kernel Guardians";
			}
			if (___hive != null)
			{
				Transform child2 = ((Component)___hive).transform.GetChild(0);
				ScanNodeProperties val2 = default(ScanNodeProperties);
				if (((child2 != null) ? new bool?(((Component)child2).TryGetComponent<ScanNodeProperties>(ref val2)) : null) == true)
				{
					val2.headerText = "...Popcorn?";
				}
			}
			NetworkObject val3 = default(NetworkObject);
			NetworkObject val4 = default(NetworkObject);
			if (((NetworkBehaviour)__instance).IsHost && !((Object)(object)___hive == (Object)null) && ((Component)___hive).TryGetComponent<NetworkObject>(ref val3) && ((Component)__instance).TryGetComponent<NetworkObject>(ref val4))
			{
				PopcornNestsInstance?.RelocateNestServerRpc(NetworkObjectReference.op_Implicit(val3), NetworkObjectReference.op_Implicit(val4));
			}
		}
	}
}
namespace Bozoros.Compatibility
{
	internal class EnemySkinRegistryCompatibility
	{
		private static bool? _enabled;

		public static bool Enabled
		{
			get
			{
				bool valueOrDefault = _enabled.GetValueOrDefault();
				if (!_enabled.HasValue)
				{
					valueOrDefault = Chainloader.PluginInfos.ContainsKey("antlershed.lethalcompany.enemyskinregistry");
					_enabled = valueOrDefault;
				}
				return _enabled.Value;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		internal static void RegisterSkins()
		{
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			AssetBundleLoader.AddOnLethalBundleLoadedListener((Action<AssetBundle>)delegate(AssetBundle assetBundle)
			{
				GoofyPuffer.GoofyPufferMaterial = assetBundle.LoadAsset<Material>("GoofyPufferMat.mat");
				ClownGiant.ClownGiantMaterial = assetBundle.LoadAsset<Material>("ClownGiantMat.mat");
				ClownGiant.ClownHair = assetBundle.LoadAsset<GameObject>("ClownHair.prefab");
				ClownGiant.ClownNose = assetBundle.LoadAsset<GameObject>("ClownNose.prefab");
				SantaButler.CandyCaneMesh = assetBundle.LoadAsset<Mesh>("Xmas_CandyCane_Knife.fbx");
				SantaButler.CandyCaneMaterial = assetBundle.LoadAsset<Material>("Motif3Mat.mat");
				SantaButler.CandyCaneKnife = assetBundle.LoadAsset<GameObject>("CandyCaneKnife.prefab");
				SantaButler.SantaMaterial = assetBundle.LoadAsset<Material>("Xmas_SantaMat.mat");
				SantaButler.SantaHat = assetBundle.LoadAsset<GameObject>("Xmas_SantaHat.prefab");
				SantaButler.GrinchHornetsTexture = assetBundle.LoadAsset<Texture2D>("Xmas_GrinchHornets.png");
			}, "bozoros.lethalbundle");
			Config? settings = Plugin.Settings;
			if (settings != null && settings.GOOFY_PUFFER_NAMES.Value.Length > 0)
			{
				List<string> list = new List<string>();
				string[] array = Plugin.Settings.GOOFY_PUFFER_NAMES.Value.Split(',');
				foreach (string item in array)
				{
					list.Add(item);
				}
				GoofyPuffer.GoofyPufferNames = list;
				LoadPatch.OnFinishGeneratingLevelPost += delegate
				{
					GoofyPuffer.Random = new Random(StartOfRound.Instance.randomMapSeed + 1);
				};
			}
			Config? settings2 = Plugin.Settings;
			if (settings2 != null && settings2.CLOWN_GIANT_NAMES.Value.Length > 0)
			{
				List<string> list2 = new List<string>();
				string[] array2 = Plugin.Settings.CLOWN_GIANT_NAMES.Value.Split(',');
				foreach (string item in array2)
				{
					list2.Add(item);
				}
				ClownGiant.ClownGiantNames = list2;
				LoadPatch.OnFinishGeneratingLevelPost += delegate
				{
					ClownGiant.Random = new Random(StartOfRound.Instance.randomMapSeed + 2);
				};
			}
			Config? settings3 = Plugin.Settings;
			if (settings3 != null && settings3.SANTA_BUTLER_NAMES.Value.Length > 0)
			{
				List<string> list3 = new List<string>();
				string[] array3 = Plugin.Settings.SANTA_BUTLER_NAMES.Value.Split(',');
				foreach (string item in array3)
				{
					list3.Add(item);
				}
				SantaButler.SantaButlerNames = list3;
				LoadPatch.OnFinishGeneratingLevelPost += delegate
				{
					SantaButler.Random = new Random(StartOfRound.Instance.randomMapSeed + 3);
				};
			}
			EnemySkinRegistry.RegisterSkin((Skin)(object)new GoofyPuffer(), (DefaultSkinConfigData?)new DefaultSkinConfigData((DefaultSkinConfigEntry[])(object)new DefaultSkinConfigEntry[2]
			{
				new DefaultSkinConfigEntry("circus", 1f),
				new DefaultSkinConfigEntry("fun", 1f)
			}, 0f, 0f));
			EnemySkinRegistry.RegisterSkin((Skin)(object)new ClownGiant(), (DefaultSkinConfigData?)new DefaultSkinConfigData((DefaultSkinConfigEntry[])(object)new DefaultSkinConfigEntry[2]
			{
				new DefaultSkinConfigEntry("circus", 1f),
				new DefaultSkinConfigEntry("fun", 1f)
			}, 0f, 0f));
			EnemySkinRegistry.RegisterSkin((Skin)(object)new SantaButler(), (DefaultSkinConfigData?)new DefaultSkinConfigData((DefaultSkinConfigEntry[])(object)new DefaultSkinConfigEntry[2]
			{
				new DefaultSkinConfigEntry("jolly", 1f),
				new DefaultSkinConfigEntry("fun", 1f)
			}, 0f, 0f));
		}
	}
	internal class MimicsCompatibility
	{
		private static bool? _enabled;

		public static bool Enabled
		{
			get
			{
				bool valueOrDefault = _enabled.GetValueOrDefault();
				if (!_enabled.HasValue)
				{
					valueOrDefault = Chainloader.PluginInfos.ContainsKey("x753.Mimics");
					_enabled = valueOrDefault;
				}
				return _enabled.Value;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		internal static void RegisterCircusMimic()
		{
			AssetBundleLoader.AddOnLethalBundleLoadedListener((Action<AssetBundle>)delegate(AssetBundle assetBundle)
			{
				CircusMimic.CircusMimicPrefab = assetBundle.LoadAsset<GameObject>("CircusWallDoorMimic.prefab");
			}, "bozoros.lethalbundle");
			Config? settings = Plugin.Settings;
			if (settings != null && settings.CIRCUS_FACILITY_MIMICS.Value && !Mimics.InteriorWhitelist.Contains("circusfacilityflow"))
			{
				Mimics.InteriorWhitelist.Add("circusfacilityflow");
			}
			MimicsAPI.GetAPI().RegisterMimicEventHandler((MimicEventHandler)(object)new CircusMimic());
		}
	}
	[HarmonyPatch]
	internal class WeatherRegistryCompatibility
	{
		private static bool? _enabled;

		public static bool Enabled
		{
			get
			{
				bool valueOrDefault = _enabled.GetValueOrDefault();
				if (!_enabled.HasValue)
				{
					valueOrDefault = Chainloader.PluginInfos.ContainsKey("mrov.WeatherRegistry");
					_enabled = valueOrDefault;
				}
				return _enabled.Value;
			}
		}

		public static event Action<LevelWeatherType>? OnWeatherEffectsApply;

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		[HarmonyPatch(typeof(WeatherEffectData), "ApplyWeatherEffects")]
		[HarmonyPostfix]
		internal static void ApplyWeatherEffectsPost(LevelWeatherType weatherType)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			WeatherRegistryCompatibility.OnWeatherEffectsApply?.Invoke(weatherType);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		internal static bool ApplyWeatherOverrides(Action<LevelWeatherType> weatherAction)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Invalid comparison between Unknown and I4
			if ((int)WeatherManager.GetCurrentLevelWeather().Type == 0)
			{
				return false;
			}
			OnWeatherEffectsApply += weatherAction;
			return true;
		}
	}
}
namespace Bozoros.Behaviours
{
	[Serializable]
	public class ChangeSettings : MonoBehaviour
	{
		public List<AudioSource> fireworkMusicVolume = new List<AudioSource>();

		public List<AudioSource> fireworkExplosionVolume = new List<AudioSource>();

		public List<AudioSource> announcerVolume = new List<AudioSource>();

		public List<AudioSource> tentMusicVolume = new List<AudioSource>();

		public List<ParticleSystem> fireworkParticles = new List<ParticleSystem>();

		public List<ParticleSystem> confettiParticles = new List<ParticleSystem>();

		public List<ParticleSystem> balloonParticles = new List<ParticleSystem>();

		public AudioClip? fireworkMusicCopyrighted;

		public List<InteractPurchasable> balloonStands = new List<InteractPurchasable>();

		public ScanNodeProperties? shipScanNode;

		public static bool SeenBalloonInstructions { get; private set; }

		private void Awake()
		{
			if (Plugin.Settings == null)
			{
				return;
			}
			if ((Object)(object)fireworkMusicVolume[0] != (Object)null && !Plugin.Settings.STREAMER_FRIENDLY.Value)
			{
				fireworkMusicVolume[0].clip = fireworkMusicCopyrighted;
				fireworkMusicVolume[0].volume = 0.15f;
			}
			ApplyVolume(Plugin.Settings.FIREWORK_MUSIC_VOLUME.Value, fireworkMusicVolume);
			ApplyVolume(Plugin.Settings.FIREWORK_EXPLOSION_VOLUME.Value, fireworkExplosionVolume);
			ApplyVolume(Plugin.Settings.ANNOUNCER_VOLUME.Value, announcerVolume);
			ApplyVolume(Plugin.Settings.TENT_MUSIC_VOLUME.Value, tentMusicVolume);
			ApplyParticleIntensity(Plugin.Settings.FIREWORK_PARTICLES.Value, fireworkParticles, firework: true);
			ApplyParticleIntensity(Plugin.Settings.CONFETTI_PARTICLES.Value, confettiParticles);
			ApplyParticleIntensity(Plugin.Settings.BALLOON_PARTICLES.Value, balloonParticles);
			foreach (InteractPurchasable balloonStand in balloonStands)
			{
				balloonStand.price = Plugin.Settings.BALLOON_PRICE.Value;
				((InteractTrigger)balloonStand).hoverTip = ((InteractTrigger)balloonStand).hoverTip.Replace("PRICE", $"{balloonStand.price}");
				balloonStand.purchaseNotification.alreadySeen = SeenBalloonInstructions || !Plugin.Settings.BALLOON_INSTRUCTIONS.Value;
			}
			if ((Object)(object)shipScanNode != (Object)null)
			{
				shipScanNode.headerText = (Plugin.Settings.MODIFY_SHIP_NODE.Value ? "Clown Car" : "Ship");
			}
		}

		private void ApplyVolume(float value, List<AudioSource> audioSources)
		{
			foreach (AudioSource audioSource in audioSources)
			{
				audioSource.volume *= value;
			}
		}

		private void ApplyParticleIntensity(float multiplier, List<ParticleSystem> particleSystems, bool firework = false)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			foreach (ParticleSystem particleSystem in particleSystems)
			{
				EmissionModule emission = particleSystem.emission;
				((EmissionModule)(ref emission)).rateOverTimeMultiplier = ((EmissionModule)(ref emission)).rateOverTimeMultiplier * multiplier;
				particleSystem.Emit(0);
				if (!firework)
				{
					break;
				}
				ParticleSystem[] componentsInChildren = ((Component)((Component)particleSystem).transform).GetComponentsInChildren<ParticleSystem>();
				foreach (ParticleSystem val in componentsInChildren)
				{
					MainModule main = val.main;
					((MainModule)(ref main)).maxParticles = (int)((float)((MainModule)(ref main)).maxParticles * multiplier);
					EmissionModule emission2 = val.emission;
					((EmissionModule)(ref emission2)).rateOverTimeMultiplier = ((EmissionModule)(ref emission2)).rateOverTimeMultiplier * multiplier;
					for (int j = 0; j < ((EmissionModule)(ref emission2)).burstCount; j++)
					{
						Burst burst = ((EmissionModule)(ref emission2)).GetBurst(j);
						((Burst)(ref burst)).minCount = (short)((float)((Burst)(ref burst)).minCount * multiplier);
						((Burst)(ref burst)).maxCount = (short)((float)((Burst)(ref burst)).maxCount * multiplier);
					}
					val.Emit(0);
				}
			}
		}

		public void ToggleBalloonInstructions()
		{
			if (SeenBalloonInstructions)
			{
				return;
			}
			SeenBalloonInstructions = true;
			foreach (InteractPurchasable balloonStand in balloonStands)
			{
				balloonStand.purchaseNotification.SetNotificationSeen();
			}
		}
	}
	[Serializable]
	public class GiftSpawner : NetworkBehaviour
	{
		private static GameObject? _vanillaGiftbox;

		public List<Transform> spawnLocations = new List<Transform>();

		public List<Material> giftMaterials = new List<Material>();

		public Item? coalItem;

		[Range(0f, 1f)]
		public float chanceForCoal = 0f;

		public static Random? Random { get; private set; }

		public static List<int> ScrapWeights { get; private set; } = new List<int>();


		public static GameObject? VanillaGiftbox
		{
			get
			{
				if ((Object)(object)_vanillaGiftbox == (Object)null)
				{
					VanillaGiftbox = OriginalContent.Items.Find((Item item) => item.itemId == 152767)?.spawnPrefab;
				}
				return _vanillaGiftbox;
			}
			private set
			{
				_vanillaGiftbox = value;
			}
		}

		private void Awake()
		{
			Random = new Random(StartOfRound.Instance.randomMapSeed + 28);
			ScrapWeights = RoundManager.Instance.currentLevel.spawnableScrap.Select((SpawnableItemWithRarity item) => item.rarity).ToList();
		}

		public void SpawnGifts()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			if (!((NetworkBehaviour)this).IsHost || (Object)(object)VanillaGiftbox == (Object)null)
			{
				return;
			}
			GiftBoxItem val2 = default(GiftBoxItem);
			NetworkObject val3 = default(NetworkObject);
			foreach (Transform spawnLocation in spawnLocations)
			{
				GameObject val = Object.Instantiate<GameObject>(VanillaGiftbox, spawnLocation.position, spawnLocation.rotation, RoundManager.Instance.spawnedScrapContainer);
				if (val.TryGetComponent<GiftBoxItem>(ref val2) && ((Component)val2).TryGetComponent<NetworkObject>(ref val3))
				{
					val3.Spawn(false);
					ReplaceGiftClientRpc(NetworkObjectReference.op_Implicit(val3), Random?.Next(0, giftMaterials.Count) ?? (-1));
				}
			}
		}

		[ClientRpc]
		public void ReplaceGiftClientRpc(NetworkObjectReference giftReference, int variant)
		{
			//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_00e6: 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(1353726552u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref giftReference, default(ForNetworkSerializable));
					BytePacker.WriteValueBitPacked(val2, variant);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1353726552u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					((MonoBehaviour)this).StartCoroutine(ReplaceGiftOnSpawn(giftReference, variant));
				}
			}
		}

		private IEnumerator ReplaceGiftOnSpawn(NetworkObjectReference giftReference, int variant)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			float startTime = Time.realtimeSinceStartup;
			NetworkObject giftNetworkObject = default(NetworkObject);
			while (!((NetworkObjectReference)(ref giftReference)).TryGet(ref giftNetworkObject, (NetworkManager)null) && Time.realtimeSinceStartup - startTime < 8f)
			{
				yield return (object)new WaitForSeconds(0.03f);
			}
			yield return (object)new WaitForEndOfFrame();
			GiftBoxItem gift = default(GiftBoxItem);
			if (!((Component)giftNetworkObject).TryGetComponent<GiftBoxItem>(ref gift))
			{
				yield break;
			}
			MeshRenderer giftRenderer = default(MeshRenderer);
			if (((Component)gift).TryGetComponent<MeshRenderer>(ref giftRenderer) && variant > -1)
			{
				((Renderer)giftRenderer).sharedMaterial = giftMaterials[variant];
			}
			ScanNodeProperties scanNode = default(ScanNodeProperties);
			if (((Component)((Component)gift).transform.GetChild(0)).TryGetComponent<ScanNodeProperties>(ref scanNode))
			{
				scanNode.nodeType = 0;
				scanNode.headerText = "Gift from Santa";
				scanNode.subText = "Value: ???";
				scanNode.minRange = 0;
				scanNode.maxRange = 40;
				scanNode.requiresLineOfSight = false;
			}
			if (!((NetworkBehaviour)this).IsHost || Random == null)
			{
				yield break;
			}
			if ((Object)(object)coalItem != (Object)null && (float)Random.Next(0, 100) < chanceForCoal * 100f)
			{
				gift.objectInPresentItem = coalItem;
				gift.objectInPresent = coalItem.spawnPrefab;
				gift.objectInPresentValue = 1;
				yield break;
			}
			int randomScrap = RoundManager.Instance.GetRandomWeightedIndexList(ScrapWeights, Random);
			SpawnableItemWithRarity item = RoundManager.Instance.currentLevel.spawnableScrap[randomScrap];
			if ((Object)(object)item?.spawnableItem != (Object)null)
			{
				gift.objectInPresentItem = item.spawnableItem;
			}
			else
			{
				ManualLogSource? staticLogger = Plugin.StaticLogger;
				if (staticLogger != null)
				{
					staticLogger.LogWarning((object)$"Item at index {randomScrap} has no spawn prefab. Spawning default gift item instead.");
				}
			}
			gift.objectInPresent = gift.objectInPresentItem.spawnPrefab;
			gift.objectInPresentValue = Math.Clamp((int)((float)Random.Next(gift.objectInPresentItem.minValue, gift.objectInPresentItem.maxValue) * RoundManager.Instance.scrapValueMultiplier), 0, 65);
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_GiftSpawner()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(1353726552u, new RpcReceiveHandler(__rpc_handler_1353726552));
		}

		private static void __rpc_handler_1353726552(NetworkBehaviour? target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference giftReference = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref giftReference, default(ForNetworkSerializable));
				int variant = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref variant);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((GiftSpawner)(object)target).ReplaceGiftClientRpc(giftReference, variant);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string? __getTypeName()
		{
			return "GiftSpawner";
		}
	}
	[Serializable]
	public class GrabbablePlatform : NetworkBehaviour
	{
		[Tooltip("Animator instance of the platform, used to play an animation once a player grabs the platform. Optional if already playing an animation, or the platform is stationary.")]
		public Animator? platformAnimator;

		[Tooltip("Name of the animation state to play once a player grabs the platform. Make sure to leave out any numbers at the end if using animation variants. Optional if already playing an animation, or the platform is stationary.")]
		public string stateName = "";

		[Tooltip("Value for the animation variant to play when the player attaches, which is appended to 'stateName'. Should only be updated in the editor, or in-game before spawning the platform. Leaving it at '-1' disables animation variants.")]
		public int stateVariant = -1;

		[Tooltip("An offset to apply to the player's position while grabbing on to the platform.")]
		public Vector3 playerOffset = Vector3.zero;

		[Header("Controls")]
		[Tooltip("Key required to be held for the player to hang on to the platform. See 'UnityEngine.InputSystem.Key' for number values. Leaving it at '-1' allows players to remain attached without holding anything, until being detached through other means (e.g. 'detachTimer').")]
		public int keyToHold = -1;

		[Tooltip("Allow players to carry two-handed items while grabbing on to the platform.")]
		public bool allowTwoHanded = false;

		[Header("Detach")]
		[Tooltip("Name of the animation state to play immediately after the player detaches. Can also be used to reset the platform's position. Optional if not playing a detach animation.")]
		public string detachState = "";

		[Tooltip("Delay in seconds until the player is forcibly detached from the platform. Can be left at '0' to allow the player to hang on to the platform for an indefinite amount of time.")]
		public float detachTimer = 0f;

		[Tooltip("Detach the player if an enemy collides with the platform.")]
		public bool detachOnEnemyCollision = false;

		[Tooltip("Destroy and despawn platform after the player detaches.")]
		public bool despawnOnDetach = false;

		[Tooltip("Delay in seconds until the platform despawns after detaching the player, to allow effects to play.")]
		public float despawnTimer = 0f;

		[Header("Audio")]
		[Tooltip("AudioSource instance of the platform, used to play sound effects at various points. Optional.")]
		public AudioSource? platformSource;

		[Tooltip("Sound effect to play when the platform spawns. Optional if not playing a spawning sound effect.")]
		public AudioClip? spawnSFX;

		[Tooltip("Sound effect to play when a player grabs on to the platform. Optional if not playing an attaching sound effect.")]
		public AudioClip? attachSFX;

		[Tooltip("Sound effect to play when the platform despawns and is destroyed. Optional if not playing a despawn sound effect.")]
		public AudioClip? destroySFX;

		[Tooltip("Lowest pitch that platform sound effects can have. Both can be set to the same value to disable pitch variation.")]
		[Range(-3f, 3f)]
		public float minPitch = 1f;

		[Tooltip("Highest pitch that platform sound effects can have. Both can be set to the same value to disable pitch variation.")]
		[Range(-3f, 3f)]
		public float maxPitch = 1f;

		public static Random Random { get; private set; } = new Random();


		public PlayerControllerB? AttachedPlayer { get; private set; }

		public bool LocalPlayerAttached { get; private set; } = false;


		public NetworkVariable<int> SyncedStateVariant { get; private set; } = new NetworkVariable<int>(-1, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);


		public NetworkVariable<float> SyncedPitch { get; private set; } = new NetworkVariable<float>(1f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);


		private void Awake()
		{
			if ((Object)(object)platformAnimator != (Object)null)
			{
				((Behaviour)platformAnimator).enabled = true;
				platformAnimator.updateMode = (AnimatorUpdateMode)1;
			}
		}

		public override void OnNetworkSpawn()
		{
			((NetworkBehaviour)this).OnNetworkSpawn();
			if ((Object)(object)platformSource != (Object)null && ((Behaviour)platformSource).enabled)
			{
				platformSource.pitch = SyncedPitch.Value;
				NetworkVariable<float> syncedPitch = SyncedPitch;
				syncedPitch.OnValueChanged = (OnValueChangedDelegate<float>)(object)Delegate.Combine((Delegate?)(object)syncedPitch.OnValueChanged, (Delegate?)(object)(OnValueChangedDelegate<float>)delegate(float _, float current)
				{
					platformSource.pitch = current;
				});
			}
			if (((NetworkBehaviour)this).IsHost)
			{
				if (minPitch < maxPitch)
				{
					SyncedPitch.Value = (float)Random.NextDouble() * (maxPitch - minPitch) + minPitch;
				}
				if (stateVariant >= 0)
				{
					SyncedStateVariant.Value = stateVariant;
				}
			}
			if ((Object)(object)spawnSFX != (Object)null)
			{
				AudioSource? obj = platformSource;
				if (obj != null)
				{
					obj.PlayOneShot(spawnSFX, 1f);
				}
			}
		}

		private void OnTriggerEnter(Collider collider)
		{
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			EnemyAI val = default(EnemyAI);
			PlayerControllerB val2 = default(PlayerControllerB);
			if (detachOnEnemyCollision && AttachedPlayer?.actualClientId == GameNetworkManager.Instance.localPlayerController.actualClientId && ((Component)collider).TryGetComponent<EnemyAI>(ref val))
			{
				DetachPlayerLocal();
				DetachPlayerServerRpc();
			}
			else if (!((Object)(object)AttachedPlayer != (Object)null) && ((Component)collider).TryGetComponent<PlayerControllerB>(ref val2) && val2.actualClientId == GameNetworkManager.Instance.localPlayerController.actualClientId && (allowTwoHanded || !val2.twoHanded) && (keyToHold <= 0 || ((ButtonControl)Keyboard.current[(Key)keyToHold]).isPressed))
			{
				AttachPlayerServerRpc(NetworkObjectReference.op_Implicit(((Component)val2).GetComponent<NetworkObject>()));
				LocalPlayerAttached = true;
				if (detachTimer > 0f)
				{
					((MonoBehaviour)this).StartCoroutine(DetachPlayerDelayed());
				}
			}
		}

		private void Update()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)AttachedPlayer == (Object)null))
			{
				((Component)AttachedPlayer).transform.position = ((Component)this).transform.position + playerOffset;
				AttachedPlayer.ResetFallGravity();
				if (LocalPlayerAttached && ((keyToHold > 0 && !((ButtonControl)Keyboard.current[(Key)keyToHold]).isPressed) || AttachedPlayer.isPlayerDead || Object.op_Implicit((Object)(object)AttachedPlayer.inAnimationWithEnemy) || AttachedPlayer.inSpecialInteractAnimation))
				{
					DetachPlayerLocal();
					DetachPlayerServerRpc();
				}
			}
		}

		public void AttachPlayerLocal(PlayerControllerB player)
		{
			AttachedPlayer = player;
			if ((Object)(object)attachSFX != (Object)null && (Object)(object)platformSource != (Object)null)
			{
				platformSource.PlayOneShot(attachSFX, 1f);
			}
			if (stateName.Length > 0 && (Object)(object)platformAnimator != (Object)null)
			{
				platformAnimator.Play(string.Format("{0}{1}", stateName, (SyncedStateVariant.Value >= 0) ? ((object)SyncedStateVariant.Value) : ""));
			}
		}

		public void DetachPlayerLocal()
		{
			if ((Object)(object)destroySFX != (Object)null && (Object)(object)platformSource != (Object)null)
			{
				platformSource.Stop();
				platformSource.PlayOneShot(destroySFX, 1f);
			}
			if (detachState.Length > 0)
			{
				Animator? obj = platformAnimator;
				if (obj != null)
				{
					obj.Play(detachState);
				}
			}
			AttachedPlayer = null;
			LocalPlayerAttached = false;
		}

		public void SwitchVariant(int variant)
		{
			stateVariant = variant;
		}

		[ServerRpc(RequireOwnership = false)]
		public void AttachPlayerServerRpc(NetworkObjectReference playerReference)
		{
			//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_00eb: 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(3359413936u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref playerReference, default(ForNetworkSerializable));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3359413936u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && !((Object)(object)AttachedPlayer != (Object)null))
				{
					AttachPlayerClientRpc(playerReference);
				}
			}
		}

		[ClientRpc]
		public void AttachPlayerClientRpc(NetworkObjectReference playerReference)
		{
			//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(864365454u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref playerReference, default(ForNetworkSerializable));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 864365454u, val, (RpcDelivery)0);
				}
				NetworkObject val3 = default(NetworkObject);
				PlayerControllerB player = default(PlayerControllerB);
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref playerReference)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent<PlayerControllerB>(ref player))
				{
					AttachPlayerLocal(player);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void DetachPlayerServerRpc()
		{
			//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(1273925016u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1273925016u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				DetachPlayerClientRpc();
				NetworkObject networkObject = default(NetworkObject);
				if (despawnOnDetach && ((NetworkBehaviour)this).IsSpawned && ((Component)this).TryGetComponent<NetworkObject>(ref networkObject))
				{
					((MonoBehaviour)this).StartCoroutine(DespawnPlatform(networkObject));
				}
			}
		}

		[ClientRpc]
		public void DetachPlayerClientRpc()
		{
			//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(3917441239u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3917441239u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((Object)(object)AttachedPlayer == (Object)null))
				{
					DetachPlayerLocal();
				}
			}
		}

		private IEnumerator DetachPlayerDelayed()
		{
			if (LocalPlayerAttached)
			{
				yield return (object)new WaitForSeconds(detachTimer);
				DetachPlayerLocal();
				DetachPlayerServerRpc();
			}
		}

		private IEnumerator DespawnPlatform(NetworkObject networkObject)
		{
			yield return (object)new WaitForSeconds(despawnTimer);
			networkObject.Despawn(true);
		}

		protected override void __initializeVariables()
		{
			if (SyncedStateVariant == null)
			{
				throw new Exception("GrabbablePlatform.<SyncedStateVariant>k__BackingField cannot be null. All NetworkVariableBase instances must be initialized.");
			}
			((NetworkVariableBase)SyncedStateVariant).Initialize((NetworkBehaviour)(object)this);
			((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SyncedStateVariant, "SyncedStateVariant");
			base.NetworkVariableFields.Add((NetworkVariableBase)(object)SyncedStateVariant);
			if (SyncedPitch == null)
			{
				throw new Exception("GrabbablePlatform.<SyncedPitch>k__BackingField cannot be null. All NetworkVariableBase instances must be initialized.");
			}
			((NetworkVariableBase)SyncedPitch).Initialize((NetworkBehaviour)(object)this);
			((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SyncedPitch, "SyncedPitch");
			base.NetworkVariableFields.Add((NetworkVariableBase)(object)SyncedPitch);
			((NetworkBehaviour)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_GrabbablePlatform()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(3359413936u, new RpcReceiveHandler(__rpc_handler_3359413936));
			NetworkManager.__rpc_func_table.Add(864365454u, new RpcReceiveHandler(__rpc_handler_864365454));
			NetworkManager.__rpc_func_table.Add(1273925016u, new RpcReceiveHandler(__rpc_handler_1273925016));
			NetworkManager.__rpc_func_table.Add(3917441239u, new RpcReceiveHandler(__rpc_handler_3917441239));
		}

		private static void __rpc_handler_3359413936(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference playerReference = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref playerReference, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((GrabbablePlatform)(object)target).AttachPlayerServerRpc(playerReference);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_864365454(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference playerReference = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref playerReference, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((GrabbablePlatform)(object)target).AttachPlayerClientRpc(playerReference);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

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

		protected internal override string __getTypeName()
		{
			return "GrabbablePlatform";
		}
	}
	[Serializable]
	public struct Notification
	{
		[Tooltip("")]
		public string headerText;

		[Tooltip("")]
		public string bodyText;

		[Tooltip("")]
		public bool showOnce;

		[Tooltip("")]
		[HideInInspector]
		public bool alreadySeen;

		public Notification()
		{
			headerText = "";
			bodyText = "";
			showOnce = false;
			alreadySeen = false;
		}

		public void SetNotificationSeen()
		{
			alreadySeen = true;
		}
	}
	[Serializable]
	public class InteractPurchasable : InteractTrigger
	{
		[Header("Purchasable Object")]
		[Tooltip("Prefab to spawn upon a successful transaction.")]
		public GameObject? spawnPrefab;

		[Tooltip("Position and rotation of the purchasable object when spawned.")]
		public Transform? spawnTransform;

		[Tooltip("Credits required to spawn the purchasable object.")]
		[Range(-1f, 10000f)]
		public int price = -1;

		[Tooltip("Callback invoked when a transaction is complete but the object has not yet been spawned. NOTE: Actions won't run using the instantiated object, but they can be used to modify the prefab on the host before spawning it, which can then be synchronized with clients using NetworkVariables... Not ideal.")]
		public UnityEvent? onPurchase;

		[Tooltip("")]
		public UnityEvent? onPurchaseNotify;

		[Tooltip("")]
		public Notification purchaseNotification;

		public static Terminal? Terminal { get; private set; }

		private void Awake()
		{
			if ((Object)(object)Terminal == (Object)null)
			{
				Terminal = Object.FindObjectOfType<Terminal>();
			}
			((UnityEvent<PlayerControllerB>)(object)base.onInteract).AddListener((UnityAction<PlayerControllerB>)delegate(PlayerControllerB player)
			{
				//IL_0052: Unknown result type (might be due to invalid IL or missing references)
				NetworkObject val = default(NetworkObject);
				if (player?.actualClientId == GameNetworkManager.Instance.localPlayerController.actualClientId && ((Component)player).TryGetComponent<NetworkObject>(ref val))
				{
					RequestPurchaseServerRpc(NetworkObjectReference.op_Implicit(val));
				}
			});
		}

		[ServerRpc(RequireOwnership = false)]
		public void RequestPurchaseServerRpc(NetworkObjectReference playerReference)
		{
			//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_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(363214469u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref playerReference, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 363214469u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost) || (Object)(object)spawnPrefab == (Object)null || (Object)(object)spawnTransform == (Object)null || (Object)(object)Terminal == (Object)null)
			{
				return;
			}
			if (price < 0 || Terminal.groupCredits < price)
			{
				SendNotificationClientRpc(playerReference, price);
				return;
			}
			Terminal.SyncGroupCreditsServerRpc(Terminal.groupCredits - price, -1);
			UnityEvent? obj = onPurchase;
			if (obj != null)
			{
				obj.Invoke();
			}
			GameObject? obj2 = spawnPrefab;
			Vector3 position = spawnTransform.position;
			Quaternion rotation = spawnTransform.rotation;
			RoundManager instance = RoundManager.Instance;
			object obj3;
			if (instance == null)
			{
				obj3 = null;
			}
			else
			{
				GameObject mapPropsContainer = instance.mapPropsContainer;
				obj3 = ((mapPropsContainer != null) ? mapPropsContainer.transform : null);
			}
			GameObject val3 = Object.Instantiate<GameObject>(obj2, position, rotation, (Transform)obj3);
			NetworkObject val4 = default(NetworkObject);
			if (val3.TryGetComponent<NetworkObject>(ref val4))
			{
				val4.Spawn(true);
			}
			SendNotificationClientRpc(playerReference, -1, success: true);
		}

		[ClientRpc]
		public void SendNotificationClientRpc(NetworkObjectReference playerReference, int price = -1, bool success = false)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: 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_00bf: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2299495428u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref playerReference, default(ForNetworkSerializable));
				BytePacker.WriteValueBitPacked(val2, price);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref success, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2299495428u, val, (RpcDelivery)0);
			}
			NetworkObject val3 = default(NetworkObject);
			PlayerControllerB val4 = default(PlayerControllerB);
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost) || !((NetworkObjectReference)(ref playerReference)).TryGet(ref val3, (NetworkManager)null) || !((Component)val3).TryGetComponent<PlayerControllerB>(ref val4) || val4.actualClientId != GameNetworkManager.Instance.localPlayerController.actualClientId)
			{
				return;
			}
			if (success)
			{
				if (purchaseNotification.alreadySeen)
				{
					return;
				}
				HUDManager.Instance.DisplayTip(purchaseNotification.headerText, purchaseNotification.bodyText, false, false, "LC_Tip1");
				if (purchaseNotification.showOnce)
				{
					UnityEvent? obj = onPurchaseNotify;
					if (obj != null)
					{
						obj.Invoke();
					}
				}
			}
			else if (price >= 0)
			{
				HUDManager.Instance.DisplayTip("Cannot afford purchase!", $"A minimum of {price} credits is required.", false, false, "LC_Tip1");
			}
			else
			{
				HUDManager.Instance.DisplayTip("Cannot purchase!", "This purchasable has been disabled by the host.", false, false, "LC_Tip1");
			}
		}

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

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

		private static void __rpc_handler_363214469(NetworkBehaviour? target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference playerReference = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref playerReference, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((InteractPurchasable)(object)target).RequestPurchaseServerRpc(playerReference);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2299495428(NetworkBehaviour? target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference playerReference = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref playerReference, default(ForNetworkSerializable));
				int num = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref num);
				bool success = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref success, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((InteractPurchasable)(object)target).SendNotificationClientRpc(playerReference, num, success);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string? __getTypeName()
		{
			return "InteractPurchasable";
		}
	}
	[Serializable]
	public class InteractSeatable : InteractTrigger
	{
		public AudioSource? seatableSource;

		public UnityEvent? onPlayerSit;

		public UnityEvent? onPlayerStand;

		public PlayerControllerB? SittingPlayer { get; private set; }

		public bool LocalPlayerSeated { get; private set; } = false;


		public Vector3 PlayerExitPoint { get; private set; } = Vector3.zero;


		private void Reset()
		{
			base.hoverTip = "Sit down : [LMB]";
			base.oneHandedItemAllowed = true;
			base.holdInteraction = true;
			base.timeToHold = 0.2f;
			base.cooldownTime = 0.3f;
			base.specialCharacterAnimation = true;
			base.stopAnimationManually = true;
			base.stopAnimationString = "SA_stopAnimation";
			base.hidePlayerItem = true;
			base.animationWaitTime = 2f;
			base.animationString = "SA_Truck";
			base.lockPlayerPosition = true;
			base.clampLooking = true;
			base.setVehicleAnimation = true;
			base.minVerticalClamp = 50f;
			base.maxVerticalClamp = -70f;
			base.horizontalClamp = 120f;
		}

		private void Awake()
		{
			((UnityEvent<PlayerControllerB>)(object)base.onInteractEarlyOtherClients).AddListener((UnityAction<PlayerControllerB>)delegate(PlayerControllerB player)
			{
				//IL_0052: Unknown result type (might be due to invalid IL or missing references)
				NetworkObject val = default(NetworkObject);
				if (player?.actualClientId == GameNetworkManager.Instance.localPlayerController.actualClientId && ((Component)player).TryGetComponent<NetworkObject>(ref val))
				{
					SetPlayerOnSeatServerRpc(NetworkObjectReference.op_Implicit(val));
				}
			});
		}

		private void Update()
		{
			((InteractTrigger)this).Update();
			if (!((Object)(object)SittingPlayer == (Object)null) && LocalPlayerSeated && ((ButtonControl)Keyboard.current[(Key)1]).isPressed)
			{
				ExitChairLocal(teleport: true);
				ExitChairServerRpc();
			}
		}

		public void SetPlayerOnSeatLocal(PlayerControllerB playerSitting)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			if (GameNetworkManager.Instance.localPlayerController.actualClientId == playerSitting.actualClientId)
			{
				PlayerExitPoint = ((Component)playerSitting.visorCamera).transform.position;
				LocalPlayerSeated = true;
			}
			SittingPlayer = playerSitting;
			base.interactable = false;
			UnityEvent? obj = onPlayerSit;
			if (obj != null)
			{
				obj.Invoke();
			}
		}

		public void ExitChairLocal(bool teleport = false)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)SittingPlayer == (Object)null))
			{
				if (teleport)
				{
					SittingPlayer.TeleportPlayer(PlayerExitPoint, false, 0f, false, true);
				}
				UnityEvent? obj = onPlayerStand;
				if (obj != null)
				{
					obj.Invoke();
				}
				PlayerExitPoint = Vector3.zero;
				LocalPlayerSeated = false;
				SittingPlayer = null;
				base.interactable = true;
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SetPlayerOnSeatServerRpc(NetworkObjectReference playerReference)
		{
			//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_00f6: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(897226711u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref playerReference, default(ForNetworkSerializable));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 897226711u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && !LocalPlayerSeated && !((Object)(object)SittingPlayer != (Object)null))
				{
					SetPlayerOnSeatClientRpc(playerReference);
				}
			}
		}

		[ClientRpc]
		public void SetPlayerOnSeatClientRpc(NetworkObjectReference playerReference)
		{
			//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)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1293416788u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref playerReference, default(ForNetworkSerializable));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1293416788u, val, (RpcDelivery)0);
				}
				NetworkObject val3 = default(NetworkObject);
				PlayerControllerB playerOnSeatLocal = default(PlayerControllerB);
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref playerReference)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent<PlayerControllerB>(ref playerOnSeatLocal))
				{
					SetPlayerOnSeatLocal(playerOnSeatLocal);
				}
			}
		}

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

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

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_InteractSeatable()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(897226711u, new RpcReceiveHandler(__rpc_handler_897226711));
			NetworkManager.__rpc_func_table.Add(1293416788u, new RpcReceiveHandler(__rpc_handler_1293416788));
			NetworkManager.__rpc_func_table.Add(1809112095u, new RpcReceiveHandler(__rpc_handler_1809112095));
			NetworkManager.__rpc_func_table.Add(716728377u, new RpcReceiveHandler(__rpc_handler_716728377));
		}

		private static void __rpc_handler_897226711(NetworkBehaviour? target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference playerOnSeatServerRpc = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref playerOnSeatServerRpc, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((InteractSeatable)(object)target).SetPlayerOnSeatServerRpc(playerOnSeatServerRpc);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1293416788(NetworkBehaviour? target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference playerOnSeatClientRpc = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref playerOnSeatClientRpc, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((InteractSeatable)(object)target).SetPlayerOnSeatClientRpc(playerOnSeatClientRpc);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

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

		protected internal override string? __getTypeName()
		{
			return "InteractSeatable";
		}
	}
	[Serializable]
	public class LightsOut : MonoBehaviour
	{
		public Material? dimLightMaterial;

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

		private void Awake()
		{
			if ((Object)(object)dimLightMaterial == (Object)null)
			{
				return;
			}
			foreach (GameObject light in lights)
			{
				MeshRenderer[] componentsInChildren = light.GetComponentsInChildren<MeshRenderer>();
				foreach (MeshRenderer val in componentsInChildren)
				{
					Material[] sharedMaterials = ((Renderer)val).sharedMaterials;
					for (int j = 0; j < sharedMaterials.Length; j++)
					{
						if (((Object)sharedMaterials[j]).name.Contains("Lights") || ((Object)sharedMaterials[j]).name.Contains("Ferris"))
						{
							sharedMaterials[j] = dimLightMaterial;
						}
					}
					((Renderer)val).sharedMaterials = sharedMaterials;
				}
			}
		}
	}
	[Serializable]
	public struct Nest
	{
		public Transform? nestLocation;

		public int minValue;

		public int maxValue;
	}
	[Serializable]
	public class PopcornNests : NetworkBehaviour
	{
		[Tooltip("The list of every unique location bees should be teleported to before simply spawning normally.")]
		public List<Nest> nestLocations = new List<Nest>();

		public static Random? Random { get; internal set; }

		private void Awake()
		{
			if (NetworkManager.Singleton.IsHost)
			{
				Random = new Random(StartOfRound.Instance.randomMapSeed);
				PopcornNestPatch.PopcornNestsInstance = this;
			}
		}

		[ServerRpc]
		public void RelocateNestServerRpc(NetworkObjectReference hiveReference, NetworkObjectReference beesReference)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Invalid comparison between Unknown and I4
			//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_00de: 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_00f8: 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
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: 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))
			{
				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(2356761973u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref hiveReference, default(ForNetworkSerializable));
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref beesReference, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2356761973u, val, (RpcDelivery)0);
			}
			NetworkObject val3 = default(NetworkObject);
			RedLocustBees val4 = default(RedLocustBees);
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost) || Random == null || nestLocations.Count <= 0 || !((NetworkObjectReference)(ref beesReference)).TryGet(ref val3, (NetworkManager)null) || !((Component)val3).TryGetComponent<RedLocustBees>(ref val4))
			{
				return;
			}
			int num = Random.Next(0