Decompiled source of Chocobo Getaway Scraps v1.0.1

plugins/com.github.zehsteam.Whiteboard.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Extras;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.InputSystem;
using UnityEngine.UI;
using com.github.zehsteam.Whiteboard.MonoBehaviours;
using com.github.zehsteam.Whiteboard.NetcodePatcher;
using com.github.zehsteam.Whiteboard.Patches;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.github.zehsteam.Whiteboard")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Adds a new whiteboard store item that you can write on!")]
[assembly: AssemblyFileVersion("1.1.4.0")]
[assembly: AssemblyInformationalVersion("1.1.4+5bcbfa114228d0849c0387bc44b6461ec716f56d")]
[assembly: AssemblyProduct("Whiteboard")]
[assembly: AssemblyTitle("com.github.zehsteam.Whiteboard")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.4.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>();
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace com.github.zehsteam.Whiteboard
{
	public class ConfigManager
	{
		public ConfigEntry<bool> ExtendedLogging { get; private set; }

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

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

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

		public ConfigManager()
		{
			BindConfigs();
			SetupChangedEvents();
			ClearUnusedEntries();
		}

		private void BindConfigs()
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			ConfigFile config = ((BaseUnityPlugin)Plugin.Instance).Config;
			ExtendedLogging = config.Bind<bool>("General Settings", "ExtendedLogging", false, "Enable extended logging.");
			Price = config.Bind<int>("Whiteboard Settings", "Price", 100, new ConfigDescription("The price of the whiteboard in the store.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 1000), Array.Empty<object>()));
			HostOnly = config.Bind<bool>("Whiteboard Settings", "HostOnly", false, "If enabled, only the host can edit the whiteboard.");
			DefaultDisplayText = config.Bind<string>("Whiteboard Settings", "DefaultDisplayText", "", "The default display text that shows on the whiteboard. Supports rich text tags.");
		}

		private void SetupChangedEvents()
		{
			Price.SettingChanged += Price_SettingChanged;
			HostOnly.SettingChanged += HostOnly_SettingChanged;
		}

		private void Price_SettingChanged(object sender, EventArgs e)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.IsHostOrServer && (Object)(object)PluginNetworkBehaviour.Instance != (Object)null)
			{
				PluginNetworkBehaviour.Instance.SetWhiteboardUnlockablePriceClientRpc(Price.Value);
			}
		}

		private void HostOnly_SettingChanged(object sender, EventArgs e)
		{
			if (Plugin.IsHostOrServer && (Object)(object)WhiteboardBehaviour.Instance != (Object)null)
			{
				WhiteboardBehaviour.Instance.IsHostOnly.Value = HostOnly.Value;
			}
		}

		private void ClearUnusedEntries()
		{
			ConfigFile config = ((BaseUnityPlugin)Plugin.Instance).Config;
			PropertyInfo property = ((object)config).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic);
			Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(config, null);
			dictionary.Clear();
			config.Save();
		}
	}
	internal class Content
	{
		public static GameObject NetworkHandlerPrefab;

		public static UnlockableItemDef WhiteboardUnlockableItemDef;

		public static TerminalNode WhiteboardBuyTerminalNode;

		public static GameObject WhiteboardEditorCanvasPrefab;

		public static void Load()
		{
			LoadAssetsFromAssetBundle();
		}

		private static void LoadAssetsFromAssetBundle()
		{
			try
			{
				string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)Plugin.Instance).Info.Location);
				string text = Path.Combine(directoryName, "whiteboard_assets");
				AssetBundle val = AssetBundle.LoadFromFile(text);
				NetworkHandlerPrefab = val.LoadAsset<GameObject>("NetworkHandler");
				NetworkHandlerPrefab.AddComponent<PluginNetworkBehaviour>();
				WhiteboardUnlockableItemDef = val.LoadAsset<UnlockableItemDef>("Whiteboard");
				WhiteboardBuyTerminalNode = val.LoadAsset<TerminalNode>("WhiteboardBuy");
				WhiteboardEditorCanvasPrefab = val.LoadAsset<GameObject>("WhiteboardEditorCanvas");
				Plugin.logger.LogInfo((object)"Successfully loaded assets from AssetBundle!");
			}
			catch (Exception arg)
			{
				Plugin.logger.LogError((object)$"Failed to load assets from AssetBundle.\n\n{arg}");
			}
		}
	}
	internal class NetworkUtils
	{
		public static int GetLocalClientId()
		{
			return (int)NetworkManager.Singleton.LocalClientId;
		}

		public static bool IsLocalClientId(int clientId)
		{
			return clientId == GetLocalClientId();
		}
	}
	internal class PlayerUtils
	{
		public static int GetLocalPlayerId()
		{
			PlayerControllerB localPlayerScript = GetLocalPlayerScript();
			if ((Object)(object)localPlayerScript == (Object)null)
			{
				return -1;
			}
			return (int)localPlayerScript.playerClientId;
		}

		public static bool IsLocalPlayerId(int playerId)
		{
			return playerId == GetLocalPlayerId();
		}

		public static PlayerControllerB GetPlayerScript(int playerId)
		{
			try
			{
				return StartOfRound.Instance.allPlayerScripts[playerId];
			}
			catch
			{
				return null;
			}
		}

		public static PlayerControllerB GetLocalPlayerScript()
		{
			return GameNetworkManager.Instance.localPlayerController;
		}

		public static bool IsLocalPlayerSpawned()
		{
			PlayerControllerB localPlayerScript = GetLocalPlayerScript();
			if ((Object)(object)localPlayerScript == (Object)null)
			{
				return false;
			}
			return ((NetworkBehaviour)localPlayerScript).IsSpawned;
		}

		public static void SetControlsEnabled(bool value)
		{
			if (value)
			{
				EnableControls();
			}
			else
			{
				DisableControls();
			}
		}

		private static void EnableControls()
		{
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB localPlayerScript = GetLocalPlayerScript();
			if (!((Object)(object)localPlayerScript == (Object)null))
			{
				localPlayerScript.disableMoveInput = false;
				InputActionAsset actions = IngamePlayerSettings.Instance.playerInput.actions;
				MovementActions movement;
				try
				{
					movement = localPlayerScript.playerActions.Movement;
					((MovementActions)(ref movement)).Look.performed += localPlayerScript.Look_performed;
					actions.FindAction("Jump", false).performed += localPlayerScript.Jump_performed;
					actions.FindAction("Crouch", false).performed += localPlayerScript.Crouch_performed;
					actions.FindAction("Interact", false).performed += localPlayerScript.Interact_performed;
					actions.FindAction("ItemSecondaryUse", false).performed += localPlayerScript.ItemSecondaryUse_performed;
					actions.FindAction("ItemTertiaryUse", false).performed += localPlayerScript.ItemTertiaryUse_performed;
					actions.FindAction("ActivateItem", false).performed += localPlayerScript.ActivateItem_performed;
					actions.FindAction("ActivateItem", false).canceled += localPlayerScript.ActivateItem_canceled;
					actions.FindAction("Discard", false).performed += localPlayerScript.Discard_performed;
					actions.FindAction("SwitchItem", false).performed += localPlayerScript.ScrollMouse_performed;
					actions.FindAction("InspectItem", false).performed += localPlayerScript.InspectItem_performed;
					actions.FindAction("SpeedCheat", false).performed += localPlayerScript.SpeedCheat_performed;
					actions.FindAction("Emote1", false).performed += localPlayerScript.Emote1_performed;
					actions.FindAction("Emote2", false).performed += localPlayerScript.Emote2_performed;
					localPlayerScript.isTypingChat = false;
					actions.FindAction("EnableChat", false).performed += HUDManager.Instance.EnableChat_performed;
					actions.FindAction("SubmitChat", false).performed += HUDManager.Instance.SubmitChat_performed;
					actions.FindAction("PingScan", false).performed += HUDManager.Instance.PingScan_performed;
					movement = localPlayerScript.playerActions.Movement;
					((MovementActions)(ref movement)).Enable();
				}
				catch (Exception arg)
				{
					Plugin.logger.LogError((object)$"Error while subscribing to input in PlayerController\n\n{arg}");
				}
				movement = localPlayerScript.playerActions.Movement;
				((MovementActions)(ref movement)).Enable();
			}
		}

		private static void DisableControls()
		{
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB localPlayerScript = GetLocalPlayerScript();
			if (!((Object)(object)localPlayerScript == (Object)null))
			{
				localPlayerScript.disableMoveInput = true;
				InputActionAsset actions = IngamePlayerSettings.Instance.playerInput.actions;
				MovementActions movement;
				try
				{
					movement = localPlayerScript.playerActions.Movement;
					((MovementActions)(ref movement)).Look.performed -= localPlayerScript.Look_performed;
					actions.FindAction("Jump", false).performed -= localPlayerScript.Jump_performed;
					actions.FindAction("Crouch", false).performed -= localPlayerScript.Crouch_performed;
					actions.FindAction("Interact", false).performed -= localPlayerScript.Interact_performed;
					actions.FindAction("ItemSecondaryUse", false).performed -= localPlayerScript.ItemSecondaryUse_performed;
					actions.FindAction("ItemTertiaryUse", false).performed -= localPlayerScript.ItemTertiaryUse_performed;
					actions.FindAction("ActivateItem", false).performed -= localPlayerScript.ActivateItem_performed;
					actions.FindAction("ActivateItem", false).canceled -= localPlayerScript.ActivateItem_canceled;
					actions.FindAction("Discard", false).performed -= localPlayerScript.Discard_performed;
					actions.FindAction("SwitchItem", false).performed -= localPlayerScript.ScrollMouse_performed;
					actions.FindAction("InspectItem", false).performed -= localPlayerScript.InspectItem_performed;
					actions.FindAction("SpeedCheat", false).performed -= localPlayerScript.SpeedCheat_performed;
					actions.FindAction("Emote1", false).performed -= localPlayerScript.Emote1_performed;
					actions.FindAction("Emote2", false).performed -= localPlayerScript.Emote2_performed;
					localPlayerScript.isTypingChat = true;
					actions.FindAction("EnableChat", false).performed -= HUDManager.Instance.EnableChat_performed;
					actions.FindAction("SubmitChat", false).performed -= HUDManager.Instance.SubmitChat_performed;
					actions.FindAction("PingScan", false).performed -= HUDManager.Instance.PingScan_performed;
					movement = localPlayerScript.playerActions.Movement;
					((MovementActions)(ref movement)).Disable();
				}
				catch (Exception arg)
				{
					Plugin.logger.LogError((object)$"Error while unsubscribing to input in PlayerController\n\n{arg}");
				}
				movement = localPlayerScript.playerActions.Movement;
				((MovementActions)(ref movement)).Disable();
			}
		}
	}
	[BepInPlugin("com.github.zehsteam.Whiteboard", "Whiteboard", "1.1.4")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	internal class Plugin : BaseUnityPlugin
	{
		private readonly Harmony harmony = new Harmony("com.github.zehsteam.Whiteboard");

		internal static Plugin Instance;

		internal static ManualLogSource logger;

		internal static ConfigManager ConfigManager;

		public static bool IsHostOrServer => NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			logger = Logger.CreateLogSource("com.github.zehsteam.Whiteboard");
			logger.LogInfo((object)"Whiteboard has awoken!");
			harmony.PatchAll(typeof(GameNetworkManagerPatch));
			harmony.PatchAll(typeof(StartOfRoundPatch));
			harmony.PatchAll(typeof(HUDManagerPatch));
			harmony.PatchAll(typeof(PlayerControllerBPatch));
			harmony.PatchAll(typeof(ShipBuildModeManagerPatch));
			ConfigManager = new ConfigManager();
			Content.Load();
			RegisterUnlockableItems();
			NetcodePatcherAwake();
		}

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

		private void RegisterUnlockableItems()
		{
			UnlockableHelper.RegisterUnlockable(Content.WhiteboardUnlockableItemDef, (StoreType)2, ConfigManager.Price.Value, Content.WhiteboardBuyTerminalNode);
		}

		public void SpawnWhiteboardEditorCanvas()
		{
			if (!((Object)(object)WhiteboardEditorBehaviour.Instance != (Object)null))
			{
				Object.Instantiate<GameObject>(Content.WhiteboardEditorCanvasPrefab);
				logger.LogInfo((object)"Spawned WhiteboardEditorCanvas.");
			}
		}

		public void LogInfoExtended(object data)
		{
			if (ConfigManager.ExtendedLogging.Value)
			{
				logger.LogInfo(data);
			}
		}
	}
	[CreateAssetMenu(menuName = "Whiteboard/SpriteSheetData")]
	public class SpriteSheetData : ScriptableObject
	{
		[Header("Editor Buttons")]
		[Space(5f)]
		public bool ImportSpriteData = false;

		[Header("Data")]
		[Space(5f)]
		public TMP_SpriteAsset SpriteAsset;

		[TextArea(3, 20)]
		public string SpriteDataImportCode;

		public List<SpriteSheetItem> SpriteData = new List<SpriteSheetItem>();

		public string GetAllSpritesText()
		{
			string text = string.Empty;
			foreach (SpriteSheetItem spriteDatum in SpriteData)
			{
				text = text + spriteDatum.GetText() + " ";
			}
			return text.Trim();
		}

		public string GetParsedText(string text, bool matchCase = false)
		{
			string text2 = text;
			StringComparison comparisonType = (matchCase ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase);
			if (text2.Contains("<all>", comparisonType))
			{
				text2 = text2.Replace("<all>", GetAllSpritesText(), comparisonType);
			}
			List<SpriteSheetItem> list = SpriteData.OrderBy((SpriteSheetItem _) => _.Name.Length).Reverse().ToList();
			foreach (SpriteSheetItem item in list)
			{
				if (text2.Contains(item.Name, comparisonType))
				{
					text2 = text2.Replace(item.Name, item.GetText(), comparisonType);
				}
			}
			return text2;
		}

		private void OnValidate()
		{
			if (ImportSpriteData)
			{
				ImportSpriteData = false;
				OnImportSpriteDataClicked();
			}
		}

		private void OnImportSpriteDataClicked()
		{
			if (string.IsNullOrWhiteSpace(SpriteDataImportCode))
			{
				LogError("Failed to import sprite data code. Sprite data import code is null or empty.");
				return;
			}
			string[] array = SpriteDataImportCode.Trim().Split(",", StringSplitOptions.RemoveEmptyEntries);
			if (array.Length == 0)
			{
				LogError("Failed to import sprite data code. Sprite data import code contains no entries.");
				return;
			}
			SpriteData = new List<SpriteSheetItem>();
			for (int i = 0; i < array.Length; i++)
			{
				if (string.IsNullOrWhiteSpace(array[i]))
				{
					LogEntryError(i, "Entry is null or empty.");
					continue;
				}
				string[] array2 = array[i].Trim().Split(":", StringSplitOptions.RemoveEmptyEntries);
				if (array2.Length < 3)
				{
					LogEntryError(i, "Entry has less than 3 items.");
					continue;
				}
				string name = array2[0];
				if (TryParseInt(i, array2[1], out var result) && TryParseInt(i, array2[2], out var result2))
				{
					float result3 = 10f;
					if (array2.Length < 4 || TryParseFloat(i, array2[3], out result3))
					{
						SpriteData.Add(new SpriteSheetItem(name, result, result2, result3));
					}
				}
			}
			LogInfo("Finished importing sprite data from sprite data import code.");
		}

		private static bool TryParseInt(int entryIndex, string text, out int result)
		{
			if (!int.TryParse(text, out result))
			{
				LogEntryError(entryIndex, "Could not parse \"" + text + "\" as an integer.");
				return false;
			}
			return true;
		}

		private static bool TryParseFloat(int entryIndex, string text, out float result)
		{
			if (!float.TryParse(text, out result))
			{
				LogEntryError(entryIndex, "Could not parse \"" + text + "\" as a float.");
				return false;
			}
			return true;
		}

		private static void LogEntryError(int entryIndex, object data)
		{
			LogError($"Failed to import sprite data entry #{entryIndex}. " + data);
		}

		private static void LogInfo(object data)
		{
			Debug.Log((object)("[SpriteSheetData] " + data));
		}

		private static void LogError(object data)
		{
			Debug.LogError((object)("[SpriteSheetData] " + data));
		}
	}
	[Serializable]
	public class SpriteSheetItem
	{
		public string Name;

		public int Index;

		public int EndIndex;

		public float AnimationSpeed;

		public SpriteSheetItem(string name, int index, int endIndex, float animationSpeed)
		{
			Name = name;
			Index = index;
			EndIndex = endIndex;
			AnimationSpeed = animationSpeed;
		}

		public string GetText()
		{
			if (EndIndex > Index)
			{
				return $"<sprite anim=\"{Index},{EndIndex},{AnimationSpeed}\">";
			}
			return $"<sprite={Index}>";
		}
	}
	internal class UnlockableHelper
	{
		public static void RegisterUnlockable(UnlockableItemDef unlockableItemDef, StoreType storeType, int price, TerminalNode terminalNode)
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				unlockableItemDef.unlockable.shopSelectionNode.itemCost = price;
				unlockableItemDef.unlockable.shopSelectionNode.terminalOptions[0].result.itemCost = price;
			}
			catch
			{
			}
			Utilities.FixMixerGroups(unlockableItemDef.unlockable.prefabObject);
			NetworkPrefabs.RegisterNetworkPrefab(unlockableItemDef.unlockable.prefabObject);
			Unlockables.RegisterUnlockable(unlockableItemDef, storeType, (TerminalNode)null, (TerminalNode)null, terminalNode, price);
			Plugin.logger.LogInfo((object)$"Registered \"{unlockableItemDef.unlockable.unlockableName}\" unlockable shop item with a price of ${price}.");
		}

		public static void UpdateUnlockablePrice(UnlockableItemDef unlockableItemDef, int price)
		{
			try
			{
				unlockableItemDef.unlockable.shopSelectionNode.itemCost = price;
				unlockableItemDef.unlockable.shopSelectionNode.terminalOptions[0].result.itemCost = price;
			}
			catch
			{
			}
			Unlockables.UpdateUnlockablePrice(unlockableItemDef.unlockable, price);
			Plugin.logger.LogInfo((object)$"Updated \"{unlockableItemDef.unlockable.unlockableName}\" unlockable shop item price to ${price}.");
		}
	}
	internal class Utils
	{
		public static void SetCursorLockState(bool value)
		{
			if (!IsQuickMenuOpen())
			{
				Cursor.lockState = (CursorLockMode)(value ? 1 : 0);
				if (value)
				{
					Cursor.visible = false;
				}
				else if (!StartOfRound.Instance.localPlayerUsingController)
				{
					Cursor.visible = true;
				}
			}
		}

		public static string GetCurrentSaveFileName()
		{
			return GameNetworkManager.Instance.currentSaveFileName;
		}

		public static void SaveToCurrentSaveFile<T>(string key, T value)
		{
			ES3.Save<T>("com.github.zehsteam.Whiteboard." + key, value, GetCurrentSaveFileName());
		}

		public static T LoadFromCurrentSaveFile<T>(string key, T defaultValue = default(T))
		{
			return ES3.Load<T>("com.github.zehsteam.Whiteboard." + key, GetCurrentSaveFileName(), defaultValue);
		}

		public static bool KeyExistsInCurrentSaveFile(string key)
		{
			return ES3.KeyExists("com.github.zehsteam.Whiteboard." + key, GetCurrentSaveFileName());
		}

		public static bool ArrayContains(string[] array, string value)
		{
			foreach (string text in array)
			{
				if (text.Equals(value, StringComparison.OrdinalIgnoreCase))
				{
					return true;
				}
			}
			return false;
		}

		public static bool IsQuickMenuOpen()
		{
			PlayerControllerB localPlayerScript = PlayerUtils.GetLocalPlayerScript();
			if ((Object)(object)localPlayerScript == (Object)null)
			{
				return false;
			}
			return localPlayerScript.quickMenuManager.isMenuOpen;
		}
	}
	[Serializable]
	public class WhiteboardData : INetworkSerializable
	{
		public string DisplayText;

		public string TextHexColor;

		public int FontSizeIndex;

		public int FontStyleIndex;

		public int FontFamilyIndex;

		public int HorizontalAlignmentIndex;

		public int VerticalAlignmentIndex;

		public WhiteboardData()
		{
			try
			{
				DisplayText = Plugin.ConfigManager.DefaultDisplayText.Value;
			}
			catch
			{
			}
			TextHexColor = "#000000";
			FontSizeIndex = 7;
		}

		public WhiteboardData(string displayText)
		{
			DisplayText = displayText;
			TextHexColor = "#000000";
			FontSizeIndex = 7;
		}

		public WhiteboardData(string displayText, string textHexColor, int fontSizeIndex, int fontStyleIndex, int fontFamilyIndex, int horizontalAlignmentIndex, int verticalAlignmentIndex)
			: this(displayText)
		{
			TextHexColor = textHexColor;
			FontSizeIndex = fontSizeIndex;
			FontStyleIndex = fontStyleIndex;
			FontFamilyIndex = fontFamilyIndex;
			HorizontalAlignmentIndex = horizontalAlignmentIndex;
			VerticalAlignmentIndex = verticalAlignmentIndex;
		}

		public unsafe void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			serializer.SerializeValue(ref DisplayText, false);
			serializer.SerializeValue(ref TextHexColor, false);
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref FontSizeIndex, default(ForPrimitives));
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref FontStyleIndex, default(ForPrimitives));
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref FontFamilyIndex, default(ForPrimitives));
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref HorizontalAlignmentIndex, default(ForPrimitives));
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref VerticalAlignmentIndex, default(ForPrimitives));
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "com.github.zehsteam.Whiteboard";

		public const string PLUGIN_NAME = "Whiteboard";

		public const string PLUGIN_VERSION = "1.1.4";
	}
}
namespace com.github.zehsteam.Whiteboard.Patches
{
	[HarmonyPatch(typeof(GameNetworkManager))]
	internal class GameNetworkManagerPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void StartPatch()
		{
			AddNetworkPrefabs();
		}

		private static void AddNetworkPrefabs()
		{
			AddNetworkPrefab(Content.NetworkHandlerPrefab);
		}

		private static void AddNetworkPrefab(GameObject prefab)
		{
			if ((Object)(object)prefab == (Object)null)
			{
				Plugin.logger.LogError((object)"Failed to add network prefab. GameObject is null.");
				return;
			}
			NetworkManager.Singleton.AddNetworkPrefab(prefab);
			Plugin.logger.LogInfo((object)("Registered \"" + ((Object)prefab).name + "\" network prefab."));
		}
	}
	[HarmonyPatch(typeof(HUDManager))]
	internal class HUDManagerPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void StartPatch()
		{
			Plugin.Instance.SpawnWhiteboardEditorCanvas();
		}

		[HarmonyPatch("OpenMenu_performed")]
		[HarmonyPrefix]
		private static void OpenMenu_performedPatch()
		{
			if (!((Object)(object)WhiteboardEditorBehaviour.Instance == (Object)null) && WhiteboardEditorBehaviour.Instance.IsWindowOpen)
			{
				WhiteboardEditorBehaviour.Instance.CloseWindow();
			}
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void StartPatch(ref PlayerControllerB __instance)
		{
			if (!((Object)(object)__instance != (Object)(object)PlayerUtils.GetLocalPlayerScript()) && (Object)(object)WhiteboardBehaviour.Instance != (Object)null)
			{
				WhiteboardBehaviour.Instance.SetWorldCanvasCamera();
			}
		}

		[HarmonyPatch("KillPlayer")]
		[HarmonyPostfix]
		private static void KillPlayerPatch()
		{
			if (!((Object)(object)WhiteboardEditorBehaviour.Instance == (Object)null) && WhiteboardEditorBehaviour.Instance.IsWindowOpen)
			{
				WhiteboardEditorBehaviour.Instance.CloseWindow();
			}
		}
	}
	[HarmonyPatch(typeof(ShipBuildModeManager))]
	internal class ShipBuildModeManagerPatch
	{
		[HarmonyPatch("PlayerMeetsConditionsToBuild")]
		[HarmonyPostfix]
		private static void PlayerMeetsConditionsToBuild(ref bool __result)
		{
			if (!((Object)(object)WhiteboardEditorBehaviour.Instance == (Object)null) && WhiteboardEditorBehaviour.Instance.IsWindowOpen)
			{
				__result = false;
			}
		}
	}
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPatch("Awake")]
		[HarmonyPostfix]
		private static void AwakePatch()
		{
			SpawnNetworkHandler();
		}

		private static void SpawnNetworkHandler()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.IsHostOrServer)
			{
				GameObject val = Object.Instantiate<GameObject>(Content.NetworkHandlerPrefab, Vector3.zero, Quaternion.identity);
				val.GetComponent<NetworkObject>().Spawn(false);
			}
		}

		[HarmonyPatch("OnClientConnect")]
		[HarmonyPrefix]
		private static void OnClientConnectPatch(ref ulong clientId)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			ClientRpcParams val = default(ClientRpcParams);
			val.Send = new ClientRpcSendParams
			{
				TargetClientIds = new <>z__ReadOnlyArray<ulong>(new ulong[1] { clientId })
			};
			ClientRpcParams clientRpcParams = val;
			PluginNetworkBehaviour.Instance.SetWhiteboardUnlockablePriceClientRpc(Plugin.ConfigManager.Price.Value, clientRpcParams);
		}

		[HarmonyPatch("ReviveDeadPlayers")]
		[HarmonyPostfix]
		private static void ReviveDeadPlayersPatch()
		{
			if (!((Object)(object)WhiteboardEditorBehaviour.Instance == (Object)null) && WhiteboardEditorBehaviour.Instance.IsWindowOpen)
			{
				PlayerControllerB localPlayerScript = PlayerUtils.GetLocalPlayerScript();
				if (!((Object)(object)localPlayerScript == (Object)null))
				{
					localPlayerScript.disableMoveInput = true;
				}
			}
		}
	}
}
namespace com.github.zehsteam.Whiteboard.MonoBehaviours
{
	public class ColorPickerBehaviour : MonoBehaviour
	{
		public static ColorPickerBehaviour Instance;

		public GameObject ColorPickerWindowObject = null;

		public ColorPickerControlBehaviour ColorPickerControlBehaviour = null;

		public bool IsWindowOpen { get; private set; }

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
		}

		private void Start()
		{
			CloseWindow();
		}

		public void OpenWindow()
		{
			if (WhiteboardEditorBehaviour.Instance.IsWindowOpen && !IsWindowOpen)
			{
				IsWindowOpen = true;
				ColorPickerWindowObject.SetActive(true);
				ColorPickerControlBehaviour.SetColor(WhiteboardEditorBehaviour.Instance.TextHexColor);
			}
		}

		public void CloseWindow()
		{
			IsWindowOpen = false;
			ColorPickerWindowObject.SetActive(false);
		}

		public void OnConfirmButtonClicked()
		{
			WhiteboardEditorBehaviour.Instance.SetTextHexColor(ColorPickerControlBehaviour.GetHexColor());
			CloseWindow();
		}

		public void OnCancelButtonClicked()
		{
			CloseWindow();
		}
	}
	public class ColorPickerControlBehaviour : MonoBehaviour
	{
		[SerializeField]
		private float _currentHue;

		[SerializeField]
		private float _currentSat;

		[SerializeField]
		private float _currentVal = 0f;

		[SerializeField]
		private RawImage _hueImage;

		[SerializeField]
		private RawImage _satValImage;

		[SerializeField]
		private RawImage _outputImage = null;

		[SerializeField]
		private Slider _hueSlider = null;

		[SerializeField]
		private TMP_InputField _hexColorInputField = null;

		[SerializeField]
		private SVImageControlBehaviour _svImageControlBehaviour = null;

		private Texture2D _hueTexture;

		private Texture2D _satValTexture;

		private Texture2D _outputTexture = null;

		private bool _updatedHexColorInputFieldInternally = false;

		private bool _initialized = false;

		private void Start()
		{
			Initialize();
		}

		private void Initialize()
		{
			if (!_initialized)
			{
				_initialized = true;
				CreateHueImage();
				CreateSatValImage();
				CreateOutputImage();
				UpdateOutputImage();
			}
		}

		private void CreateHueImage()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			_hueTexture = new Texture2D(1, 16);
			((Texture)_hueTexture).wrapMode = (TextureWrapMode)1;
			((Object)_hueTexture).name = "HueTexture";
			for (int i = 0; i < ((Texture)_hueTexture).height; i++)
			{
				_hueTexture.SetPixel(0, i, Color.HSVToRGB((float)i / (float)((Texture)_hueTexture).height, 1f, 0.95f));
			}
			_hueTexture.Apply();
			_currentHue = 0f;
			_hueImage.texture = (Texture)(object)_hueTexture;
		}

		private void CreateSatValImage()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			_satValTexture = new Texture2D(16, 16);
			((Texture)_satValTexture).wrapMode = (TextureWrapMode)1;
			((Object)_satValTexture).name = "SatValTexture";
			for (int i = 0; i < ((Texture)_satValTexture).height; i++)
			{
				for (int j = 0; j < ((Texture)_satValTexture).width; j++)
				{
					_satValTexture.SetPixel(j, i, Color.HSVToRGB(_currentHue, (float)j / (float)((Texture)_satValTexture).width, (float)i / (float)((Texture)_satValTexture).height));
				}
			}
			_satValTexture.Apply();
			_currentSat = 0f;
			_currentVal = 0f;
			_satValImage.texture = (Texture)(object)_satValTexture;
		}

		private void CreateOutputImage()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			_outputTexture = new Texture2D(1, 16);
			((Texture)_outputTexture).wrapMode = (TextureWrapMode)1;
			((Object)_outputTexture).name = "OutputTexture";
			Color val = Color.HSVToRGB(_currentHue, _currentSat, _currentVal);
			for (int i = 0; i < ((Texture)_outputTexture).height; i++)
			{
				_outputTexture.SetPixel(0, i, val);
			}
			_outputTexture.Apply();
			_outputImage.texture = (Texture)(object)_outputTexture;
		}

		private void UpdateOutputImage()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			Color val = Color.HSVToRGB(_currentHue, _currentSat, _currentVal);
			for (int i = 0; i < ((Texture)_outputTexture).height; i++)
			{
				_outputTexture.SetPixel(0, i, val);
			}
			_outputTexture.Apply();
			_updatedHexColorInputFieldInternally = true;
			_hexColorInputField.text = GetHexColor();
		}

		public void SetSatVal(float saturation, float value)
		{
			_currentSat = saturation;
			_currentVal = value;
			UpdateOutputImage();
		}

		public void UpdateSatValImage()
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			_currentHue = _hueSlider.value;
			for (int i = 0; i < ((Texture)_satValTexture).height; i++)
			{
				for (int j = 0; j < ((Texture)_satValTexture).width; j++)
				{
					_satValTexture.SetPixel(j, i, Color.HSVToRGB(_currentHue, (float)j / (float)((Texture)_satValTexture).width, (float)i / (float)((Texture)_satValTexture).height));
				}
			}
			_satValTexture.Apply();
			UpdateOutputImage();
		}

		public void OnHexColorInputFieldValueChanged()
		{
			if (_updatedHexColorInputFieldInternally)
			{
				_updatedHexColorInputFieldInternally = false;
			}
			else if (_hexColorInputField.text.Length >= 6)
			{
				string hexColor = ((!_hexColorInputField.text.StartsWith("#")) ? ("#" + _hexColorInputField.text) : _hexColorInputField.text);
				UpdateColor(hexColor);
			}
		}

		private void UpdateColor(string hexColor)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			Color val = default(Color);
			if (ColorUtility.TryParseHtmlString(hexColor, ref val))
			{
				Color.RGBToHSV(val, ref _currentHue, ref _currentSat, ref _currentVal);
				_hueSlider.value = _currentHue;
				UpdateOutputImage();
				_svImageControlBehaviour.SetPickerLocation(_currentSat, _currentVal);
			}
		}

		public void SetColor(string hexColor)
		{
			Initialize();
			_updatedHexColorInputFieldInternally = true;
			_hexColorInputField.text = hexColor;
			UpdateColor(hexColor);
		}

		public string GetHexColor()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			Color val = Color.HSVToRGB(_currentHue, _currentSat, _currentVal);
			return "#" + ColorUtility.ToHtmlStringRGB(val);
		}
	}
	internal class PluginNetworkBehaviour : NetworkBehaviour
	{
		public static PluginNetworkBehaviour Instance;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
		}

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

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_PluginNetworkBehaviour()
		{
			//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(151062475u, new RpcReceiveHandler(__rpc_handler_151062475));
		}

		private static void __rpc_handler_151062475(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0040: 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)
			{
				int price = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref price);
				ClientRpcParams client = rpcParams.Client;
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PluginNetworkBehaviour)(object)target).SetWhiteboardUnlockablePriceClientRpc(price, client);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "PluginNetworkBehaviour";
		}
	}
	public class SVImageControlBehaviour : MonoBehaviour, IDragHandler, IEventSystemHandler, IPointerClickHandler
	{
		[SerializeField]
		private ColorPickerControlBehaviour _colorPickerControlBehaviour;

		[SerializeField]
		private Image _pickerImage;

		private RectTransform _rectTransform;

		private RectTransform _pickerTransform;

		private void Awake()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: 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)
			_rectTransform = ((Component)this).GetComponent<RectTransform>();
			_pickerTransform = ((Component)_pickerImage).GetComponent<RectTransform>();
			((Transform)_pickerTransform).localPosition = Vector2.op_Implicit(new Vector2(0f - _rectTransform.sizeDelta.x * 0.5f, 0f - _rectTransform.sizeDelta.y * 0.5f));
		}

		private void UpdateColor(PointerEventData eventData)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = ((Transform)_rectTransform).InverseTransformPoint(Vector2.op_Implicit(eventData.position));
			float num = _rectTransform.sizeDelta.x * 0.5f;
			float num2 = _rectTransform.sizeDelta.y * 0.5f;
			val.x = Mathf.Clamp(val.x, 0f - num, num);
			val.y = Mathf.Clamp(val.y, 0f - num2, num2);
			float num3 = val.x + num;
			float num4 = val.y + num2;
			float saturation = num3 / _rectTransform.sizeDelta.x;
			float num5 = num4 / _rectTransform.sizeDelta.y;
			((Transform)_pickerTransform).localPosition = val;
			((Graphic)_pickerImage).color = Color.HSVToRGB(0f, 0f, 1f - num5);
			_colorPickerControlBehaviour.SetSatVal(saturation, num5);
		}

		public void OnDrag(PointerEventData eventData)
		{
			UpdateColor(eventData);
		}

		public void OnPointerClick(PointerEventData eventData)
		{
			UpdateColor(eventData);
		}

		public void SetPickerLocation(float saturation, float value)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			float num = saturation * _rectTransform.sizeDelta.x - _rectTransform.sizeDelta.x * 0.5f;
			float num2 = value * _rectTransform.sizeDelta.y - _rectTransform.sizeDelta.y * 0.5f;
			((Transform)_pickerTransform).localPosition = Vector2.op_Implicit(new Vector2(num, num2));
			((Graphic)_pickerImage).color = Color.HSVToRGB(0f, 0f, 1f - value);
			Plugin.Instance.LogInfoExtended($"SetPickerLocation (saturation: {saturation}, value: {value}), (x: {num}, y: {num2})");
		}
	}
	public class WhiteboardBehaviour : NetworkBehaviour
	{
		public static WhiteboardBehaviour Instance;

		public InteractTrigger InteractTrigger;

		public Canvas WorldCanvas = null;

		public TextMeshProUGUI WhiteboardText = null;

		public float[] FontSizeArray = Array.Empty<float>();

		public FontStyles[] FontStyleArray = Array.Empty<FontStyles>();

		public TMP_FontAsset[] FontAssetArray = Array.Empty<TMP_FontAsset>();

		public SpriteSheetData EmotesSpriteSheetData = null;

		[HideInInspector]
		public NetworkVariable<bool> IsHostOnly = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		public WhiteboardData Data { get; private set; }

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			Data = new WhiteboardData();
		}

		private void Start()
		{
			if ((Object)(object)EmotesSpriteSheetData != (Object)null)
			{
				((TMP_Text)WhiteboardText).spriteAsset = EmotesSpriteSheetData.SpriteAsset;
			}
			if (PlayerUtils.IsLocalPlayerSpawned())
			{
				SetWorldCanvasCamera();
			}
			if (Plugin.IsHostOrServer)
			{
				LoadData();
			}
			else
			{
				RequestDataServerRpc(NetworkUtils.GetLocalClientId());
			}
		}

		public override void OnNetworkSpawn()
		{
			NetworkVariable<bool> isHostOnly = IsHostOnly;
			isHostOnly.OnValueChanged = (OnValueChangedDelegate<bool>)(object)Delegate.Combine((Delegate?)(object)isHostOnly.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate<bool>(OnIsHostOnlyChanged));
			if (Plugin.IsHostOrServer)
			{
				IsHostOnly.Value = Plugin.ConfigManager.HostOnly.Value;
			}
			else if (IsHostOnly.Value)
			{
				InteractTrigger.interactable = false;
			}
		}

		public override void OnNetworkDespawn()
		{
			NetworkVariable<bool> isHostOnly = IsHostOnly;
			isHostOnly.OnValueChanged = (OnValueChangedDelegate<bool>)(object)Delegate.Remove((Delegate?)(object)isHostOnly.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate<bool>(OnIsHostOnlyChanged));
			if (!((Object)(object)WhiteboardEditorBehaviour.Instance == (Object)null) && WhiteboardEditorBehaviour.Instance.IsWindowOpen)
			{
				WhiteboardEditorBehaviour.Instance.CloseWindow();
			}
		}

		private void OnIsHostOnlyChanged(bool previous, bool current)
		{
			if (!Plugin.IsHostOrServer)
			{
				InteractTrigger.interactable = !current;
			}
		}

		public void OnInteract()
		{
			if ((Object)(object)WhiteboardEditorBehaviour.Instance == (Object)null)
			{
				Plugin.logger.LogError((object)"Failed to open whiteboard editor window. WhiteboardEditorBehaviour instance was not found.");
			}
			else
			{
				WhiteboardEditorBehaviour.Instance.OpenWindow();
			}
		}

		public void SetWorldCanvasCamera()
		{
			PlayerControllerB localPlayerScript = PlayerUtils.GetLocalPlayerScript();
			if ((Object)(object)localPlayerScript == (Object)null)
			{
				Plugin.logger.LogWarning((object)"Failed to set whiteboard world canvas camera. Could not find the local player script or the local player is not spawned yet.");
				return;
			}
			WorldCanvas.worldCamera = localPlayerScript.gameplayCamera;
			Plugin.Instance.LogInfoExtended("Set whiteboard world canvas camera.");
		}

		private void LoadData()
		{
			if (Plugin.IsHostOrServer)
			{
				string displayText = Utils.LoadFromCurrentSaveFile("Whiteboard_DisplayText", Plugin.ConfigManager.DefaultDisplayText.Value);
				string textHexColor = Utils.LoadFromCurrentSaveFile("Whiteboard_TextHexColor", "#000000");
				int fontSizeIndex = Utils.LoadFromCurrentSaveFile("Whiteboard_FontSizeIndex", 7);
				int fontStyleIndex = Utils.LoadFromCurrentSaveFile("Whiteboard_FontStyleIndex", 0);
				int fontFamilyIndex = Utils.LoadFromCurrentSaveFile("Whiteboard_FontFamilyIndex", 0);
				int horizontalAlignmentIndex = Utils.LoadFromCurrentSaveFile("Whiteboard_HorizontalAlignmentIndex", 0);
				int verticalAlignmentIndex = Utils.LoadFromCurrentSaveFile("Whiteboard_VerticalAlignmentIndex", 0);
				SetData(new WhiteboardData(displayText, textHexColor, fontSizeIndex, fontStyleIndex, fontFamilyIndex, horizontalAlignmentIndex, verticalAlignmentIndex));
			}
		}

		private void SaveData()
		{
			if (Plugin.IsHostOrServer)
			{
				Utils.SaveToCurrentSaveFile("Whiteboard_DisplayText", Data.DisplayText);
				Utils.SaveToCurrentSaveFile("Whiteboard_TextHexColor", Data.TextHexColor);
				Utils.SaveToCurrentSaveFile("Whiteboard_FontSizeIndex", Data.FontSizeIndex);
				Utils.SaveToCurrentSaveFile("Whiteboard_FontStyleIndex", Data.FontStyleIndex);
				Utils.SaveToCurrentSaveFile("Whiteboard_FontFamilyIndex", Data.FontFamilyIndex);
				Utils.SaveToCurrentSaveFile("Whiteboard_HorizontalAlignmentIndex", Data.HorizontalAlignmentIndex);
				Utils.SaveToCurrentSaveFile("Whiteboard_VerticalAlignmentIndex", Data.VerticalAlignmentIndex);
			}
		}

		public void SetData(WhiteboardData data)
		{
			SetDataServerRpc(data, NetworkUtils.GetLocalClientId());
		}

		[ServerRpc(RequireOwnership = false)]
		public void SetDataServerRpc(WhiteboardData data, int fromClientId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2180141345u, val, (RpcDelivery)0);
				bool flag = data != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe<WhiteboardData>(ref data, default(ForNetworkSerializable));
				}
				BytePacker.WriteValueBitPacked(val2, fromClientId);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2180141345u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			if (fromClientId == NetworkUtils.GetLocalClientId())
			{
				Plugin.Instance.LogInfoExtended("Set the whiteboard data. Display text: \"" + data.DisplayText + "\".");
			}
			else
			{
				if (Plugin.ConfigManager.HostOnly.Value)
				{
					Plugin.logger.LogWarning((object)$"Client #{fromClientId} tried to edit the whiteboard while HostOnly mode is enabled.");
					return;
				}
				Plugin.Instance.LogInfoExtended($"Client #{fromClientId} set the whiteboard data. Display text: \"{data.DisplayText}\".");
			}
			SetDataClientRpc(data);
			SetDataOnLocalClient(data);
		}

		[ClientRpc]
		private void SetDataClientRpc(WhiteboardData data)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2144233494u, val, (RpcDelivery)0);
				bool flag = data != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe<WhiteboardData>(ref data, default(ForNetworkSerializable));
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2144233494u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !Plugin.IsHostOrServer)
			{
				SetDataOnLocalClient(data);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void RequestDataServerRpc(int toClientId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			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(3228134666u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, toClientId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3228134666u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					Plugin.Instance.LogInfoExtended($"Recieved request for whiteboard data from client #{toClientId}");
					ClientRpcParams val3 = default(ClientRpcParams);
					val3.Send = new ClientRpcSendParams
					{
						TargetClientIds = new <>z__ReadOnlyArray<ulong>(new ulong[1] { (ulong)toClientId })
					};
					ClientRpcParams clientRpcParams = val3;
					RequestDataClientRpc(Data, clientRpcParams);
				}
			}
		}

		[ClientRpc]
		private void RequestDataClientRpc(WhiteboardData data, ClientRpcParams clientRpcParams = default(ClientRpcParams))
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4129067645u, clientRpcParams, (RpcDelivery)0);
				bool flag = data != null;
				((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val)).WriteValueSafe<WhiteboardData>(ref data, default(ForNetworkSerializable));
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 4129067645u, clientRpcParams, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				Plugin.Instance.LogInfoExtended("Recieved whiteboard data.");
				SetDataOnLocalClient(data);
			}
		}

		public void SetDataOnLocalClient(WhiteboardData data)
		{
			Data = data;
			SaveData();
			UpdateWorldCanvas();
			LogDataExtended();
		}

		private void UpdateWorldCanvas()
		{
			UpdateWhiteboardText();
		}

		private void UpdateWhiteboardText()
		{
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			if (Data == null)
			{
				Plugin.logger.LogWarning((object)"WhiteboardData is null in WhiteboardBehaviour.UpdateWhiteboardText(); Setting WhiteboardData to default.");
				Data = new WhiteboardData();
			}
			string text = string.Empty;
			if (!string.IsNullOrWhiteSpace(Data.TextHexColor))
			{
				text = text + "<color=" + Data.TextHexColor + ">";
			}
			text = ((!((Object)(object)EmotesSpriteSheetData != (Object)null)) ? (text + Data.DisplayText) : (text + EmotesSpriteSheetData.GetParsedText(Data.DisplayText)));
			if (Data.FontFamilyIndex == 2)
			{
				text = text.ToLower();
			}
			((TMP_Text)WhiteboardText).text = text;
			((TMP_Text)WhiteboardText).fontSize = FontSizeArray[Data.FontSizeIndex];
			((TMP_Text)WhiteboardText).fontStyle = FontStyleArray[Data.FontStyleIndex];
			((TMP_Text)WhiteboardText).font = FontAssetArray[Data.FontFamilyIndex];
			TextMeshProUGUI whiteboardText = WhiteboardText;
			int horizontalAlignmentIndex = Data.HorizontalAlignmentIndex;
			if (1 == 0)
			{
			}
			HorizontalAlignmentOptions horizontalAlignment = (HorizontalAlignmentOptions)(horizontalAlignmentIndex switch
			{
				0 => 1, 
				1 => 2, 
				2 => 4, 
				_ => 1, 
			});
			if (1 == 0)
			{
			}
			((TMP_Text)whiteboardText).horizontalAlignment = horizontalAlignment;
			TextMeshProUGUI whiteboardText2 = WhiteboardText;
			int verticalAlignmentIndex = Data.VerticalAlignmentIndex;
			if (1 == 0)
			{
			}
			VerticalAlignmentOptions verticalAlignment = (VerticalAlignmentOptions)(verticalAlignmentIndex switch
			{
				0 => 256, 
				1 => 512, 
				2 => 1024, 
				_ => 256, 
			});
			if (1 == 0)
			{
			}
			((TMP_Text)whiteboardText2).verticalAlignment = verticalAlignment;
		}

		private void LogDataExtended()
		{
			string empty = string.Empty;
			empty = empty + "DisplayText: \n\"" + Data.DisplayText + "\"\n\n";
			empty = empty + "TextHexColor: \"" + Data.TextHexColor + "\"\n";
			empty += $"FontSizeIndex: {Data.FontSizeIndex}\n";
			empty += $"FontStyleIndex: {Data.FontStyleIndex}\n";
			empty += $"FontFamilyIndex: {Data.FontFamilyIndex}\n";
			empty += $"HorizontalAlignmentIndex: {Data.HorizontalAlignmentIndex}\n";
			empty += $"VerticalAlignmentIndex: {Data.VerticalAlignmentIndex}\n";
			Plugin.Instance.LogInfoExtended("\n" + empty.Trim() + "\n\n");
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_WhiteboardBehaviour()
		{
			//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(2180141345u, new RpcReceiveHandler(__rpc_handler_2180141345));
			NetworkManager.__rpc_func_table.Add(2144233494u, new RpcReceiveHandler(__rpc_handler_2144233494));
			NetworkManager.__rpc_func_table.Add(3228134666u, new RpcReceiveHandler(__rpc_handler_3228134666));
			NetworkManager.__rpc_func_table.Add(4129067645u, new RpcReceiveHandler(__rpc_handler_4129067645));
		}

		private static void __rpc_handler_2180141345(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_0068: 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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				WhiteboardData data = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe<WhiteboardData>(ref data, default(ForNetworkSerializable));
				}
				int fromClientId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref fromClientId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((WhiteboardBehaviour)(object)target).SetDataServerRpc(data, fromClientId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2144233494(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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				WhiteboardData dataClientRpc = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe<WhiteboardData>(ref dataClientRpc, default(ForNetworkSerializable));
				}
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((WhiteboardBehaviour)(object)target).SetDataClientRpc(dataClientRpc);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		private static void __rpc_handler_4129067645(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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				WhiteboardData data = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe<WhiteboardData>(ref data, default(ForNetworkSerializable));
				}
				ClientRpcParams client = rpcParams.Client;
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((WhiteboardBehaviour)(object)target).RequestDataClientRpc(data, client);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "WhiteboardBehaviour";
		}
	}
	public class WhiteboardEditorBehaviour : MonoBehaviour
	{
		public static WhiteboardEditorBehaviour Instance;

		public GameObject EditorWindowObject = null;

		public TMP_InputField DisplayTextInputField = null;

		public GameObject HostOnlyObject = null;

		public Button HostOnlyButton = null;

		public GameObject HostOnlyCheckedObject = null;

		public Image TextColorPreviewImage = null;

		public TMP_Dropdown FontSizeDropdown = null;

		public TMP_Dropdown FontStyleDropdown = null;

		public TMP_Dropdown FontFamilyDropdown = null;

		public TMP_Dropdown HorizontalAlignmentDropdown = null;

		public TMP_Dropdown VerticalAlignmentDropdown = null;

		public const int DefaultFontSizeIndex = 7;

		public const string DefaultTextHexColor = "#000000";

		public bool IsWindowOpen { get; private set; }

		public string TextHexColor { get; private set; }

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
		}

		private void Start()
		{
			CloseWindow();
			TextHexColor = "#000000";
		}

		public void OpenWindow()
		{
			if ((Object)(object)WhiteboardBehaviour.Instance == (Object)null)
			{
				Plugin.logger.LogError((object)"Failed to open whiteboard editor window. Whiteboard instance was not found.");
			}
			else if (!Utils.IsQuickMenuOpen() && !IsWindowOpen)
			{
				HostOnlyObject.SetActive(Plugin.IsHostOrServer);
				if (Plugin.IsHostOrServer)
				{
					UpdateHostOnlyCheckbox();
				}
				IsWindowOpen = true;
				EditorWindowObject.SetActive(true);
				SetDataToUI(WhiteboardBehaviour.Instance.Data);
				Utils.SetCursorLockState(value: false);
				PlayerUtils.SetControlsEnabled(value: false);
			}
		}

		public void CloseWindow()
		{
			if (ColorPickerBehaviour.Instance.IsWindowOpen)
			{
				ColorPickerBehaviour.Instance.CloseWindow();
			}
			IsWindowOpen = false;
			EditorWindowObject.SetActive(false);
			Utils.SetCursorLockState(value: true);
			PlayerUtils.SetControlsEnabled(value: true);
		}

		public void OnConfirmButtonClicked()
		{
			if ((Object)(object)WhiteboardBehaviour.Instance == (Object)null)
			{
				Plugin.logger.LogError((object)"Failed to confirm whiteboard changes. Whiteboard instance was not found.");
				return;
			}
			WhiteboardBehaviour.Instance.SetData(GetDataFromUI());
			CloseWindow();
		}

		public void OnCancelButtonClicked()
		{
			CloseWindow();
		}

		public void OnResetButtonClicked()
		{
			SetDataToUI(new WhiteboardData());
		}

		public void OnHostOnlyButtonClicked()
		{
			if (Plugin.IsHostOrServer)
			{
				Plugin.ConfigManager.HostOnly.Value = !Plugin.ConfigManager.HostOnly.Value;
				UpdateHostOnlyCheckbox();
			}
		}

		public void OnColorPickerButtonClicked()
		{
			if (!((Object)(object)ColorPickerBehaviour.Instance == (Object)null))
			{
				ColorPickerBehaviour.Instance.OpenWindow();
			}
		}

		private void UpdateHostOnlyCheckbox()
		{
			HostOnlyCheckedObject.SetActive(Plugin.ConfigManager.HostOnly.Value);
		}

		private WhiteboardData GetDataFromUI()
		{
			string text = DisplayTextInputField.text;
			string textHexColor = TextHexColor;
			int value = FontSizeDropdown.value;
			int value2 = FontStyleDropdown.value;
			int value3 = FontFamilyDropdown.value;
			int value4 = HorizontalAlignmentDropdown.value;
			int value5 = VerticalAlignmentDropdown.value;
			return new WhiteboardData(text, textHexColor, value, value2, value3, value4, value5);
		}

		private void SetDataToUI(WhiteboardData data)
		{
			if (data == null)
			{
				Plugin.logger.LogWarning((object)"WhiteboardData is null in WhiteboardEditorBehaviour.SetDataToUI(); Setting WhiteboardData to default.");
				data = new WhiteboardData();
			}
			try
			{
				DisplayTextInputField.text = data.DisplayText;
				SetTextHexColor(data.TextHexColor);
				FontSizeDropdown.value = data.FontSizeIndex;
				FontStyleDropdown.value = data.FontStyleIndex;
				FontFamilyDropdown.value = data.FontFamilyIndex;
				HorizontalAlignmentDropdown.value = data.HorizontalAlignmentIndex;
				VerticalAlignmentDropdown.value = data.VerticalAlignmentIndex;
			}
			catch (Exception arg)
			{
				Plugin.logger.LogError((object)$"Failed to set whiteboard editor ui data.\n\n{arg}");
			}
		}

		private void UpdateTextColorPreview()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			Color color = default(Color);
			if (ColorUtility.TryParseHtmlString(TextHexColor, ref color))
			{
				((Graphic)TextColorPreviewImage).color = color;
			}
		}

		public void SetTextHexColor(string newTextColorHex)
		{
			TextHexColor = newTextColorHex;
			UpdateTextColorPreview();
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}
internal sealed class <>z__ReadOnlyArray<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T>
{
	int ICollection.Count => _items.Length;

	bool ICollection.IsSynchronized => false;

	object ICollection.SyncRoot => this;

	object IList.this[int index]
	{
		get
		{
			return _items[index];
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	bool IList.IsFixedSize => true;

	bool IList.IsReadOnly => true;

	int IReadOnlyCollection<T>.Count => _items.Length;

	T IReadOnlyList<T>.this[int index] => _items[index];

	int ICollection<T>.Count => _items.Length;

	bool ICollection<T>.IsReadOnly => true;

	T IList<T>.this[int index]
	{
		get
		{
			return _items[index];
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	public <>z__ReadOnlyArray(T[] items)
	{
		_items = items;
	}

	IEnumerator IEnumerable.GetEnumerator()
	{
		return ((IEnumerable)_items).GetEnumerator();
	}

	void ICollection.CopyTo(Array array, int index)
	{
		((ICollection)_items).CopyTo(array, index);
	}

	int IList.Add(object value)
	{
		throw new NotSupportedException();
	}

	void IList.Clear()
	{
		throw new NotSupportedException();
	}

	bool IList.Contains(object value)
	{
		return ((IList)_items).Contains(value);
	}

	int IList.IndexOf(object value)
	{
		return ((IList)_items).IndexOf(value);
	}

	void IList.Insert(int index, object value)
	{
		throw new NotSupportedException();
	}

	void IList.Remove(object value)
	{
		throw new NotSupportedException();
	}

	void IList.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}

	IEnumerator<T> IEnumerable<T>.GetEnumerator()
	{
		return ((IEnumerable<T>)_items).GetEnumerator();
	}

	void ICollection<T>.Add(T item)
	{
		throw new NotSupportedException();
	}

	void ICollection<T>.Clear()
	{
		throw new NotSupportedException();
	}

	bool ICollection<T>.Contains(T item)
	{
		return ((ICollection<T>)_items).Contains(item);
	}

	void ICollection<T>.CopyTo(T[] array, int arrayIndex)
	{
		((ICollection<T>)_items).CopyTo(array, arrayIndex);
	}

	bool ICollection<T>.Remove(T item)
	{
		throw new NotSupportedException();
	}

	int IList<T>.IndexOf(T item)
	{
		return ((IList<T>)_items).IndexOf(item);
	}

	void IList<T>.Insert(int index, T item)
	{
		throw new NotSupportedException();
	}

	void IList<T>.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}
}
namespace com.github.zehsteam.Whiteboard.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}

plugins/Frizzbee dependencies.dll

Decompiled a month ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using LethalLib.Modules;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Frizzbee dependencies")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Frizzbee dependencies")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b4bd11df-1c87-4390-9600-40b8e5dc00c2")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Frizzbee_dependencies;

[BepInPlugin("TreyFrizzBee", "FrizzBee", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	private const string GUID = "TreyFrizzBee";

	private const string NAME = "FrizzBee";

	private const string VERSION = "1.0.0";

	public static Plugin instance;

	private void Awake()
	{
		instance = this;
		string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "itemmod");
		AssetBundle val = AssetBundle.LoadFromFile(text);
		ConfigEntry<int> val2 = ((BaseUnityPlugin)this).Config.Bind<int>("General", "Rarity", 28, "Higher means more common.");
		ConfigEntry<int> val3 = ((BaseUnityPlugin)this).Config.Bind<int>("General", "MaxValue", 120, "Determines the Max value of the Scrap. (Note: The max number does not mean the max amount of credits, it's a little skewed. So 120 would be around 50.)");
		ConfigEntry<int> val4 = ((BaseUnityPlugin)this).Config.Bind<int>("General", "MinValue", 80, "Determines the Min value of the Scrap. (Note: The min number does not mean the min amount of credits, it's a little skewed. So 80 would be around 30.)");
		Item val5 = val.LoadAsset<Item>("Assets/ModelsTrey/FrizzBee/FrizzBeeScript.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val5.spawnPrefab);
		Utilities.FixMixerGroups(val5.spawnPrefab);
		Items.RegisterScrap(val5, val2.Value, (LevelTypes)(-1));
		val5.minValue = val4.Value;
		val5.maxValue = val3.Value;
		((BaseUnityPlugin)this).Logger.LogInfo((object)"FrizzBee Yay");
	}
}
internal class keyframe
{
	private int v1;

	private int v2;

	public keyframe(int v1, int v2)
	{
		this.v1 = v1;
		this.v2 = v2;
	}
}

plugins/ImmersiveScrap.dll

Decompiled a month 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 BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using ImmersiveScrap.Configs;
using ImmersiveScrap.Keybinds;
using ImmersiveScrap.Misc;
using ImmersiveScrap.NetcodePatcher;
using LethalCompanyInputUtils.Api;
using LethalLevelLoader;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ImmersiveScrap")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Immersive Scrap mod with 40+ Vanilla style Scrap!")]
[assembly: AssemblyFileVersion("1.4.1.0")]
[assembly: AssemblyInformationalVersion("1.4.1+423798bcc22618cfc1f7fa83f7357cbf3e6b55ee")]
[assembly: AssemblyProduct("ImmersiveScrap")]
[assembly: AssemblyTitle("ImmersiveScrap")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.4.1.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ImmersiveScrap
{
	[BepInPlugin("ImmersiveScrap", "ImmersiveScrap", "1.4.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Logger;

		public static GameObject explosionPrefab;

		internal static IngameKeybinds InputActionsInstance;

		public static ImmersiveScrapConfig ModConfig { get; private set; }

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			InputActionsInstance = new IngameKeybinds();
			ModConfig = new ImmersiveScrapConfig(((BaseUnityPlugin)this).Config);
			AssetBundleLoader.AddOnExtendedModLoadedListener((Action<ExtendedMod>)OnExtendedModRegistered, "XuXiaolan", "ImmersiveScraps");
			AssetBundleLoader.AddOnLethalBundleLoadedListener((Action<AssetBundle>)OnLethalBundleLoaded, "immersivescrapassets.lethalbundle");
			InitializeNetworkBehaviours();
			Logger.LogInfo((object)"Plugin ImmersiveScrap is loaded!");
		}

		internal static void OnExtendedModRegistered(ExtendedMod extendedMod)
		{
			if ((Object)(object)extendedMod == (Object)null)
			{
				return;
			}
			foreach (ExtendedItem extendedItem in extendedMod.ExtendedItems)
			{
				string configValueForItem = GetConfigValueForItem(extendedItem.Item.itemName);
				if (!string.IsNullOrEmpty(configValueForItem))
				{
					List<StringWithRarity> collection = ConfigParsing(configValueForItem);
					extendedItem.LevelMatchingProperties.levelTags.AddRange(collection);
					extendedItem.LevelMatchingProperties.planetNames.AddRange(collection);
					Logger.LogInfo((object)$"Updated matching properties for {extendedItem.Item}.");
				}
			}
		}

		internal static void OnLethalBundleLoaded(AssetBundle assetBundle)
		{
			_ = (Object)(object)assetBundle == (Object)null;
		}

		private static string GetConfigValueForItem(string itemName)
		{
			switch (itemName)
			{
			case "Alcohol Flask":
				return ImmersiveScrapConfig.ConfigAlcoholSpawnWeight.Value;
			case "ImmersiveAnvil":
				return ImmersiveScrapConfig.ConfigAnvilSpawnWeight.Value;
			case "IBaseball bat":
				return ImmersiveScrapConfig.ConfigBaseballSpawnWeight.Value;
			case "Beer can":
				return ImmersiveScrapConfig.ConfigBeercanSpawnWeight.Value;
			case "IBrick":
				return ImmersiveScrapConfig.ConfigBrickSpawnWeight.Value;
			case "Broken engine":
				return ImmersiveScrapConfig.ConfigBrokenEngineSpawnWeight.Value;
			case "Bucket":
				return ImmersiveScrapConfig.ConfigBucketSpawnWeight.Value;
			case "Can paint":
				return ImmersiveScrapConfig.ConfigCanPaintSpawnWeight.Value;
			case "Canteen":
				return ImmersiveScrapConfig.ConfigCanteenSpawnWeight.Value;
			case "Car battery":
				return ImmersiveScrapConfig.ConfigCarBatterySpawnWeight.Value;
			case "Clamp":
				return ImmersiveScrapConfig.ConfigClampSpawnWeight.Value;
			case "IClock":
				return ImmersiveScrapConfig.ConfigClockSpawnWeight.Value;
			case "IFan":
				return ImmersiveScrapConfig.ConfigFanSpawnWeight.Value;
			case "Fancy Painting":
				return ImmersiveScrapConfig.ConfigFancyPaintingSpawnWeight.Value;
			case "IFireAxe":
				return ImmersiveScrapConfig.ConfigFireAxeSpawnWeight.Value;
			case "Fire extinguisher":
				return ImmersiveScrapConfig.ConfigFireExtingSpawnWeight.Value;
			case "Fire hydrant":
				return ImmersiveScrapConfig.ConfigFireHydrantSpawnWeight.Value;
			case "Food can":
				return ImmersiveScrapConfig.ConfigFoodCanSpawnWeight.Value;
			case "Gameboy":
				return ImmersiveScrapConfig.ConfigGameboySpawnWeight.Value;
			case "Garbage":
				return ImmersiveScrapConfig.ConfigGarbageSpawnWeight.Value;
			case "ImmersiveHammer":
				return ImmersiveScrapConfig.ConfigHammerSpawnWeight.Value;
			case "Jerrycan":
				return ImmersiveScrapConfig.ConfigJerryCanSpawnWeight.Value;
			case "IKeyboard":
				return ImmersiveScrapConfig.ConfigKeyboardSpawnWeight.Value;
			case "ILantern":
				return ImmersiveScrapConfig.ConfigLanternSpawnWeight.Value;
			case "Library lamp":
				return ImmersiveScrapConfig.ConfigLibraryLampSpawnWeight.Value;
			case "ImmersivePlant":
				return ImmersiveScrapConfig.ConfigPlantSpawnWeight.Value;
			case "Pliers":
				return ImmersiveScrapConfig.ConfigPliersSpawnWeight.Value;
			case "Plunger":
				return ImmersiveScrapConfig.ConfigPlungerSpawnWeight.Value;
			case "Retro Toy":
				return ImmersiveScrapConfig.ConfigRetroToySpawnWeight.Value;
			case "Screwdriver":
				return ImmersiveScrapConfig.ConfigScrewdriverSpawnWeight.Value;
			case "Sink":
				return ImmersiveScrapConfig.ConfigSinkSpawnWeight.Value;
			case "Socket Wrench":
				return ImmersiveScrapConfig.ConfigSocketSpawnWeight.Value;
			case "ISqueaky toy":
				return ImmersiveScrapConfig.ConfigSqueakyToySpawnWeight.Value;
			case "Suitcase":
				return ImmersiveScrapConfig.ConfigSuitcaseSpawnWeight.Value;
			case "Toaster":
				return ImmersiveScrapConfig.ConfigToasterSpawnWeight.Value;
			case "IToolbox":
				return ImmersiveScrapConfig.ConfigToolboxSpawnWeight.Value;
			case "Top hat":
				return ImmersiveScrapConfig.ConfigTophatSpawnWeight.Value;
			case "Traffic cone":
				return ImmersiveScrapConfig.ConfigTrafficConeSpawnWeight.Value;
			case "Vent":
				return ImmersiveScrapConfig.ConfigVentSpawnWeight.Value;
			case "Watering Can":
				return ImmersiveScrapConfig.ConfigWateringCanSpawnWeight.Value;
			case "Wheel":
				return ImmersiveScrapConfig.ConfigWheelSpawnWeight.Value;
			case "Wine bottle":
				return ImmersiveScrapConfig.ConfigWineBottleSpawnWeight.Value;
			case "Wrench":
				return ImmersiveScrapConfig.ConfigWrenchSpawnWeight.Value;
			default:
				Logger.LogInfo((object)("No configuration found for item type: " + itemName));
				return null;
			}
		}

		private static List<StringWithRarity> ConfigParsing(string configMoonRarity)
		{
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			List<StringWithRarity> list = new List<StringWithRarity>();
			foreach (string item in from s in configMoonRarity.Split(",")
				select s.Trim())
			{
				string[] array = item.Split(":");
				if (array.Length == 2)
				{
					string text = array[0];
					if (int.TryParse(array[1], out var result))
					{
						list.Add(new StringWithRarity(text, result));
						Logger.LogInfo((object)$"Registered spawn rate for {text} to {result}");
					}
				}
			}
			return list;
		}

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

		public const string PLUGIN_NAME = "ImmersiveScrap";

		public const string PLUGIN_VERSION = "1.4.1";
	}
}
namespace ImmersiveScrap.Misc
{
	public class ThrowableNoisemaker : NoisemakerProp
	{
		public bool throwWithRight;

		public bool beingThrown;

		public AnimationCurve itemFallCurve;

		public AnimationCurve itemVerticalFallCurve;

		public AnimationCurve itemVerticalFallCurveNoBounce;

		public RaycastHit itemHit;

		public Ray itemThrowRay;

		public override void FallWithCurve()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = ((GrabbableObject)this).startFallingPosition - ((GrabbableObject)this).targetFloorPosition;
			float magnitude = ((Vector3)(ref val)).magnitude;
			((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(((GrabbableObject)this).itemProperties.restingRotation.x, ((Component)this).transform.eulerAngles.y, ((GrabbableObject)this).itemProperties.restingRotation.z), 14f * Time.deltaTime / magnitude);
			((Component)this).transform.localPosition = Vector3.Lerp(((GrabbableObject)this).startFallingPosition, ((GrabbableObject)this).targetFloorPosition, itemFallCurve.Evaluate(((GrabbableObject)this).fallTime));
			if (magnitude > 5f)
			{
				((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), itemVerticalFallCurveNoBounce.Evaluate(((GrabbableObject)this).fallTime));
			}
			else
			{
				((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), itemVerticalFallCurve.Evaluate(((GrabbableObject)this).fallTime));
			}
			((GrabbableObject)this).fallTime = ((GrabbableObject)this).fallTime + Mathf.Abs(Time.deltaTime * 12f / magnitude);
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
		}

		public Vector3 GetItemThrowDestination()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = ((Component)this).transform.position;
			itemThrowRay = new Ray(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward);
			float num = 30f;
			position = ((!Physics.Raycast(itemThrowRay, ref itemHit, num, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) ? ((Ray)(ref itemThrowRay)).GetPoint(num) : ((Ray)(ref itemThrowRay)).GetPoint(((RaycastHit)(ref itemHit)).distance - 0.05f));
			itemThrowRay = new Ray(position, Vector3.down);
			if (Physics.Raycast(itemThrowRay, ref itemHit, 30f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1))
			{
				return ((RaycastHit)(ref itemHit)).point + Vector3.up * 0.05f;
			}
			return ((Ray)(ref itemThrowRay)).GetPoint(30f);
		}

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

		protected internal override string __getTypeName()
		{
			return "ThrowableNoisemaker";
		}
	}
	public class Utilities
	{
		private static Dictionary<int, int> _masksByLayer;

		public static void Init()
		{
			GenerateLayerMap();
		}

		public static void GenerateLayerMap()
		{
			_masksByLayer = new Dictionary<int, int>();
			for (int i = 0; i < 32; i++)
			{
				int num = 0;
				for (int j = 0; j < 32; j++)
				{
					if (!Physics.GetIgnoreLayerCollision(i, j))
					{
						num |= 1 << j;
					}
				}
				_masksByLayer.Add(i, num);
			}
		}

		public static Transform TryFindRoot(Transform child)
		{
			Transform val = child;
			while ((Object)(object)val != (Object)null)
			{
				if ((Object)(object)((Component)val).GetComponent<NetworkObject>() != (Object)null)
				{
					return val;
				}
				val = ((Component)val).transform.parent;
			}
			return null;
		}

		public static int MaskForLayer(int layer)
		{
			return _masksByLayer[layer];
		}

		public static void TeleportPlayer(int playerObj, Vector3 teleportPos)
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerObj];
			if (Object.op_Implicit((Object)(object)Object.FindObjectOfType<AudioReverbPresets>()))
			{
				Object.FindObjectOfType<AudioReverbPresets>().audioPresets[2].ChangeAudioReverbForPlayer(val);
			}
			val.isInElevator = false;
			val.isInHangarShipRoom = false;
			val.isInsideFactory = true;
			val.averageVelocity = 0f;
			val.velocityLastFrame = Vector3.zero;
			StartOfRound.Instance.allPlayerScripts[playerObj].TeleportPlayer(teleportPos, false, 0f, false, true);
			StartOfRound.Instance.allPlayerScripts[playerObj].beamOutParticle.Play();
			if ((Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController)
			{
				HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
			}
		}

		public static IEnumerator TeleportPlayerBody(int playerObj, Vector3 teleportPosition)
		{
			//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;
			yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)StartOfRound.Instance.allPlayerScripts[playerObj].deadBody != (Object)null || Time.realtimeSinceStartup - startTime > 2f));
			if (StartOfRound.Instance.inShipPhase || SceneManager.sceneCount <= 1)
			{
				yield break;
			}
			DeadBodyInfo deadBody = StartOfRound.Instance.allPlayerScripts[playerObj].deadBody;
			if ((Object)(object)deadBody != (Object)null)
			{
				deadBody.attachedTo = null;
				deadBody.attachedLimb = null;
				deadBody.secondaryAttachedLimb = null;
				deadBody.secondaryAttachedTo = null;
				if ((Object)(object)deadBody.grabBodyObject != (Object)null && deadBody.grabBodyObject.isHeld && (Object)(object)deadBody.grabBodyObject.playerHeldBy != (Object)null)
				{
					deadBody.grabBodyObject.playerHeldBy.DropAllHeldItems(true, false);
				}
				deadBody.isInShip = false;
				deadBody.parentedToShip = false;
				((Component)deadBody).transform.SetParent((Transform)null, true);
				deadBody.SetRagdollPositionSafely(teleportPosition, true);
			}
		}

		public static void TeleportEnemy(EnemyAI enemy, Vector3 teleportPos)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			enemy.serverPosition = teleportPos;
			((Component)enemy).transform.position = teleportPos;
			enemy.agent.Warp(teleportPos);
			enemy.SyncPositionToClients();
		}

		public static void CreateExplosion(Vector3 explosionPosition, bool spawnExplosionEffect = false, int damage = 20, float minDamageRange = 0f, float maxDamageRange = 1f, int enemyHitForce = 6, CauseOfDeath causeOfDeath = 3, PlayerControllerB attacker = null)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)$"Spawning explosion at pos: {explosionPosition}");
			Transform val = null;
			if ((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer.transform != (Object)null)
			{
				val = RoundManager.Instance.mapPropsContainer.transform;
			}
			if (spawnExplosionEffect)
			{
				Object.Instantiate<GameObject>(StartOfRound.Instance.explosionPrefab, explosionPosition, Quaternion.Euler(-90f, 0f, 0f), val).SetActive(true);
			}
			float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, explosionPosition);
			if (num < 14f)
			{
				HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
			}
			else if (num < 25f)
			{
				HUDManager.Instance.ShakeCamera((ScreenShakeType)0);
			}
			Collider[] array = Physics.OverlapSphere(explosionPosition, maxDamageRange, 2621448, (QueryTriggerInteraction)2);
			PlayerControllerB val2 = null;
			for (int i = 0; i < array.Length; i++)
			{
				float num2 = Vector3.Distance(explosionPosition, ((Component)array[i]).transform.position);
				if (num2 > 4f && Physics.Linecast(explosionPosition, ((Component)array[i]).transform.position + Vector3.up * 0.3f, 256, (QueryTriggerInteraction)1))
				{
					continue;
				}
				if (((Component)array[i]).gameObject.layer == 3)
				{
					val2 = ((Component)array[i]).gameObject.GetComponent<PlayerControllerB>();
					if ((Object)(object)val2 != (Object)null && ((NetworkBehaviour)val2).IsOwner)
					{
						float num3 = 1f - Mathf.Clamp01((num2 - minDamageRange) / (maxDamageRange - minDamageRange));
						val2.DamagePlayer((int)((float)damage * num3), true, true, causeOfDeath, 0, false, default(Vector3));
					}
				}
				else if (((Component)array[i]).gameObject.layer == 21)
				{
					Landmine componentInChildren = ((Component)array[i]).gameObject.GetComponentInChildren<Landmine>();
					if ((Object)(object)componentInChildren != (Object)null && !componentInChildren.hasExploded && num2 < 6f)
					{
						Debug.Log((object)"Setting off other mine");
						((MonoBehaviour)componentInChildren).StartCoroutine(componentInChildren.TriggerOtherMineDelayed(componentInChildren));
					}
				}
				else if (((Component)array[i]).gameObject.layer == 19)
				{
					EnemyAICollisionDetect componentInChildren2 = ((Component)array[i]).gameObject.GetComponentInChildren<EnemyAICollisionDetect>();
					if ((Object)(object)componentInChildren2 != (Object)null && ((NetworkBehaviour)componentInChildren2.mainScript).IsOwner && num2 < 4.5f)
					{
						componentInChildren2.mainScript.HitEnemyOnLocalClient(enemyHitForce, default(Vector3), attacker, false, -1);
					}
				}
			}
			int num4 = ~LayerMask.GetMask(new string[1] { "Room" });
			num4 = ~LayerMask.GetMask(new string[1] { "Colliders" });
			array = Physics.OverlapSphere(explosionPosition, 10f, num4);
			for (int j = 0; j < array.Length; j++)
			{
				Rigidbody component = ((Component)array[j]).GetComponent<Rigidbody>();
				if ((Object)(object)component != (Object)null)
				{
					component.AddExplosionForce(70f, explosionPosition, 10f);
				}
			}
		}
	}
}
namespace ImmersiveScrap.Scrap
{
	public class Brick : ThrowableNoisemaker
	{
		public AudioClip[] cookieSpecialAudio;

		public AudioSource brickPlayer;

		private float explodePercentage = 100f;

		public bool wasThrown;

		private Random noiseMakerRandom;

		public override void Start()
		{
			((NoisemakerProp)this).Start();
			noiseMakerRandom = new Random(StartOfRound.Instance.randomMapSeed + 85);
		}

		public void DetectThrowKeyPressed()
		{
			//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_003f: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.InputActionsInstance.ThrowKey.triggered && !((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)GameNetworkManager.Instance.localPlayerController))
			{
				wasThrown = true;
				Vector3 itemThrowDestination = GetItemThrowDestination();
				((GrabbableObject)this).playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, itemThrowDestination, true);
				PlayCookieAudioServerRpc(0);
			}
		}

		public override void Update()
		{
			((GrabbableObject)this).Update();
			if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) && !((Object)(object)((GrabbableObject)this).playerHeldBy.currentlyHeldObjectServer != (Object)(object)this))
			{
				DetectThrowKeyPressed();
			}
		}

		[ServerRpc]
		public void PlayCookieAudioServerRpc(int index)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: 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_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__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(3742843923u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, index);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3742843923u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				PlayCookieAudioClientRpc(index);
			}
		}

		[ClientRpc]
		public void PlayCookieAudioClientRpc(int index)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: 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(2929058189u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, index);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2929058189u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && cookieSpecialAudio.Length != 0)
				{
					brickPlayer.PlayOneShot(cookieSpecialAudio[index]);
					WalkieTalkie.TransmitOneShotAudio(brickPlayer, cookieSpecialAudio[index], 0.5f);
					RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 15f, 0.5f, 0, ((GrabbableObject)this).isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0);
				}
			}
		}

		[ServerRpc]
		public void StopPlayingCookieAudioServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__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(4170301725u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4170301725u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				StopPlayingCookieAudioClientRpc();
			}
		}

		[ClientRpc]
		public void StopPlayingCookieAudioClientRpc()
		{
			//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(366094878u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 366094878u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					brickPlayer.Stop();
				}
			}
		}

		[ClientRpc]
		public void BoomClientRpc()
		{
			//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(2731884806u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2731884806u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Boom();
				}
			}
		}

		[ServerRpc]
		public void BoomServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__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(3369954093u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3369954093u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				Boom();
				BoomClientRpc();
			}
		}

		public void CreateExplosion()
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB attacker = ((IEnumerable<PlayerControllerB>)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB x) => ((NetworkBehaviour)x).OwnerClientId == ((NetworkBehaviour)this).OwnerClientId));
			int num = 0;
			if (ImmersiveScrapConfig.ConfigBrickDealingDamage.Value)
			{
				num = ImmersiveScrapConfig.ConfigBrickDealingXDamage.Value;
			}
			Utilities.CreateExplosion(((Component)this).transform.position, ImmersiveScrapConfig.ConfigBrickExploding.Value, 20, 0f, num, 2, (CauseOfDeath)3, attacker);
		}

		public void Boom()
		{
			CreateExplosion();
		}

		public override void OnHitGround()
		{
			if (wasThrown)
			{
				wasThrown = false;
				if (((NetworkBehaviour)this).IsOwner && (float)noiseMakerRandom.Next(0, 101) <= explodePercentage)
				{
					Boom();
					BoomServerRpc();
				}
			}
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_Brick()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(3742843923u, new RpcReceiveHandler(__rpc_handler_3742843923));
			NetworkManager.__rpc_func_table.Add(2929058189u, new RpcReceiveHandler(__rpc_handler_2929058189));
			NetworkManager.__rpc_func_table.Add(4170301725u, new RpcReceiveHandler(__rpc_handler_4170301725));
			NetworkManager.__rpc_func_table.Add(366094878u, new RpcReceiveHandler(__rpc_handler_366094878));
			NetworkManager.__rpc_func_table.Add(2731884806u, new RpcReceiveHandler(__rpc_handler_2731884806));
			NetworkManager.__rpc_func_table.Add(3369954093u, new RpcReceiveHandler(__rpc_handler_3369954093));
		}

		private static void __rpc_handler_3742843923(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: 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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
			{
				if ((int)networkManager.LogLevel <= 1)
				{
					Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
				}
			}
			else
			{
				int index = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref index);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Brick)(object)target).PlayCookieAudioServerRpc(index);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		private static void __rpc_handler_4170301725(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
			{
				if ((int)networkManager.LogLevel <= 1)
				{
					Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
				}
			}
			else
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Brick)(object)target).StopPlayingCookieAudioServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_366094878(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;
				((Brick)(object)target).StopPlayingCookieAudioClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2731884806(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;
				((Brick)(object)target).BoomClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3369954093(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
			{
				if ((int)networkManager.LogLevel <= 1)
				{
					Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
				}
			}
			else
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Brick)(object)target).BoomServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "Brick";
		}
	}
	internal class HittingStuff : GrabbableObject
	{
		public int hammerHitForce = 1;

		public float hammerHitPercentage = 1f;

		public bool reelingUp;

		public bool isHoldingButton;

		private RaycastHit rayHit;

		private Coroutine reelingUpCoroutine;

		private RaycastHit[] objectsHitByHammer;

		private List<RaycastHit> objectsHitByHammerList = new List<RaycastHit>();

		public AudioClip reelUp;

		public AudioClip swing;

		public AudioClip[] hitSFX;

		public AudioSource hammerAudio;

		private PlayerControllerB previousPlayerHeldBy;

		private int hammerMask = 11012424;

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			if ((Object)(object)base.playerHeldBy == (Object)null)
			{
				return;
			}
			isHoldingButton = buttonDown;
			if (!reelingUp && buttonDown)
			{
				reelingUp = true;
				previousPlayerHeldBy = base.playerHeldBy;
				if (reelingUpCoroutine != null)
				{
					((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine);
				}
				reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(reelUpHammer());
			}
		}

		private IEnumerator reelUpHammer()
		{
			base.playerHeldBy.activatingItem = true;
			base.playerHeldBy.twoHanded = true;
			base.playerHeldBy.playerBodyAnimator.ResetTrigger("hammerHit");
			base.playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true);
			hammerAudio.PlayOneShot(reelUp);
			ReelUpSFXServerRpc();
			yield return (object)new WaitForSeconds(0.35f);
			yield return (object)new WaitUntil((Func<bool>)(() => !isHoldingButton || !base.isHeld));
			SwingHammer(!base.isHeld);
			yield return (object)new WaitForSeconds(0.13f);
			HitHammer(!base.isHeld);
			yield return (object)new WaitForSeconds(0.3f);
			reelingUp = false;
			reelingUpCoroutine = null;
		}

		[ServerRpc]
		public void ReelUpSFXServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__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(2951614796u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2951614796u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ReelUpSFXClientRpc();
			}
		}

		[ClientRpc]
		public void ReelUpSFXClientRpc()
		{
			//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(989564174u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 989564174u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					hammerAudio.PlayOneShot(reelUp);
				}
			}
		}

		public override void DiscardItem()
		{
			base.playerHeldBy.activatingItem = false;
			((GrabbableObject)this).DiscardItem();
		}

		public void SwingHammer(bool cancel = false)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false);
			if (!cancel)
			{
				hammerAudio.PlayOneShot(swing);
				previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false);
			}
		}

		public void HitHammer(bool cancel = false)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: 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_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: 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_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_031f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)previousPlayerHeldBy == (Object)null)
			{
				return;
			}
			previousPlayerHeldBy.activatingItem = false;
			bool flag = false;
			int num = -1;
			if (!cancel)
			{
				previousPlayerHeldBy.twoHanded = false;
				Debug.DrawRay(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward * 1.85f, Color.blue, 5f);
				objectsHitByHammer = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.75f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.85f, hammerMask, (QueryTriggerInteraction)2);
				objectsHitByHammerList = objectsHitByHammer.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList();
				Vector3 val = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position;
				IHittable val3 = default(IHittable);
				RaycastHit val5 = default(RaycastHit);
				for (int i = 0; i < objectsHitByHammerList.Count; i++)
				{
					RaycastHit val2 = objectsHitByHammerList[i];
					if (((Component)((RaycastHit)(ref val2)).transform).gameObject.layer != 8)
					{
						val2 = objectsHitByHammerList[i];
						if (((Component)((RaycastHit)(ref val2)).transform).gameObject.layer != 11)
						{
							val2 = objectsHitByHammerList[i];
							if (!((Component)((RaycastHit)(ref val2)).transform).TryGetComponent<IHittable>(ref val3))
							{
								continue;
							}
							val2 = objectsHitByHammerList[i];
							if ((Object)(object)((RaycastHit)(ref val2)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform)
							{
								continue;
							}
							val2 = objectsHitByHammerList[i];
							if (!(((RaycastHit)(ref val2)).point == Vector3.zero))
							{
								Vector3 val4 = val;
								val2 = objectsHitByHammerList[i];
								if (Physics.Linecast(val4, ((RaycastHit)(ref val2)).point, ref val5, StartOfRound.Instance.collidersAndRoomMaskAndDefault))
								{
									continue;
								}
							}
							flag = true;
							Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward;
							val3.Hit(hammerHitForce, forward, previousPlayerHeldBy, true, -1);
							continue;
						}
					}
					val2 = objectsHitByHammerList[i];
					Vector3 point = ((RaycastHit)(ref val2)).point;
					val2 = objectsHitByHammerList[i];
					val = point + ((RaycastHit)(ref val2)).normal * 0.01f;
					flag = true;
					val2 = objectsHitByHammerList[i];
					string tag = ((Component)((RaycastHit)(ref val2)).collider).gameObject.tag;
					for (int j = 0; j < StartOfRound.Instance.footstepSurfaces.Length; j++)
					{
						if (StartOfRound.Instance.footstepSurfaces[j].surfaceTag == tag)
						{
							hammerAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX);
							WalkieTalkie.TransmitOneShotAudio(hammerAudio, StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX, 1f);
							num = j;
							break;
						}
					}
				}
			}
			if (flag)
			{
				int soundID = RoundManager.PlayRandomClip(hammerAudio, hitSFX, true, 1f, 0, 1000);
				Object.FindObjectOfType<RoundManager>().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0);
				base.playerHeldBy.playerBodyAnimator.SetTrigger("hammerHit");
				HitHammerServerRpc(soundID);
			}
		}

		[ServerRpc]
		public void HitHammerServerRpc(int soundID)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: 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_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__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(2176195719u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, soundID);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2176195719u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				HitHammerClientRpc(soundID);
			}
		}

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

		private void HitSurfaceWithHammer(int soundID)
		{
			if (!((NetworkBehaviour)this).IsOwner)
			{
				hammerAudio.PlayOneShot(hitSFX[soundID]);
			}
			WalkieTalkie.TransmitOneShotAudio(hammerAudio, hitSFX[soundID], 1f);
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_HittingStuff()
		{
			//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(2951614796u, new RpcReceiveHandler(__rpc_handler_2951614796));
			NetworkManager.__rpc_func_table.Add(989564174u, new RpcReceiveHandler(__rpc_handler_989564174));
			NetworkManager.__rpc_func_table.Add(2176195719u, new RpcReceiveHandler(__rpc_handler_2176195719));
			NetworkManager.__rpc_func_table.Add(3269527847u, new RpcReceiveHandler(__rpc_handler_3269527847));
		}

		private static void __rpc_handler_2951614796(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
			{
				if ((int)networkManager.LogLevel <= 1)
				{
					Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
				}
			}
			else
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((HittingStuff)(object)target).ReelUpSFXServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_989564174(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;
				((HittingStuff)(object)target).ReelUpSFXClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2176195719(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: 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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
			{
				if ((int)networkManager.LogLevel <= 1)
				{
					Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
				}
			}
			else
			{
				int soundID = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref soundID);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((HittingStuff)(object)target).HitHammerServerRpc(soundID);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		protected internal override string __getTypeName()
		{
			return "HittingStuff";
		}
	}
}
namespace ImmersiveScrap.Weapons
{
	public class BaseballBat : Shovel
	{
		protected override void __initializeVariables()
		{
			((Shovel)this).__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "BaseballBat";
		}
	}
	public class Plunger : Shovel
	{
		protected override void __initializeVariables()
		{
			((Shovel)this).__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "Plunger";
		}
	}
}
namespace ImmersiveScrap.Keybinds
{
	public class IngameKeybinds : LcInputActions
	{
		[InputAction("<Keyboard>/q", Name = "ThrowKeybind")]
		public InputAction ThrowKey { get; set; }
	}
}
namespace ImmersiveScrap.Configs
{
	public class ImmersiveScrapConfig
	{
		public static ConfigEntry<int> ConfigVanillaSpawnWeight { get; private set; }

		public static ConfigEntry<int> ConfigCustomSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigAlcoholSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigAnvilSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigBaseballSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigBeercanSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigBrickSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigBrokenEngineSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigBucketSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigCanPaintSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigCanteenSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigCarBatterySpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigClampSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigClockSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigFanSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigFancyPaintingSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigFireAxeSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigFireExtingSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigFireHydrantSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigFoodCanSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigGameboySpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigGarbageSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigHammerSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigJerryCanSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigKeyboardSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigLanternSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigLibraryLampSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigPlantSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigPliersSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigPlungerSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigRetroToySpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigScrewdriverSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigSinkSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigSocketSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigSqueakyToySpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigSuitcaseSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigToasterSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigToolboxSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigTophatSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigTrafficConeSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigVentSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigWateringCanSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigWheelSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigWineBottleSpawnWeight { get; private set; }

		public static ConfigEntry<string> ConfigWrenchSpawnWeight { get; private set; }

		public static ConfigEntry<bool> ConfigBrickExploding { get; private set; }

		public static ConfigEntry<bool> ConfigBrickDealingDamage { get; private set; }

		public static ConfigEntry<int> ConfigBrickDealingXDamage { get; private set; }

		public ImmersiveScrapConfig(ConfigFile configFile)
		{
			ConfigBrickExploding = configFile.Bind<bool>("Scrap Options", "Brick Exploding", false, "Enable/Disable Brick Exploding");
			ConfigBrickDealingDamage = configFile.Bind<bool>("Scrap Options", "Brick Dealing Damage", false, "Enable/Disable Brick Dealing Damage");
			ConfigBrickDealingXDamage = configFile.Bind<int>("Scrap Options", "Brick Dealing X Damage", 1, "Set how much damage the Brick deals");
			ConfigAlcoholSpawnWeight = configFile.Bind<string>("Scrap Options", "Alcohol | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for alcohol scrap on moons");
			ConfigAnvilSpawnWeight = configFile.Bind<string>("Scrap Options", "Anvil | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for anvil scrap on moons");
			ConfigBaseballSpawnWeight = configFile.Bind<string>("Scrap Options", "Baseball | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for baseball scrap on moons");
			ConfigBeercanSpawnWeight = configFile.Bind<string>("Scrap Options", "Beercan | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for beer can scrap on moons");
			ConfigBrickSpawnWeight = configFile.Bind<string>("Scrap Options", "Brick | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for brick scrap on moons");
			ConfigCanteenSpawnWeight = configFile.Bind<string>("Scrap Options", "Canteen | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for canteen scrap on moons");
			ConfigCarBatterySpawnWeight = configFile.Bind<string>("Scrap Options", "CarBattery | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for car battery scrap on moons");
			ConfigFireAxeSpawnWeight = configFile.Bind<string>("Scrap Options", "FireAxe | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for fire axe scrap on moons");
			ConfigFireExtingSpawnWeight = configFile.Bind<string>("Scrap Options", "FireExtinguisher | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for fire extinguisher scrap on moons");
			ConfigFireHydrantSpawnWeight = configFile.Bind<string>("Scrap Options", "FireHydrant | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for fire hydrant scrap on moons");
			ConfigFoodCanSpawnWeight = configFile.Bind<string>("Scrap Options", "FoodCan | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for food can scrap on moons");
			ConfigLibraryLampSpawnWeight = configFile.Bind<string>("Scrap Options", "LibraryLamp | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for library lamp scrap on moons");
			ConfigPlantSpawnWeight = configFile.Bind<string>("Scrap Options", "Plant | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for plant scrap on moons");
			ConfigPliersSpawnWeight = configFile.Bind<string>("Scrap Options", "Pliers | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for pliers scrap on moons");
			ConfigPlungerSpawnWeight = configFile.Bind<string>("Scrap Options", "Plunger | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for plunger scrap on moons");
			ConfigTrafficConeSpawnWeight = configFile.Bind<string>("Scrap Options", "TrafficCone | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for traffic cone scrap on moons");
			ConfigWateringCanSpawnWeight = configFile.Bind<string>("Scrap Options", "WateringCan | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for watering can scrap on moons");
			ConfigWrenchSpawnWeight = configFile.Bind<string>("Scrap Options", "Wrench | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for wrench scrap on moons");
			ConfigBrokenEngineSpawnWeight = configFile.Bind<string>("Scrap Options", "BrokenEngine | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for broken engine scrap on moons");
			ConfigBucketSpawnWeight = configFile.Bind<string>("Scrap Options", "Bucket | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for bucket scrap on moons");
			ConfigCanPaintSpawnWeight = configFile.Bind<string>("Scrap Options", "CanPaint | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for can of paint scrap on moons");
			ConfigClampSpawnWeight = configFile.Bind<string>("Scrap Options", "Clamp | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for clamp scrap on moons");
			ConfigClockSpawnWeight = configFile.Bind<string>("Scrap Options", "Clock | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for clock scrap on moons");
			ConfigFanSpawnWeight = configFile.Bind<string>("Scrap Options", "Fan | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for fan scrap on moons");
			ConfigFancyPaintingSpawnWeight = configFile.Bind<string>("Scrap Options", "FancyPainting | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for fancy painting scrap on moons");
			ConfigGarbageSpawnWeight = configFile.Bind<string>("Scrap Options", "Garbage | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for garbage scrap on moons");
			ConfigGameboySpawnWeight = configFile.Bind<string>("Scrap Options", "Gameboy | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for Gameboy scrap on moons");
			ConfigHammerSpawnWeight = configFile.Bind<string>("Scrap Options", "Hammer | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for hammer scrap on moons");
			ConfigJerryCanSpawnWeight = configFile.Bind<string>("Scrap Options", "JerryCan | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for jerry can scrap on moons");
			ConfigKeyboardSpawnWeight = configFile.Bind<string>("Scrap Options", "Keyboard | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for keyboard scrap on moons");
			ConfigLanternSpawnWeight = configFile.Bind<string>("Scrap Options", "Lantern | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for lantern scrap on moons");
			ConfigRetroToySpawnWeight = configFile.Bind<string>("Scrap Options", "RetroToy | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for retro toy scrap on moons");
			ConfigScrewdriverSpawnWeight = configFile.Bind<string>("Scrap Options", "Screwdriver | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for screwdriver scrap on moons");
			ConfigSinkSpawnWeight = configFile.Bind<string>("Scrap Options", "Sink | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for sink scrap on moons");
			ConfigSocketSpawnWeight = configFile.Bind<string>("Scrap Options", "Socket | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for socket scrap on moons");
			ConfigSqueakyToySpawnWeight = configFile.Bind<string>("Scrap Options", "SqueakyToy | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for squeaky toy scrap on moons");
			ConfigSuitcaseSpawnWeight = configFile.Bind<string>("Scrap Options", "Suitcase | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for suitcase scrap on moons");
			ConfigToasterSpawnWeight = configFile.Bind<string>("Scrap Options", "Toaster | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for toaster scrap on moons");
			ConfigToolboxSpawnWeight = configFile.Bind<string>("Scrap Options", "Toolbox | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for toolbox scrap on moons");
			ConfigTophatSpawnWeight = configFile.Bind<string>("Scrap Options", "Tophat | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for top hat scrap on moons");
			ConfigVentSpawnWeight = configFile.Bind<string>("Scrap Options", "Vent | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for vent scrap on moons");
			ConfigWheelSpawnWeight = configFile.Bind<string>("Scrap Options", "Wheel | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for wheel scrap on moons");
			ConfigWineBottleSpawnWeight = configFile.Bind<string>("Scrap Options", "WineBottle | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for wine bottle scrap on moons");
			ClearUnusedEntries(configFile);
			Plugin.Logger.LogInfo((object)"Setting up config for ImmersiveScrap plugin...");
		}

		private void ClearUnusedEntries(ConfigFile configFile)
		{
			PropertyInfo property = ((object)configFile).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic);
			Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(configFile, null);
			dictionary.Clear();
			configFile.Save();
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}
namespace ImmersiveScrap.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}

plugins/LCGoldScrapMod.dll

Decompiled a month ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
using System.Xml.Serialization;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using DunGen;
using GameNetcodeStuff;
using HarmonyLib;
using HarmonyLib.Tools;
using LethalConfig;
using LethalConfig.ConfigItems;
using STSharedAudioLib;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
internal class <Module>
{
	static <Module>()
	{
	}
}
[CreateAssetMenu(menuName = "LCGoldScrapMod/ArtOfGoldMaterials", order = 1)]
public class ArtOfGoldMaterials : ScriptableObject
{
	public List<Material> allArtwork;

	public List<Material> allSillyArtwork;
}
public enum GoldScrapLevels
{
	Experimentation,
	Assurance,
	Vow,
	Offense,
	March,
	Rend,
	Dine,
	Titan,
	Adamance,
	Artifice,
	Embrion
}
[CreateAssetMenu(menuName = "LCGoldScrapMod/ItemData", order = 0)]
public class ItemData : ScriptableObject
{
	[Header("Item")]
	[Tooltip("The LCGoldScrapMod itemProperties the game will read from on the host.")]
	public Item itemProperties;

	[Tooltip("If true, it will be registered to levels and its itemProperties' weight, max-, and minValues will be put through the configMultipliers.\nIf false, only weight will be multiplied by its configMultiplier.")]
	public bool isScrap = true;

	[Tooltip("If true, its value will not be counted when collected in levels and when sold on the Company desk.")]
	public bool isStoreItem;

	[Space(3f)]
	[Header("Defaults")]
	[Tooltip("The intended default weight not yet taking the default 1.5x weightMultiplier into account.\nUsually the weight of the original item, unless that has no weight.")]
	public float defaultWeight = 1f;

	[Tooltip("The intended default maxValue not yet taking the default 2x maxValueMultiplier into account.\nUsually the maxValue of the original item.")]
	public int defaultMaxValue;

	[Tooltip("The intended default minValue not yet taking the default 2.5x minValueMultiplier into account.\nUsually the minValue of the original item.")]
	public int defaultMinValue;

	[Tooltip("The intended default rarity not yet taking the custom plusGain and minusLoss into account.\nRefer to 'GoldScrap - Items' document.")]
	public int defaultRarity = 3;

	[Space(3f)]
	[Header("Levels")]
	[Tooltip("The vanilla levels where this gold scrap can appear.\nTakes a calculation of 'Default Rarity - 1' into account.")]
	public GoldScrapLevels[] levelsToAddMinus;

	[Tooltip("The vanilla levels where this gold scrap can appear.\nOnly takes Default Rarity into account.")]
	public GoldScrapLevels[] levelsToAddDefault;

	[Tooltip("The vanilla levels where this gold scrap can appear.\nTakes a calculation of 'Default Rarity + 2' into account.")]
	public GoldScrapLevels[] levelsToAddPlus;

	[Tooltip("A custom positive gain or negative loss that will influence the Default Rarity of gold scrap on levels selected in 'Levels To Add Custom'.\nWill have no effect if Default Rarity is 2 or smaller and Custom Change is -2 or lower.")]
	public int customChange;

	[Tooltip("The vanilla levels where this gold scrap can appear.\nTakes a calculation of 'Default Rarity + Custom Change' into account.")]
	public GoldScrapLevels[] levelsToAddCustom;

	[Space(3f)]
	[Header("Host values")]
	[HideInInspector]
	public int localMaxValue;

	[HideInInspector]
	public int localMinValue;
}
[CreateAssetMenu(menuName = "LCGoldScrapMod/List/AudioClipList")]
public class AudioClipList : ScriptableObject
{
	public List<AudioClip> allClips = new List<AudioClip>();
}
[CreateAssetMenu(menuName = "LCGoldScrapMod/List/GameObjectList")]
public class GameObjectList : ScriptableObject
{
	public GameObject[] allPrefabs;
}
[CreateAssetMenu(menuName = "LCGoldScrapMod/List/ItemDataList")]
public class ItemDataList : ScriptableObject
{
	public ItemData[] allItemData;
}
[CreateAssetMenu(menuName = "LCGoldScrapMod/List/StringList")]
public class StringList : ScriptableObject
{
	[TextArea(1, 20)]
	public string[] allStrings;
}
public interface IGoldenGlassSecret
{
	void BeginReveal();

	void EndReveal();
}
public class GoldBirdScript : GrabbableObject
{
	[HarmonyPatch(typeof(HUDManager), "RadiationWarningHUD")]
	public class NewHUDManagerRadiationWarning
	{
		[HarmonyPostfix]
		public static void AwakenGoldBirds()
		{
			if ((Object)(object)GameNetworkManager.Instance != (Object)null && (Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null && GameNetworkManager.Instance.localPlayerController.isHostPlayerObject)
			{
				GoldBirdScript[] array = Object.FindObjectsOfType<GoldBirdScript>();
				foreach (GoldBirdScript obj in array)
				{
					obj.AwakenClientRpc((int)((float)((GrabbableObject)obj).scrapValue * Random.Range(3f, 4f)));
				}
			}
		}
	}

	private static ManualLogSource Logger = Plugin.Logger;

	[Space(3f)]
	[Header("Alarm")]
	public AudioSource alarmSource;

	public AudioClip alarmClip;

	private float alarmTimer;

	private bool canAlarmFire;

	[Space(3f)]
	[Header("Spotlight")]
	public AudioSource spotlightAudio;

	public AudioClip lightOnClip;

	public AudioClip lightOffClip;

	public Light headlight;

	public Color normalColor;

	public Color alarmColor;

	[Space(3f)]
	[Header("Dormancy")]
	public AudioSource awakeSource;

	public AudioClip awakeClip;

	public AudioClip dieClip;

	public bool dormant = true;

	public ScanNodeProperties scanNode;

	private bool canWakeThisRound = true;

	public override void Start()
	{
		((GrabbableObject)this).Start();
		alarmSource.clip = alarmClip;
		if (base.isInShipRoom)
		{
			canWakeThisRound = false;
		}
		else
		{
			scanNode.headerText = "Gold Bird (Dormant)";
		}
	}

	public override void Update()
	{
		((GrabbableObject)this).Update();
		if (!((NetworkBehaviour)this).IsServer || dormant)
		{
			return;
		}
		canAlarmFire = (Object)(object)base.playerHeldBy != (Object)null && StartOfRound.Instance.shipDoorsEnabled && !StartOfRound.Instance.inShipPhase;
		if (!canAlarmFire && alarmTimer < 0.1f)
		{
			alarmTimer = 0.1f;
			ToggleAlarmClientRpc(alarm: false);
			return;
		}
		alarmTimer += Time.deltaTime;
		if (alarmTimer > 2f)
		{
			alarmTimer = 0f;
			DoAlarmInterval();
		}
	}

	private void DoAlarmInterval()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		if (canAlarmFire)
		{
			if (IsNearbyPlayerInSight())
			{
				ToggleAlarmClientRpc(alarm: true);
				RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, alarmSource.maxDistance + 15f, 1f, 0, false, 0);
			}
			else
			{
				ToggleAlarmClientRpc(alarm: false);
			}
		}
	}

	private bool IsNearbyPlayerInSight()
	{
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: 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_008e: Unknown result type (might be due to invalid IL or missing references)
		if (StartOfRound.Instance.connectedPlayersAmount > 0)
		{
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB val in allPlayerScripts)
			{
				if (!((Object)(object)val == (Object)null) && !((Object)(object)val == (Object)(object)base.playerHeldBy) && val.isPlayerControlled && !(Vector3.Distance(((Component)headlight).transform.position, ((Component)val).transform.position) > alarmSource.maxDistance - 15f))
				{
					return !Physics.Linecast(((Component)headlight).transform.position, val.playerEye.position, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1);
				}
			}
		}
		return false;
	}

	[ClientRpc]
	private void ToggleAlarmClientRpc(bool alarm)
	{
		//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_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: 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(3862976390u, val, (RpcDelivery)0);
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref alarm, default(ForPrimitives));
			((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3862976390u, val, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
		{
			if (!((Behaviour)headlight).enabled)
			{
				((Behaviour)headlight).enabled = true;
			}
			if (alarm && !alarmSource.isPlaying)
			{
				spotlightAudio.PlayOneShot(lightOnClip);
				alarmSource.Play();
				headlight.color = alarmColor;
			}
			else if (!alarm && alarmSource.isPlaying)
			{
				spotlightAudio.PlayOneShot(lightOffClip);
				alarmSource.Stop();
				headlight.color = normalColor;
			}
		}
	}

	[ClientRpc]
	public void AwakenClientRpc(int awakenedValue)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0171: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a1: 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(4211676833u, val, (RpcDelivery)0);
			BytePacker.WriteValueBitPacked(val2, awakenedValue);
			((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4211676833u, val, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
		{
			return;
		}
		Logger.LogDebug((object)$"{((Object)((Component)this).gameObject).name} #{((NetworkBehaviour)this).NetworkObjectId}: canWake {canWakeThisRound} // dormant {dormant}");
		if (canWakeThisRound && dormant)
		{
			Logger.LogDebug((object)"awakening");
			awakeSource.PlayOneShot(awakeClip);
			WalkieTalkie.TransmitOneShotAudio(awakeSource, awakeClip, 0.5f);
			RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, awakeSource.maxDistance, 0.1f, 0, false, 0);
			((Behaviour)headlight).enabled = true;
			headlight.color = normalColor;
			dormant = false;
			canWakeThisRound = false;
			if (scanNode.headerText.Contains("(Dormant)"))
			{
				scanNode.headerText = scanNode.headerText.Replace("Dormant", "Awake");
			}
			((GrabbableObject)this).SetScrapValue(awakenedValue);
		}
	}

	[ClientRpc]
	public void DeactivateAtEndOfDayClientRpc()
	{
		//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)
		//IL_015f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: 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(634004460u, val, (RpcDelivery)0);
			((NetworkBehaviour)this).__endSendClientRpc(ref val2, 634004460u, val, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost) || !canWakeThisRound)
		{
			return;
		}
		canWakeThisRound = false;
		Logger.LogDebug((object)$"{((Object)((Component)this).gameObject).name} #{((NetworkBehaviour)this).NetworkObjectId} can no longer wake");
		if (dormant)
		{
			if (scanNode.headerText.Contains("(Dormant)"))
			{
				scanNode.headerText = scanNode.headerText.Replace("Dormant", "Dead");
			}
			spotlightAudio.PlayOneShot(dieClip);
			Object.Instantiate<GameObject>(AssetsCollection.poofParticle, ((Component)headlight).transform.position, new Quaternion(0f, 0f, 0f, 0f)).GetComponent<ParticleSystem>().Play();
		}
	}

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

	[ClientRpc]
	private void SyncUponJoinClientRpc(bool hostCanWakeValue, bool enableHeadlight, string scanNodeName, int playerID)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0117: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: 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(1832698290u, val, (RpcDelivery)0);
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref hostCanWakeValue, default(ForPrimitives));
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref enableHeadlight, default(ForPrimitives));
			bool flag = scanNodeName != null;
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
			if (flag)
			{
				((FastBufferWriter)(ref val2)).WriteValueSafe(scanNodeName, false);
			}
			BytePacker.WriteValueBitPacked(val2, playerID);
			((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1832698290u, val, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && playerID == (int)StartOfRound.Instance.localPlayerController.playerClientId)
		{
			canWakeThisRound = hostCanWakeValue;
			((Behaviour)headlight).enabled = enableHeadlight;
			if (enableHeadlight)
			{
				headlight.color = (alarmSource.isPlaying ? alarmColor : normalColor);
			}
			scanNode.headerText = scanNodeName;
		}
	}

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

	[RuntimeInitializeOnLoadMethod]
	internal static void InitializeRPCS_GoldBirdScript()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Expected O, but got Unknown
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Expected O, but got Unknown
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Expected O, but got Unknown
		NetworkManager.__rpc_func_table.Add(3862976390u, new RpcReceiveHandler(__rpc_handler_3862976390));
		NetworkManager.__rpc_func_table.Add(4211676833u, new RpcReceiveHandler(__rpc_handler_4211676833));
		NetworkManager.__rpc_func_table.Add(634004460u, new RpcReceiveHandler(__rpc_handler_634004460));
		NetworkManager.__rpc_func_table.Add(2991509102u, new RpcReceiveHandler(__rpc_handler_2991509102));
		NetworkManager.__rpc_func_table.Add(1832698290u, new RpcReceiveHandler(__rpc_handler_1832698290));
	}

	private static void __rpc_handler_3862976390(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_005e: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			bool alarm = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref alarm, default(ForPrimitives));
			target.__rpc_exec_stage = (__RpcExecStage)2;
			((GoldBirdScript)(object)target).ToggleAlarmClientRpc(alarm);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

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

	private static void __rpc_handler_634004460(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;
			((GoldBirdScript)(object)target).DeactivateAtEndOfDayClientRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

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

	private static void __rpc_handler_1832698290(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_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: 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_00ca: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			bool hostCanWakeValue = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref hostCanWakeValue, default(ForPrimitives));
			bool enableHeadlight = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref enableHeadlight, default(ForPrimitives));
			bool flag = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
			string scanNodeName = null;
			if (flag)
			{
				((FastBufferReader)(ref reader)).ReadValueSafe(ref scanNodeName, false);
			}
			int playerID = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref playerID);
			target.__rpc_exec_stage = (__RpcExecStage)2;
			((GoldBirdScript)(object)target).SyncUponJoinClientRpc(hostCanWakeValue, enableHeadlight, scanNodeName, playerID);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	protected internal override string __getTypeName()
	{
		return "GoldBirdScript";
	}
}
public class GoldenClockScript : GrabbableObject
{
	private static ManualLogSource Logger = Plugin.Logger;

	[Space(3f)]
	[Header("Original Clock")]
	public Transform minuteHand;

	public Transform secondHand;

	private float timeOfLastSecond;

	public AudioSource tickAudio;

	public AudioClip tickSFX;

	public AudioClip tockSFX;

	private bool tickOrTock;

	[Space(3f)]
	[Header("Custom Timer")]
	public AudioClip intervalClip;

	public AudioClip failClip;

	public int maxRealSeconds;

	public int minRealSeconds;

	public float countdownInterval;

	[Space(3f)]
	[Header("Close Call")]
	public AudioSource closeCallAudio;

	public AudioClip closeCallApproach;

	public AudioClip closeCallSuccess;

	public AudioClip closeCallFail;

	private bool shouldCountDown;

	private bool approachedShipFinalPhase;

	private int secondsLeft;

	private int thisClocksStartingSeconds;

	private int thisClocksStartingValue;

	private int thisClocksIntervalAmount;

	private int thisClocksSpecialMultiplier;

	private float timeOfLastTickTock;

	public override void Start()
	{
		((GrabbableObject)this).Start();
		if (((NetworkBehaviour)this).IsServer && !base.isInShipRoom)
		{
			((MonoBehaviour)this).StartCoroutine(RollForNewTimer());
		}
	}

	public override void Update()
	{
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		((GrabbableObject)this).Update();
		if (!shouldCountDown)
		{
			return;
		}
		if (Time.realtimeSinceStartup - timeOfLastSecond > countdownInterval)
		{
			timeOfLastSecond = Time.realtimeSinceStartup;
			if (((NetworkBehaviour)this).IsServer || (!((NetworkBehaviour)this).IsServer && secondsLeft % 60 != 1))
			{
				secondsLeft--;
				secondHand.Rotate(6f, 0f, 0f, (Space)1);
			}
			if (((NetworkBehaviour)this).IsServer)
			{
				if (secondsLeft <= 0)
				{
					shouldCountDown = false;
					SyncFailureClientRpc(base.scrapValue / thisClocksSpecialMultiplier);
					return;
				}
				if (secondsLeft % 60 == 0)
				{
					SyncTimeAndValueClientRpc(secondsLeft, base.scrapValue - (int)Mathf.Lerp(0f, (float)thisClocksStartingValue, (float)(Random.Range(40, 70) / thisClocksIntervalAmount) / 100f), isMinute: true);
				}
				if (secondsLeft < 60 && !approachedShipFinalPhase && (Object)(object)base.playerHeldBy != (Object)null && Vector3.Distance(((Component)base.playerHeldBy).transform.position, ((Component)StartOfRound.Instance.shipDoorNode).transform.position) < 10f)
				{
					approachedShipFinalPhase = true;
					SyncApproachClientRpc();
				}
			}
			if (secondsLeft > 60)
			{
				TickTock();
			}
		}
		if (secondsLeft <= 60 && Time.realtimeSinceStartup - timeOfLastTickTock > countdownInterval / 2f)
		{
			TickTock();
		}
	}

	public override void OnBroughtToShip()
	{
		((GrabbableObject)this).OnBroughtToShip();
		if (shouldCountDown)
		{
			SyncSuccessServerRpc();
		}
	}

	private IEnumerator RollForNewTimer()
	{
		yield return (object)new WaitUntil((Func<bool>)(() => StartOfRound.Instance.shipHasLanded));
		int num = Random.Range(minRealSeconds, maxRealSeconds);
		int num2 = (int)((float)num / countdownInterval);
		int intervalAmount = num2 / 60;
		int num3 = Mathf.Clamp(TimeOfDay.Instance.daysUntilDeadline, 1, 3) + 1;
		int num4 = base.scrapValue * num3 + (maxRealSeconds - num) / 2;
		if (RarityManager.CurrentlyGoldFever())
		{
			num4 *= 2;
		}
		SendNewTimerClientRpc(num2, intervalAmount, num3, num4);
	}

	[ClientRpc]
	private void SendNewTimerClientRpc(int startingSeconds, int intervalAmount, int specialMultiplier, int startingValue)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: 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(724639717u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, startingSeconds);
				BytePacker.WriteValueBitPacked(val2, intervalAmount);
				BytePacker.WriteValueBitPacked(val2, specialMultiplier);
				BytePacker.WriteValueBitPacked(val2, startingValue);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 724639717u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				thisClocksStartingSeconds = startingSeconds;
				thisClocksIntervalAmount = intervalAmount;
				thisClocksSpecialMultiplier = specialMultiplier;
				thisClocksStartingValue = startingValue;
				shouldCountDown = true;
				minuteHand.Rotate(-20f * (float)(thisClocksIntervalAmount % 18), 0f, 0f, (Space)1);
				SetTimerRotationAndValue(thisClocksStartingSeconds, isMinute: false, thisClocksStartingValue);
				Logger.LogDebug((object)$"{((Object)((Component)this).gameObject).name} #{((NetworkBehaviour)this).NetworkObjectId}:");
				Logger.LogDebug((object)$"{thisClocksStartingSeconds}");
				Logger.LogDebug((object)$"{thisClocksIntervalAmount}");
				Logger.LogDebug((object)$"{thisClocksSpecialMultiplier}");
				Logger.LogDebug((object)$"{thisClocksStartingValue}");
			}
		}
	}

	private void SetTimerRotationAndValue(int seconds, bool isMinute = false, int newScrapValue = -1)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		secondsLeft = seconds;
		if (isMinute)
		{
			secondHand.localRotation = new Quaternion(0f, 0f, 0f, 0f);
		}
		else
		{
			secondHand.Rotate(-6f * (float)(seconds % 60), 0f, 0f, (Space)1);
		}
		if (newScrapValue != -1)
		{
			((GrabbableObject)this).SetScrapValue(newScrapValue);
		}
	}

	[ClientRpc]
	private void SyncTimeAndValueClientRpc(int hostSecondsLeft, int newScrapValue, bool isMinute)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: 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(173399023u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, hostSecondsLeft);
				BytePacker.WriteValueBitPacked(val2, newScrapValue);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref isMinute, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 173399023u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				minuteHand.Rotate(20f, 0f, 0f, (Space)1);
				tickAudio.PlayOneShot(intervalClip);
				RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 5f, 0.5f, 0, false, 0);
				WalkieTalkie.TransmitOneShotAudio(tickAudio, intervalClip, 1f);
				SetTimerRotationAndValue(hostSecondsLeft, isMinute, newScrapValue);
			}
		}
	}

	[ServerRpc(RequireOwnership = false)]
	private void SyncSuccessServerRpc()
	{
		//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(1373350663u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1373350663u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				SyncSuccessClientRpc(secondsLeft < 60);
			}
		}
	}

	[ClientRpc]
	private void SyncSuccessClientRpc(bool inFinalPhase)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
		{
			ClientRpcParams val = default(ClientRpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2850989775u, val, (RpcDelivery)0);
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref inFinalPhase, default(ForPrimitives));
			((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2850989775u, val, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
		{
			shouldCountDown = false;
			tickAudio.PlayOneShot(intervalClip);
			WalkieTalkie.TransmitOneShotAudio(tickAudio, intervalClip, 1f);
			if (inFinalPhase)
			{
				closeCallAudio.Stop();
				closeCallAudio.PlayOneShot(closeCallSuccess);
				WalkieTalkie.TransmitOneShotAudio(closeCallAudio, closeCallSuccess, 1f);
			}
		}
	}

	[ClientRpc]
	private void SyncFailureClientRpc(int failedScrapValue)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: 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(3360715093u, val, (RpcDelivery)0);
			BytePacker.WriteValueBitPacked(val2, failedScrapValue);
			((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3360715093u, val, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
		{
			shouldCountDown = false;
			secondsLeft = 0;
			tickAudio.PlayOneShot(failClip);
			WalkieTalkie.TransmitOneShotAudio(tickAudio, failClip, 1f);
			RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 15f, 1f, 0, false, 0);
			((GrabbableObject)this).SetScrapValue(failedScrapValue);
			secondHand.localRotation = new Quaternion(0f, 0f, 0f, 0f);
			minuteHand.localRotation = new Quaternion(0f, 0f, 0f, 0f);
			if (approachedShipFinalPhase)
			{
				closeCallAudio.Stop();
				closeCallAudio.PlayOneShot(closeCallFail);
				WalkieTalkie.TransmitOneShotAudio(closeCallAudio, closeCallFail, 1f);
			}
		}
	}

	[ClientRpc]
	private void SyncApproachClientRpc()
	{
		//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(2869504692u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2869504692u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				approachedShipFinalPhase = true;
				closeCallAudio.PlayOneShot(closeCallApproach);
				WalkieTalkie.TransmitOneShotAudio(closeCallAudio, closeCallApproach, 1f);
			}
		}
	}

	private void TickTock()
	{
		tickOrTock = !tickOrTock;
		AudioClip val = (tickOrTock ? tickSFX : tockSFX);
		tickAudio.PlayOneShot(val);
		WalkieTalkie.TransmitOneShotAudio(tickAudio, val, 0.33f);
		timeOfLastTickTock = Time.realtimeSinceStartup;
	}

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

	[ClientRpc]
	private void SyncUponJoinClientRpc(bool hostBroughtToShip, int hostSecondsLeft, int playerID)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: 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_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		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(3919497654u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref hostBroughtToShip, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, hostSecondsLeft);
				BytePacker.WriteValueBitPacked(val2, playerID);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3919497654u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && playerID == (int)StartOfRound.Instance.localPlayerController.playerClientId)
			{
				shouldCountDown = hostBroughtToShip;
				SetTimerRotationAndValue(hostSecondsLeft);
			}
		}
	}

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

	[RuntimeInitializeOnLoadMethod]
	internal static void InitializeRPCS_GoldenClockScript()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Expected O, but got Unknown
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Expected O, but got Unknown
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Expected O, but got Unknown
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Expected O, but got Unknown
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Expected O, but got Unknown
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Expected O, but got Unknown
		NetworkManager.__rpc_func_table.Add(724639717u, new RpcReceiveHandler(__rpc_handler_724639717));
		NetworkManager.__rpc_func_table.Add(173399023u, new RpcReceiveHandler(__rpc_handler_173399023));
		NetworkManager.__rpc_func_table.Add(1373350663u, new RpcReceiveHandler(__rpc_handler_1373350663));
		NetworkManager.__rpc_func_table.Add(2850989775u, new RpcReceiveHandler(__rpc_handler_2850989775));
		NetworkManager.__rpc_func_table.Add(3360715093u, new RpcReceiveHandler(__rpc_handler_3360715093));
		NetworkManager.__rpc_func_table.Add(2869504692u, new RpcReceiveHandler(__rpc_handler_2869504692));
		NetworkManager.__rpc_func_table.Add(118909299u, new RpcReceiveHandler(__rpc_handler_118909299));
		NetworkManager.__rpc_func_table.Add(3919497654u, new RpcReceiveHandler(__rpc_handler_3919497654));
	}

	private static void __rpc_handler_724639717(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: 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)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			int startingSeconds = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref startingSeconds);
			int intervalAmount = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref intervalAmount);
			int specialMultiplier = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref specialMultiplier);
			int startingValue = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref startingValue);
			target.__rpc_exec_stage = (__RpcExecStage)2;
			((GoldenClockScript)(object)target).SendNewTimerClientRpc(startingSeconds, intervalAmount, specialMultiplier, startingValue);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_173399023(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: 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)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			int hostSecondsLeft = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref hostSecondsLeft);
			int newScrapValue = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref newScrapValue);
			bool isMinute = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref isMinute, default(ForPrimitives));
			target.__rpc_exec_stage = (__RpcExecStage)2;
			((GoldenClockScript)(object)target).SyncTimeAndValueClientRpc(hostSecondsLeft, newScrapValue, isMinute);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_1373350663(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;
			((GoldenClockScript)(object)target).SyncSuccessServerRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_2850989775(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_005e: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			bool inFinalPhase = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref inFinalPhase, default(ForPrimitives));
			target.__rpc_exec_stage = (__RpcExecStage)2;
			((GoldenClockScript)(object)target).SyncSuccessClientRpc(inFinalPhase);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

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

	private static void __rpc_handler_2869504692(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;
			((GoldenClockScript)(object)target).SyncApproachClientRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

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

	private static void __rpc_handler_3919497654(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_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			bool hostBroughtToShip = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref hostBroughtToShip, default(ForPrimitives));
			int hostSecondsLeft = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref hostSecondsLeft);
			int playerID = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref playerID);
			target.__rpc_exec_stage = (__RpcExecStage)2;
			((GoldenClockScript)(object)target).SyncUponJoinClientRpc(hostBroughtToShip, hostSecondsLeft, playerID);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	protected internal override string __getTypeName()
	{
		return "GoldenClockScript";
	}
}
public class GoldenGirlScript : GrabbableObject, IGoldenGlassSecret
{
	private static ManualLogSource Logger = Plugin.Logger;

	private Mesh loadedMesh;

	private bool broughtToShip;

	private bool choseLocalPlayer;

	[Space(3f)]
	[Header("(In)visibility")]
	public MeshFilter meshToToggle;

	public MeshRenderer materialToToggle;

	public AudioSource audioToMute;

	[Space(3f)]
	[Header("Audiovisual feedback")]
	public AudioSource reappearSource;

	public AudioClip reappearClip;

	public override void Start()
	{
		((GrabbableObject)this).Start();
		loadedMesh = ((Component)this).GetComponent<MeshFilter>().mesh;
		if (((NetworkBehaviour)this).IsServer)
		{
			if (base.isInShipRoom)
			{
				broughtToShip = true;
			}
			else
			{
				ChoosePlayer();
			}
		}
	}

	private void ChoosePlayer()
	{
		if (base.isInFactory && !base.isInShipRoom)
		{
			ChoosePlayerClientRpc((int)General.GetRandomPlayer().playerClientId);
		}
	}

	[ClientRpc]
	private void ChoosePlayerClientRpc(int playerClientId)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
		{
			ClientRpcParams val = default(ClientRpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2685509517u, val, (RpcDelivery)0);
			BytePacker.WriteValueBitPacked(val2, playerClientId);
			((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2685509517u, val, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
		{
			Logger.LogDebug((object)$"#{((NetworkBehaviour)this).NetworkObjectId}: [{playerClientId}]");
			if ((Object)(object)StartOfRound.Instance.allPlayerScripts[playerClientId] == (Object)(object)StartOfRound.Instance.localPlayerController)
			{
				choseLocalPlayer = true;
			}
			else
			{
				((MonoBehaviour)this).StartCoroutine(ToggleOnDelay());
			}
		}
	}

	private IEnumerator ToggleOnDelay()
	{
		yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)loadedMesh != (Object)null));
		ToggleGirl(enabled: false);
	}

	public override void OnHitGround()
	{
		((GrabbableObject)this).OnHitGround();
		if (!broughtToShip && !choseLocalPlayer)
		{
			ToggleGirl(enabled: false);
		}
	}

	public override void OnBroughtToShip()
	{
		((GrabbableObject)this).OnBroughtToShip();
		if (((NetworkBehaviour)this).IsOwner && !broughtToShip)
		{
			ReappearForEveryoneServerRpc();
		}
	}

	private void ToggleGirl(bool enabled)
	{
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		meshToToggle.mesh = (enabled ? loadedMesh : null);
		audioToMute.volume = (enabled ? 1 : 0);
		Collider[] propColliders = base.propColliders;
		for (int i = 0; i < propColliders.Length; i++)
		{
			((Collider)(BoxCollider)propColliders[i]).enabled = enabled;
		}
		if (!enabled && (Object)(object)base.radarIcon != (Object)null)
		{
			Object.Destroy((Object)(object)((Component)base.radarIcon).gameObject);
		}
		if (enabled && !StartOfRound.Instance.inShipPhase)
		{
			reappearSource.PlayOneShot(reappearClip);
			Object.Instantiate<GameObject>(AssetsCollection.poofParticle, ((Component)this).transform.position, new Quaternion(0f, 0f, 0f, 0f)).GetComponent<ParticleSystem>().Play();
		}
		if (enabled)
		{
			((Renderer)materialToToggle).material = AssetsCollection.defaultMaterialGold;
		}
	}

	[ServerRpc(RequireOwnership = false)]
	private void ReappearForEveryoneServerRpc()
	{
		//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(247589533u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 247589533u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ReappearForEveryoneClientRpc();
			}
		}
	}

	[ClientRpc]
	private void ReappearForEveryoneClientRpc()
	{
		//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)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
		{
			ClientRpcParams val = default(ClientRpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(958526731u, val, (RpcDelivery)0);
			((NetworkBehaviour)this).__endSendClientRpc(ref val2, 958526731u, val, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
		{
			broughtToShip = true;
			if (!choseLocalPlayer)
			{
				ToggleGirl(enabled: true);
			}
		}
	}

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

	[ClientRpc]
	private void SyncUponJoinClientRpc(bool onShip, int playerID)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4022450178u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref onShip, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, playerID);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4022450178u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && playerID == (int)StartOfRound.Instance.localPlayerController.playerClientId)
			{
				broughtToShip = onShip;
			}
		}
	}

	void IGoldenGlassSecret.BeginReveal()
	{
		if (!Config.hostToolRebalance && !broughtToShip && !choseLocalPlayer)
		{
			meshToToggle.mesh = loadedMesh;
			((Renderer)materialToToggle).material = AssetsCollection.defaultMaterialGoldTransparent;
		}
	}

	void IGoldenGlassSecret.EndReveal()
	{
		if (!broughtToShip && !choseLocalPlayer)
		{
			meshToToggle.mesh = null;
			((Renderer)materialToToggle).material = AssetsCollection.defaultMaterialGold;
		}
	}

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

	[RuntimeInitializeOnLoadMethod]
	internal static void InitializeRPCS_GoldenGirlScript()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Expected O, but got Unknown
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Expected O, but got Unknown
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Expected O, but got Unknown
		NetworkManager.__rpc_func_table.Add(2685509517u, new RpcReceiveHandler(__rpc_handler_2685509517));
		NetworkManager.__rpc_func_table.Add(247589533u, new RpcReceiveHandler(__rpc_handler_247589533));
		NetworkManager.__rpc_func_table.Add(958526731u, new RpcReceiveHandler(__rpc_handler_958526731));
		NetworkManager.__rpc_func_table.Add(2777299986u, new RpcReceiveHandler(__rpc_handler_2777299986));
		NetworkManager.__rpc_func_table.Add(4022450178u, new RpcReceiveHandler(__rpc_handler_4022450178));
	}

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

	private static void __rpc_handler_247589533(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;
			((GoldenGirlScript)(object)target).ReappearForEveryoneServerRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_958526731(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;
			((GoldenGirlScript)(object)target).ReappearForEveryoneClientRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

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

	private static void __rpc_handler_4022450178(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_006f: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			bool onShip = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref onShip, default(ForPrimitives));
			int playerID = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref playerID);
			target.__rpc_exec_stage = (__RpcExecStage)2;
			((GoldenGirlScript)(object)target).SyncUponJoinClientRpc(onShip, playerID);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	protected internal override string __getTypeName()
	{
		return "GoldenGirlScript";
	}
}
public class GoldenGlassScript : GrabbableObject
{
	private static ManualLogSource Logger = Plugin.Logger;

	private Coroutine beginRevealCoroutine;

	private Coroutine endRevealCoroutine;

	[Space(3f)]
	[Header("Audiovisual")]
	public AudioSource audio2D;

	public AudioClip beginRevealClip;

	public AudioClip endRevealClip;

	[Tooltip("The fewer reveals per frame, the better performance, but the slower things will appear/disappear on-screen when using the Glass.")]
	public int revealPerFrame;

	public override void InspectItem()
	{
		((GrabbableObject)this).InspectItem();
		if (base.playerHeldBy.IsInspectingItem)
		{
			StartAndStopCoroutine(beginReveal: true);
		}
		else
		{
			StartAndStopCoroutine(beginReveal: false);
		}
	}

	public override void PocketItem()
	{
		if ((Object)(object)base.playerHeldBy != (Object)null && (Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController)
		{
			StartAndStopCoroutine(beginReveal: false, base.playerHeldBy.IsInspectingItem);
		}
		((GrabbableObject)this).PocketItem();
	}

	public override void DiscardItem()
	{
		StartAndStopCoroutine(beginReveal: false, base.playerHeldBy.IsInspectingItem);
		((GrabbableObject)this).DiscardItem();
	}

	private void StartAndStopCoroutine(bool beginReveal, bool playClip = true)
	{
		if (beginReveal)
		{
			if (endRevealCoroutine != null)
			{
				Logger.LogDebug((object)"!!!STOPPING END REVEAL COROUTINE!!!");
				((MonoBehaviour)this).StopCoroutine(endRevealCoroutine);
				endRevealCoroutine = null;
			}
			beginRevealCoroutine = ((MonoBehaviour)this).StartCoroutine(BeginRevealLocal(playClip));
		}
		else
		{
			if (beginRevealCoroutine != null)
			{
				Logger.LogDebug((object)"!!!STOPPING BEGIN REVEAL COROUTINE!!!");
				((MonoBehaviour)this).StopCoroutine(beginRevealCoroutine);
				beginRevealCoroutine = null;
			}
			endRevealCoroutine = ((MonoBehaviour)this).StartCoroutine(EndRevealLocal(playClip));
		}
	}

	private IEnumerator BeginRevealLocal(bool playClip = true)
	{
		if (!playClip)
		{
			yield break;
		}
		audio2D.Stop();
		audio2D.PlayOneShot(beginRevealClip);
		int num = 0;
		GoldScrapObject[] array = Object.FindObjectsOfType<GoldScrapObject>();
		GoldScrapObject[] array2 = array;
		foreach (GoldScrapObject goldScrapObject in array2)
		{
			if (RarityManager.CurrentlyGoldFever() && (Object)(object)goldScrapObject.item != (Object)null)
			{
				SetAllItemsScanNodes(goldScrapObject.item, setTo: true);
			}
			IGoldenGlassSecret component = ((Component)goldScrapObject).GetComponent<IGoldenGlassSecret>();
			if (component != null)
			{
				Logger.LogDebug((object)("BEGIN revealing " + ((Object)((Component)goldScrapObject).gameObject).name));
				component.BeginReveal();
				num++;
				if (num >= revealPerFrame)
				{
					yield return null;
					num = 0;
				}
			}
		}
		beginRevealCoroutine = null;
	}

	private IEnumerator EndRevealLocal(bool playClip = true)
	{
		if (!playClip)
		{
			yield break;
		}
		audio2D.Stop();
		audio2D.PlayOneShot(endRevealClip);
		int num = 0;
		GoldScrapObject[] array = Object.FindObjectsOfType<GoldScrapObject>();
		GoldScrapObject[] array2 = array;
		foreach (GoldScrapObject goldScrapObject in array2)
		{
			if ((StartOfRound.Instance.inShipPhase || RarityManager.CurrentlyGoldFever()) && (Object)(object)goldScrapObject.item != (Object)null)
			{
				SetAllItemsScanNodes(goldScrapObject.item, setTo: false);
			}
			IGoldenGlassSecret component = ((Component)goldScrapObject).GetComponent<IGoldenGlassSecret>();
			if (component != null)
			{
				Logger.LogDebug((object)("STOP revealing " + ((Object)((Component)goldScrapObject).gameObject).name));
				component.EndReveal();
				num++;
				if (num >= revealPerFrame)
				{
					yield return null;
					num = 0;
				}
			}
		}
		endRevealCoroutine = null;
	}

	private void SetAllItemsScanNodes(GrabbableObject item, bool setTo)
	{
		ScanNodeProperties componentInChildren = ((Component)item).gameObject.GetComponentInChildren<ScanNodeProperties>();
		if ((Object)(object)componentInChildren != (Object)null)
		{
			if (setTo && !item.isInShipRoom)
			{
				componentInChildren.maxRange = (Config.hostToolRebalance ? 128 : 256);
				componentInChildren.requiresLineOfSight = false;
			}
			else if (!setTo)
			{
				componentInChildren.maxRange = 13;
				componentInChildren.requiresLineOfSight = true;
			}
		}
	}

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

	protected internal override string __getTypeName()
	{
		return "GoldenGlassScript";
	}
}
public class GoldenGuardianScript : GrabbableObject
{
	[HarmonyPatch(typeof(PlayerControllerB), "DamagePlayer")]
	public class NewPlayerDamage
	{
		[HarmonyPrefix]
		public static bool PreventDamage(PlayerControllerB __instance)
		{
			return PatchToPreventDamage(__instance, isKillCommand: false);
		}
	}

	[HarmonyPatch(typeof(PlayerControllerB), "KillPlayer")]
	public class NewPlayerKill
	{
		[HarmonyPrefix]
		public static bool PreventKill(PlayerControllerB __instance)
		{
			return PatchToPreventDamage(__instance, isKillCommand: true);
		}
	}

	private static ManualLogSource Logger = Plugin.Logger;

	private bool aboutToExplode;

	private Coroutine explosionCoroutine;

	[Space(3f)]
	[Header("Audiovisual")]
	public AudioSource audioSource;

	public AudioClip buildUpClip;

	public AudioClip explodeClip;

	public GameObject stunGrenadeExplosion;

	public override void Update()
	{
		((GrabbableObject)this).Update();
		if (((NetworkBehaviour)this).IsOwner && !((Object)(object)base.playerHeldBy == (Object)null) && (Object)(object)base.playerHeldBy.inAnimationWithEnemy != (Object)null && !aboutToExplode)
		{
			LocalPlayerStartExplosion(delay: true);
		}
	}

	public void LocalPlayerStartExplosion(bool delay = false, bool fromKillCommand = false)
	{
		float delayTime = 1.75f;
		if (Config.hostToolRebalance)
		{
			delayTime = 1.3f;
			delay = true;
		}
		if (fromKillCommand)
		{
			delay = false;
		}
		StartExplosion(delay, delayTime);
		StartExplosionServerRpc(delay, delayTime, (int)GameNetworkManager.Instance.localPlayerController.playerClientId);
	}

	private void StartExplosion(bool delay, float delayTime)
	{
		Logger.LogDebug((object)$"{((Object)this).name} #{((NetworkBehaviour)this).NetworkObjectId} called StartExplosion with delay {delay} and delayTime {delayTime}");
		aboutToExplode = true;
		if (delay)
		{
			explosionCoroutine = ((MonoBehaviour)this).StartCoroutine(ExplodeOnDelay(delayTime));
			return;
		}
		if (explosionCoroutine != null)
		{
			Logger.LogDebug((object)"interrupting coroutine to explode immediately!");
			((MonoBehaviour)this).StopCoroutine(explosionCoroutine);
		}
		Explode();
	}

	private IEnumerator ExplodeOnDelay(float delayTime = 1.75f)
	{
		yield return (object)new WaitForSeconds(0.1f);
		audioSource.PlayOneShot(buildUpClip);
		WalkieTalkie.TransmitOneShotAudio(audioSource, buildUpClip, 0.5f);
		yield return (object)new WaitForSeconds(delayTime);
		Explode();
	}

	public void Explode()
	{
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		if (!base.deactivated)
		{
			audioSource.Stop();
			((GrabbableObject)this).DestroyObjectInHand(base.playerHeldBy);
			if (!Config.hostToolRebalance)
			{
				audioSource.PlayOneShot(explodeClip);
				WalkieTalkie.TransmitOneShotAudio(audioSource, explodeClip, 1f);
				RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 25f, 0.3f, 0, false, 0);
				StunGrenadeItem.StunExplosion(((Component)this).transform.position, true, 0.2f, 10f, 1f, false, (PlayerControllerB)null, (PlayerControllerB)null, 0f);
				Transform val = (base.isInElevator ? StartOfRound.Instance.elevatorTransform : RoundManager.Instance.mapPropsContainer.transform);
				Object.Instantiate<GameObject>(stunGrenadeExplosion, ((Component)this).transform.position, Quaternion.identity, val);
			}
			else
			{
				Landmine.SpawnExplosion(((Component)this).transform.position, true, 4f, 8f, 25, 5f, (GameObject)null, false);
			}
			((MonoBehaviour)this).StartCoroutine(DelaySettingObjectAway());
		}
	}

	private IEnumerator DelaySettingObjectAway()
	{
		yield return (object)new WaitForSeconds(5f);
		base.targetFloorPosition = new Vector3(3000f, -400f, 3000f);
		base.startFallingPosition = new Vector3(3000f, -400f, 3000f);
	}

	public override void PlayDropSFX()
	{
		if (!base.deactivated)
		{
			((GrabbableObject)this).PlayDropSFX();
		}
	}

	[ServerRpc(RequireOwnership = false)]
	private void StartExplosionServerRpc(bool delay, float delayTime, int heldPlayerID)
	{
		//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_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: 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)
		{
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(619446056u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref delay, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref delayTime, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, heldPlayerID);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 619446056u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				StartExplosionClientRpc(delay, delayTime, heldPlayerID);
			}
		}
	}

	[ClientRpc]
	private void StartExplosionClientRpc(bool delay, float delayTime, int heldPlayerID)
	{
		//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_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: 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)
		{
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4234394122u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref delay, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref delayTime, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, heldPlayerID);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4234394122u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && heldPlayerID != (int)GameNetworkManager.Instance.localPlayerController.playerClientId)
			{
				Logger.LogDebug((object)$"non-owner client starting GoldenGuardian #{((NetworkBehaviour)this).NetworkObjectId} explosion");
				StartExplosion(delay, delayTime);
			}
		}
	}

	public static bool PatchToPreventDamage(PlayerControllerB __instance, bool isKillCommand)
	{
		if (!((NetworkBehaviour)__instance).IsOwner || __instance.isPlayerDead || !__instance.AllowPlayerDeath() || (Object)(object)__instance.currentlyHeldObjectServer == (Object)null)
		{
			return true;
		}
		GoldenGuardianScript component = ((Component)__instance.currentlyHeldObjectServer).GetComponent<GoldenGuardianScript>();
		if ((Object)(object)component != (Object)null && !((GrabbableObject)component).deactivated && (isKillCommand || !component.aboutToExplode))
		{
			Logger.LogDebug((object)$"GoldenGuardianScript patch: local player likely holding GoldenGuardian on server, trying to execute explosion | isKillCommand = {isKillCommand}");
			bool delay = !isKillCommand && Config.hostToolRebalance;
			component.LocalPlayerStartExplosion(delay, isKillCommand);
			return false;
		}
		return true;
	}

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

	[RuntimeInitializeOnLoadMethod]
	internal static void InitializeRPCS_GoldenGuardianScript()
	{
		//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(619446056u, new RpcReceiveHandler(__rpc_handler_619446056));
		NetworkManager.__rpc_func_table.Add(4234394122u, new RpcReceiveHandler(__rpc_handler_4234394122));
	}

	private static void __rpc_handler_619446056(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_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: 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_008e: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			bool delay = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref delay, default(ForPrimitives));
			float delayTime = default(float);
			((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref delayTime, default(ForPrimitives));
			int heldPlayerID = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref heldPlayerID);
			target.__rpc_exec_stage = (__RpcExecStage)1;
			((GoldenGuardianScript)(object)target).StartExplosionServerRpc(delay, delayTime, heldPlayerID);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_4234394122(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_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: 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_008e: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			bool delay = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref delay, default(ForPrimitives));
			float delayTime = default(float);
			((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref delayTime, default(ForPrimitives));
			int heldPlayerID = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref heldPlayerID);
			target.__rpc_exec_stage = (__RpcExecStage)2;
			((GoldenGuardianScript)(object)target).StartExplosionClientRpc(delay, delayTime, heldPlayerID);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	protected internal override string __getTypeName()
	{
		return "GoldenGuardianScript";
	}
}
public class GoldkeeperScript : GrabbableObject
{
	private static ManualLogSource Logger = Plugin.Logger;

	[Space(3f)]
	[Header("Blockers")]
	public Collider losBlocker;

	public NavMeshObstacle navBlocker;

	private Coroutine checkDistanceCoroutine;

	public override void Start()
	{
		((GrabbableObject)this).Start();
		navBlocker.carveOnlyStationary = true;
	}

	public override void EquipItem()
	{
		((GrabbableObject)this).EquipItem();
		if (checkDistanceCoroutine != null)
		{
			Logger.LogDebug((object)"stopped CheckDistance Coroutine");
			((MonoBehaviour)this).StopCoroutine(checkDistanceCoroutine);
			checkDistanceCoroutine = null;
		}
		losBlocker.enabled = false;
		navBlocker.carving = false;
		((Behaviour)navBlocker).enabled = false;
		LogEnabled();
	}

	public override void PlayDropSFX()
	{
		((GrabbableObject)this).PlayDropSFX();
		if (checkDistanceCoroutine != null)
		{
			Logger.LogDebug((object)"stopped CheckDistance Coroutine");
			((MonoBehaviour)this).StopCoroutine(checkDistanceCoroutine);
			checkDistanceCoroutine = null;
		}
		checkDistanceCoroutine = ((MonoBehaviour)this).StartCoroutine(CheckDistance());
	}

	private IEnumerator CheckDistance()
	{
		bool playerInRange = true;
		bool setTo = true;
		PlayerControllerB player = StartOfRound.Instance.localPlayerController;
		while (playerInRange)
		{
			yield return (object)new WaitForSeconds(0.1f);
			if ((Object)(object)((Component)this).GetComponentInParent<VehicleController>() != (Object)null || (Object)(object)((Component)this).GetComponentInParent<MineshaftElevatorController>() != (Object)null)
			{
				setTo = false;
				Logger.LogDebug((object)$"WARNING!!! {((Object)((Component)this).gameObject).name} #{((NetworkBehaviour)this).NetworkObjectId} dropped inside vehicle or elevator! breaking and setting collision enabled to {setTo}");
				break;
			}
			if ((Object)(object)player == (Object)null || !player.isPlayerControlled)
			{
				playerInRange = false;
			}
			if (Vector3.Distance(((Component)this).transform.position - Vector3.back * 0.15f, ((Component)player).transform.position) >= 0.65f)
			{
				playerInRange = false;
			}
		}
		checkDistanceCoroutine = null;
		losBlocker.enabled = setTo;
		navBlocker.carving = setTo;
		((Behaviour)navBlocker).enabled = setTo;
		LogEnabled();
	}

	private void LogEnabled()
	{
		Logger.LogDebug((object)$"{((Object)((Component)this).gameObject).name} #{((NetworkBehaviour)this).NetworkObjectId}: {((Object)((Component)losBlocker).gameObject).name} enabled = {losBlocker.enabled}");
	}

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

	[ClientRpc]
	private void SyncUponJoinClientRpc(bool hostNullHeld, int playerID)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
		{
			ClientRpcParams val = default(ClientRpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4258008049u, val, (RpcDelivery)0);
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref hostNullHeld, default(ForPrimitives));
			BytePacker.WriteValueBitPacked(val2, playerID);
			((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4258008049u, val, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && playerID == (int)StartOfRound.Instance.localPlayerController.playerClientId)
		{
			losBlocker.enabled = hostNullHeld;
			navBlocker.carving = hostNullHeld;
			((Behaviour)navBlocker).enabled = hostNullHeld;
			if (!hostNullHeld)
			{
				Logger.LogDebug((object)$"custom injecting hasHitGround on {((Object)((Component)this).gameObject).name} #{((NetworkBehaviour)this).NetworkObjectId} since likely held on host");
				base.hasHitGround = false;
			}
			LogEnabled();
		}
	}

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

	[RuntimeInitializeOnLoadMethod]
	internal static void InitializeRPCS_GoldkeeperScript()
	{
		//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(688314264u, new RpcReceiveHandler(__rpc_handler_688314264));
		NetworkManager.__rpc_func_table.Add(4258008049u, new RpcReceiveHandler(__rpc_handler_4258008049));
	}

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

	private static void __rpc_handler_4258008049(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_006f: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			bool hostNullHeld = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref hostNullHeld, default(ForPrimitives));
			int playerID = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref playerID);
			target.__rpc_exec_stage = (__RpcExecStage)2;
			((GoldkeeperScript)(object)target).SyncUponJoinClientRpc(hostNullHeld, playerID);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	protected internal override string __getTypeName()
	{
		return "GoldkeeperScript";
	}
}
public class GoldmineScript : GrabbableObject
{
	private static ManualLogSource Logger = Plugin.Logger;

	[Space(3f)]
	[Header("Functionality")]
	public GoldmineTrigger trigger;

	public bool hasExploded;

	public bool activated;

	public bool willExplodeImmediately;

	public bool willExplodeOnDelay;

	private float timeAtLastLightToggle;

	[Space(3f)]
	[Header("Audiovisual")]
	public AudioSource audioSource;

	public AudioClip triggerClip;

	public AudioClip beepClip;

	public AudioClip onClip;

	public AudioClip offClip;

	public Light triggerLight;

	public override void Start()
	{
		((GrabbableObject)this).Start();
		((Behaviour)triggerLight).enabled = false;
		int num = (Config.hostToolRebalance ? 67 : 33);
		if (((NetworkBehaviour)this).IsServer && !base.isInShipRoom && Random.Range(1, 101) < num)
		{
			ToggleActiveClientRpc(hostActivated: true);
		}
	}

	public override void Update()
	{
		((GrabbableObject)this).Update();
		if (hasExploded)
		{
			return;
		}
		if (willExplodeOnDelay && (double)(Time.realtimeSinceStartup - timeAtLastLightToggle) > 0.075)
		{
			ToggleLight();
		}
		if (activated)
		{
			if (Time.realtimeSinceStartup - timeAtLastLightToggle > 5f)
			{
				audioSource.PlayOneShot(beepClip);
				ToggleLight();
			}
			if (((Behaviour)triggerLight).enabled && Time.realtimeSinceStartup - timeAtLastLightToggle > 0.1f)
			{
				ToggleLight();
			}
		}
	}

	public override void ItemActivate(bool used, bool buttonDown = true)
	{
		((GrabbableObject)this).ItemActivate(used, buttonDown);
		if (StartOfRound.Instance.shipDoorsEnabled && !StartOfRound.Instance.inShipPhase)
		{
			ImmediateExplosionServerRpc((int)base.playerHeldBy.playerClientId);
		}
	}

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

	[ClientRpc]
	private void ImmediateExplosionClientRpc(int playerID)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (net

plugins/LethalThings.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Threading;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalCompanyInputUtils.Api;
using LethalLib.Extras;
using LethalLib.Modules;
using LethalThings.Extensions;
using LethalThings.MonoBehaviours;
using LethalThings.NetcodePatcher;
using LethalThings.Patches;
using Microsoft.CodeAnalysis;
using On;
using On.GameNetcodeStuff;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Animations.Rigging;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.InputSystem.Utilities;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ClientNetworkTransform")]
[assembly: IgnoresAccessChecksTo("DissonanceVoip")]
[assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Jobs")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")]
[assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")]
[assembly: IgnoresAccessChecksTo("Unity.Services.QoS")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Relay")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: AssemblyCompany("LethalThings")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Mod for Lethal Company")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+1b8b33b895284cd355a72b99cdac7d152a8c9c92")]
[assembly: AssemblyProduct("LethalThings")]
[assembly: AssemblyTitle("LethalThings")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>();
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<float>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<float>();
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<Vector3>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<Vector3>();
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<HackingTool.HackState>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedValueEquals<HackingTool.HackState>();
	}
}
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 LethalLib.Modules
{
	public class SaveData
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_ResetSavedGameValues <0>__GameNetworkManager_ResetSavedGameValues;

			public static hook_SaveItemsInShip <1>__GameNetworkManager_SaveItemsInShip;

			public static hook_LoadShipGrabbableItems <2>__StartOfRound_LoadShipGrabbableItems;
		}

		public static List<string> saveKeys = new List<string>();

		public static void Init()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			object obj = <>O.<0>__GameNetworkManager_ResetSavedGameValues;
			if (obj == null)
			{
				hook_ResetSavedGameValues val = GameNetworkManager_ResetSavedGameValues;
				<>O.<0>__GameNetworkManager_ResetSavedGameValues = val;
				obj = (object)val;
			}
			GameNetworkManager.ResetSavedGameValues += (hook_ResetSavedGameValues)obj;
			object obj2 = <>O.<1>__GameNetworkManager_SaveItemsInShip;
			if (obj2 == null)
			{
				hook_SaveItemsInShip val2 = GameNetworkManager_SaveItemsInShip;
				<>O.<1>__GameNetworkManager_SaveItemsInShip = val2;
				obj2 = (object)val2;
			}
			GameNetworkManager.SaveItemsInShip += (hook_SaveItemsInShip)obj2;
			object obj3 = <>O.<2>__StartOfRound_LoadShipGrabbableItems;
			if (obj3 == null)
			{
				hook_LoadShipGrabbableItems val3 = StartOfRound_LoadShipGrabbableItems;
				<>O.<2>__StartOfRound_LoadShipGrabbableItems = val3;
				obj3 = (object)val3;
			}
			StartOfRound.LoadShipGrabbableItems += (hook_LoadShipGrabbableItems)obj3;
		}

		private static void StartOfRound_LoadShipGrabbableItems(orig_LoadShipGrabbableItems orig, StartOfRound self)
		{
			orig.Invoke(self);
			SaveableObject[] array = Object.FindObjectsOfType<SaveableObject>();
			SaveableNetworkBehaviour[] array2 = Object.FindObjectsOfType<SaveableNetworkBehaviour>();
			SaveableObject[] array3 = array;
			foreach (SaveableObject saveableObject in array3)
			{
				saveableObject.LoadObjectData();
			}
			SaveableNetworkBehaviour[] array4 = array2;
			foreach (SaveableNetworkBehaviour saveableNetworkBehaviour in array4)
			{
				saveableNetworkBehaviour.LoadObjectData();
			}
			if (ES3.KeyExists("LethalLibItemSaveKeys", GameNetworkManager.Instance.currentSaveFileName))
			{
				saveKeys = ES3.Load<List<string>>("LethalLibItemSaveKeys", GameNetworkManager.Instance.currentSaveFileName);
			}
		}

		private static void GameNetworkManager_SaveItemsInShip(orig_SaveItemsInShip orig, GameNetworkManager self)
		{
			orig.Invoke(self);
			SaveableObject[] array = Object.FindObjectsOfType<SaveableObject>();
			SaveableNetworkBehaviour[] array2 = Object.FindObjectsOfType<SaveableNetworkBehaviour>();
			SaveableObject[] array3 = array;
			foreach (SaveableObject saveableObject in array3)
			{
				saveableObject.SaveObjectData();
			}
			SaveableNetworkBehaviour[] array4 = array2;
			foreach (SaveableNetworkBehaviour saveableNetworkBehaviour in array4)
			{
				saveableNetworkBehaviour.SaveObjectData();
			}
			ES3.Save<List<string>>("LethalLibItemSaveKeys", saveKeys, GameNetworkManager.Instance.currentSaveFileName);
		}

		private static void GameNetworkManager_ResetSavedGameValues(orig_ResetSavedGameValues orig, GameNetworkManager self)
		{
			orig.Invoke(self);
			foreach (string saveKey in saveKeys)
			{
				ES3.DeleteKey(saveKey, GameNetworkManager.Instance.currentSaveFileName);
			}
			saveKeys.Clear();
		}

		public static void SaveObjectData<T>(string key, T data, int objectId)
		{
			List<T> list = new List<T>();
			if (ES3.KeyExists("LethalThingsSave_" + key, GameNetworkManager.Instance.currentSaveFileName))
			{
				list = ES3.Load<List<T>>("LethalThingsSave_" + key, GameNetworkManager.Instance.currentSaveFileName);
			}
			List<int> list2 = new List<int>();
			if (ES3.KeyExists("LethalThingsSave_objectIds_" + key, GameNetworkManager.Instance.currentSaveFileName))
			{
				list2 = ES3.Load<List<int>>("LethalThingsSave_objectIds_" + key, GameNetworkManager.Instance.currentSaveFileName);
			}
			list.Add(data);
			list2.Add(objectId);
			if (!saveKeys.Contains("LethalThingsSave_" + key))
			{
				saveKeys.Add("LethalThingsSave_" + key);
			}
			if (!saveKeys.Contains("LethalThingsSave_objectIds_" + key))
			{
				saveKeys.Add("LethalThingsSave_objectIds_" + key);
			}
			ES3.Save<List<T>>("LethalThingsSave_" + key, list, GameNetworkManager.Instance.currentSaveFileName);
			ES3.Save<List<int>>("LethalThingsSave_objectIds_" + key, list2, GameNetworkManager.Instance.currentSaveFileName);
		}

		public static T LoadObjectData<T>(string key, int objectId)
		{
			List<T> list = new List<T>();
			if (ES3.KeyExists("LethalThingsSave_" + key, GameNetworkManager.Instance.currentSaveFileName))
			{
				list = ES3.Load<List<T>>("LethalThingsSave_" + key, GameNetworkManager.Instance.currentSaveFileName);
			}
			List<int> list2 = new List<int>();
			if (ES3.KeyExists("LethalThingsSave_objectIds_" + key, GameNetworkManager.Instance.currentSaveFileName))
			{
				list2 = ES3.Load<List<int>>("LethalThingsSave_objectIds_" + key, GameNetworkManager.Instance.currentSaveFileName);
			}
			if (!saveKeys.Contains("LethalThingsSave_" + key))
			{
				saveKeys.Add("LethalThingsSave_" + key);
			}
			if (!saveKeys.Contains("LethalThingsSave_objectIds_" + key))
			{
				saveKeys.Add("LethalThingsSave_objectIds_" + key);
			}
			if (list2.Contains(objectId))
			{
				int index = list2.IndexOf(objectId);
				return list[index];
			}
			return default(T);
		}
	}
}
namespace LethalThings
{
	public class Content
	{
		public static AssetBundle MainAssets;

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

		public static ContentLoader ContentLoader;

		public static GameObject devMenuPrefab;

		public static GameObject configManagerPrefab;

		public static void Init()
		{
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Expected O, but got Unknown
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Expected O, but got Unknown
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Expected O, but got Unknown
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Expected O, but got Unknown
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Expected O, but got Unknown
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Expected O, but got Unknown
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Expected O, but got Unknown
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Expected O, but got Unknown
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Expected O, but got Unknown
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Expected O, but got Unknown
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Expected O, but got Unknown
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Expected O, but got Unknown
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Expected O, but got Unknown
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Expected O, but got Unknown
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Expected O, but got Unknown
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Expected O, but got Unknown
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c9: Expected O, but got Unknown
			//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Expected O, but got Unknown
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Expected O, but got Unknown
			//IL_0350: Unknown result type (might be due to invalid IL or missing references)
			//IL_0356: Expected O, but got Unknown
			//IL_0364: Unknown result type (might be due to invalid IL or missing references)
			//IL_036a: Expected O, but got Unknown
			//IL_038a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0390: Expected O, but got Unknown
			//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b6: Expected O, but got Unknown
			//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dc: Expected O, but got Unknown
			//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0402: Expected O, but got Unknown
			//IL_0423: Unknown result type (might be due to invalid IL or missing references)
			//IL_0429: Expected O, but got Unknown
			//IL_0468: Unknown result type (might be due to invalid IL or missing references)
			//IL_046e: Expected O, but got Unknown
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0495: Expected O, but got Unknown
			//IL_04c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ca: Expected O, but got Unknown
			MainAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "lethalthings"));
			configManagerPrefab = MainAssets.LoadAsset<GameObject>("Assets/Custom/LethalThings/LTNetworkConfig.prefab");
			NetworkPrefabs.RegisterNetworkPrefab(configManagerPrefab);
			ContentLoader = new ContentLoader(Plugin.pluginInfo, MainAssets, (Action<CustomContent, GameObject>)delegate(CustomContent content, GameObject prefab)
			{
				Prefabs.Add(content.ID, prefab);
			});
			CustomContent[] array = (CustomContent[])(object)new CustomContent[28]
			{
				(CustomContent)new ScrapItem("Arson", "Assets/Custom/LethalThings/Scrap/Arson/ArsonPlush.asset", NetworkConfig.arsonSpawnChance.Value, (LevelTypes)(-1), (string[])null, (Action<Item>)null),
				(CustomContent)new ScrapItem("Cookie", "Assets/Custom/LethalThings/Scrap/Cookie/CookieFumo.asset", NetworkConfig.cookieSpawnChance.Value, (LevelTypes)(-1), (string[])null, (Action<Item>)null),
				(CustomContent)new ScrapItem("Bilka", "Assets/Custom/LethalThings/Scrap/Toimari/ToimariPlush.asset", NetworkConfig.toimariSpawnChance.Value, (LevelTypes)(-1), (string[])null, (Action<Item>)null),
				(CustomContent)new ScrapItem("Hamis", "Assets/Custom/LethalThings/Scrap/Hamis/HamisPlush.asset", NetworkConfig.hamisSpawnChance.Value, (LevelTypes)(-1), (string[])null, (Action<Item>)null),
				(CustomContent)new ScrapItem("ArsonDirty", "Assets/Custom/LethalThings/Scrap/Arson/ArsonPlushDirty.asset", NetworkConfig.dirtyArsonSpawnChance.Value, (LevelTypes)(-1), (string[])null, (Action<Item>)null),
				(CustomContent)new ScrapItem("Maxwell", "Assets/Custom/LethalThings/Scrap/Maxwell/Dingus.asset", NetworkConfig.maxwellSpawnChance.Value, (LevelTypes)(-1), (string[])null, (Action<Item>)null),
				(CustomContent)new ScrapItem("Glizzy", "Assets/Custom/LethalThings/Scrap/glizzy/glizzy.asset", NetworkConfig.glizzySpawnChance.Value, (LevelTypes)(-1), (string[])null, (Action<Item>)null),
				(CustomContent)new ScrapItem("Revolver", "Assets/Custom/LethalThings/Scrap/Flaggun/Toygun.asset", NetworkConfig.revolverSpawnChance.Value, (LevelTypes)(-1), (string[])null, (Action<Item>)null),
				(CustomContent)new ScrapItem("GremlinEnergy", "Assets/Custom/LethalThings/Scrap/GremlinEnergy/GremlinEnergy.asset", NetworkConfig.gremlinSodaSpawnChance.Value, (LevelTypes)(-1), (string[])null, (Action<Item>)null),
				(CustomContent)new ScrapItem("ToyHammerScrap", "Assets/Custom/LethalThings/Items/ToyHammer/ToyHammer.asset", NetworkConfig.toyHammerScrapSpawnChance.Value, (LevelTypes)(-1), (string[])null, (Action<Item>)null),
				(CustomContent)new ScrapItem("Gnarpy", "Assets/Custom/LethalThings/Scrap/Gnarpy/GnarpyPlush.asset", NetworkConfig.gnarpySpawnChance.Value, (LevelTypes)(-1), (string[])null, (Action<Item>)null),
				(CustomContent)new ShopItem("RocketLauncher", "Assets/Custom/LethalThings/Items/RocketLauncher/RocketLauncher.asset", NetworkConfig.rocketLauncherPrice.Value, (string)null, (string)null, "Assets/Custom/LethalThings/Items/RocketLauncher/RocketLauncherInfo.asset", (Action<Item>)delegate(Item item)
				{
					NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab.GetComponent<RocketLauncher>().missilePrefab);
				}),
				(CustomContent)new ShopItem("Flaregun", "Assets/Custom/LethalThings/Items/Flaregun/Flaregun.asset", NetworkConfig.flareGunPrice.Value, (string)null, (string)null, "Assets/Custom/LethalThings/Items/Flaregun/FlaregunInfo.asset", (Action<Item>)delegate(Item item)
				{
					NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab.GetComponent<ProjectileWeapon>().projectilePrefab);
				}),
				(CustomContent)new ShopItem("FlaregunAmmo", "Assets/Custom/LethalThings/Items/Flaregun/FlaregunAmmo.asset", NetworkConfig.flareGunAmmoPrice.Value, (string)null, (string)null, "Assets/Custom/LethalThings/Items/Flaregun/FlaregunAmmoInfo.asset", (Action<Item>)null),
				(CustomContent)new ShopItem("ToyHammerShop", "Assets/Custom/LethalThings/Items/ToyHammer/ToyHammer.asset", NetworkConfig.toyHammerPrice.Value, (string)null, (string)null, "Assets/Custom/LethalThings/Items/ToyHammer/ToyHammerInfo.asset", (Action<Item>)null),
				(CustomContent)new ShopItem("RemoteRadar", "Assets/Custom/LethalThings/Items/Radar/HandheldRadar.asset", NetworkConfig.remoteRadarPrice.Value, (string)null, (string)null, "Assets/Custom/LethalThings/Items/Radar/HandheldRadarInfo.asset", (Action<Item>)null),
				(CustomContent)new ShopItem("PouchyBelt", "Assets/Custom/LethalThings/Items/Pouch/Pouch.asset", NetworkConfig.pouchyBeltPrice.Value, (string)null, (string)null, "Assets/Custom/LethalThings/Items/Pouch/PouchInfo.asset", (Action<Item>)null),
				(CustomContent)new ShopItem("HackingTool", "Assets/Custom/LethalThings/Items/HackingTool/HackingTool.asset", NetworkConfig.hackingToolPrice.Value, (string)null, (string)null, "Assets/Custom/LethalThings/Items/HackingTool/HackingToolInfo.asset", (Action<Item>)null),
				(CustomContent)new ShopItem("Pinger", "Assets/Custom/LethalThings/Items/PingingTool/PingTool.asset", NetworkConfig.pingerPrice.Value, (string)null, (string)null, "Assets/Custom/LethalThings/Items/PingingTool/PingToolInfo.asset", (Action<Item>)delegate(Item item)
				{
					NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab.GetComponent<Pinger>().pingMarkerPrefab);
				}),
				(CustomContent)new CustomItem("Dart", "Assets/Custom/LethalThings/Unlockables/dartboard/Dart.asset", (Action<Item>)null),
				(CustomContent)new Unlockable("SmallRug", "Assets/Custom/LethalThings/Unlockables/Rug/SmallRug.asset", NetworkConfig.smallRugPrice.Value, (string)null, (string)null, "Assets/Custom/LethalThings/Unlockables/Rug/RugInfo.asset", (StoreType)2, (Action<UnlockableItem>)null),
				(CustomContent)new Unlockable("LargeRug", "Assets/Custom/LethalThings/Unlockables/Rug/LargeRug.asset", NetworkConfig.largeRugPrice.Value, (string)null, (string)null, "Assets/Custom/LethalThings/Unlockables/Rug/RugInfo.asset", (StoreType)2, (Action<UnlockableItem>)null),
				(CustomContent)new Unlockable("FatalitiesSign", "Assets/Custom/LethalThings/Unlockables/Sign/Sign.asset", NetworkConfig.fatalitiesSignPrice.Value, (string)null, (string)null, "Assets/Custom/LethalThings/Unlockables/Sign/SignInfo.asset", (StoreType)2, (Action<UnlockableItem>)null),
				(CustomContent)new Unlockable("Dartboard", "Assets/Custom/LethalThings/Unlockables/dartboard/Dartboard.asset", NetworkConfig.dartBoardPrice.Value, (string)null, (string)null, "Assets/Custom/LethalThings/Unlockables/dartboard/DartboardInfo.asset", (StoreType)2, (Action<UnlockableItem>)null),
				(CustomContent)new CustomEnemy("Boomba", "Assets/Custom/LethalThings/Enemies/Roomba/Boomba.asset", NetworkConfig.boombaSpawnWeight.Value, (LevelTypes)(-1), (SpawnType)0, (string[])null, "Assets/Custom/LethalThings/Enemies/Roomba/BoombaFile.asset", (string)null, (Action<EnemyType>)null),
				(CustomContent)new CustomEnemy("Maggie", "Assets/Custom/LethalThings/Enemies/Maggie/Maggie.asset", NetworkConfig.maggieSpawnWeight.Value, (LevelTypes)(-1), (SpawnType)0, (string[])null, "Assets/Custom/LethalThings/Enemies/Maggie/MaggieFile.asset", (string)null, (Action<EnemyType>)delegate
				{
					GameObject val4 = MainAssets.LoadAsset<GameObject>("Assets/Custom/LethalThings/Enemies/Maggie/PlayerRagdollGoop.prefab");
					Player.RegisterPlayerRagdoll("LTGoopRagdoll", val4);
				}),
				(CustomContent)new CustomEnemy("CrystalRay", "Assets/Custom/LethalThings/Enemies/CrystalRay/CrystalRay.asset", NetworkConfig.crystalRaySpawnWeight.Value, (LevelTypes)(-1), (SpawnType)0, (string[])null, "Assets/Custom/LethalThings/Enemies/CrystalRay/CrystalRayFile.asset", (string)null, (Action<EnemyType>)null),
				(CustomContent)new MapHazard("TeleporterTrap", "Assets/Custom/LethalThings/hazards/TeleporterTrap/TeleporterTrap.asset", (LevelTypes)(-1), (string[])null, (Func<SelectableLevel, AnimationCurve>)((SelectableLevel level) => new AnimationCurve((Keyframe[])(object)new Keyframe[2]
				{
					new Keyframe(0f, 0f),
					new Keyframe(1f, 4f)
				})), (Action<SpawnableMapObjectDef>)null)
			};
			ContentLoader.RegisterAll(array);
			foreach (KeyValuePair<string, GameObject> prefab in Prefabs)
			{
				GameObject value = prefab.Value;
				string key = prefab.Key;
				AudioSource[] componentsInChildren = value.GetComponentsInChildren<AudioSource>();
				if (componentsInChildren.Length != 0)
				{
					ConfigEntry<float> val = NetworkConfig.VolumeConfig.Bind<float>("Volume", key ?? "", 100f, "Audio volume for " + key + " (0 - 100)");
					AudioSource[] array2 = componentsInChildren;
					foreach (AudioSource val2 in array2)
					{
						val2.volume *= val.Value / 100f;
					}
				}
			}
			GameObject val3 = MainAssets.LoadAsset<GameObject>("Assets/Custom/LethalThings/DevMenu.prefab");
			NetworkPrefabs.RegisterNetworkPrefab(val3);
			devMenuPrefab = val3;
			try
			{
				IEnumerable<Type> loadableTypes = Assembly.GetExecutingAssembly().GetLoadableTypes();
				foreach (Type item in loadableTypes)
				{
					MethodInfo[] methods = item.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
					MethodInfo[] array3 = methods;
					foreach (MethodInfo methodInfo in array3)
					{
						object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
						if (customAttributes.Length != 0)
						{
							methodInfo.Invoke(null, null);
						}
					}
				}
			}
			catch (Exception)
			{
			}
		}
	}
	public static class InputCompat
	{
		public static InputActionAsset Asset;

		public static bool Enabled => Chainloader.PluginInfos.ContainsKey("com.rune580.LethalCompanyInputUtils");

		public static InputAction LTUtilityBeltQuick1 => Keybinds.Instance.LTUtilityBeltQuick1;

		public static InputAction LTUtilityBeltQuick2 => Keybinds.Instance.LTUtilityBeltQuick2;

		public static InputAction LTUtilityBeltQuick3 => Keybinds.Instance.LTUtilityBeltQuick3;

		public static InputAction LTUtilityBeltQuick4 => Keybinds.Instance.LTUtilityBeltQuick4;

		public static void Init()
		{
			Keybinds.Instance = new Keybinds();
			Asset = Keybinds.Instance.GetAsset();
		}
	}
	public class Keybinds : LcInputActions
	{
		public static Keybinds Instance;

		[InputAction("", Name = "[LT] Utility Belt Quick 1")]
		public InputAction LTUtilityBeltQuick1 { get; set; }

		[InputAction("", Name = "[LT] Utility Belt Quick 2")]
		public InputAction LTUtilityBeltQuick2 { get; set; }

		[InputAction("", Name = "[LT] Utility Belt Quick 3")]
		public InputAction LTUtilityBeltQuick3 { get; set; }

		[InputAction("", Name = "[LT] Utility Belt Quick 4")]
		public InputAction LTUtilityBeltQuick4 { get; set; }

		public InputActionAsset GetAsset()
		{
			return ((LcInputActions)this).Asset;
		}
	}
	public class Dingus : SaveableObject
	{
		public AudioSource noiseAudio;

		public AudioSource noiseAudioFar;

		public AudioSource musicAudio;

		public AudioSource musicAudioFar;

		[Space(3f)]
		public AudioClip[] noiseSFX;

		public AudioClip[] noiseSFXFar;

		public AudioClip evilNoise;

		[Space(3f)]
		public float noiseRange;

		public float maxLoudness;

		public float minLoudness;

		public float minPitch;

		public float maxPitch;

		private Random noisemakerRandom;

		public Animator triggerAnimator;

		private int timesPlayedWithoutTurningOff = 0;

		private RoundManager roundManager;

		private float noiseInterval = 1f;

		public Animator danceAnimator;

		public bool wasLoadedFromSave = false;

		public bool exploding = false;

		[HideInInspector]
		private NetworkVariable<bool> isEvil = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		public GameObject evilObject;

		[HideInInspector]
		public NetworkVariable<bool> isPlayingMusic = new NetworkVariable<bool>(NetworkConfig.maxwellPlayMusicDefault.Value, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1);

		[HideInInspector]
		public NetworkVariable<bool> isPipebomb = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		public override void SaveObjectData()
		{
			SaveData.SaveObjectData("dingusBeEvil", isEvil.Value, uniqueId);
		}

		public override void LoadObjectData()
		{
			if (((NetworkBehaviour)this).IsHost)
			{
				bool flag = SaveData.LoadObjectData<bool>("dingusBeEvil", uniqueId);
				Plugin.logger.LogInfo((object)$"Loading object[{uniqueId}] save data, evil? {flag}");
				if (flag)
				{
					isEvil.Value = flag;
				}
			}
		}

		public override void Start()
		{
			((GrabbableObject)this).Start();
			roundManager = Object.FindObjectOfType<RoundManager>();
			noisemakerRandom = new Random(StartOfRound.Instance.randomMapSeed + 85);
			Debug.Log((object)"Making the dingus dance");
		}

		public override void OnNetworkSpawn()
		{
			base.OnNetworkSpawn();
			if (((NetworkBehaviour)this).IsOwner)
			{
				isPlayingMusic.Value = NetworkConfig.Instance.maxwellPlayMusicDefaultNetVar.Value;
			}
			if (((NetworkBehaviour)this).IsHost && !StartOfRound.Instance.inShipPhase)
			{
				isEvil.Value = Random.Range(0f, 100f) <= NetworkConfig.evilMaxwellChance.Value;
			}
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (!((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null))
			{
				int num = noisemakerRandom.Next(0, noiseSFX.Length);
				float num2 = (float)noisemakerRandom.Next((int)(minLoudness * 100f), (int)(maxLoudness * 100f)) / 100f;
				float pitch = (float)noisemakerRandom.Next((int)(minPitch * 100f), (int)(maxPitch * 100f)) / 100f;
				noiseAudio.pitch = pitch;
				noiseAudio.PlayOneShot(noiseSFX[num], num2);
				if ((Object)(object)noiseAudioFar != (Object)null)
				{
					noiseAudioFar.pitch = pitch;
					noiseAudioFar.PlayOneShot(noiseSFXFar[num], num2);
				}
				if ((Object)(object)triggerAnimator != (Object)null)
				{
					triggerAnimator.SetTrigger("playAnim");
				}
				WalkieTalkie.TransmitOneShotAudio(noiseAudio, noiseSFX[num], num2);
				RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, num2, 0, ((GrabbableObject)this).isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0);
			}
		}

		public override void DiscardItem()
		{
			if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)
			{
				((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false;
			}
			((GrabbableObject)this).isBeingUsed = false;
			((GrabbableObject)this).DiscardItem();
		}

		public override void EquipItem()
		{
			((GrabbableObject)this).EquipItem();
			((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = true;
			danceAnimator.Play("dingusIdle");
			Debug.Log((object)"Making the dingus idle");
		}

		public override void ItemInteractLeftRight(bool right)
		{
			((GrabbableObject)this).ItemInteractLeftRight(right);
			if (!right && ((NetworkBehaviour)this).IsOwner)
			{
				isPlayingMusic.Value = !isPlayingMusic.Value;
			}
		}

		public override void InteractItem()
		{
			((GrabbableObject)this).InteractItem();
			if (isEvil.Value && !exploding && !isPipebomb.Value)
			{
				EvilMaxwellServerRpc();
			}
		}

		public void EvilMaxwellTruly()
		{
			danceAnimator.Play("dingusIdle");
			if (musicAudio.isPlaying)
			{
				musicAudio.Pause();
				musicAudioFar.Pause();
			}
			((MonoBehaviour)this).StartCoroutine(evilMaxwellMoment());
		}

		[ServerRpc(RequireOwnership = false)]
		public void EvilMaxwellServerRpc()
		{
			//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(88404199u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 88404199u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					isPipebomb.Value = true;
					EvilMaxwellClientRpc();
				}
			}
		}

		[ClientRpc]
		public void EvilMaxwellClientRpc()
		{
			//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)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1120322383u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1120322383u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				EvilMaxwellTruly();
				exploding = true;
				if (((NetworkBehaviour)this).IsOwner)
				{
					isPlayingMusic.Value = false;
				}
				timesPlayedWithoutTurningOff = 0;
				danceAnimator.Play("dingusIdle");
				if (musicAudio.isPlaying)
				{
					musicAudio.Pause();
					musicAudioFar.Pause();
				}
				Plugin.logger.LogInfo((object)"Evil maxwell moment");
			}
		}

		public IEnumerator evilMaxwellMoment()
		{
			yield return (object)new WaitForSeconds(1f);
			noiseAudio.PlayOneShot(evilNoise, 1f);
			evilObject.SetActive(true);
			((Renderer)((GrabbableObject)this).mainObjectRenderer).enabled = false;
			if ((Object)(object)noiseAudioFar != (Object)null)
			{
				noiseAudioFar.PlayOneShot(evilNoise, 1f);
			}
			if ((Object)(object)triggerAnimator != (Object)null)
			{
				triggerAnimator.SetTrigger("playAnim");
			}
			WalkieTalkie.TransmitOneShotAudio(noiseAudio, evilNoise, 1f);
			RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, 1f, 0, ((GrabbableObject)this).isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0);
			yield return (object)new WaitForSeconds(1.5f);
			Utilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, 100, 0f, 6.4f, 6, (CauseOfDeath)3);
			Rigidbody[] componentsInChildren = evilObject.GetComponentsInChildren<Rigidbody>();
			foreach (Rigidbody rb in componentsInChildren)
			{
				rb.isKinematic = false;
				rb.AddExplosionForce(1000f, evilObject.transform.position, 100f);
			}
			yield return (object)new WaitForSeconds(2f);
			if (((NetworkBehaviour)this).IsServer)
			{
				((Component)this).GetComponent<NetworkObject>().Despawn(true);
			}
		}

		public override void Update()
		{
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).Update();
			if (isEvil.Value)
			{
				((GrabbableObject)this).grabbable = false;
				((GrabbableObject)this).grabbableToEnemies = false;
			}
			if (isPlayingMusic.Value && !exploding)
			{
				if (!musicAudio.isPlaying)
				{
					musicAudio.Play();
					musicAudioFar.Play();
				}
				if (!((GrabbableObject)this).isHeld)
				{
					danceAnimator.Play("dingusDance");
				}
				else
				{
					danceAnimator.Play("dingusIdle");
				}
				if (noiseInterval <= 0f)
				{
					noiseInterval = 1f;
					timesPlayedWithoutTurningOff++;
					roundManager.PlayAudibleNoise(((Component)this).transform.position, 16f, 0.9f, timesPlayedWithoutTurningOff, false, 5);
				}
				else
				{
					noiseInterval -= Time.deltaTime;
				}
			}
			else
			{
				timesPlayedWithoutTurningOff = 0;
				danceAnimator.Play("dingusIdle");
				if (musicAudio.isPlaying)
				{
					musicAudio.Pause();
					musicAudioFar.Pause();
				}
			}
		}

		protected override void __initializeVariables()
		{
			if (isEvil == null)
			{
				throw new Exception("Dingus.isEvil cannot be null. All NetworkVariableBase instances must be initialized.");
			}
			((NetworkVariableBase)isEvil).Initialize((NetworkBehaviour)(object)this);
			((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isEvil, "isEvil");
			((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isEvil);
			if (isPlayingMusic == null)
			{
				throw new Exception("Dingus.isPlayingMusic cannot be null. All NetworkVariableBase instances must be initialized.");
			}
			((NetworkVariableBase)isPlayingMusic).Initialize((NetworkBehaviour)(object)this);
			((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isPlayingMusic, "isPlayingMusic");
			((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isPlayingMusic);
			if (isPipebomb == null)
			{
				throw new Exception("Dingus.isPipebomb cannot be null. All NetworkVariableBase instances must be initialized.");
			}
			((NetworkVariableBase)isPipebomb).Initialize((NetworkBehaviour)(object)this);
			((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isPipebomb, "isPipebomb");
			((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isPipebomb);
			base.__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_Dingus()
		{
			//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(88404199u, new RpcReceiveHandler(__rpc_handler_88404199));
			NetworkManager.__rpc_func_table.Add(1120322383u, new RpcReceiveHandler(__rpc_handler_1120322383));
		}

		private static void __rpc_handler_88404199(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;
				((Dingus)(object)target).EvilMaxwellServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1120322383(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;
				((Dingus)(object)target).EvilMaxwellClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "Dingus";
		}
	}
	public class Missile : NetworkBehaviour
	{
		public int damage = 50;

		public float maxDistance = 10f;

		public float minDistance = 0f;

		public float gravity = 2.4f;

		public float flightDelay = 0.5f;

		public float flightForce = 150f;

		public float flightTime = 2f;

		public float autoDestroyTime = 3f;

		private float timeAlive = 0f;

		public float LobForce = 100f;

		public ParticleSystem particleSystem;

		private void OnCollisionEnter(Collision collision)
		{
			if (((NetworkBehaviour)this).IsHost)
			{
				Boom();
				BoomClientRpc();
			}
			else
			{
				BoomServerRpc();
			}
		}

		private void Start()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).GetComponent<Rigidbody>().useGravity = false;
			if (((NetworkBehaviour)this).IsHost)
			{
				((Component)this).GetComponent<Rigidbody>().AddForce(((Component)this).transform.forward * LobForce, (ForceMode)1);
			}
		}

		[ClientRpc]
		public void BoomClientRpc()
		{
			//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(3331368301u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3331368301u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Boom();
				}
			}
		}

		[ServerRpc]
		public void BoomServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(452316787u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 452316787u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				Boom();
				BoomClientRpc();
			}
		}

		public void CreateExplosion()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB attacker = ((IEnumerable<PlayerControllerB>)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB x) => ((NetworkBehaviour)x).OwnerClientId == ((NetworkBehaviour)this).OwnerClientId));
			Utilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, damage, minDistance, maxDistance, 10, (CauseOfDeath)3, attacker);
		}

		public void Boom()
		{
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)particleSystem == (Object)null)
			{
				Debug.LogError((object)"No particle system set on missile, destruction time!!");
				CreateExplosion();
				if (((NetworkBehaviour)this).IsHost)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
				}
				return;
			}
			particleSystem.Stop(true, (ParticleSystemStopBehavior)1);
			((Component)particleSystem).transform.SetParent((Transform)null);
			((Component)particleSystem).transform.localScale = Vector3.one;
			GameObject gameObject = ((Component)particleSystem).gameObject;
			MainModule main = particleSystem.main;
			float duration = ((MainModule)(ref main)).duration;
			main = particleSystem.main;
			MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime;
			Object.Destroy((Object)(object)gameObject, duration + ((MinMaxCurve)(ref startLifetime)).constant);
			CreateExplosion();
			if (((NetworkBehaviour)this).IsHost)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}

		private void FixedUpdate()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			if (!((NetworkBehaviour)this).IsHost)
			{
				return;
			}
			((Component)this).GetComponent<Rigidbody>().useGravity = false;
			((Component)this).GetComponent<Rigidbody>().AddForce(Vector3.down * gravity);
			if (timeAlive <= flightTime && timeAlive >= flightDelay)
			{
				((Component)this).GetComponent<Rigidbody>().AddForce(((Component)this).transform.forward * flightForce);
			}
			timeAlive += Time.fixedDeltaTime;
			if (timeAlive > autoDestroyTime)
			{
				if (((NetworkBehaviour)this).IsHost)
				{
					Boom();
					BoomClientRpc();
				}
				else
				{
					BoomServerRpc();
				}
			}
			else
			{
				Debug.Log((object)("Time alive: " + timeAlive + " / " + autoDestroyTime));
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_Missile()
		{
			//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(3331368301u, new RpcReceiveHandler(__rpc_handler_3331368301));
			NetworkManager.__rpc_func_table.Add(452316787u, new RpcReceiveHandler(__rpc_handler_452316787));
		}

		private static void __rpc_handler_3331368301(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;
				((Missile)(object)target).BoomClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_452316787(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
			{
				if ((int)networkManager.LogLevel <= 1)
				{
					Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
				}
			}
			else
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Missile)(object)target).BoomServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "Missile";
		}
	}
	public class PouchyBelt : GrabbableObject
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_BeginGrabObject <0>__PlayerControllerB_BeginGrabObject;
		}

		public Transform beltCosmetic;

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

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

		public int beltCapacity = 3;

		private PlayerControllerB previousPlayerHeldBy;

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

		public static void Initialize()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			object obj = <>O.<0>__PlayerControllerB_BeginGrabObject;
			if (obj == null)
			{
				hook_BeginGrabObject val = PlayerControllerB_BeginGrabObject;
				<>O.<0>__PlayerControllerB_BeginGrabObject = val;
				obj = (object)val;
			}
			PlayerControllerB.BeginGrabObject += (hook_BeginGrabObject)obj;
		}

		public void Awake()
		{
			if (InputCompat.Enabled)
			{
				InputCompat.LTUtilityBeltQuick1.started += InputReceived;
				InputCompat.LTUtilityBeltQuick2.started += InputReceived;
				InputCompat.LTUtilityBeltQuick3.started += InputReceived;
				InputCompat.LTUtilityBeltQuick4.started += InputReceived;
			}
		}

		private static void PlayerControllerB_BeginGrabObject(orig_BeginGrabObject orig, PlayerControllerB self)
		{
			orig.Invoke(self);
			if (self.currentlyGrabbingObject is PouchyBelt)
			{
				self.currentlyGrabbingObject.grabbable = true;
			}
		}

		public override void InteractItem()
		{
			if (GameNetworkManager.Instance.localPlayerController.ItemSlots.Any((GrabbableObject x) => (Object)(object)x != (Object)null && x is PouchyBelt))
			{
				GameNetworkManager.Instance.localPlayerController.currentlyGrabbingObject.grabbable = false;
			}
			((GrabbableObject)this).InteractItem();
		}

		public void InputReceived(CallbackContext context)
		{
			if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.playerHeldBy != (Object)null && ((CallbackContext)(ref context)).started)
			{
				int num = -1;
				if (((CallbackContext)(ref context)).action == InputCompat.LTUtilityBeltQuick1)
				{
					num = 0;
				}
				else if (((CallbackContext)(ref context)).action == InputCompat.LTUtilityBeltQuick2)
				{
					num = 1;
				}
				else if (((CallbackContext)(ref context)).action == InputCompat.LTUtilityBeltQuick3)
				{
					num = 2;
				}
				else if (((CallbackContext)(ref context)).action == InputCompat.LTUtilityBeltQuick4)
				{
					num = 3;
				}
				if (num != -1 && num < slotIndexes.Count)
				{
					base.playerHeldBy.SwitchItemSlots(slotIndexes[num]);
				}
			}
		}

		public override void LateUpdate()
		{
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).LateUpdate();
			if (GameNetworkManager.Instance.localPlayerController.ItemSlots.Any((GrabbableObject x) => (Object)(object)x != (Object)null && x is PouchyBelt))
			{
				base.customGrabTooltip = "(Cannot hold more than 1 belt)";
			}
			else
			{
				base.customGrabTooltip = "Pick up belt";
			}
			if ((Object)(object)previousPlayerHeldBy != (Object)null)
			{
				((Component)beltCosmetic).gameObject.SetActive(true);
				beltCosmetic.SetParent((Transform)null);
				((Renderer)((Component)beltCosmetic).GetComponent<MeshRenderer>()).enabled = true;
				if (((NetworkBehaviour)this).IsOwner)
				{
					((Renderer)((Component)beltCosmetic).GetComponent<MeshRenderer>()).enabled = false;
				}
				Transform parent = previousPlayerHeldBy.lowerSpine.parent;
				beltCosmetic.position = parent.position + beltCosmeticPositionOffset;
				Quaternion rotation = parent.rotation;
				Quaternion rotation2 = Quaternion.Euler(((Quaternion)(ref rotation)).eulerAngles + beltCosmeticRotationOffset);
				beltCosmetic.rotation = rotation2;
				((Renderer)base.mainObjectRenderer).enabled = false;
				((Component)this).gameObject.SetActive(true);
			}
			else
			{
				((Component)beltCosmetic).gameObject.SetActive(false);
				((Renderer)base.mainObjectRenderer).enabled = true;
				beltCosmetic.SetParent(((Component)this).transform);
			}
		}

		public void UpdateHUD(bool add)
		{
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: 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)
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			slotIndexes.Clear();
			HUDManager instance = HUDManager.Instance;
			if (add)
			{
				int num = 0;
				GrabbableObject[] itemSlots = GameNetworkManager.Instance.localPlayerController.ItemSlots;
				foreach (GrabbableObject val in itemSlots)
				{
					if (val is PouchyBelt)
					{
						num++;
					}
				}
				Image val2 = instance.itemSlotIconFrames[0];
				Image val3 = instance.itemSlotIcons[0];
				int num2 = instance.itemSlotIconFrames.Length;
				CanvasScaler componentInParent = ((Component)val2).GetComponentInParent<CanvasScaler>();
				AspectRatioFitter componentInParent2 = ((Component)val2).GetComponentInParent<AspectRatioFitter>();
				float x = ((Graphic)val2).rectTransform.sizeDelta.x;
				float y = ((Graphic)val2).rectTransform.sizeDelta.y;
				float num3 = ((Graphic)val2).rectTransform.anchoredPosition.y + 1.125f * y * (float)num;
				Vector3 localEulerAngles = ((Transform)((Graphic)val2).rectTransform).localEulerAngles;
				Vector3 localEulerAngles2 = ((Transform)((Graphic)val3).rectTransform).localEulerAngles;
				List<Image> list = instance.itemSlotIconFrames.ToList();
				List<Image> list2 = instance.itemSlotIcons.ToList();
				int count = list.Count;
				float num4 = (float)beltCapacity * x + (float)(beltCapacity - 1) * 15f;
				Debug.Log((object)$"Adding {beltCapacity} item slots! Surely this will go well..");
				Debug.Log((object)$"Adding after index: {count}");
				for (int j = 0; j < beltCapacity; j++)
				{
					float num5 = 0f - ((Component)((Transform)((Graphic)val2).rectTransform).parent).GetComponent<RectTransform>().sizeDelta.x / 2f - 3f;
					float num6 = num5 + (float)j * x + (float)j * 15f;
					Image val4 = list[0];
					Image val5 = Object.Instantiate<Image>(val4, ((Component)val2).transform.parent);
					((Object)val5).name = $"Slot{num2 + j}[LethalThingsBelt]";
					((Graphic)val5).rectTransform.anchoredPosition = new Vector2(num6, num3);
					((Transform)((Graphic)val5).rectTransform).eulerAngles = localEulerAngles;
					Image component = ((Component)((Component)val5).transform.GetChild(0)).GetComponent<Image>();
					((Object)component).name = "icon";
					((Behaviour)component).enabled = false;
					((Transform)((Graphic)component).rectTransform).eulerAngles = localEulerAngles2;
					((Transform)((Graphic)component).rectTransform).Rotate(new Vector3(0f, 0f, -90f));
					int num7 = count + j;
					list.Insert(num7, val5);
					list2.Insert(num7, component);
					slotIndexes.Add(num7);
					((Component)val5).transform.SetSiblingIndex(num7);
				}
				instance.itemSlotIconFrames = list.ToArray();
				instance.itemSlotIcons = list2.ToArray();
				Debug.Log((object)$"Added {beltCapacity} item slots!");
				return;
			}
			List<Image> list3 = instance.itemSlotIconFrames.ToList();
			List<Image> list4 = instance.itemSlotIcons.ToList();
			int count2 = list3.Count;
			int num8 = 0;
			for (int num9 = count2 - 1; num9 >= 0; num9--)
			{
				if (((Object)list3[num9]).name.Contains("[LethalThingsBelt]"))
				{
					num8++;
					Image val6 = list3[num9];
					list3.RemoveAt(num9);
					list4.RemoveAt(num9);
					Object.Destroy((Object)(object)((Component)val6).gameObject);
					if (num8 >= beltCapacity)
					{
						break;
					}
				}
			}
			instance.itemSlotIconFrames = list3.ToArray();
			instance.itemSlotIcons = list4.ToArray();
			Debug.Log((object)$"Removed {beltCapacity} item slots!");
		}

		public void AddItemSlots()
		{
			if ((Object)(object)base.playerHeldBy != (Object)null)
			{
				List<GrabbableObject> list = base.playerHeldBy.ItemSlots.ToList();
				base.playerHeldBy.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[list.Count + beltCapacity];
				for (int i = 0; i < list.Count; i++)
				{
					base.playerHeldBy.ItemSlots[i] = list[i];
				}
				if ((Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController)
				{
					UpdateHUD(add: true);
				}
			}
		}

		public void RemoveItemSlots()
		{
			if (!((Object)(object)base.playerHeldBy != (Object)null))
			{
				return;
			}
			int num = base.playerHeldBy.ItemSlots.Length - beltCapacity;
			int currentItemSlot = base.playerHeldBy.currentItemSlot;
			for (int i = 0; i < beltCapacity; i++)
			{
				GrabbableObject val = base.playerHeldBy.ItemSlots[num + i];
				if ((Object)(object)val != (Object)null)
				{
					base.playerHeldBy.DropItem(val, num + i);
				}
			}
			int currentItemSlot2 = base.playerHeldBy.currentItemSlot;
			currentItemSlot2 = ((currentItemSlot < base.playerHeldBy.ItemSlots.Length) ? currentItemSlot : 0);
			List<GrabbableObject> list = base.playerHeldBy.ItemSlots.ToList();
			base.playerHeldBy.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[list.Count - beltCapacity];
			for (int j = 0; j < base.playerHeldBy.ItemSlots.Length; j++)
			{
				base.playerHeldBy.ItemSlots[j] = list[j];
			}
			if ((Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController)
			{
				UpdateHUD(add: false);
			}
			base.playerHeldBy.SwitchItemSlots(currentItemSlot2);
		}

		public override void DiscardItem()
		{
			RemoveItemSlots();
			previousPlayerHeldBy = null;
			((GrabbableObject)this).DiscardItem();
		}

		public override void OnNetworkDespawn()
		{
			RemoveItemSlots();
			previousPlayerHeldBy = null;
			((NetworkBehaviour)this).OnNetworkDespawn();
		}

		public void GrabItemOnClient()
		{
			((GrabbableObject)this).GrabItemOnClient();
		}

		public override void OnDestroy()
		{
			if (InputCompat.Enabled)
			{
				InputCompat.LTUtilityBeltQuick1.started -= InputReceived;
				InputCompat.LTUtilityBeltQuick2.started -= InputReceived;
				InputCompat.LTUtilityBeltQuick3.started -= InputReceived;
				InputCompat.LTUtilityBeltQuick4.started -= InputReceived;
			}
			((NetworkBehaviour)this).OnDestroy();
		}

		public override void EquipItem()
		{
			((GrabbableObject)this).EquipItem();
			if ((Object)(object)base.playerHeldBy != (Object)null)
			{
				if ((Object)(object)base.playerHeldBy != (Object)(object)previousPlayerHeldBy)
				{
					AddItemSlots();
				}
				previousPlayerHeldBy = base.playerHeldBy;
			}
		}

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "PouchyBelt";
		}
	}
	public class PowerOutletStun : NetworkBehaviour
	{
		private Coroutine electrocutionCoroutine;

		public AudioSource strikeAudio;

		public ParticleSystem strikeParticle;

		[HideInInspector]
		private NetworkVariable<int> damage = new NetworkVariable<int>(20, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		public void Electrocute(ItemCharger socket)
		{
			Debug.Log((object)"Attempting electrocution");
			if (electrocutionCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(electrocutionCoroutine);
			}
			electrocutionCoroutine = ((MonoBehaviour)this).StartCoroutine(electrocutionDelayed(socket));
		}

		public void Awake()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			StormyWeather val = Object.FindObjectOfType<StormyWeather>(true);
			GameObject gameObject = ((Component)val.targetedStrikeAudio).gameObject;
			strikeAudio = Object.Instantiate<GameObject>(gameObject, ((Component)this).transform).GetComponent<AudioSource>();
			((Component)strikeAudio).transform.localPosition = Vector3.zero;
			((Component)strikeAudio).gameObject.SetActive(true);
			strikeParticle = Object.Instantiate<GameObject>(((Component)val.explosionEffectParticle).gameObject, ((Component)this).transform).GetComponent<ParticleSystem>();
			((Component)strikeParticle).transform.localPosition = Vector3.zero;
			((Component)strikeParticle).gameObject.SetActive(true);
		}

		public override void OnNetworkSpawn()
		{
			((NetworkBehaviour)this).OnNetworkSpawn();
			if (((NetworkBehaviour)this).IsHost)
			{
				damage.Value = NetworkConfig.itemChargerElectrocutionDamage.Value;
			}
		}

		private IEnumerator electrocutionDelayed(ItemCharger socket)
		{
			Debug.Log((object)"Electrocution started");
			socket.zapAudio.Play();
			yield return (object)new WaitForSeconds(0.75f);
			socket.chargeStationAnimator.SetTrigger("zap");
			Debug.Log((object)"Electrocution finished");
			if (((NetworkBehaviour)this).NetworkObject.IsOwner && !((NetworkBehaviour)this).NetworkObject.IsOwnedByServer)
			{
				Debug.Log((object)"Sending stun to server!!");
				ElectrocutedServerRpc(((Component)this).transform.position);
			}
			else if (((NetworkBehaviour)this).NetworkObject.IsOwner && ((NetworkBehaviour)this).NetworkObject.IsOwnedByServer)
			{
				Debug.Log((object)"Sending stun to clients!!");
				ElectrocutedClientRpc(((Component)this).transform.position);
				Electrocuted(((Component)this).transform.position);
			}
		}

		[ClientRpc]
		private void ElectrocutedClientRpc(Vector3 position)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: 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(328188188u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 328188188u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Debug.Log((object)"Stun received!!");
					Electrocuted(position);
				}
			}
		}

		private void Electrocuted(Vector3 position)
		{
			//IL_0008: 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)
			StormyWeather val = Object.FindObjectOfType<StormyWeather>(true);
			Utilities.CreateExplosion(position, spawnExplosionEffect: false, damage.Value, 0f, 5f, 3, (CauseOfDeath)11);
			strikeParticle.Play();
			val.PlayThunderEffects(position, strikeAudio);
		}

		[ServerRpc]
		private void ElectrocutedServerRpc(Vector3 position)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Invalid comparison between Unknown and I4
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2844681185u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2844681185u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ElectrocutedClientRpc(position);
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_PowerOutletStun()
		{
			//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(328188188u, new RpcReceiveHandler(__rpc_handler_328188188));
			NetworkManager.__rpc_func_table.Add(2844681185u, new RpcReceiveHandler(__rpc_handler_2844681185));
		}

		private static void __rpc_handler_328188188(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Vector3 position = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PowerOutletStun)(object)target).ElectrocutedClientRpc(position);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2844681185(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
			{
				if ((int)networkManager.LogLevel <= 1)
				{
					Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
				}
			}
			else
			{
				Vector3 position = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PowerOutletStun)(object)target).ElectrocutedServerRpc(position);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "PowerOutletStun";
		}
	}
	public class ProjectileWeapon : SaveableObject
	{
		public AudioSource mainAudio;

		public AudioClip[] activateClips;

		public AudioClip[] noAmmoSounds;

		public AudioClip[] reloadSounds;

		public Transform aimDirection;

		public int maxAmmo = 4;

		[HideInInspector]
		private NetworkVariable<int> currentAmmo = new NetworkVariable<int>(4, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		public GameObject projectilePrefab;

		public float LobForce = 100f;

		private float timeSinceLastShot;

		private PlayerControllerB previousPlayerHeldBy;

		public Animator Animator;

		public ParticleSystem particleSystem;

		public Item ammoItem;

		public int ammoSlotToUse = -1;

		public override void SaveObjectData()
		{
			SaveData.SaveObjectData("projectileWeaponAmmoData", currentAmmo.Value, uniqueId);
		}

		public override void LoadObjectData()
		{
			if (((NetworkBehaviour)this).IsHost)
			{
				currentAmmo.Value = SaveData.LoadObjectData<int>("projectileWeaponAmmoData", uniqueId);
			}
		}

		public static void Init()
		{
		}

		private static bool GrabbableObject_UseItemBatteries(orig_UseItemBatteries orig, GrabbableObject self, bool isThrowable, bool buttonDown)
		{
			if (self is ProjectileWeapon)
			{
				return true;
			}
			return orig.Invoke(self, isThrowable, buttonDown);
		}

		public override void Start()
		{
			((GrabbableObject)this).Start();
		}

		public override void OnDestroy()
		{
			((NetworkBehaviour)this).OnDestroy();
		}

		public override void OnNetworkSpawn()
		{
			base.OnNetworkSpawn();
			if (((NetworkBehaviour)this).IsServer)
			{
				currentAmmo.Value = maxAmmo;
			}
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: 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_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (currentAmmo.Value > 0)
			{
				if (((NetworkBehaviour)this).IsHost)
				{
					NetworkVariable<int> obj = currentAmmo;
					int value = obj.Value;
					obj.Value = value - 1;
				}
				PlayRandomAudio(mainAudio, activateClips);
				Animator.Play("fire");
				particleSystem.Play();
				timeSinceLastShot = 0f;
				if (((NetworkBehaviour)this).IsOwner)
				{
					if (((NetworkBehaviour)this).IsHost)
					{
						ProjectileSpawner(aimDirection.position, aimDirection.rotation, aimDirection.forward);
					}
					else
					{
						SpawnProjectileServerRpc(aimDirection.position, aimDirection.rotation, aimDirection.forward);
					}
				}
			}
			else
			{
				PlayRandomAudio(mainAudio, noAmmoSounds);
			}
		}

		private bool ReloadedGun()
		{
			int num = FindAmmoInInventory();
			if (num == -1)
			{
				return false;
			}
			ammoSlotToUse = num;
			return true;
		}

		private int FindAmmoInInventory()
		{
			for (int i = 0; i < ((GrabbableObject)this).playerHeldBy.ItemSlots.Length; i++)
			{
				if (!((Object)(object)((GrabbableObject)this).playerHeldBy.ItemSlots[i] == (Object)null) && ((GrabbableObject)this).playerHeldBy.ItemSlots[i].itemProperties.itemId == ammoItem.itemId)
				{
					return i;
				}
			}
			return -1;
		}

		[ServerRpc]
		private void FixWeightServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__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(43845628u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 43845628u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				FixWeightClientRpc();
			}
		}

		[ClientRpc]
		private void FixWeightClientRpc()
		{
			//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(948021082u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 948021082u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)
				{
					PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy;
					playerHeldBy.carryWeight -= Mathf.Clamp(ammoItem.weight - 1f, 0f, 10f);
				}
			}
		}

		public override void ItemInteractLeftRight(bool right)
		{
			((GrabbableObject)this).ItemInteractLeftRight(right);
			if (right || !((NetworkBehaviour)this).IsOwner)
			{
				return;
			}
			if (ReloadedGun())
			{
				if (currentAmmo.Value > 0)
				{
					HUDManager.Instance.DisplayTip("Item already loaded.", "You can reload once you use up all the ammo.", false, false, "LC_Tip1");
					return;
				}
				ReloadAmmoServerRpc();
				DestroyItemInSlotAndSync(ammoSlotToUse);
				ammoSlotToUse = -1;
			}
			else
			{
				HUDManager.Instance.DisplayTip("No ammo found.", "Buy " + ammoItem.itemName + " from the Terminal to reload.", false, false, "LC_Tip1");
			}
		}

		[ServerRpc]
		private void ReloadAmmoServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__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(1064596822u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1064596822u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				currentAmmo.Value = maxAmmo;
				ReloadAmmoSoundClientRpc();
			}
		}

		[ClientRpc]
		private void ReloadAmmoSoundClientRpc()
		{
			//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(3520251861u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3520251861u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					PlayRandomAudio(mainAudio, reloadSounds);
					Animator.Play("reload");
				}
			}
		}

		[ServerRpc]
		private void SpawnProjectileServerRpc(Vector3 aimPosition, Quaternion aimRotation, Vector3 forward)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Invalid comparison between Unknown and I4
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__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(1043162412u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref aimPosition);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref aimRotation);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref forward);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1043162412u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ProjectileSpawner(aimPosition, aimRotation, forward);
			}
		}

		private void ProjectileSpawner(Vector3 aimPosition, Quaternion aimRotation, Vector3 forward)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: 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_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(projectilePrefab, aimPosition, aimRotation);
			val.GetComponent<NetworkObject>().SpawnWithOwnership(((NetworkBehaviour)this).OwnerClientId, false);
			ApplyProjectileForceClientRpc(NetworkObjectReference.op_Implicit(val.GetComponent<NetworkObject>()), aimPosition, aimRotation, forward);
		}

		[ClientRpc]
		public void ApplyProjectileForceClientRpc(NetworkObjectReference projectile, Vector3 aimPosition, Quaternion aimRotation, Vector3 forward)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			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(2170744407u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref projectile, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref aimPosition);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref aimRotation);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref forward);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2170744407u, val, (RpcDelivery)0);
				}
				NetworkObject val3 = default(NetworkObject);
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref projectile)).TryGet(ref val3, (NetworkManager)null))
				{
					GameObject gameObject = ((Component)val3).gameObject;
					gameObject.transform.position = aimPosition;
					gameObject.transform.rotation = aimRotation;
					gameObject.GetComponent<Rigidbody>().AddForce(forward * LobForce, (ForceMode)1);
				}
			}
		}

		private void PlayRandomAudio(AudioSource audioSource, AudioClip[] audioClips)
		{
			if (audioClips.Length != 0)
			{
				audioSource.PlayOneShot(audioClips[Random.Range(0, audioClips.Length)]);
			}
		}

		public override void Update()
		{
			((GrabbableObject)this).Update();
			timeSinceLastShot += Time.deltaTime;
		}

		private void OnEnable()
		{
		}

		private void OnDisable()
		{
		}

		public override void PocketItem()
		{
			((GrabbableObject)this).PocketItem();
			if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)
			{
				((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false;
			}
		}

		public override void DiscardItem()
		{
			((GrabbableObject)this).DiscardItem();
			if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)
			{
				((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false;
			}
		}

		public override void EquipItem()
		{
			((GrabbableObject)this).EquipItem();
			((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = true;
		}

		public void DestroyItemInSlotAndSync(int itemSlot)
		{
			if (((NetworkBehaviour)this).IsOwner)
			{
				if (itemSlot >= ((GrabbableObject)this).playerHeldBy.ItemSlots.Length || (Object)(object)((GrabbableObject)this).playerHeldBy.ItemSlots[itemSlot] == (Object)null)
				{
					Debug.LogError((object)$"Destroy item in slot called for a slot (slot {itemSlot}) which is empty or incorrect");
				}
				DestroyItemInSlotServerRpc(itemSlot);
			}
		}

		[ServerRpc]
		public void DestroyItemInSlotServerRpc(int itemSlot)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: 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_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__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(3656085789u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, itemSlot);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3656085789u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				DestroyItemInSlotClientRpc(itemSlot);
			}
		}

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

		public void DestroyItemInSlot(int itemSlot)
		{
			if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null || (Object)(object)NetworkManager.Singleton == (Object)null || NetworkManager.Singleton.ShutdownInProgress)
			{
				return;
			}
			GrabbableObject val = ((GrabbableObject)this).playerHeldBy.ItemSlots[itemSlot];
			if ((Object)(object)val == (Object)null || (Object)(object)val.itemProperties == (Object)null)
			{
				Plugin.logger.LogError((object)"Item properties are null, cannot destroy item in slot");
				return;
			}
			PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy;
			playerHeldBy.carryWeight -= Mathf.Clamp(val.itemProperties.weight - 1f, 0f, 10f);
			if (((GrabbableObject)this).playerHeldBy.currentItemSlot == itemSlot)
			{
				((GrabbableObject)this).playerHeldBy.isHoldingObject = false;
				((GrabbableObject)this).playerHeldBy.twoHanded = false;
				if (((NetworkBehaviour)((GrabbableObject)this).playerHeldBy).IsOwner)
				{
					((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("cancelHolding", true);
					((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("Throw");
					((Behaviour)HUDManager.Instance.holdingTwoHandedItem).enabled = false;
					HUDManager.Instance.ClearControlTips();
					((GrabbableObject)this).playerHeldBy.activatingItem = false;
				}
			}
			if (((NetworkBehaviour)this).IsOwner)
			{
				((Behaviour)HUDManager.Instance.itemSlotIcons[itemSlot]).enabled = false;
			}
			if ((Object)(object)((GrabbableObject)this).playerHeldBy.currentlyHeldObjectServer != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.currentlyHeldObjectServer == (Object)(object)val)
			{
				if (((NetworkBehaviour)((GrabbableObject)this).playerHeldBy).IsOwner)
				{
					((GrabbableObject)this).playerHeldBy.SetSpecialGrabAnimationBool(false, ((GrabbableObject)this).playerHeldBy.currentlyHeldObjectServer);
					((GrabbableObject)this).playerHeldBy.currentlyHeldObjectServer.DiscardItemOnClient();
				}
				((GrabbableObject)this).playerHeldBy.currentlyHeldObjectServer = null;
			}
			((GrabbableObject)this).playerHeldBy.ItemSlots[itemSlot] = null;
			if (((NetworkBehaviour)this).IsServer)
			{
				((NetworkBehaviour)val).NetworkObject.Despawn(true);
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_ProjectileWeapon()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(43845628u, new RpcReceiveHandler(__rpc_handler_43845628));
			NetworkManager.__rpc_func_table.Add(948021082u, new RpcReceiveHandler(__rpc_handler_948021082));
			NetworkManager.__rpc_func_table.Add(1064596822u, new RpcReceiveHandler(__rpc_handler_1064596822));
			NetworkManager.__rpc_func_table.Add(3520251861u, new RpcReceiveHandler(__rpc_handler_3520251861));
			NetworkManager.__rpc_func_table.Add(1043162412u, new RpcReceiveHandler(__rpc_handler_1043162412));
			NetworkManager.__rpc_func_table.Add(2170744407u, new RpcReceiveHandler(__rpc_handler_2170744407));
			NetworkManager.__rpc_func_table.Add(3656085789u, new RpcReceiveHandler(__rpc_handler_3656085789));
			NetworkManager.__rpc_func_table.Add(314723133u, new RpcReceiveHandler(__rpc_handler_314723133));
		}

		private static void __rpc_handler_43845628(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to

plugins/Luigi Doll Scrap.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Luigi Doll Scrap")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Luigi Doll Scrap")]
[assembly: AssemblyTitle("Luigi Doll Scrap")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace Luigi_Doll_Scrap
{
	[BepInPlugin("shadow.LuigiDollScrap", "Luigi Doll", "1.1.2")]
	public class Plugins : BaseUnityPlugin
	{
		private const string GUID = "shadow.LuigiDollScrap";

		private const string NAME = "Luigi Doll";

		private const string VERSION = "1.1.2";

		public static Plugins instance;

		private void Awake()
		{
			instance = this;
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "luigidollscrapitem");
			AssetBundle val = AssetBundle.LoadFromFile(text);
			Item val2 = val.LoadAsset<Item>("Assets/Luigi Doll Item.asset");
			NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
			Utilities.FixMixerGroups(val2.spawnPrefab);
			Items.RegisterScrap(val2, 50, (LevelTypes)(-1));
			Items.RemoveScrapFromLevels(val2, (LevelTypes)8, (string[])null);
			Items.RemoveScrapFromLevels(val2, (LevelTypes)16, (string[])null);
			Items.RemoveScrapFromLevels(val2, (LevelTypes)4, (string[])null);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Loaded Luigi Doll");
		}
	}
}

plugins/MelanieMeliciousUtilFurniture.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class HarmonyPatches
{
	private static int[] itemIndex = new int[2];

	private static int ornament;

	[HarmonyPostfix]
	[HarmonyPatch(typeof(StartOfRound), "Start")]
	[HarmonyAfter(new string[] { "MelanieMelicious.2StoryShip" })]
	private static void StartPatch()
	{
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0145: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Unknown result type (might be due to invalid IL or missing references)
		//IL_0194: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			foreach (Item items in StartOfRound.Instance.allItemsList.itemsList)
			{
				if (items.itemName == "Hive")
				{
					itemIndex = new int[2]
					{
						StartOfRound.Instance.allItemsList.itemsList.IndexOf(items),
						itemIndex[1]
					};
				}
				else if (items.itemName == "Gift")
				{
					itemIndex = new int[2]
					{
						itemIndex[0],
						StartOfRound.Instance.allItemsList.itemsList.IndexOf(items)
					};
				}
			}
		}
		catch
		{
		}
		if (MelanieUtilFurnitureConfig.roomEnable.Value)
		{
			Transform transform = GameObject.Find("ShipBoundsTrigger").transform;
			transform.localPosition += new Vector3(0f, 75f, 0f);
			Transform transform2 = GameObject.Find("ShipInnerRoomBoundsTrigger").transform;
			transform2.localPosition += new Vector3(0f, 75f, 0f);
			Transform transform3 = GameObject.Find("ShipBoundsTrigger").transform;
			transform3.localScale += new Vector3(0f, 150f, 0f);
			Transform transform4 = GameObject.Find("ShipInnerRoomBoundsTrigger").transform;
			transform4.localScale += new Vector3(0f, 150f, 0f);
		}
	}

	[HarmonyPrefix]
	[HarmonyPatch(typeof(RoundManager), "LoadNewLevel")]
	private static void PreLevelPatch()
	{
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Expected O, but got Unknown
		try
		{
			GameObject.Find("EntranceTeleportShip0").transform.parent.SetParent(GameObject.Find("Environment/Teleports").transform);
		}
		catch
		{
		}
		try
		{
			ornament = -7;
			foreach (Transform item in GameObject.Find("TreeXMAS0(Clone)").transform)
			{
				Transform val = item;
				ornament++;
			}
			ornament *= MelanieUtilFurnitureConfig.xmasLootChance.Value;
		}
		catch
		{
		}
	}

	[HarmonyPostfix]
	[HarmonyPatch(typeof(TimeOfDay), "OnHourChanged")]
	private static void HourPatch()
	{
		//IL_0211: Unknown result type (might be due to invalid IL or missing references)
		//IL_022a: Unknown result type (might be due to invalid IL or missing references)
		//IL_023e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0260: Unknown result type (might be due to invalid IL or missing references)
		//IL_0265: 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_003b: Expected O, but got Unknown
		//IL_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Expected O, but got Unknown
		//IL_0076: 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)
		//IL_0152: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		if (!GameNetworkManager.Instance.isHostingGame)
		{
			return;
		}
		try
		{
			foreach (Transform item in GameObject.Find("Tree0ItemSpawn").transform)
			{
				Transform val = item;
				if (Random.Range(0, 99) < MelanieUtilFurnitureConfig.treeLootChance.Value)
				{
					GameObject val2 = Object.Instantiate<GameObject>(StartOfRound.Instance.allItemsList.itemsList[itemIndex[0]].spawnPrefab, val.position, val.rotation);
					val2.GetComponent<NetworkObject>().Spawn(false);
					val2.GetComponent<GrabbableObject>().SetScrapValue(Random.Range(MelanieUtilFurnitureConfig.treeLootMin.Value, MelanieUtilFurnitureConfig.treeLootMax.Value));
				}
			}
		}
		catch
		{
		}
		try
		{
			foreach (Transform item2 in GameObject.Find("Tree1ItemSpawn").transform)
			{
				Transform val3 = item2;
				if (Random.Range(0, 99) < MelanieUtilFurnitureConfig.treeLootChance.Value)
				{
					GameObject val4 = Object.Instantiate<GameObject>(StartOfRound.Instance.allItemsList.itemsList[itemIndex[0]].spawnPrefab, val3.position, val3.rotation);
					val4.GetComponent<NetworkObject>().Spawn(false);
					val4.GetComponent<GrabbableObject>().SetScrapValue(Random.Range(MelanieUtilFurnitureConfig.treeLootMin.Value, MelanieUtilFurnitureConfig.treeLootMax.Value));
				}
			}
		}
		catch
		{
		}
		try
		{
			if (Random.Range(0, 99) < ornament)
			{
				GameObject val5 = Object.Instantiate<GameObject>(StartOfRound.Instance.allItemsList.itemsList[itemIndex[1]].spawnPrefab, GameObject.Find("TreeXMAS0Spawn").transform.position, new Quaternion(0f, 0f, 0f, 0f));
				Transform transform = val5.transform;
				transform.localPosition += new Vector3((float)Random.Range(-2, 2), 0f, Random.Range(-2f, 2f));
				val5.GetComponent<NetworkObject>().Spawn(false);
				val5.GetComponent<GrabbableObject>().SetScrapValue(Random.Range(10, 30));
			}
		}
		catch
		{
		}
	}
}
public static class MelanieUtilFurnitureConfig
{
	public static ConfigEntry<bool> alwaysStock;

	public static ConfigEntry<bool> fireExit0Enable;

	public static ConfigEntry<bool> wallEnable;

	public static ConfigEntry<bool> xmasEnable;

	public static ConfigEntry<bool> roomEnable;

	public static ConfigEntry<int> fireExit0Type;

	public static ConfigEntry<int> workshop0Cost;

	public static ConfigEntry<int> workTable0Cost;

	public static ConfigEntry<int> cabinetWide0Cost;

	public static ConfigEntry<int> gate0Cost;

	public static ConfigEntry<int> door0Cost;

	public static ConfigEntry<int> wall0Cost;

	public static ConfigEntry<int> fireExit0Cost;

	public static ConfigEntry<int> bedTwin0Cost;

	public static ConfigEntry<int> treeBig0Cost;

	public static ConfigEntry<int> benchTable0Cost;

	public static ConfigEntry<int> fern0Cost;

	public static ConfigEntry<int> fireplaceCost;

	public static ConfigEntry<int> room0Cost;

	public static ConfigEntry<int> treeLootChance;

	public static ConfigEntry<int> treeLootMin;

	public static ConfigEntry<int> treeLootMax;

	public static ConfigEntry<int> xmasLootChance;

	public static void SetupConfig(ConfigFile config)
	{
		alwaysStock = config.Bind<bool>("Store Toggle", "Items Always In Stock", true, "Toggle if furniture is always in stock, or put into rotation.");
		fireExit0Enable = config.Bind<bool>("Store Toggle", "Enable Fire Exit", true, "Toggle buyable fire exit.");
		wallEnable = config.Bind<bool>("Store Toggle", "Enable Walls", true, "Toggle buyable walls.");
		xmasEnable = config.Bind<bool>("Store Toggle", "Enable XMAS Decor", true, "Toggle XMAS decor.");
		roomEnable = config.Bind<bool>("Store Toggle", "Enable Pocket Rooms", true, "Toggle doors into pocket rooms.");
		fireExit0Type = config.Bind<int>("Fire Exit", "Fire Exit Type", 0, "Toggle fire exit mode. 0 for both enter and exit, 1 for only enter, 2 for only exit.");
		workshop0Cost = config.Bind<int>("Prices", "Workshop 1 Cost", 100, "Modify the price for Workshop 1.");
		workTable0Cost = config.Bind<int>("Prices", "Work Table 1 Cost", 60, "Modify the price for Work Table 1.");
		cabinetWide0Cost = config.Bind<int>("Prices", "Wide Cabinet Cost", 50, "Modify the price for Wide Cabinet.");
		gate0Cost = config.Bind<int>("Prices", "Gate Costs", 50, "Modify the price for the gates.");
		door0Cost = config.Bind<int>("Prices", "Door Costs", 50, "Modify the price for the doors.");
		wall0Cost = config.Bind<int>("Prices", "Wall Costs", 35, "Modify the price for the walls.");
		fireExit0Cost = config.Bind<int>("Prices", "Fire Exit Cost", 2000, "Modify the price for the fire exit.");
		bedTwin0Cost = config.Bind<int>("Prices", "Twin Bed Cost", 150, "Modify the price for the twin bed.");
		treeBig0Cost = config.Bind<int>("Prices", "Large Tree", 250, "Modify the price for large trees.");
		benchTable0Cost = config.Bind<int>("Prices", "Bench Table", 70, "Modify the price for bench tables.");
		fern0Cost = config.Bind<int>("Prices", "Fern", 40, "Modify the price for ferns.");
		fireplaceCost = config.Bind<int>("Prices", "Fireplace", 100, "Modify the price for the fireplace.");
		room0Cost = config.Bind<int>("Prices", "Storage Room", 500, "Modify the price for the storage room.");
		treeLootChance = config.Bind<int>("Loot", "Tree Items Chance", 2, "Modify the percent chance for beehives to fall out of buyable trees.");
		treeLootMin = config.Bind<int>("Loot", "Trees Items Minimum", 10, "Modify the minimum value of beehives from trees.");
		treeLootMax = config.Bind<int>("Loot", "Trees Items Minimum", 40, "Modify the maximum value of beehives from trees.");
		xmasLootChance = config.Bind<int>("Loot", "XMAS Tree Ornament Influence", 1, "Modify how much items placed on the tree increase the percent chance for gifts to spawn under it.");
	}
}
namespace MelanieMeliciousFurniturePack0
{
	public class ParentItems : NetworkBehaviour
	{
		public Transform oldParent;

		public Transform newParent;

		public void ParentItem()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			foreach (Transform item in oldParent)
			{
				Transform val = item;
				if (((Component)val).gameObject.layer != 26 && ((Object)val).name != "ObjectPlacements")
				{
					val.parent = newParent;
				}
			}
		}
	}
	[BepInPlugin("MelanieMelicious.furniturePack0", "Melanie Melicious - Furniture Pack 1", "0.4.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private const string GUID = "MelanieMelicious.furniturePack0";

		private const string NAME = "Melanie Melicious - Furniture Pack 1";

		private const string VERSION = "0.4.1";

		private readonly Harmony harmony = new Harmony("MelanieMelicious.furniturePack0");

		public static ManualLogSource mls;

		public static AssetBundle bundle;

		public static Plugin instance;

		private void Awake()
		{
			instance = this;
			MelanieUtilFurnitureConfig.SetupConfig(((BaseUnityPlugin)this).Config);
			mls = Logger.CreateLogSource("MelanieMelicious - Utility Furniture");
			mls = ((BaseUnityPlugin)this).Logger;
			harmony.PatchAll(typeof(HarmonyPatches));
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "melaniemeliciousfurniturepack0");
			bundle = AssetBundle.LoadFromFile(text);
			UnlockablesList val = bundle.LoadAsset<UnlockablesList>("Assets/MelanieFurniture/Asset/Furniture.asset");
			ushort num = 1;
			if (!MelanieUtilFurnitureConfig.alwaysStock.Value)
			{
				num = 2;
				foreach (UnlockableItem unlockable in val.unlockables)
				{
					unlockable.alwaysInStock = false;
				}
			}
			NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[0].prefabObject);
			Unlockables.RegisterUnlockable(val.unlockables[0], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.workshop0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[1].prefabObject);
			Unlockables.RegisterUnlockable(val.unlockables[1], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.workTable0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[2].prefabObject);
			Unlockables.RegisterUnlockable(val.unlockables[2], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.cabinetWide0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[12].prefabObject);
			Unlockables.RegisterUnlockable(val.unlockables[12], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.bedTwin0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[13].prefabObject);
			Unlockables.RegisterUnlockable(val.unlockables[13], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.treeBig0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[14].prefabObject);
			Unlockables.RegisterUnlockable(val.unlockables[14], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.treeBig0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[15].prefabObject);
			Unlockables.RegisterUnlockable(val.unlockables[15], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.benchTable0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[16].prefabObject);
			Unlockables.RegisterUnlockable(val.unlockables[16], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.fern0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[17].prefabObject);
			Unlockables.RegisterUnlockable(val.unlockables[17], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.fern0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[19].prefabObject);
			Unlockables.RegisterUnlockable(val.unlockables[19], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.fireplaceCost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[20].prefabObject);
			Unlockables.RegisterUnlockable(val.unlockables[20], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.workTable0Cost.Value);
			if (MelanieUtilFurnitureConfig.fireExit0Enable.Value)
			{
				switch (MelanieUtilFurnitureConfig.fireExit0Type.Value)
				{
				case 1:
					val.unlockables[3].prefabObject = bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/FireExit0/Exit/FireExit0.prefab");
					break;
				case 2:
					val.unlockables[3].prefabObject = bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/FireExit0/Entrance/FireExit0.prefab");
					break;
				}
				NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[3].prefabObject);
				Unlockables.RegisterUnlockable(val.unlockables[3], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.fireExit0Cost.Value);
			}
			if (MelanieUtilFurnitureConfig.wallEnable.Value)
			{
				NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[4].prefabObject);
				Unlockables.RegisterUnlockable(val.unlockables[4], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.gate0Cost.Value);
				NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[5].prefabObject);
				Unlockables.RegisterUnlockable(val.unlockables[5], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.door0Cost.Value);
				NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[6].prefabObject);
				Unlockables.RegisterUnlockable(val.unlockables[6], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.door0Cost.Value);
				NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[7].prefabObject);
				Unlockables.RegisterUnlockable(val.unlockables[7], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.door0Cost.Value);
				NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[8].prefabObject);
				Unlockables.RegisterUnlockable(val.unlockables[8], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
				NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[9].prefabObject);
				Unlockables.RegisterUnlockable(val.unlockables[9], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
				NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[10].prefabObject);
				Unlockables.RegisterUnlockable(val.unlockables[10], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
				NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[11].prefabObject);
				Unlockables.RegisterUnlockable(val.unlockables[11], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
			}
			if (MelanieUtilFurnitureConfig.xmasEnable.Value)
			{
				NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[18].prefabObject);
				Unlockables.RegisterUnlockable(val.unlockables[18], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.treeBig0Cost.Value);
			}
			if (MelanieUtilFurnitureConfig.roomEnable.Value)
			{
				NetworkPrefabs.RegisterNetworkPrefab(val.unlockables[21].prefabObject);
				Unlockables.RegisterUnlockable(val.unlockables[21], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.room0Cost.Value);
			}
		}
	}
}

plugins/ShoppingCart.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CSync.Extensions;
using CSync.Lib;
using CustomItemBehaviourLibrary.AbstractItems;
using CustomItemBehaviourLibrary.Misc;
using GameNetcodeStuff;
using HarmonyLib;
using LethalCompanyInputUtils.Api;
using LethalLib.Extras;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using ShoppingCart.Behaviour;
using ShoppingCart.Compat;
using ShoppingCart.Input;
using ShoppingCart.Misc;
using ShoppingCart.NetcodePatcher;
using ShoppingCart.Util;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.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 ShoppingCart
{
	[BepInPlugin("com.github.WhiteSpike.ShoppingCart", "Shopping Cart", "1.0.2")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		internal static readonly Harmony harmony = new Harmony("com.github.WhiteSpike.ShoppingCart");

		internal static readonly ManualLogSource mls = Logger.CreateLogSource("Shopping Cart");

		internal static readonly List<AudioClip> wheelsNoise = new List<AudioClip>();

		public static PluginConfig Config;

		private void Awake()
		{
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_0331: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Unknown result type (might be due to invalid IL or missing references)
			//IL_033b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0345: Expected O, but got Unknown
			//IL_034e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0353: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Expected O, but got Unknown
			Config = new PluginConfig(((BaseUnityPlugin)this).Config);
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "shoppingcart");
			AssetBundle val = AssetBundle.LoadFromFile(text);
			string text2 = "Assets/Shopping Cart/";
			Item val2 = ScriptableObject.CreateInstance<Item>();
			((Object)val2).name = "ShoppingCartItemProperties";
			val2.allowDroppingAheadOfPlayer = SyncedEntry<bool>.op_Implicit(Config.DROP_AHEAD_PLAYER);
			val2.canBeGrabbedBeforeGameStart = SyncedEntry<bool>.op_Implicit(Config.GRABBED_BEFORE_START);
			val2.canBeInspected = false;
			val2.isScrap = true;
			val2.minValue = SyncedEntry<int>.op_Implicit(Config.MINIMUM_VALUE);
			val2.maxValue = SyncedEntry<int>.op_Implicit(Config.MAXIMUM_VALUE);
			val2.floorYOffset = -90;
			val2.restingRotation = new Vector3(0f, 0f, 0f);
			val2.rotationOffset = new Vector3(0f, 0f, 0f);
			val2.positionOffset = new Vector3(0f, -1.7f, 0.35f);
			val2.weight = 0.99f + (float)SyncedEntry<int>.op_Implicit(Config.WEIGHT) / 100f;
			val2.twoHanded = true;
			val2.itemIcon = val.LoadAsset<Sprite>(text2 + "Icon.png");
			val2.spawnPrefab = val.LoadAsset<GameObject>(text2 + "ShoppingCart.prefab");
			val2.dropSFX = val.LoadAsset<AudioClip>(text2 + "Drop.ogg");
			val2.grabSFX = val.LoadAsset<AudioClip>(text2 + "Grab.ogg");
			val2.pocketSFX = val.LoadAsset<AudioClip>(text2 + "Pocket.ogg");
			val2.throwSFX = val.LoadAsset<AudioClip>(text2 + "Throw.ogg");
			wheelsNoise.Add(AssetBundleHandler.TryLoadAudioClipAsset(val, text2 + "Shopping_Cart_Move_1.ogg"));
			wheelsNoise.Add(AssetBundleHandler.TryLoadAudioClipAsset(val, text2 + "Shopping_Cart_Move_2.ogg"));
			wheelsNoise.Add(AssetBundleHandler.TryLoadAudioClipAsset(val, text2 + "Shopping_Cart_Move_3.ogg"));
			wheelsNoise.Add(AssetBundleHandler.TryLoadAudioClipAsset(val, text2 + "Shopping_Cart_Move_4.ogg"));
			val2.highestSalePercentage = 0;
			val2.itemName = "Shopping Cart";
			val2.itemSpawnsOnGround = true;
			val2.isConductiveMetal = SyncedEntry<bool>.op_Implicit(Config.CONDUCTIVE);
			val2.requiresBattery = false;
			val2.batteryUsage = 0f;
			val2.twoHandedAnimation = true;
			val2.grabAnim = "HoldJetpack";
			ShoppingCartBehaviour shoppingCartBehaviour = val2.spawnPrefab.AddComponent<ShoppingCartBehaviour>();
			((GrabbableObject)shoppingCartBehaviour).itemProperties = val2;
			((GrabbableObject)shoppingCartBehaviour).grabbable = true;
			((GrabbableObject)shoppingCartBehaviour).grabbableToEnemies = true;
			Utilities.FixMixerGroups(val2.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
			Items.RegisterItem(val2);
			AnimationCurve curve = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
			{
				new Keyframe(0f, 0f),
				new Keyframe(1f - Config.RARITY.Value, 1f),
				new Keyframe(1f, 1f)
			});
			SpawnableMapObjectDef val3 = ScriptableObject.CreateInstance<SpawnableMapObjectDef>();
			val3.spawnableMapObject = new SpawnableMapObject
			{
				prefabToSpawn = val2.spawnPrefab
			};
			MapObjects.RegisterMapObject(val3, (LevelTypes)(-1), (Func<SelectableLevel, AnimationCurve>)((SelectableLevel _) => curve));
			InputUtilsCompat.Init();
			harmony.PatchAll(typeof(Keybinds));
			mls.LogInfo((object)"Shopping Cart 1.0.2 has been loaded successfully.");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "ShoppingCart";

		public const string PLUGIN_NAME = "ShoppingCart";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace ShoppingCart.Util
{
	internal static class Constants
	{
		internal const string ITEM_SCAN_NODE_KEY_FORMAT = "Enable scan node of {0}";

		internal const bool ITEM_SCAN_NODE_DEFAULT = true;

		internal const string ITEM_SCAN_NODE_DESCRIPTION = "Shows a scan node on the item when scanning";

		internal const string SHOPPING_CART_RARITY_KEY = "Spawn Chance of the Shopping Cart Item";

		internal const float SHOPPING_CART_RARITY_DEFAULT = 0.1f;

		internal const string SHOPPING_CART_RARITY_DESCRIPTION = "How likely it is for a Shopping Cart item to spawn when landing on a moon. (0.1 = 10%)";

		internal const string SHOPPING_CART_WEIGHT_KEY = "Weight of the Shopping Cart Item";

		internal const int SHOPPING_CART_WEIGHT_DEFAULT = 25;

		internal const string SHOPPING_CART_WEIGHT_DESCRIPTION = "Weight of the Shopping Cart without any items in lbs";

		internal const string SHOPPING_CART_CONDUCTIVE_KEY = "Conductive";

		internal const bool SHOPPING_CART_CONDUCTIVE_DEFAULT = true;

		internal const string SHOPPING_CART_CONDUCTIVE_DESCRIPTION = "Wether it attracts lightning to the item or not. (Or other mechanics that rely on item being conductive)";

		internal const string SHOPPING_CART_DROP_AHEAD_PLAYER_KEY = "Drop ahead of player when dropping";

		internal const bool SHOPPING_CART_DROP_AHEAD_PLAYER_DEFAULT = true;

		internal const string SHOPPING_CART_DROP_AHEAD_PLAYER_DESCRIPTION = "If on, the item will drop infront of the player. Otherwise, drops underneath them and slightly infront.";

		internal const string SHOPPING_CART_GRABBED_BEFORE_START_KEY = "Grabbable before game start";

		internal const bool SHOPPING_CART_GRABBED_BEFORE_START_DEFAULT = true;

		internal const string SHOPPING_CART_GRABBED_BEFORE_START_DESCRIPTION = "Allows wether the item can be grabbed before hand or not";

		internal const string SHOPPING_CART_HIGHEST_SALE_PERCENTAGE_KEY = "Highest Sale Percentage";

		internal const int SHOPPING_CART_HIGHEST_SALE_PERCENTAGE_DEFAULT = 50;

		internal const string SHOPPING_CART_HIGHEST_SALE_PERCENTAGE_DESCRIPTION = "Maximum percentage of sale allowed when this item is selected for a sale.";

		internal const string SHOPPING_CART_RESTRICTION_MODE_KEY = "Restrictions on the Shopping Cart Item";

		internal const Restrictions SHOPPING_CART_RESTRICTION_MODE_DEFAULT = 2;

		internal const string SHOPPING_CART_RESTRICTION_MODE_DESCRIPTION = "Restriction applied when trying to insert an item on the Shopping Cart.\nSupported values: None, ItemCount, TotalWeight, All";

		internal const string SHOPPING_CART_MINIMUM_VALUE_KEY = "Minimum scrap value of Shopping Cart";

		internal const int SHOPPING_CART_MINIMUM_VALUE_DEFAULT = 50;

		internal const string SHOPPING_CART_MINIMUM_VALUE_DESCRIPTION = "Lower boundary of the scrap's possible value";

		internal const string SHOPPING_CART_MAXIMUM_VALUE_KEY = "Maximum scrap value of Shopping Cart";

		internal const int SHOPPING_CART_MAXIMUM_VALUE_DEFAULT = 100;

		internal const string SHOPPING_CART_MAXIMUM_VALUE_DESCRIPTION = "Higher boundary of the scrap's possible value";

		internal const string SHOPPING_CART_MAXIMUM_WEIGHT_ALLOWED_KEY = "Maximum amount of weight for Shopping Cart";

		internal const float SHOPPING_CART_MAXIMUM_WEIGHT_ALLOWED_DEFAULT = 100f;

		internal const string SHOPPING_CART_MAXIMUM_WEIGHT_ALLOWED_DESCRIPTION = "How much weight (in lbs and after weight reduction multiplier is applied on the stored items) a Shopping Cart can carry in items before it is considered full.";

		internal const string SHOPPING_CART_MAXIMUM_AMOUNT_ITEMS_KEY = "Maximum amount of items for Shopping Cart";

		internal const int SHOPPING_CART_MAXIMUM_AMOUNT_ITEMS_DEFAULT = 6;

		internal const string SHOPPING_CART_MAXIMUM_AMOUNT_ITEMS_DESCRIPTION = "Amount of items allowed before the Shopping Cart is considered full";

		internal const string SHOPPING_CART_WEIGHT_REDUCTION_MULTIPLIER_KEY = "Weight reduction multiplier for Shopping Cart";

		internal const float SHOPPING_CART_WEIGHT_REDUCTION_MULTIPLIER_DEFAULT = 0.5f;

		internal const string SHOPPING_CART_WEIGHT_REDUCTION_MUTLIPLIER_DESCRIPTION = "How much an item's weight will be ignored to the Shopping Cart's total weight";

		internal const string SHOPPING_CART_NOISE_RANGE_KEY = "Noise range of the Shopping Cart Item";

		internal const float SHOPPING_CART_NOISE_RANGE_DEFAULT = 14f;

		internal const string SHOPPING_CART_NOISE_RANGE_DESCRIPTION = "How far the Shopping Cart sound propagates to nearby enemies when in movement";

		internal const string SHOPPING_CART_LOOK_SENSITIVITY_DRAWBACK_KEY = "Look sensitivity drawback of the Shopping Cart Item";

		internal const float SHOPPING_CART_LOOK_SENSITIVITY_DRAWBACK_DEFAULT = 0.4f;

		internal const string SHOPPING_CART_LOOK_SENSITIVITY_DRAWBACK_DESCRIPTION = "Value multiplied on the player's look sensitivity when moving with the Shopping Cart Item";

		internal const string SHOPPING_CART_MOVEMENT_SLOPPY_KEY = "Sloppiness of the Shopping Cart Item";

		internal const float SHOPPING_CART_MOVEMENT_SLOPPY_DEFAULT = 5f;

		internal const string SHOPPING_CART_MOVEMENT_SLOPPY_DESCRIPTION = "Value multiplied on the player's movement to give the feeling of drifting while carrying the Shopping Cart Item";

		internal const string SHOPPING_CART_PLAY_NOISE_KEY = "Plays noises for players with Shopping Cart Item";

		internal const bool SHOPPING_CART_PLAY_NOISE_DEFAULT = true;

		internal const string SHOPPING_CART_PLAY_NOISE_DESCRIPTION = "If false, it will just not play the sounds, it will still attract monsters to noise";

		internal const string DROP_ALL_ITEMS_SHOPPING_CART_KEYBIND_NAME = "Drop all items from wheelbarrow";

		internal const string DROP_ALL_ITEMS_SHOPPING_CART_DEFAULT_KEYBIND = "<Mouse>/middleButton";

		internal static readonly string SHOPPING_CART_SCAN_NODE_KEY = string.Format("Enable scan node of {0}", "Shopping Cart");
	}
}
namespace ShoppingCart.Misc
{
	[DataContract]
	public class PluginConfig : SyncedConfig2<PluginConfig>
	{
		[field: SyncedEntryField]
		public SyncedEntry<float> RARITY { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> SCAN_NODE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> MINIMUM_VALUE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> MAXIMUM_VALUE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> WEIGHT { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> DROP_AHEAD_PLAYER { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> GRABBED_BEFORE_START { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> CONDUCTIVE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<Restrictions> RESTRICTION_MODE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> MAXIMUM_AMOUNT_ITEMS { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> MAXIMUM_WEIGHT_ALLOWED { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> WEIGHT_REDUCTION_MULTIPLIER { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> LOOK_SENSITIVITY_DRAWBACK { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> MOVEMENT_SLOPPY { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> NOISE_RANGE { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> PLAY_NOISE { get; set; }

		public PluginConfig(ConfigFile cfg)
			: base("com.github.WhiteSpike.ShoppingCart")
		{
			string text = "Shopping Cart";
			MINIMUM_VALUE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Minimum scrap value of Shopping Cart", 50, "Lower boundary of the scrap's possible value");
			MAXIMUM_VALUE = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Maximum scrap value of Shopping Cart", 100, "Higher boundary of the scrap's possible value");
			RARITY = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, text, "Spawn Chance of the Shopping Cart Item", 0.1f, "How likely it is for a Shopping Cart item to spawn when landing on a moon. (0.1 = 10%)");
			WEIGHT = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Weight of the Shopping Cart Item", 25, "Weight of the Shopping Cart without any items in lbs");
			SCAN_NODE = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, text, Constants.SHOPPING_CART_SCAN_NODE_KEY, true, "Shows a scan node on the item when scanning");
			DROP_AHEAD_PLAYER = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, text, "Drop ahead of player when dropping", true, "If on, the item will drop infront of the player. Otherwise, drops underneath them and slightly infront.");
			CONDUCTIVE = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, text, "Conductive", true, "Wether it attracts lightning to the item or not. (Or other mechanics that rely on item being conductive)");
			GRABBED_BEFORE_START = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, text, "Grabbable before game start", true, "Allows wether the item can be grabbed before hand or not");
			RESTRICTION_MODE = SyncedBindingExtensions.BindSyncedEntry<Restrictions>(cfg, text, "Restrictions on the Shopping Cart Item", (Restrictions)2, "Restriction applied when trying to insert an item on the Shopping Cart.\nSupported values: None, ItemCount, TotalWeight, All");
			MAXIMUM_WEIGHT_ALLOWED = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, text, "Maximum amount of weight for Shopping Cart", 100f, "How much weight (in lbs and after weight reduction multiplier is applied on the stored items) a Shopping Cart can carry in items before it is considered full.");
			MAXIMUM_AMOUNT_ITEMS = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, text, "Maximum amount of items for Shopping Cart", 6, "Amount of items allowed before the Shopping Cart is considered full");
			WEIGHT_REDUCTION_MULTIPLIER = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, text, "Weight reduction multiplier for Shopping Cart", 0.5f, "How much an item's weight will be ignored to the Shopping Cart's total weight");
			NOISE_RANGE = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, text, "Noise range of the Shopping Cart Item", 14f, "How far the Shopping Cart sound propagates to nearby enemies when in movement");
			LOOK_SENSITIVITY_DRAWBACK = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, text, "Look sensitivity drawback of the Shopping Cart Item", 0.4f, "Value multiplied on the player's look sensitivity when moving with the Shopping Cart Item");
			MOVEMENT_SLOPPY = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, text, "Sloppiness of the Shopping Cart Item", 5f, "Value multiplied on the player's movement to give the feeling of drifting while carrying the Shopping Cart Item");
			PLAY_NOISE = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, text, "Plays noises for players with Shopping Cart Item", true, "If false, it will just not play the sounds, it will still attract monsters to noise");
			ConfigManager.Register<PluginConfig>((SyncedConfig2<PluginConfig>)this);
		}
	}
	internal static class Metadata
	{
		public const string GUID = "com.github.WhiteSpike.ShoppingCart";

		public const string NAME = "Shopping Cart";

		public const string VERSION = "1.0.2";
	}
	internal static class Tools
	{
		internal enum NodeType
		{
			GENERAL,
			DANGER,
			SCRAP
		}

		private static GameObject CreateCanvasScanNode(ref GameObject objectToAddScanNode)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(GameObject.CreatePrimitive((PrimitiveType)3), objectToAddScanNode.transform.position, Quaternion.Euler(Vector3.zero), objectToAddScanNode.transform);
			((Object)val).name = "ScanNode";
			val.layer = LayerMask.NameToLayer("ScanNode");
			Object.Destroy((Object)(object)val.GetComponent<MeshRenderer>());
			Object.Destroy((Object)(object)val.GetComponent<MeshFilter>());
			return val;
		}

		private static void AddScanNode(GameObject objectToAddScanNode, NodeType nodeType, string header = "LGU Scan Node", string subText = "Used for LGU stuff", int creatureScanID = -1, int minRange = 2, int maxRange = 7)
		{
			GameObject val = CreateCanvasScanNode(ref objectToAddScanNode);
			ScanNodeProperties scanNodeProperties = val.AddComponent<ScanNodeProperties>();
			ChangeScanNode(ref scanNodeProperties, nodeType, header, subText, creatureScanID, 0, minRange, maxRange);
		}

		public static void AddScrapScanNode(GameObject objectToAddScanNode, string header = "LGU Scan Node", string subText = "Used for LGU stuff", int creatureScanID = -1, int minRange = 2, int maxRange = 7)
		{
			AddScanNode(objectToAddScanNode, NodeType.SCRAP, header, subText, creatureScanID, minRange, maxRange);
		}

		public static void ChangeScanNode(ref ScanNodeProperties scanNodeProperties, NodeType nodeType, string header = "LGU Scan Node", string subText = "Used for LGU stuff", int creatureScanID = -1, int scrapValue = 0, int minRange = 2, int maxRange = 7)
		{
			scanNodeProperties.headerText = header;
			scanNodeProperties.subText = subText;
			scanNodeProperties.nodeType = (int)nodeType;
			scanNodeProperties.creatureScanID = creatureScanID;
			scanNodeProperties.scrapValue = scrapValue;
			scanNodeProperties.minRange = minRange;
			scanNodeProperties.maxRange = maxRange;
		}
	}
}
namespace ShoppingCart.Input
{
	internal class IngameKeybinds : LcInputActions
	{
		public static IngameKeybinds Instance;

		[InputAction("<Mouse>/middleButton", Name = "Drop all items from wheelbarrow")]
		public InputAction ShoppingCartKey { get; set; }

		internal static InputActionAsset GetAsset()
		{
			return ((LcInputActions)Instance).Asset;
		}
	}
	[HarmonyPatch]
	internal static class Keybinds
	{
		public static InputActionAsset Asset;

		public static InputActionMap ActionMap;

		public static InputAction ShoppingCartAction;

		public static PlayerControllerB localPlayerController => StartOfRound.Instance?.localPlayerController;

		[HarmonyPatch(typeof(PreInitSceneScript), "Awake")]
		[HarmonyPrefix]
		public static void AddToKeybindMenu()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			Asset = InputUtilsCompat.Asset;
			ActionMap = Asset.actionMaps[0];
			ShoppingCartAction = InputUtilsCompat.ShoppingCartKey;
		}

		[HarmonyPatch(typeof(StartOfRound), "OnEnable")]
		[HarmonyPostfix]
		public static void OnEnable()
		{
			Asset.Enable();
			ShoppingCartAction.performed += OnShoppingCartActionPerformed;
		}

		[HarmonyPatch(typeof(StartOfRound), "OnDisable")]
		[HarmonyPostfix]
		public static void OnDisable()
		{
			Asset.Disable();
			ShoppingCartAction.performed -= OnShoppingCartActionPerformed;
		}

		private static void OnShoppingCartActionPerformed(CallbackContext context)
		{
			if (!((Object)(object)localPlayerController == (Object)null) && localPlayerController.isPlayerControlled && (!((NetworkBehaviour)localPlayerController).IsServer || localPlayerController.isHostPlayerObject) && Object.op_Implicit((Object)(object)localPlayerController.currentlyHeldObjectServer))
			{
				ShoppingCartBehaviour component = ((Component)localPlayerController.currentlyHeldObjectServer).GetComponent<ShoppingCartBehaviour>();
				if (Object.op_Implicit((Object)(object)component))
				{
					((ContainerBehaviour)component).UpdateContainerDrop();
				}
			}
		}
	}
}
namespace ShoppingCart.Compat
{
	public static class InputUtilsCompat
	{
		internal static InputActionAsset Asset => IngameKeybinds.GetAsset();

		public static InputAction ShoppingCartKey => IngameKeybinds.Instance.ShoppingCartKey;

		internal static void Init()
		{
			IngameKeybinds.Instance = new IngameKeybinds();
		}
	}
}
namespace ShoppingCart.Behaviour
{
	internal class ShoppingCartBehaviour : ContainerBehaviour
	{
		internal const string ITEM_NAME = "Shopping Cart";

		protected bool KeepScanNode => SyncedEntry<bool>.op_Implicit(Plugin.Config.SCAN_NODE);

		public override void Start()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			((ContainerBehaviour)this).Start();
			PluginConfig config = Plugin.Config;
			base.maximumAmountItems = config.MAXIMUM_AMOUNT_ITEMS.Value;
			base.weightReduceMultiplier = config.WEIGHT_REDUCTION_MULTIPLIER.Value;
			base.restriction = SyncedEntry<Restrictions>.op_Implicit(config.RESTRICTION_MODE);
			base.maximumWeightAllowed = config.MAXIMUM_WEIGHT_ALLOWED.Value;
			base.noiseRange = config.NOISE_RANGE.Value;
			base.sloppiness = config.MOVEMENT_SLOPPY.Value;
			base.lookSensitivityDrawback = config.LOOK_SENSITIVITY_DRAWBACK.Value;
			base.playSounds = config.PLAY_NOISE.Value;
			base.wheelsClip = Plugin.wheelsNoise.ToArray();
			if (((GrabbableObject)this).scrapValue <= 0)
			{
				Random random = new Random(StartOfRound.Instance.randomMapSeed + 45);
				((GrabbableObject)this).SetScrapValue(random.Next(config.MINIMUM_VALUE.Value, config.MAXIMUM_VALUE.Value));
			}
			if (!KeepScanNode)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject.GetComponentInChildren<ScanNodeProperties>());
			}
		}

		protected override void SetupScanNodeProperties()
		{
			ScanNodeProperties scanNodeProperties = ((Component)this).GetComponentInChildren<ScanNodeProperties>();
			if ((Object)(object)scanNodeProperties != (Object)null)
			{
				Tools.ChangeScanNode(ref scanNodeProperties, (Tools.NodeType)scanNodeProperties.nodeType, "Shopping Cart");
			}
			else
			{
				Tools.AddScrapScanNode(((Component)this).gameObject, "Shopping Cart");
			}
		}

		protected override string[] SetupContainerTooltips()
		{
			string bindingDisplayString = InputActionRebindingExtensions.GetBindingDisplayString(IngameKeybinds.Instance.ShoppingCartKey, (DisplayStringOptions)0, (string)null);
			return new string[1] { "Drop all items: [" + bindingDisplayString + "]" };
		}

		protected override bool ShowDepositPrompts()
		{
			PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
			return localPlayerController.isHoldingObject && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)localPlayerController;
		}

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

		protected internal override string __getTypeName()
		{
			return "ShoppingCartBehaviour";
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}
namespace ShoppingCart.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}

plugins/SomeStuff.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using LethalLib.Modules;
using TerminalApi;
using TerminalApi.Events;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("SomeStuff")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SomeStuff")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("8b8d4b02-f0c4-41ef-86f4-cac85c26b89d")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SmoothReserevesDecor;

[BepInPlugin("SmoothReserve.SmoothReservesDecor", "SmoothReserves Decor", "1.1.3")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class SmoothReservesDecor : BaseUnityPlugin
{
	private const string modGUID = "SmoothReserve.SmoothReservesDecor";

	private const string modName = "SmoothReserves Decor";

	private const string modVersion = "1.1.3";

	private readonly Harmony harmony = new Harmony("SmoothReserve.SmoothReservesDecor");

	private static SmoothReservesDecor Instance;

	private bool stringPrinted = false;

	private ConfigEntry<int> configArma;

	private ConfigEntry<int> configAot;

	private ConfigEntry<int> configKim;

	private ConfigEntry<int> configHelldivers;

	private ConfigEntry<int> configRE2;

	private ConfigEntry<int> configCat;

	private ConfigEntry<int> configCraft;

	private ConfigEntry<int> configZombie;

	private ConfigEntry<int> configFootball;

	private ConfigEntry<int> configPersona;

	private ConfigEntry<int> configROR2;

	private ConfigEntry<int> configCSGO2;

	private ConfigEntry<int> configTerraria;

	private ConfigEntry<int> configTF2;

	private ConfigEntry<int> configZomboid;

	private ConfigEntry<int> configEyelessDog;

	private ConfigEntry<int> configSofa;

	private ConfigEntry<int> configDivider;

	private ConfigEntry<int> configMiniFrige;

	private ConfigEntry<int> configFridge;

	private ConfigEntry<int> configStove;

	private ConfigEntry<int> configCounter;

	private ConfigEntry<int> configCabinet;

	private ConfigEntry<int> configChoppingBoard;

	private ConfigEntry<int> configPot;

	private ConfigEntry<int> configPan;

	private ConfigEntry<int> configToaster;

	private ConfigEntry<int> configFlatScreen;

	private ConfigEntry<int> configSBox;

	private ConfigEntry<int> configJoystick;

	private ConfigEntry<int> configToiletPaperStand;

	private ConfigEntry<int> configTrashCan;

	private ConfigEntry<int> configSoap;

	private ConfigEntry<int> configTowelRack;

	private ConfigEntry<int> configSink;

	private ConfigEntry<int> configShower;

	private ConfigEntry<int> configToothbrushHolder;

	private ConfigEntry<int> configWashroomCubby;

	private ConfigEntry<int> configPiano;

	private ConfigEntry<int> configTVStand;

	private ConfigEntry<int> configTrafficCone;

	private ConfigEntry<int> configLaptop;

	private ConfigEntry<int> configBasicTable;

	private ConfigEntry<int> configGamingChair;

	private ConfigEntry<int> configToilet;

	private ConfigEntry<int> configBasicItemShelf;

	private ConfigEntry<int> configEndTable;

	private ConfigEntry<int> configBasicStandingLamp;

	private ConfigEntry<int> configVRHeadset;

	private ConfigEntry<int> configDrawingTablet;

	private ConfigEntry<int> configRectangleRug;

	private ConfigEntry<int> configCircleRug;

	private ConfigEntry<int> configShowerMat;

	private ConfigEntry<int> configPlunger;

	private ConfigEntry<int> configDeskLamp;

	private ConfigEntry<int> configHeadphones;

	private ConfigEntry<int> configSPhone;

	private ConfigEntry<int> configWasher;

	private ConfigEntry<int> configDryer;

	private ConfigEntry<int> configAxe;

	private ConfigEntry<int> configBasicCeilingLight1;

	private ConfigEntry<int> configBasicCeilingLight2;

	private ConfigEntry<int> configBasicWallLight1;

	private ConfigEntry<int> configBasicWallLight2;

	public string PingCommand()
	{
		return "Pong!";
	}

	private void Awake()
	{
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Expected O, but got Unknown
		//IL_07ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d1: Expected O, but got Unknown
		//IL_0849: Unknown result type (might be due to invalid IL or missing references)
		//IL_0850: Expected O, but got Unknown
		//IL_093a: Unknown result type (might be due to invalid IL or missing references)
		//IL_093f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0943: Unknown result type (might be due to invalid IL or missing references)
		//IL_0952: Unknown result type (might be due to invalid IL or missing references)
		//IL_0961: Unknown result type (might be due to invalid IL or missing references)
		//IL_0981: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		ConfigEntry<bool> val = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "IsPlayerUsingImports", false, "Are you using custom imports?");
		Events.TerminalAwake += new TerminalEventHandler(TerminalIsAwake);
		string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "axeitembundle");
		AssetBundle val2 = AssetBundle.LoadFromFile(text);
		string path = "";
		if (val.Value)
		{
			path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "imports");
		}
		string[] array = new string[0];
		string[] array2 = new string[0];
		string[] array3 = new string[0];
		string[] array4 = new string[0];
		UnlockablesList[] array5 = (UnlockablesList[])(object)new UnlockablesList[0];
		UnlockableItem[] array6 = (UnlockableItem[])(object)new UnlockableItem[0];
		if (val.Value)
		{
			array = Directory.GetDirectories(path);
			array2 = new string[array.Length];
			array3 = new string[array.Length];
			array4 = new string[array.Length];
			int num = 0;
			string[] array7 = array;
			foreach (string text2 in array7)
			{
				num++;
			}
			array5 = (UnlockablesList[])(object)new UnlockablesList[num];
			array6 = (UnlockableItem[])(object)new UnlockableItem[num];
		}
		string text3 = "WELCOME TO SMOOTHRESERVES DECOR!\nplease select a subcatagory\n_____________________________\n";
		if (val.Value)
		{
			int num2 = 0;
			string[] array8 = array;
			foreach (string path2 in array8)
			{
				switch (num2)
				{
				case 0:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate0/ImportTemplateUnlockable.asset");
					break;
				case 1:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate1/ImportTemplateUnlockable.asset");
					break;
				case 2:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate2/ImportTemplateUnlockable.asset");
					break;
				case 3:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate3/ImportTemplateUnlockable.asset");
					break;
				case 4:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate4/ImportTemplateUnlockable.asset");
					break;
				case 5:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate5/ImportTemplateUnlockable.asset");
					break;
				case 6:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate6/ImportTemplateUnlockable.asset");
					break;
				case 7:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate7/ImportTemplateUnlockable.asset");
					break;
				case 8:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate8/ImportTemplateUnlockable.asset");
					break;
				case 9:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate9/ImportTemplateUnlockable.asset");
					break;
				case 10:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate10/ImportTemplateUnlockable.asset");
					break;
				case 11:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate11/ImportTemplateUnlockable.asset");
					break;
				case 12:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate12/ImportTemplateUnlockable.asset");
					break;
				case 13:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate13/ImportTemplateUnlockable.asset");
					break;
				case 14:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate14/ImportTemplateUnlockable.asset");
					break;
				case 15:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate15/ImportTemplateUnlockable.asset");
					break;
				case 16:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate16/ImportTemplateUnlockable.asset");
					break;
				case 17:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate17/ImportTemplateUnlockable.asset");
					break;
				case 18:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate18/ImportTemplateUnlockable.asset");
					break;
				case 19:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate19/ImportTemplateUnlockable.asset");
					break;
				case 20:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate20/ImportTemplateUnlockable.asset");
					break;
				case 21:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate21/ImportTemplateUnlockable.asset");
					break;
				case 22:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate22/ImportTemplateUnlockable.asset");
					break;
				case 23:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate23/ImportTemplateUnlockable.asset");
					break;
				case 24:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate24/ImportTemplateUnlockable.asset");
					break;
				case 25:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate25/ImportTemplateUnlockable.asset");
					break;
				case 26:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate26/ImportTemplateUnlockable.asset");
					break;
				case 27:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate27/ImportTemplateUnlockable.asset");
					break;
				case 28:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate28/ImportTemplateUnlockable.asset");
					break;
				case 29:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate29/ImportTemplateUnlockable.asset");
					break;
				case 30:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate30/ImportTemplateUnlockable.asset");
					break;
				case 31:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate31/ImportTemplateUnlockable.asset");
					break;
				case 32:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate32/ImportTemplateUnlockable.asset");
					break;
				case 33:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate33/ImportTemplateUnlockable.asset");
					break;
				case 34:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate34/ImportTemplateUnlockable.asset");
					break;
				case 35:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate35/ImportTemplateUnlockable.asset");
					break;
				case 36:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate36/ImportTemplateUnlockable.asset");
					break;
				case 37:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate37/ImportTemplateUnlockable.asset");
					break;
				case 38:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate38/ImportTemplateUnlockable.asset");
					break;
				case 39:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate39/ImportTemplateUnlockable.asset");
					break;
				case 40:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate40/ImportTemplateUnlockable.asset");
					break;
				case 41:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate41/ImportTemplateUnlockable.asset");
					break;
				case 42:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate42/ImportTemplateUnlockable.asset");
					break;
				case 43:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate43/ImportTemplateUnlockable.asset");
					break;
				case 44:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate44/ImportTemplateUnlockable.asset");
					break;
				case 45:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate45/ImportTemplateUnlockable.asset");
					break;
				case 46:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate46/ImportTemplateUnlockable.asset");
					break;
				case 47:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate47/ImportTemplateUnlockable.asset");
					break;
				case 48:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate48/ImportTemplateUnlockable.asset");
					break;
				case 49:
					array5[num2] = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ImportTemplates/ImportTemplate49/ImportTemplateUnlockable.asset");
					break;
				}
				Material val3 = new Material(Shader.Find("HDRP/Lit"));
				array6[num2] = array5[num2].unlockables[0];
				GameObject prefabObject = array6[num2].prefabObject;
				array2[num2] = Path.GetFileName(path2);
				array3[num2] = Directory.GetFiles(path2, "*.png")[0];
				array4[num2] = Directory.GetFiles(path2, "*.obj")[0];
				prefabObject.GetComponentInChildren<MeshFilter>().mesh = LoadMeshFromOBJ(array4[num2]);
				byte[] array9 = File.ReadAllBytes(array3[num2]);
				Texture2D val4 = new Texture2D(2, 2);
				ImageConversion.LoadImage(val4, array9);
				val3.mainTexture = (Texture)(object)val4;
				((Renderer)prefabObject.GetComponentInChildren<MeshRenderer>()).material = val3;
				array6[num2].spawnPrefab = Object.op_Implicit((Object)(object)prefabObject);
				NetworkPrefabs.RegisterNetworkPrefab(array6[num2].prefabObject);
				Utilities.FixMixerGroups(array6[num2].prefabObject);
				ConfigEntry<float> val5 = ((BaseUnityPlugin)this).Config.Bind<float>("General", array2[num2] + " scale", 1f, "The scale of the " + array2[num2]);
				if (array2[num2] == "Skull")
				{
					val5.Value = 0.025f;
				}
				ConfigEntry<int> val6 = ((BaseUnityPlugin)this).Config.Bind<int>("General", array2[num2] + " price", 1, "The scale of the " + array2[num2]);
				Vector3 localScale = ((Component)prefabObject.GetComponentInChildren<MeshRenderer>()).transform.localScale;
				((Vector3)(ref localScale))..ctor(localScale.x * val5.Value, localScale.y * val5.Value, localScale.z * val5.Value);
				((Component)prefabObject.GetComponentInChildren<MeshRenderer>()).transform.localScale = localScale;
				array6[num2].unlockableName = array2[num2];
				Unlockables.RegisterUnlockable(array6[num2], (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, 1);
				((BaseUnityPlugin)this).Logger.LogMessage((object)("object " + (num2 + 1) + "  Name: " + array2[num2] + "  png: " + Path.GetFileName(array3[num2]) + "  obj: " + Path.GetFileName(array4[num2])));
				((BaseUnityPlugin)this).Logger.LogMessage((object)array6[num2].unlockableName);
				text3 = text3 + "\n" + array2[num2] + " - [" + val6.Value + "]\nProduct ID: " + array2[num2] + "\n";
				num2++;
			}
		}
		text3 += "_____________________________\n";
		UnlockablesList val7 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Arma/ArmaUnlockable.asset");
		UnlockableItem val8 = val7.unlockables[0];
		UnlockablesList val9 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/AOT/AOTUnlockable.asset");
		UnlockableItem val10 = val9.unlockables[0];
		UnlockablesList val11 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Kim/KimUnlockable.asset");
		UnlockableItem val12 = val11.unlockables[0];
		UnlockablesList val13 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Helldivers/HelldiversUnlockable.asset");
		UnlockableItem val14 = val13.unlockables[0];
		UnlockablesList val15 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/RE2/RE2Unlockable.asset");
		UnlockableItem val16 = val15.unlockables[0];
		UnlockablesList val17 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Cat/CatUnlockable.asset");
		UnlockableItem val18 = val17.unlockables[0];
		UnlockablesList val19 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Craft/CraftUnlockable.asset");
		UnlockableItem val20 = val19.unlockables[0];
		UnlockablesList val21 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Zombies/ZombiesUnlockable.asset");
		UnlockableItem val22 = val21.unlockables[0];
		UnlockablesList val23 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Football/FootballUnlockable.asset");
		UnlockableItem val24 = val23.unlockables[0];
		UnlockablesList val25 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Persona/PersonaUnlockable.asset");
		UnlockableItem val26 = val25.unlockables[0];
		UnlockablesList val27 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ROR/RORUnlockable.asset");
		UnlockableItem val28 = val27.unlockables[0];
		UnlockablesList val29 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/CSGO/CSGOUnlockable.asset");
		UnlockableItem val30 = val29.unlockables[0];
		UnlockablesList val31 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Terraria/TerrariaUnlockable.asset");
		UnlockableItem val32 = val31.unlockables[0];
		UnlockablesList val33 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/TF2/TF2Unlockable.asset");
		UnlockableItem val34 = val33.unlockables[0];
		UnlockablesList val35 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Zomboid/ZomboidUnlockable.asset");
		UnlockableItem val36 = val35.unlockables[0];
		UnlockablesList val37 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/EyelessDog/EyelessDogUnlockable.asset");
		UnlockableItem val38 = val37.unlockables[0];
		UnlockablesList val39 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Sofa/SofaUnlockable.asset");
		UnlockableItem val40 = val39.unlockables[0];
		UnlockablesList val41 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/DeviderWall/DeviderWallUnlockable.asset");
		UnlockableItem val42 = val41.unlockables[0];
		UnlockablesList val43 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/MiniFridge/MiniFridgeUnlockable.asset");
		UnlockableItem val44 = val43.unlockables[0];
		UnlockablesList val45 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Fridge/FridgeUnlockable.asset");
		UnlockableItem val46 = val45.unlockables[0];
		UnlockablesList val47 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Stove/StoveUnlockable.asset");
		UnlockableItem val48 = val47.unlockables[0];
		UnlockablesList val49 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Counter/CounterUnlockable.asset");
		UnlockableItem val50 = val49.unlockables[0];
		UnlockablesList val51 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Cupboard/CupboardUnlockable.asset");
		UnlockableItem val52 = val51.unlockables[0];
		UnlockablesList val53 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ChoppingBoard/ChoppingBoardUnlockable.asset");
		UnlockableItem val54 = val53.unlockables[0];
		UnlockablesList val55 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Pan/PanUnlockable.asset");
		UnlockableItem val56 = val55.unlockables[0];
		UnlockablesList val57 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Toaster/ToasterUnlockable.asset");
		UnlockableItem val58 = val57.unlockables[0];
		UnlockablesList val59 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Pot/PotUnlockable.asset");
		UnlockableItem val60 = val59.unlockables[0];
		UnlockablesList val61 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/FlatScreen/FlatScreenUnlockable.asset");
		UnlockableItem val62 = val61.unlockables[0];
		UnlockablesList val63 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/SBox/SBoxUnlockable.asset");
		UnlockableItem val64 = val63.unlockables[0];
		UnlockablesList val65 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Joystick/JoystickUnlockable.asset");
		UnlockableItem val66 = val65.unlockables[0];
		UnlockablesList val67 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ToiletPaperHolder/ToiletPaperHolderUnlockable.asset");
		UnlockableItem val68 = val67.unlockables[0];
		UnlockablesList val69 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/TowelRack/TowelRackUnlockable.asset");
		UnlockableItem val70 = val69.unlockables[0];
		UnlockablesList val71 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/TrashCan/TrashCanUnlockable.asset");
		UnlockableItem val72 = val71.unlockables[0];
		UnlockablesList val73 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Sink/SinkUnlockable.asset");
		UnlockableItem val74 = val73.unlockables[0];
		UnlockablesList val75 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Soap/SoapUnlockable.asset");
		UnlockableItem val76 = val75.unlockables[0];
		UnlockablesList val77 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/WashroomCubby/WashroomCubbyUnlockable.asset");
		UnlockableItem val78 = val77.unlockables[0];
		UnlockablesList val79 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Shower/ShowerUnlockable.asset");
		UnlockableItem val80 = val79.unlockables[0];
		UnlockablesList val81 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Toilet/ToiletUnlockable.asset");
		UnlockableItem val82 = val81.unlockables[0];
		UnlockablesList val83 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/TVStand/TVStandUnlockable.asset");
		UnlockableItem val84 = val83.unlockables[0];
		UnlockablesList val85 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Piano/PianoUnlockable.asset");
		UnlockableItem val86 = val85.unlockables[0];
		UnlockablesList val87 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Laptop/LaptopUnlockable.asset");
		UnlockableItem val88 = val87.unlockables[0];
		UnlockablesList val89 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/BasicTable/BasicTableUnlockable.asset");
		UnlockableItem val90 = val89.unlockables[0];
		UnlockablesList val91 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/GamingChair/GamingChairUnlockable.asset");
		UnlockableItem val92 = val91.unlockables[0];
		UnlockablesList val93 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/TrafficCone/TrafficConeUnlockable.asset");
		UnlockableItem val94 = val93.unlockables[0];
		UnlockablesList val95 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ToothbrushHolder/ToothbrushHolderUnlockable.asset");
		UnlockableItem val96 = val95.unlockables[0];
		UnlockablesList val97 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/BasicItemShelf/BasicItemShelfUnlockable.asset");
		UnlockableItem val98 = val97.unlockables[0];
		UnlockablesList val99 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/EndTable/EndTableUnlockable.asset");
		UnlockableItem val100 = val99.unlockables[0];
		UnlockablesList val101 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/BasicStandingLamp/BasicStandingLampUnlockable.asset");
		UnlockableItem val102 = val101.unlockables[0];
		UnlockablesList val103 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/VRHeadset/VRHeadsetUnlockable.asset");
		UnlockableItem val104 = val103.unlockables[0];
		UnlockablesList val105 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/DrawingTablet/DrawingTabletUnlockable.asset");
		UnlockableItem val106 = val105.unlockables[0];
		UnlockablesList val107 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/RectangleRug/RectangleRugUnlockable.asset");
		UnlockableItem val108 = val107.unlockables[0];
		UnlockablesList val109 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/CircleRug/CircleRugUnlockable.asset");
		UnlockableItem val110 = val109.unlockables[0];
		UnlockablesList val111 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/ShowerMat/ShowerMatUnlockable.asset");
		UnlockableItem val112 = val111.unlockables[0];
		UnlockablesList val113 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Plunger/PlungerUnlockable.asset");
		UnlockableItem val114 = val113.unlockables[0];
		UnlockablesList val115 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/DeskLamp/DeskLampUnlockable.asset");
		UnlockableItem val116 = val115.unlockables[0];
		UnlockablesList val117 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Headphones/HeadphonesUnlockable.asset");
		UnlockableItem val118 = val117.unlockables[0];
		UnlockablesList val119 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/SPhone/SPhoneUnlockable.asset");
		UnlockableItem val120 = val119.unlockables[0];
		UnlockablesList val121 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/WashingMachine/WashingMachineUnlockable.asset");
		UnlockableItem val122 = val121.unlockables[0];
		UnlockablesList val123 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/DryingMachine/DryingMachineUnlockable.asset");
		UnlockableItem val124 = val123.unlockables[0];
		UnlockablesList val125 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/Axe/AxeUnlockable.asset");
		UnlockableItem val126 = val125.unlockables[0];
		UnlockablesList val127 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/BasicCeilingLight1/BasicCeilingLight1Unlockable.asset");
		UnlockableItem val128 = val127.unlockables[0];
		UnlockablesList val129 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/BasicCeilingLight2/BasicCeilingLight2Unlockable.asset");
		UnlockableItem val130 = val129.unlockables[0];
		UnlockablesList val131 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/BasicWallLight1/BasicWallLight1Unlockable.asset");
		UnlockableItem val132 = val131.unlockables[0];
		UnlockablesList val133 = val2.LoadAsset<UnlockablesList>("Assets/SomeStuff/BasicWallLight2/BasicWallLight2Unlockable.asset");
		UnlockableItem val134 = val133.unlockables[0];
		NetworkPrefabs.RegisterNetworkPrefab(val8.prefabObject);
		Utilities.FixMixerGroups(val8.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val10.prefabObject);
		Utilities.FixMixerGroups(val10.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val12.prefabObject);
		Utilities.FixMixerGroups(val12.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val14.prefabObject);
		Utilities.FixMixerGroups(val14.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val16.prefabObject);
		Utilities.FixMixerGroups(val16.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val18.prefabObject);
		Utilities.FixMixerGroups(val18.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val20.prefabObject);
		Utilities.FixMixerGroups(val20.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val22.prefabObject);
		Utilities.FixMixerGroups(val22.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val24.prefabObject);
		Utilities.FixMixerGroups(val24.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val26.prefabObject);
		Utilities.FixMixerGroups(val26.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val28.prefabObject);
		Utilities.FixMixerGroups(val28.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val30.prefabObject);
		Utilities.FixMixerGroups(val30.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val32.prefabObject);
		Utilities.FixMixerGroups(val32.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val34.prefabObject);
		Utilities.FixMixerGroups(val34.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val36.prefabObject);
		Utilities.FixMixerGroups(val36.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val38.prefabObject);
		Utilities.FixMixerGroups(val38.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val40.prefabObject);
		Utilities.FixMixerGroups(val40.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val42.prefabObject);
		Utilities.FixMixerGroups(val42.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val44.prefabObject);
		Utilities.FixMixerGroups(val44.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val46.prefabObject);
		Utilities.FixMixerGroups(val46.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val48.prefabObject);
		Utilities.FixMixerGroups(val48.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val50.prefabObject);
		Utilities.FixMixerGroups(val50.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val52.prefabObject);
		Utilities.FixMixerGroups(val52.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val52.prefabObject);
		Utilities.FixMixerGroups(val56.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val56.prefabObject);
		Utilities.FixMixerGroups(val58.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val58.prefabObject);
		Utilities.FixMixerGroups(val54.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val54.prefabObject);
		Utilities.FixMixerGroups(val60.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val60.prefabObject);
		Utilities.FixMixerGroups(val62.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val62.prefabObject);
		Utilities.FixMixerGroups(val64.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val64.prefabObject);
		Utilities.FixMixerGroups(val66.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val66.prefabObject);
		Utilities.FixMixerGroups(val68.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val68.prefabObject);
		Utilities.FixMixerGroups(val70.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val70.prefabObject);
		Utilities.FixMixerGroups(val72.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val72.prefabObject);
		Utilities.FixMixerGroups(val74.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val74.prefabObject);
		Utilities.FixMixerGroups(val76.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val76.prefabObject);
		Utilities.FixMixerGroups(val78.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val78.prefabObject);
		Utilities.FixMixerGroups(val80.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val80.prefabObject);
		Utilities.FixMixerGroups(val82.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val82.prefabObject);
		Utilities.FixMixerGroups(val86.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val86.prefabObject);
		Utilities.FixMixerGroups(val84.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val84.prefabObject);
		Utilities.FixMixerGroups(val88.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val88.prefabObject);
		Utilities.FixMixerGroups(val90.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val90.prefabObject);
		Utilities.FixMixerGroups(val92.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val92.prefabObject);
		Utilities.FixMixerGroups(val94.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val94.prefabObject);
		Utilities.FixMixerGroups(val96.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val96.prefabObject);
		Utilities.FixMixerGroups(val98.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val98.prefabObject);
		Utilities.FixMixerGroups(val100.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val100.prefabObject);
		Utilities.FixMixerGroups(val102.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val102.prefabObject);
		Utilities.FixMixerGroups(val104.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val104.prefabObject);
		Utilities.FixMixerGroups(val106.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val106.prefabObject);
		Utilities.FixMixerGroups(val108.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val108.prefabObject);
		Utilities.FixMixerGroups(val110.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val110.prefabObject);
		Utilities.FixMixerGroups(val112.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val112.prefabObject);
		Utilities.FixMixerGroups(val116.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val116.prefabObject);
		Utilities.FixMixerGroups(val114.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val114.prefabObject);
		Utilities.FixMixerGroups(val118.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val118.prefabObject);
		Utilities.FixMixerGroups(val120.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val120.prefabObject);
		Utilities.FixMixerGroups(val122.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val122.prefabObject);
		Utilities.FixMixerGroups(val124.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val124.prefabObject);
		Utilities.FixMixerGroups(val126.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val126.prefabObject);
		Utilities.FixMixerGroups(val132.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val132.prefabObject);
		Utilities.FixMixerGroups(val134.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val134.prefabObject);
		Utilities.FixMixerGroups(val128.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val128.prefabObject);
		Utilities.FixMixerGroups(val130.prefabObject);
		NetworkPrefabs.RegisterNetworkPrefab(val130.prefabObject);
		configArma = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ArmaPosterPrice", 30, "The price of the Arma poster");
		configAot = ((BaseUnityPlugin)this).Config.Bind<int>("General", "AttackOnTitanPosterPrice", 30, "The price of the Attack on Titan poster");
		configKim = ((BaseUnityPlugin)this).Config.Bind<int>("General", "KitsuragiPosterPrice", 30, "The price of the Kitsuragi poster");
		configHelldivers = ((BaseUnityPlugin)this).Config.Bind<int>("General", "HelldiversPosterPrice", 30, "The price of the Helldivers2 poster");
		configRE2 = ((BaseUnityPlugin)this).Config.Bind<int>("General", "RE2PosterPrice", 30, "The price of the RE2 poster");
		configCat = ((BaseUnityPlugin)this).Config.Bind<int>("General", "HappyCatPosterPrice", 30, "The price of the Happy Cat poster");
		configCraft = ((BaseUnityPlugin)this).Config.Bind<int>("General", "MinecraftPosterPrice", 30, "The price of the Minecraft poster");
		configZombie = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ZombiesPosterPrice", 30, "The price of the Zombies poster");
		configFootball = ((BaseUnityPlugin)this).Config.Bind<int>("General", "FootballPosterPrice", 30, "The price of the Football poster");
		configPersona = ((BaseUnityPlugin)this).Config.Bind<int>("General", "PersonaPosterPrice", 30, "The price of the Persona 5 poster");
		configROR2 = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ROR2PosterPrice", 30, "The price of the Risk of Rain 2 poster");
		configCSGO2 = ((BaseUnityPlugin)this).Config.Bind<int>("General", "CSGO2PosterPrice", 30, "The price of the CSGO 2 poster");
		configTerraria = ((BaseUnityPlugin)this).Config.Bind<int>("General", "TerrariaPosterPrice", 30, "The price of the Terraria poster");
		configTF2 = ((BaseUnityPlugin)this).Config.Bind<int>("General", "TF2PosterPrice", 30, "The price of the TF2 poster");
		configZomboid = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ZomboidPosterPrice", 30, "The price of the Zomboid poster");
		configEyelessDog = ((BaseUnityPlugin)this).Config.Bind<int>("General", "EyelessDogPosterPrice", 30, "The price of the Eyeless Dog poster");
		configSofa = ((BaseUnityPlugin)this).Config.Bind<int>("General", "SofaPrice", 50, "The price of the Sofa");
		configDivider = ((BaseUnityPlugin)this).Config.Bind<int>("General", "DividerPrice", 125, "The price of the Divider");
		configMiniFrige = ((BaseUnityPlugin)this).Config.Bind<int>("General", "MiniFridgePrice", 40, "The price of the Mini Fridge");
		configFridge = ((BaseUnityPlugin)this).Config.Bind<int>("General", "FridgePrice", 50, "The price of the Fridge");
		configStove = ((BaseUnityPlugin)this).Config.Bind<int>("General", "StovePrice", 40, "The price of the Stove");
		configCounter = ((BaseUnityPlugin)this).Config.Bind<int>("General", "CounterPrice", 30, "The price of the Counter");
		configCabinet = ((BaseUnityPlugin)this).Config.Bind<int>("General", "CabinetPrice", 30, "The price of the Cabinet");
		configChoppingBoard = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ChoppingBoardPrice", 15, "The price of the Chopping Board");
		configPot = ((BaseUnityPlugin)this).Config.Bind<int>("General", "PotPrice", 20, "The price of the Pot");
		configPan = ((BaseUnityPlugin)this).Config.Bind<int>("General", "PanPrice", 20, "The price of the Pan");
		configToaster = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ToasterPrice", 25, "The price of the Toaster");
		configFlatScreen = ((BaseUnityPlugin)this).Config.Bind<int>("General", "FlatscreenTVPrice", 50, "The price of the Flatscreen TV");
		configSBox = ((BaseUnityPlugin)this).Config.Bind<int>("General", "SBoxPrice", 40, "The price of the SBox");
		configJoystick = ((BaseUnityPlugin)this).Config.Bind<int>("General", "JoystickPrice", 15, "The price of the Joystick");
		configToiletPaperStand = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ToiletPaperStandPrice", 20, "The price of the Toilet Paper Stand");
		configTrashCan = ((BaseUnityPlugin)this).Config.Bind<int>("General", "TrashCanPrice", 15, "The price of the Trash Can");
		configSoap = ((BaseUnityPlugin)this).Config.Bind<int>("General", "SoapPrice", 10, "The price of the Soap");
		configTowelRack = ((BaseUnityPlugin)this).Config.Bind<int>("General", "TowelRackPrice", 25, "The price of the Towel Rack");
		configSink = ((BaseUnityPlugin)this).Config.Bind<int>("General", "SinkPrice", 50, "The price of the Sink");
		configShower = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ShowerPrice", 75, "The price of the Shower");
		configToothbrushHolder = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ToothbrushHolderPrice", 15, "The price of the Toothbrush Holder");
		configWashroomCubby = ((BaseUnityPlugin)this).Config.Bind<int>("General", "WashroomCubbyPrice", 100, "The price of the Washroom Cubby");
		configPiano = ((BaseUnityPlugin)this).Config.Bind<int>("General", "PianoPrice", 50, "The price of the Piano");
		configTVStand = ((BaseUnityPlugin)this).Config.Bind<int>("General", "TVStandPrice", 40, "The price of the TV Stand");
		configTrafficCone = ((BaseUnityPlugin)this).Config.Bind<int>("General", "TrafficConePrice", 15, "The price of the Traffic Cone");
		configLaptop = ((BaseUnityPlugin)this).Config.Bind<int>("General", "LaptopPrice", 40, "The price of the Laptop");
		configBasicTable = ((BaseUnityPlugin)this).Config.Bind<int>("General", "BasicTablePrice", 30, "The price of the Basic Table");
		configGamingChair = ((BaseUnityPlugin)this).Config.Bind<int>("General", "GamingChairPrice", 50, "The price of the Gaming Chair");
		configToilet = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ToiletPrice", 50, "The price of the Toilet");
		configBasicItemShelf = ((BaseUnityPlugin)this).Config.Bind<int>("General", "BasicItemShelfPrice", 40, "The price of the Basic Item Shelf");
		configEndTable = ((BaseUnityPlugin)this).Config.Bind<int>("General", "EndTablePrice", 35, "The price of the End Table");
		configBasicStandingLamp = ((BaseUnityPlugin)this).Config.Bind<int>("General", "BasicStandingLampPrice", 25, "The price of the Basic Standing Lamp");
		configVRHeadset = ((BaseUnityPlugin)this).Config.Bind<int>("General", "VRHeadsetPrice", 30, "The price of the VR Headset");
		configDrawingTablet = ((BaseUnityPlugin)this).Config.Bind<int>("General", "DrawingTabletPrice", 30, "The price of the Drawing Tablet");
		configRectangleRug = ((BaseUnityPlugin)this).Config.Bind<int>("General", "RectangleRugPrice", 25, "The price of the Rectangle Rug");
		configCircleRug = ((BaseUnityPlugin)this).Config.Bind<int>("General", "CircleRugPrice", 20, "The price of the Circle Rug");
		configShowerMat = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ShowerMatPrice", 15, "The price of the Shower Mat");
		configPlunger = ((BaseUnityPlugin)this).Config.Bind<int>("General", "PlungerPrice", 30, "The price of the Plunger");
		configDeskLamp = ((BaseUnityPlugin)this).Config.Bind<int>("General", "DeskLampPrice", 15, "The price of the Desk Lamp");
		configHeadphones = ((BaseUnityPlugin)this).Config.Bind<int>("General", "HeadphonesPrice", 30, "The price of the Headphones");
		configSPhone = ((BaseUnityPlugin)this).Config.Bind<int>("General", "SPhonePrice", 30, "The price of the SPhone");
		configWasher = ((BaseUnityPlugin)this).Config.Bind<int>("General", "WashingMachinePrice", 50, "The price of the Washing Machine");
		configDryer = ((BaseUnityPlugin)this).Config.Bind<int>("General", "DryingMachinePrice", 50, "The price of the Drying Machine");
		configAxe = ((BaseUnityPlugin)this).Config.Bind<int>("General", "AxePrice", 20, "The price of the Axe");
		configBasicCeilingLight1 = ((BaseUnityPlugin)this).Config.Bind<int>("General", "BasicCeilingLight1", 20, "The price of the Basic Ceiling Light 1");
		configBasicCeilingLight2 = ((BaseUnityPlugin)this).Config.Bind<int>("General", "BasicCeilingLight2", 20, "The price of the Basic Ceiling Light 2");
		configBasicWallLight1 = ((BaseUnityPlugin)this).Config.Bind<int>("General", "BasicWallLight1", 20, "The price of the Basic Wall Light 1");
		configBasicWallLight2 = ((BaseUnityPlugin)this).Config.Bind<int>("General", "BasicWallLight2", 20, "The price of the Basic Wall Light 2");
		Unlockables.RegisterUnlockable(val8, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configArma.Value);
		Unlockables.RegisterUnlockable(val10, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configAot.Value);
		Unlockables.RegisterUnlockable(val12, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configKim.Value);
		Unlockables.RegisterUnlockable(val14, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configHelldivers.Value);
		Unlockables.RegisterUnlockable(val16, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configRE2.Value);
		Unlockables.RegisterUnlockable(val18, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configCat.Value);
		Unlockables.RegisterUnlockable(val20, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configCraft.Value);
		Unlockables.RegisterUnlockable(val22, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configZombie.Value);
		Unlockables.RegisterUnlockable(val24, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configFootball.Value);
		Unlockables.RegisterUnlockable(val26, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configPersona.Value);
		Unlockables.RegisterUnlockable(val28, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configROR2.Value);
		Unlockables.RegisterUnlockable(val30, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configCSGO2.Value);
		Unlockables.RegisterUnlockable(val32, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configTerraria.Value);
		Unlockables.RegisterUnlockable(val34, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configTF2.Value);
		Unlockables.RegisterUnlockable(val36, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configZomboid.Value);
		Unlockables.RegisterUnlockable(val38, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configEyelessDog.Value);
		Unlockables.RegisterUnlockable(val40, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configSofa.Value);
		Unlockables.RegisterUnlockable(val42, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configDivider.Value);
		Unlockables.RegisterUnlockable(val44, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configMiniFrige.Value);
		Unlockables.RegisterUnlockable(val46, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configFridge.Value);
		Unlockables.RegisterUnlockable(val48, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configStove.Value);
		Unlockables.RegisterUnlockable(val50, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configCounter.Value);
		Unlockables.RegisterUnlockable(val52, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configCabinet.Value);
		Unlockables.RegisterUnlockable(val56, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configPan.Value);
		Unlockables.RegisterUnlockable(val54, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configChoppingBoard.Value);
		Unlockables.RegisterUnlockable(val58, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configToaster.Value);
		Unlockables.RegisterUnlockable(val60, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configPot.Value);
		Unlockables.RegisterUnlockable(val62, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configFlatScreen.Value);
		Unlockables.RegisterUnlockable(val64, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configSBox.Value);
		Unlockables.RegisterUnlockable(val66, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configJoystick.Value);
		Unlockables.RegisterUnlockable(val72, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configTrashCan.Value);
		Unlockables.RegisterUnlockable(val68, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configToiletPaperStand.Value);
		Unlockables.RegisterUnlockable(val76, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configSoap.Value);
		Unlockables.RegisterUnlockable(val74, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configSink.Value);
		Unlockables.RegisterUnlockable(val70, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configTowelRack.Value);
		Unlockables.RegisterUnlockable(val78, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configWashroomCubby.Value);
		Unlockables.RegisterUnlockable(val80, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configShower.Value);
		Unlockables.RegisterUnlockable(val82, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configToilet.Value);
		Unlockables.RegisterUnlockable(val86, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configPiano.Value);
		Unlockables.RegisterUnlockable(val84, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configTVStand.Value);
		Unlockables.RegisterUnlockable(val88, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configLaptop.Value);
		Unlockables.RegisterUnlockable(val90, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configBasicTable.Value);
		Unlockables.RegisterUnlockable(val92, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configGamingChair.Value);
		Unlockables.RegisterUnlockable(val94, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configTrafficCone.Value);
		Unlockables.RegisterUnlockable(val96, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configToothbrushHolder.Value);
		Unlockables.RegisterUnlockable(val98, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configBasicItemShelf.Value);
		Unlockables.RegisterUnlockable(val100, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configEndTable.Value);
		Unlockables.RegisterUnlockable(val102, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configBasicStandingLamp.Value);
		Unlockables.RegisterUnlockable(val104, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configVRHeadset.Value);
		Unlockables.RegisterUnlockable(val106, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configDrawingTablet.Value);
		Unlockables.RegisterUnlockable(val108, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configRectangleRug.Value);
		Unlockables.RegisterUnlockable(val110, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configCircleRug.Value);
		Unlockables.RegisterUnlockable(val112, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configShowerMat.Value);
		Unlockables.RegisterUnlockable(val116, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configDeskLamp.Value);
		Unlockables.RegisterUnlockable(val114, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configPlunger.Value);
		Unlockables.RegisterUnlockable(val118, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configHeadphones.Value);
		Unlockables.RegisterUnlockable(val120, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configSPhone.Value);
		Unlockables.RegisterUnlockable(val122, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configWasher.Value);
		Unlockables.RegisterUnlockable(val124, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configDryer.Value);
		Unlockables.RegisterUnlockable(val126, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configAxe.Value);
		Unlockables.RegisterUnlockable(val128, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configBasicCeilingLight1.Value);
		Unlockables.RegisterUnlockable(val130, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configBasicCeilingLight2.Value);
		Unlockables.RegisterUnlockable(val132, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configBasicWallLight1.Value);
		Unlockables.RegisterUnlockable(val134, (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, configBasicWallLight2.Value);
		string text4 = "WELCOME TO SMOOTHRESERVES DECOR!\nplease select a subcatagory\n_____________________________\n\n<Livingroom\n<srLivingRoom\n\n<Kitchen\n<srKitchen\n\n<Washroom\n<srWashroom\n\n<Lights\n<srLights\n\n<Posters\n<srPosters\n\n<Other\n<srOther\n\n<Imports\n<srImports\n_____________________________\n";
		string text5 = "\nWELCOME TO SMOOTHRESERVES OTHERS!\n_____________________________\n\nAxe - [" + configAxe.Value + "]\nProduct ID: 4X3S\n\nDivider Wall - [" + configDivider.Value + "]\nProduct ID: 2n9d\n\nTraffic Cone - [" + configTrafficCone.Value + "]\nProduct ID: 9s9f\n\nWashroom Cubby - [" + configWashroomCubby.Value + "]\nProduct ID: S5J7\nNOTE: The grab point for the cubby is above the door.\n";
		string text6 = "\nWELCOME TO SMOOTHRESERVES KITCHEN!\n_____________________________\n\nCabinet - [" + configCabinet.Value + "]\nProduct ID: 3U0x\n\nChopping Board - [" + configChoppingBoard.Value + "]\nProduct ID: e98c\n\nCounter - [" + configCounter.Value + "]\nProduct ID: 4a7m\n\nDrying Machine - [" + configDryer.Value + "]\nProduct ID: d4y1\n\nFridge - [" + configFridge.Value + "]\nProduct ID: g2a6\n\nPan - [" + configPan.Value + "]\nProduct ID: k3h6\n\nPot - [" + configPot.Value + "]\nProduct ID: 7j5c\n\nStove - [" + configStove.Value + "]\nProduct ID: 9h1m\n\nToaster - [" + configToaster.Value + "]\nProduct ID: f3mh\n\nWashing Machine - [" + configWasher.Value + "]\nProduct ID: w6s5\n";
		string text7 = "\nWELCOME TO SMOOTHRESERVES LIVING ROOMS!\n_____________________________\n\nBasic Item Shelf - [" + configBasicItemShelf.Value + "]\nProduct ID: z2z4\n\nBasic Table - [" + configBasicTable.Value + "]\nProduct ID: k5z1\n\nCircle Rug - [" + configCircleRug.Value + "]\nProduct ID: C1R6\n\nDrawing Tablet - [" + configDrawingTablet.Value + "]\nProduct ID: 0b0z\n\nEnd Table - [" + configEndTable.Value + "]\nProduct ID: u6r3\n\nFlat-Screen TV - [" + configFlatScreen.Value + "]\nProduct ID: l0z6\n\nGaming Chair - [" + configGamingChair.Value + "]\nProduct ID: u2o9\n\nHeadphones - [" + configHeadphones.Value + "]\nProduct ID: H3A6\n\nJoystick - [" + configJoystick.Value + "]\nProduct ID: 2l5k\n\nLaptop - [" + configLaptop.Value + "]\nProduct ID: t6t2\n\nMini Fridge - [" + configMiniFrige.Value + "]\nProduct ID: j2x8\n\nPiano - [" + configPiano.Value + "]\nProduct ID: a0p1\n\nRectangle Rug - [" + configRectangleRug.Value + "]\nProduct ID: R3C7\n\nSBox - [" + configSBox.Value + "]\nProduct ID: 8i4r\n\nSPhone - [" + configSPhone.Value + "]\nProduct ID: 5P0N\n\nSofa - [" + configSofa.Value + "]\nProduct ID: f6h1\n\nTV Stand - [" + configTVStand.Value + "]\nProduct ID: r7a2\n\nVR Headset - [" + configVRHeadset.Value + "]\nProduct ID: v3c8\n";
		string text8 = "\nWELCOME TO SMOOTHRESERVES WASHROOMS!\n_____________________________\n\nPlunger - [" + configPlunger.Value + "]\nProduct ID: P1U5\n\nShower - [" + configShower.Value + "]\nProduct ID: C4uk\n\nShower Mat - [" + configShowerMat.Value + "]\nProduct ID: 5H0W\n\nToilet - [" + configToilet.Value + "]\nProduct ID: F2K0\n\nToilet Paper Stand - [" + configToiletPaperStand.Value + "]\nProduct ID: z8OV\n\nToothbrush Holder - [" + configToothbrushHolder.Value + "]\nProduct ID: m8n4\n\nTowel Rack - [" + configTowelRack.Value + "]\nProduct ID: 5x1k\n\nTrash Can - [" + configTrashCan.Value + "]\nProduct ID: h3d0\n\nSink - [" + configSink.Value + "]\nProduct ID: X3f8\n\nSoap Bar - [" + configSoap.Value + "]\nProduct ID: g1v5\n";
		string text9 = "\nWELCOME TO SMOOTHRESERVES POSTERS!\n_____________________________\n\nArma 3 Poster - [" + configArma.Value + "]\nProduct ID: d4l6\n\nAttack On Titan Poster - [" + configAot.Value + "]\nProduct ID: 5n9d\n\nCSGO 2 Poster - [" + configCSGO2.Value + "]\nProduct ID: C5G0\n\nEyelessDog Poster - [" + configEyelessDog.Value + "]\nProduct ID: 3Y3L\n\nFootball Poster - [" + configFootball.Value + "]\nProduct ID: f0o7\n\nHappy Cat Poster - [" + configCat.Value + "]\nProduct ID: 4n9d\n\nHellDivers 2 Poster - [" + configHelldivers.Value + "]\nProduct ID: 8k3m\n\nKim Kitsuragi Poster - [" + configKim.Value + "]\nProduct ID: 6d3n\n\nMinecraft Poster - [" + configCraft.Value + "]\nProduct ID: 2o8c\n\nPersona 5 Poster - [" + configPersona.Value + "]\nProduct ID: p3r5\n\nResident Evil 2 Poster - [" + configRE2.Value + "]\nProduct ID: h3c7\n\nRisk of Rain 2 Poster - [" + configROR2.Value + "]\nProduct ID: b4u9\n\nTerraria Poster - [" + configTerraria.Value + "]\nProduct ID: T3R4\n\nTF2 Poster - [" + configTF2.Value + "]\nProduct ID: T72o\n\nZombies Poster - [" + configZombie.Value + "]\nProduct ID: c2z8\n\nZomboid Poster - [" + configZomboid.Value + "]\nProduct ID: Z0m6\n";
		string text10 = "\nWELCOME TO SMOOTHRESERVES LIGHTS!\n_____________________________\n\nBasic Ceiling Light 1 - [" + configBasicCeilingLight1.Value + "]\nProduct ID: C1L7\n\nBasic Ceiling Light 2 - [" + configBasicCeilingLight2.Value + "]\nProduct ID: C2L7\n\nBasic Wall Light 1 - [" + configBasicWallLight1.Value + "]\nProduct ID: W1L7\n\nBasic Wall Light 2 - [" + configBasicWallLight2.Value + "]\nProduct ID: W2L7\n\nStanding Lamp - [" + configBasicStandingLamp.Value + "]\nProduct ID: D4A9\n\nDesk Lamp - [" + configDeskLamp.Value + "]\nProduct ID: D3S8\n";
		TerminalApi.AddCommand("srFurniture", text4, "sr", true);
		TerminalApi.AddCommand("srLivingRoom", text7, "sr", true);
		TerminalApi.AddCommand("srKitchen", text6, "sr", true);
		TerminalApi.AddCommand("srWashRoom", text8, "sr", true);
		TerminalApi.AddCommand("srPosters", text9, "sr", true);
		TerminalApi.AddCommand("srOther", text5, "sr", true);
		TerminalApi.AddCommand("srImports", text3, "sr", true);
		TerminalApi.AddCommand("srLights", text10, "sr", true);
		harmony.PatchAll();
		((BaseUnityPlugin)this).Logger.LogMessage((object)"Loaded SmoothReserves decor!");
	}

	private void TerminalIsAwake(object sender, TerminalEventArgs e)
	{
		if (!stringPrinted)
		{
			((BaseUnityPlugin)this).Logger.LogMessage((object)"Terminal is awake");
			TerminalApi.NodeAppendLine("help", ">srFurniture\nTo access the furniture menu\n");
			stringPrinted = true;
		}
	}

	public static Mesh LoadMeshFromOBJ(string filePath)
	{
		//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f3: Expected O, but got Unknown
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_0199: Unknown result type (might be due to invalid IL or missing references)
		//IL_043c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0441: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
		List<Vector3> list = new List<Vector3>();
		List<Vector3> list2 = new List<Vector3>();
		List<Vector2> list3 = new List<Vector2>();
		List<int> list4 = new List<int>();
		List<int> list5 = new List<int>();
		List<int> list6 = new List<int>();
		using (StreamReader streamReader = new StreamReader(filePath))
		{
			string text;
			while ((text = streamReader.ReadLine()) != null)
			{
				if (text.StartsWith("v "))
				{
					string[] array = text.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
					if (array.Length >= 4)
					{
						float num = float.Parse(array[1], CultureInfo.InvariantCulture);
						float num2 = float.Parse(array[2], CultureInfo.InvariantCulture);
						float num3 = float.Parse(array[3], CultureInfo.InvariantCulture);
						list.Add(new Vector3(num, num2, num3));
					}
				}
				else if (text.StartsWith("vn "))
				{
					string[] array2 = text.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
					if (array2.Length >= 4)
					{
						float num4 = float.Parse(array2[1], CultureInfo.InvariantCulture);
						float num5 = float.Parse(array2[2], CultureInfo.InvariantCulture);
						float num6 = float.Parse(array2[3], CultureInfo.InvariantCulture);
						list2.Add(new Vector3(num4, num5, num6));
					}
				}
				else if (text.StartsWith("vt "))
				{
					string[] array3 = text.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
					if (array3.Length >= 3)
					{
						float num7 = float.Parse(array3[1], CultureInfo.InvariantCulture);
						float num8 = float.Parse(array3[2], CultureInfo.InvariantCulture);
						list3.Add(new Vector2(num7, num8));
					}
				}
				else
				{
					if (!text.StartsWith("f "))
					{
						continue;
					}
					string[] array4 = text.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
					if (array4.Length < 4)
					{
						continue;
					}
					int[] array5 = new int[array4.Length - 1];
					int[] array6 = new int[array4.Length - 1];
					int[] array7 = new int[array4.Length - 1];
					for (int i = 1; i < array4.Length; i++)
					{
						string[] array8 = array4[i].Split(new char[1] { '/' });
						int num9 = int.Parse(array8[0]) - 1;
						array5[i - 1] = num9;
						if (array8.Length > 1 && !string.IsNullOrEmpty(array8[1]))
						{
							int num10 = int.Parse(array8[1]) - 1;
							array6[i - 1] = num10;
						}
						if (array8.Length > 2 && !string.IsNullOrEmpty(array8[2]))
						{
							int num11 = int.Parse(array8[2]) - 1;
							array7[i - 1] = num11;
						}
					}
					for (int j = 1; j < array5.Length - 1; j++)
					{
						list4.Add(array5[0]);
						list4.Add(array5[j]);
						list4.Add(array5[j + 1]);
						if (array6[0] != -1 && array6[j] != -1 && array6[j + 1] != -1)
						{
							list5.Add(array6[0]);
							list5.Add(array6[j]);
							list5.Add(array6[j + 1]);
						}
						if (array7[0] != -1 && array7[j] != -1 && array7[j + 1] != -1)
						{
							list6.Add(array7[0]);
							list6.Add(array7[j]);
							list6.Add(array7[j + 1]);
						}
					}
				}
			}
		}
		Mesh val = new Mesh
		{
			vertices = list.ToArray(),
			triangles = list4.ToArray()
		};
		if (list2.Count > 0 && list6.Count == list4.Count)
		{
			Vector3[] array9 = (Vector3[])(object)new Vector3[list.Count];
			for (int k = 0; k < list4.Count; k++)
			{
				array9[list4[k]] = list2[list6[k]];
			}
			val.normals = array9;
		}
		else
		{
			val.RecalculateNormals();
		}
		if (list3.Count > 0 && list5.Count == list4.Count)
		{
			Vector2[] array10 = (Vector2[])(object)new Vector2[list.Count];
			for (int l = 0; l < list4.Count; l++)
			{
				array10[list4[l]] = list3[list5[l]];
			}
			val.uv = array10;
		}
		val.RecalculateBounds();
		return val;
	}
}

plugins/TerrasScrap.dll

Decompiled a month ago
using System;
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 BepInEx;
using HarmonyLib;
using LethalLevelLoader;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("TerrasScrap")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("A small collection of vanilla styled scrap.")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyInformationalVersion("1.0.2+e01cea7a61e58729b4695f7a34df66cf1ac416f8")]
[assembly: AssemblyProduct("TerrasScrap")]
[assembly: AssemblyTitle("Terra's Scrap")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace TerrasScrap
{
	[BepInPlugin("terraformer9x.TerrasScrap", "Terra's Scrap", "1.0.2")]
	public class Plugin : BaseUnityPlugin
	{
		private const string pluginGUID = "terraformer9x.TerrasScrap";

		private const string pluginName = "Terra's Scrap";

		private const string pluginVersion = "1.0.2";

		private readonly Harmony harmony = new Harmony("terraformer9x.TerrasScrap");

		public static Plugin Instance;

		private void Awake()
		{
			if (Instance == null)
			{
				Instance = this;
			}
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Terra's Scrap 1.0.2  is loaded!");
			harmony.PatchAll(typeof(StartOfRoundPatch));
		}

		public static void Log(string msg)
		{
			((BaseUnityPlugin)Instance).Logger.LogInfo((object)msg);
		}

		public static void LogError(string msg)
		{
			((BaseUnityPlugin)Instance).Logger.LogError((object)msg);
		}

		public static void LogDebug(string msg)
		{
			((BaseUnityPlugin)Instance).Logger.LogDebug((object)msg);
		}
	}
	internal class StartOfRoundPatch
	{
		private static bool executed;

		[HarmonyPatch(typeof(StartOfRound), "Awake")]
		[HarmonyPostfix]
		private static void StartOfRoundPostfix(ref StartOfRound __instance)
		{
			if (executed)
			{
				return;
			}
			executed = true;
			Dictionary<string, List<ItemGroup>> dictionary = new Dictionary<string, List<ItemGroup>>();
			ItemGroup[] array = Resources.FindObjectsOfTypeAll<ItemGroup>();
			foreach (ItemGroup val in array)
			{
				if (!dictionary.ContainsKey(((Object)val).name))
				{
					List<ItemGroup> value = new List<ItemGroup>(1) { val };
					dictionary.Add(((Object)val).name, value);
				}
				else
				{
					dictionary[((Object)val).name].Add(val);
				}
			}
			List<ExtendedItem> list = PatchedContent.ExtendedItems.Where((ExtendedItem x) => ((ExtendedContent)x).ModName == "Terra's Scrap").ToList();
			Dictionary<string, Item> dictionary2 = new Dictionary<string, Item>();
			foreach (ExtendedItem item in list)
			{
				if ((Object)(object)item.Item != (Object)null && !dictionary2.ContainsKey(((Object)item.Item).name) && !dictionary2.ContainsValue(item.Item))
				{
					dictionary2.Add(((Object)item.Item).name, item.Item);
				}
			}
			dictionary2["TrafficCone"].spawnPositionTypes.AddRange(dictionary["GeneralItemClass"]);
			dictionary2["Tuba"].spawnPositionTypes.AddRange(dictionary["GeneralItemClass"]);
			dictionary2["WineBottle"].spawnPositionTypes.AddRange(dictionary["TabletopItems"]);
			dictionary2["Fan"].spawnPositionTypes.AddRange(dictionary["GeneralItemClass"]);
			dictionary2["Fan"].spawnPositionTypes.AddRange(dictionary["TabletopItems"]);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "TerrasScrap";

		public const string PLUGIN_NAME = "TerrasScrap";

		public const string PLUGIN_VERSION = "1.0.2";
	}
}