Decompiled source of UsualScrap v1.7.6

UsualScrap.dll

Decompiled 2 weeks 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.Tasks;
using BepInEx;
using BepInEx.Configuration;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Events;
using UsualScrap.Behaviors;
using UsualScrap.Behaviors.Effects;
using UsualScrap.Behaviors.OvertimeEffects;
using UsualScrap.NetcodePatcher;

[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("UsualScrap")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Adds 15+ unique equipment and scrap items that try to keep the vanilla tone")]
[assembly: AssemblyFileVersion("1.7.6.0")]
[assembly: AssemblyInformationalVersion("1.7.6")]
[assembly: AssemblyProduct("UsualScrap")]
[assembly: AssemblyTitle("UsualScrap")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.7.6.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 UsualScrap
{
	[BepInPlugin("Emil.UsualScrap", "UsualScrap", "1.7.6")]
	public class Plugin : BaseUnityPlugin
	{
		public const string PLUGIN_GUID = "Emil.UsualScrap";

		public const string PLUGIN_NAME = "UsualScrap";

		public const string PLUGIN_VERSION = "1.7.6";

		public static Plugin instance;

		internal static UsualScrapConfigs BoundConfig { get; private set; }

		public void Registerstoreitem(Item name, string description, int price)
		{
			TerminalNode val = ScriptableObject.CreateInstance<TerminalNode>();
			val.clearPreviousText = true;
			val.displayText = description + "\n\n";
			Items.RegisterShopItem(name, (TerminalNode)null, (TerminalNode)null, val, price);
		}

		public void ScriptSetUp(GrabbableObject script, bool grabbable, bool grabbableToEnemies, bool isInFactory, Item itemProperties)
		{
			script.grabbable = grabbable;
			script.grabbableToEnemies = grabbableToEnemies;
			script.isInFactory = isInFactory;
			script.itemProperties = itemProperties;
		}

		public void Awake()
		{
			//IL_0581: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_082c: Unknown result type (might be due to invalid IL or missing references)
			//IL_087f: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0925: Unknown result type (might be due to invalid IL or missing references)
			//IL_0978: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8f: Unknown result type (might be due to invalid IL or missing references)
			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);
					}
				}
			}
			instance = this;
			AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "usualscrapassetbundle"));
			Item val2 = val.LoadAsset<Item>("Assets/Items/UnstableFuelCylinderAssets/UnstableFuelCylinder_Item.asset");
			Item val3 = val.LoadAsset<Item>("Assets/Items/HandlampAssets/Handlamp_Item.asset");
			Item val4 = val.LoadAsset<Item>("Assets/Items/BandagesAssets/Bandages_Item.asset");
			Item val5 = val.LoadAsset<Item>("Assets/Items/MedicalKitAssets/MedicalKit_Item.asset");
			Item val6 = val.LoadAsset<Item>("Assets/Items/DefibrillatorAssets/Defibrillator_Item.asset");
			Item val7 = val.LoadAsset<Item>("Assets/Items/ToolboxAssets/Toolbox_Item.asset");
			Item val8 = val.LoadAsset<Item>("Assets/Items/WalkingCaneAssets/WalkingCane_Item.asset");
			Item val9 = val.LoadAsset<Item>("Assets/Items/RadioactiveCellAssets/RadioactiveCell_Item.asset");
			Item val10 = val.LoadAsset<Item>("Assets/Items/ScissorsAssets/Scissors_Item.asset");
			Item val11 = val.LoadAsset<Item>("Assets/Items/RoseAssets/Rose_Item.asset");
			Item val12 = val.LoadAsset<Item>("Assets/Items/GoldenTicketAssets/GoldenTicket_Item.asset");
			Item val13 = val.LoadAsset<Item>("Assets/Items/TicketAssets/Ticket_Item.asset");
			Item val14 = val.LoadAsset<Item>("Assets/Items/PadlockAssets/Padlock_Item.asset");
			Item val15 = val.LoadAsset<Item>("Assets/Items/PocketWatchAssets/PocketWatch_Item.asset");
			Item val16 = val.LoadAsset<Item>("Assets/Items/CrowbarAssets/Crowbar_Item.asset");
			Item val17 = val.LoadAsset<Item>("Assets/Items/CandyDispenserAssets/CandyDispenser_Item.asset");
			Item val18 = val.LoadAsset<Item>("Assets/Items/CandyAssets/Lollipop_Item.asset");
			Item val19 = val.LoadAsset<Item>("Assets/Items/CandyAssets/Peppermint_Item.asset");
			Item val20 = val.LoadAsset<Item>("Assets/Items/EmergencyInjectorAssets/EmergencyInjector_Item.asset");
			Item val21 = val.LoadAsset<Item>("Assets/Items/ShiftControllerAssets/ShiftController_Item.asset");
			Item val22 = val.LoadAsset<Item>("Assets/Items/GloomyCapsuleAssets/GloomyCapsule_Item.asset");
			Item val23 = val.LoadAsset<Item>("Assets/Items/FrigidCapsuleAssets/FrigidCapsule_Item.asset");
			Item val24 = val.LoadAsset<Item>("Assets/Items/SanguineCapsuleAssets/SanguineCapsule_Item.asset");
			List<Item> list = new List<Item>
			{
				val2, val3, val4, val5, val6, val20, val21, val7, val9, val22,
				val23, val24, val15, val14, val16, val8, val10, val11, val12, val13,
				val17, val18
			};
			foreach (Item item in list)
			{
				if ((Object)(object)item != (Object)null)
				{
					NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab);
					Utilities.FixMixerGroups(item.spawnPrefab);
				}
			}
			HandlampScript script = val3.spawnPrefab.AddComponent<HandlampScript>();
			ScriptSetUp((GrabbableObject)(object)script, grabbable: true, grabbableToEnemies: true, isInFactory: false, val3);
			ToolboxScript toolboxScript = val7.spawnPrefab.AddComponent<ToolboxScript>();
			ScriptSetUp((GrabbableObject)(object)toolboxScript, grabbable: true, grabbableToEnemies: true, isInFactory: false, val7);
			((GrabbableObject)toolboxScript).useCooldown = 0.1f;
			PadlockScript script2 = val14.spawnPrefab.AddComponent<PadlockScript>();
			ScriptSetUp((GrabbableObject)(object)script2, grabbable: true, grabbableToEnemies: true, isInFactory: true, val14);
			CrowbarScript script3 = val16.spawnPrefab.AddComponent<CrowbarScript>();
			ScriptSetUp((GrabbableObject)(object)script3, grabbable: true, grabbableToEnemies: true, isInFactory: true, val16);
			Items.RegisterItem(val16);
			UnstableFuelCylinderScript script4 = val2.spawnPrefab.AddComponent<UnstableFuelCylinderScript>();
			ScriptSetUp((GrabbableObject)(object)script4, grabbable: true, grabbableToEnemies: true, isInFactory: true, val2);
			RadioactiveCellScript script5 = val9.spawnPrefab.AddComponent<RadioactiveCellScript>();
			ScriptSetUp((GrabbableObject)(object)script5, grabbable: true, grabbableToEnemies: true, isInFactory: true, val9);
			GloomyCapsuleScript script6 = val22.spawnPrefab.AddComponent<GloomyCapsuleScript>();
			ScriptSetUp((GrabbableObject)(object)script6, grabbable: true, grabbableToEnemies: true, isInFactory: true, val22);
			FrigidCapsuleScript script7 = val23.spawnPrefab.AddComponent<FrigidCapsuleScript>();
			ScriptSetUp((GrabbableObject)(object)script7, grabbable: true, grabbableToEnemies: true, isInFactory: true, val23);
			SanguineCapsuleScript script8 = val24.spawnPrefab.AddComponent<SanguineCapsuleScript>();
			ScriptSetUp((GrabbableObject)(object)script8, grabbable: true, grabbableToEnemies: true, isInFactory: true, val24);
			BandagesScript bandagesScript = val4.spawnPrefab.AddComponent<BandagesScript>();
			ScriptSetUp((GrabbableObject)(object)bandagesScript, grabbable: true, grabbableToEnemies: true, isInFactory: false, val4);
			((GrabbableObject)bandagesScript).useCooldown = 0.5f;
			MedicalKitScript script9 = val5.spawnPrefab.AddComponent<MedicalKitScript>();
			ScriptSetUp((GrabbableObject)(object)script9, grabbable: true, grabbableToEnemies: true, isInFactory: false, val5);
			DefibrillatorScript script10 = val6.spawnPrefab.AddComponent<DefibrillatorScript>();
			ScriptSetUp((GrabbableObject)(object)script10, grabbable: true, grabbableToEnemies: true, isInFactory: false, val6);
			EmergencyInjectorScript script11 = val20.spawnPrefab.AddComponent<EmergencyInjectorScript>();
			ScriptSetUp((GrabbableObject)(object)script11, grabbable: true, grabbableToEnemies: true, isInFactory: false, val20);
			ShiftControllerScript script12 = val21.spawnPrefab.AddComponent<ShiftControllerScript>();
			ScriptSetUp((GrabbableObject)(object)script12, grabbable: true, grabbableToEnemies: true, isInFactory: false, val21);
			CaneScript script13 = val8.spawnPrefab.AddComponent<CaneScript>();
			ScriptSetUp((GrabbableObject)(object)script13, grabbable: true, grabbableToEnemies: true, isInFactory: true, val8);
			ScissorsScript script14 = val10.spawnPrefab.AddComponent<ScissorsScript>();
			ScriptSetUp((GrabbableObject)(object)script14, grabbable: true, grabbableToEnemies: true, isInFactory: true, val10);
			RoseScript script15 = val11.spawnPrefab.AddComponent<RoseScript>();
			ScriptSetUp((GrabbableObject)(object)script15, grabbable: true, grabbableToEnemies: true, isInFactory: true, val11);
			GoldenTicketScript script16 = val12.spawnPrefab.AddComponent<GoldenTicketScript>();
			ScriptSetUp((GrabbableObject)(object)script16, grabbable: true, grabbableToEnemies: true, isInFactory: true, val12);
			TicketScript script17 = val13.spawnPrefab.AddComponent<TicketScript>();
			ScriptSetUp((GrabbableObject)(object)script17, grabbable: true, grabbableToEnemies: true, isInFactory: true, val13);
			CandyDispenserScript script18 = val17.spawnPrefab.AddComponent<CandyDispenserScript>();
			ScriptSetUp((GrabbableObject)(object)script18, grabbable: true, grabbableToEnemies: true, isInFactory: true, val17);
			CandyScript script19 = val18.spawnPrefab.AddComponent<CandyScript>();
			ScriptSetUp((GrabbableObject)(object)script19, grabbable: true, grabbableToEnemies: true, isInFactory: true, val18);
			CandyScript script20 = val19.spawnPrefab.AddComponent<CandyScript>();
			ScriptSetUp((GrabbableObject)(object)script20, grabbable: true, grabbableToEnemies: true, isInFactory: true, val19);
			LevelTypes val25 = (LevelTypes)14208;
			BoundConfig = new UsualScrapConfigs(((BaseUnityPlugin)this).Config);
			if (BoundConfig.UnstableFuelCylinderLoaded.Value)
			{
				if (BoundConfig.UnstableFuelCylinderSpawnsAsScrap.Value)
				{
					Items.RegisterScrap(val2, BoundConfig.UnstableFuelCylinderSpawnWeight.Value, (LevelTypes)(-1));
				}
				else
				{
					Items.RegisterItem(val2);
				}
			}
			if (BoundConfig.RadioactiveCellLoaded.Value)
			{
				if (BoundConfig.RadioactiveCellSpawnsAsScrap.Value)
				{
					Items.RegisterScrap(val9, BoundConfig.RadioactiveCellSpawnWeight.Value, (LevelTypes)(-1));
				}
				else
				{
					Items.RegisterItem(val9);
				}
			}
			if (BoundConfig.CrowbarLoaded.Value)
			{
				if (BoundConfig.CrowbarSpawnsAsScrap.Value)
				{
					Items.RegisterScrap(val16, BoundConfig.CrowbarSpawnWeight.Value, (LevelTypes)(-1));
				}
				if (BoundConfig.CrowbarIsStoreItem.Value)
				{
					Registerstoreitem(val16, "The Crowbar is a light melee weapon that can be used to pry open doors.", BoundConfig.CrowbarStorePrice.Value);
				}
				if (!BoundConfig.CrowbarSpawnsAsScrap.Value && !BoundConfig.CrowbarIsStoreItem.Value)
				{
					Items.RegisterItem(val16);
				}
			}
			if (BoundConfig.PadlockLoaded.Value)
			{
				if (BoundConfig.PadlockSpawnsAsScrap.Value)
				{
					Items.RegisterScrap(val14, BoundConfig.PadlockSpawnWeight.Value, (LevelTypes)(-1));
				}
				if (BoundConfig.PadlockIsStoreItem.Value)
				{
					Registerstoreitem(val14, "The Padlock can be used to lock doors on your enemies..or coworkers.", BoundConfig.PadlockStorePrice.Value);
				}
				if (!BoundConfig.PadlockSpawnsAsScrap.Value && !BoundConfig.PadlockIsStoreItem.Value)
				{
					Items.RegisterItem(val14);
				}
			}
			if (BoundConfig.WalkingCaneLoaded.Value)
			{
				if (BoundConfig.WalkingCaneSpawnsAsScrap.Value)
				{
					Items.RegisterScrap(val8, BoundConfig.WalkingCaneSpawnWeight.Value, val25);
				}
				else
				{
					Items.RegisterItem(val8);
				}
			}
			if (BoundConfig.ScissorsLoaded.Value)
			{
				if (BoundConfig.ScissorsSpawnsAsScrap.Value)
				{
					Items.RegisterScrap(val10, BoundConfig.ScissorsSpawnWeight.Value, val25);
				}
				else
				{
					Items.RegisterItem(val10);
				}
			}
			if (BoundConfig.RoseLoaded.Value)
			{
				if (BoundConfig.RoseSpawnsAsScrap.Value)
				{
					Items.RegisterScrap(val11, BoundConfig.RoseSpawnWeight.Value, val25);
				}
				else
				{
					Items.RegisterItem(val11);
				}
			}
			if (BoundConfig.TicketLoaded.Value)
			{
				if (BoundConfig.TicketSpawnsAsScrap.Value)
				{
					Items.RegisterScrap(val13, BoundConfig.TicketSpawnWeight.Value, val25);
				}
				else
				{
					Items.RegisterItem(val13);
				}
			}
			if (BoundConfig.GoldenTicketLoaded.Value)
			{
				if (BoundConfig.GoldenTicketSpawnsAsScrap.Value)
				{
					Items.RegisterScrap(val12, BoundConfig.GoldenTicketSpawnWeight.Value, val25);
				}
				else
				{
					Items.RegisterItem(val12);
				}
			}
			if (BoundConfig.CandyDispenserLoaded.Value)
			{
				if (BoundConfig.CandyDispenserSpawnsAsScrap.Value)
				{
					Items.RegisterScrap(val17, BoundConfig.CandyDispenserSpawnWeight.Value, val25);
					Items.RegisterItem(val18);
					Items.RegisterItem(val19);
				}
				else
				{
					Items.RegisterItem(val17);
					Items.RegisterItem(val18);
					Items.RegisterItem(val19);
				}
			}
			if (BoundConfig.GloomyCapsuleLoaded.Value)
			{
				if (BoundConfig.GloomyCapsuleSpawnsAsScrap.Value)
				{
					Items.RegisterScrap(val22, BoundConfig.GloomyCapsuleSpawnWeight.Value, (LevelTypes)(-1));
				}
				else
				{
					Items.RegisterItem(val22);
				}
			}
			if (BoundConfig.FrigidCapsuleLoaded.Value)
			{
				if (BoundConfig.FrigidCapsuleSpawnsAsScrap.Value)
				{
					Items.RegisterScrap(val23, BoundConfig.FrigidCapsuleSpawnWeight.Value, (LevelTypes)(-1));
				}
				else
				{
					Items.RegisterItem(val23);
				}
			}
			if (BoundConfig.PocketWatchLoaded.Value)
			{
				if (BoundConfig.PocketWatchSpawnsAsScrap.Value)
				{
					Items.RegisterScrap(val15, BoundConfig.PocketWatchSpawnWeight.Value, val25);
				}
				else
				{
					Items.RegisterItem(val15);
				}
			}
			if (BoundConfig.HandlampLoaded.Value)
			{
				if (BoundConfig.HandlampIsStoreItem.Value)
				{
					Registerstoreitem(val3, "The Handlamp is perfect for illuminating your surroundings..and possibly blinding you.", BoundConfig.HandlampStorePrice.Value);
				}
				else
				{
					Items.RegisterItem(val3);
				}
			}
			if (BoundConfig.BandagesLoaded.Value)
			{
				if (BoundConfig.BandagesIsStoreItem.Value)
				{
					Registerstoreitem(val4, "The Bandages will get you up and going in no time at all!", BoundConfig.BandagesStorePrice.Value);
				}
				else
				{
					Items.RegisterItem(val4);
				}
			}
			if (BoundConfig.MedicalKitLoaded.Value)
			{
				if (BoundConfig.MedicalKitIsStoreItem.Value)
				{
					Registerstoreitem(val5, "The Medical Kit can heal anything if given time!", BoundConfig.MedicalKitStorePrice.Value);
				}
				else
				{
					Items.RegisterItem(val5);
				}
			}
			if (BoundConfig.ShiftControllerLoaded.Value)
			{
				if (BoundConfig.ShiftControllerIsStoreItem.Value)
				{
					Registerstoreitem(val21, "The Shift Controller is a portable teleporter that allows you to set the teleport position.", BoundConfig.ShiftControllerStorePrice.Value);
				}
				else
				{
					Items.RegisterItem(val21);
				}
			}
			if (BoundConfig.EmergencyInjectorLoaded.Value)
			{
				if (BoundConfig.EmergencyInjectorIsStoreItem.Value)
				{
					Registerstoreitem(val20, "The Emergency Injector boosts your movement capabilities for a while and gives a small amount of health, don't take too much!", BoundConfig.EmergencyInjectorStorePrice.Value);
				}
				else
				{
					Items.RegisterItem(val20);
				}
			}
			if (BoundConfig.DefibrillatorLoaded.Value)
			{
				if (BoundConfig.DefibrillatorIsStoreItem.Value)
				{
					Registerstoreitem(val6, "The Defibrillator can revive those employees lost to stupidity.", BoundConfig.DefibrillatorStorePrice.Value);
				}
				else
				{
					Items.RegisterItem(val6);
				}
			}
			if (BoundConfig.ToolboxLoaded.Value)
			{
				if (BoundConfig.ToolboxIsStoreItem.Value)
				{
					Registerstoreitem(val7, "The Toolbox can deconstruct some traps for a fine reward.", BoundConfig.ToolboxStorePrice.Value);
				}
				else
				{
					Items.RegisterItem(val7);
				}
			}
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Emil.UsualScrap");
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Emil.UsualScrap is loaded!");
		}
	}
	internal class UsualScrapConfigs
	{
		public readonly ConfigEntry<bool> UnstableFuelCylinderLoaded;

		public readonly ConfigEntry<bool> UnstableFuelCylinderSpawnsAsScrap;

		public readonly ConfigEntry<int> UnstableFuelCylinderSpawnWeight;

		public readonly ConfigEntry<bool> RadioactiveCellLoaded;

		public readonly ConfigEntry<bool> RadioactiveCellSpawnsAsScrap;

		public readonly ConfigEntry<int> RadioactiveCellSpawnWeight;

		public readonly ConfigEntry<bool> CrowbarLoaded;

		public readonly ConfigEntry<bool> CrowbarSpawnsAsScrap;

		public readonly ConfigEntry<int> CrowbarSpawnWeight;

		public readonly ConfigEntry<bool> CrowbarIsStoreItem;

		public readonly ConfigEntry<int> CrowbarStorePrice;

		public readonly ConfigEntry<bool> PadlockLoaded;

		public readonly ConfigEntry<bool> PadlockSpawnsAsScrap;

		public readonly ConfigEntry<int> PadlockSpawnWeight;

		public readonly ConfigEntry<bool> PadlockIsStoreItem;

		public readonly ConfigEntry<int> PadlockStorePrice;

		public readonly ConfigEntry<bool> WalkingCaneLoaded;

		public readonly ConfigEntry<bool> WalkingCaneSpawnsAsScrap;

		public readonly ConfigEntry<int> WalkingCaneSpawnWeight;

		public readonly ConfigEntry<bool> ScissorsLoaded;

		public readonly ConfigEntry<bool> ScissorsSpawnsAsScrap;

		public readonly ConfigEntry<int> ScissorsSpawnWeight;

		public readonly ConfigEntry<bool> RoseLoaded;

		public readonly ConfigEntry<bool> RoseSpawnsAsScrap;

		public readonly ConfigEntry<int> RoseSpawnWeight;

		public readonly ConfigEntry<bool> TicketLoaded;

		public readonly ConfigEntry<bool> TicketSpawnsAsScrap;

		public readonly ConfigEntry<int> TicketSpawnWeight;

		public readonly ConfigEntry<bool> GoldenTicketLoaded;

		public readonly ConfigEntry<bool> GoldenTicketSpawnsAsScrap;

		public readonly ConfigEntry<int> GoldenTicketSpawnWeight;

		public readonly ConfigEntry<bool> CandyDispenserLoaded;

		public readonly ConfigEntry<bool> CandyDispenserSpawnsAsScrap;

		public readonly ConfigEntry<int> CandyDispenserSpawnWeight;

		public readonly ConfigEntry<bool> GloomyCapsuleLoaded;

		public readonly ConfigEntry<bool> GloomyCapsuleSpawnsAsScrap;

		public readonly ConfigEntry<int> GloomyCapsuleSpawnWeight;

		public readonly ConfigEntry<bool> FrigidCapsuleLoaded;

		public readonly ConfigEntry<bool> FrigidCapsuleSpawnsAsScrap;

		public readonly ConfigEntry<int> FrigidCapsuleSpawnWeight;

		public readonly ConfigEntry<bool> PocketWatchLoaded;

		public readonly ConfigEntry<bool> PocketWatchSpawnsAsScrap;

		public readonly ConfigEntry<int> PocketWatchSpawnWeight;

		public readonly ConfigEntry<bool> HandlampLoaded;

		public readonly ConfigEntry<bool> HandlampIsStoreItem;

		public readonly ConfigEntry<int> HandlampStorePrice;

		public readonly ConfigEntry<bool> BandagesLoaded;

		public readonly ConfigEntry<bool> BandagesIsStoreItem;

		public readonly ConfigEntry<int> BandagesStorePrice;

		public readonly ConfigEntry<bool> MedicalKitLoaded;

		public readonly ConfigEntry<bool> MedicalKitIsStoreItem;

		public readonly ConfigEntry<int> MedicalKitStorePrice;

		public readonly ConfigEntry<bool> DefibrillatorLoaded;

		public readonly ConfigEntry<bool> DefibrillatorIsStoreItem;

		public readonly ConfigEntry<int> DefibrillatorStorePrice;

		public readonly ConfigEntry<bool> DefibrillatorUsesLimited;

		public readonly ConfigEntry<int> DefibrillatorUseLimit;

		public readonly ConfigEntry<bool> ShiftControllerLoaded;

		public readonly ConfigEntry<bool> ShiftControllerIsStoreItem;

		public readonly ConfigEntry<int> ShiftControllerStorePrice;

		public readonly ConfigEntry<bool> EmergencyInjectorLoaded;

		public readonly ConfigEntry<bool> EmergencyInjectorIsStoreItem;

		public readonly ConfigEntry<int> EmergencyInjectorStorePrice;

		public readonly ConfigEntry<bool> ToolboxLoaded;

		public readonly ConfigEntry<bool> ToolboxIsStoreItem;

		public readonly ConfigEntry<int> ToolboxStorePrice;

		public readonly ConfigEntry<int> ShiftControllerGreatRange;

		public readonly ConfigEntry<int> ShiftControllerPoorRange;

		public readonly ConfigEntry<bool> CapsulesDisabledOnTheShip;

		public UsualScrapConfigs(ConfigFile cfg)
		{
			cfg.SaveOnConfigSet = false;
			UnstableFuelCylinderLoaded = cfg.Bind<bool>("Scrap Item - Unstable Fuel Cylinder", "Unstable Fuel Cylinder is Loaded", true, "Whether or not the Unstable Fuel Cylinder is loaded.");
			UnstableFuelCylinderSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Unstable Fuel Cylinder", "Unstable Fuel Cylinder is a scrap item", true, "Whether or not the Unstable Fuel Cylinder spawns as scrap.");
			UnstableFuelCylinderSpawnWeight = cfg.Bind<int>("Scrap Item - Unstable Fuel Cylinder", "Unstable Fuel Cylinder spawn weight", 25, "How often the Unstable Fuel Cylinder spawns as scrap.");
			RadioactiveCellLoaded = cfg.Bind<bool>("Scrap Item - Radioactive Cell", "Radioactive Cell is Loaded", true, "Whether or not the Radioactive Cell is loaded.");
			RadioactiveCellSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Radioactive Cell", "Radioactive Cell is a scrap item", true, "Whether or not the Radioactive Cell spawns as scrap.");
			RadioactiveCellSpawnWeight = cfg.Bind<int>("Scrap Item - Radioactive Cell", "Radioactive Cell spawn weight", 15, "How often the Radioactive Cell spawns as scrap.");
			CrowbarLoaded = cfg.Bind<bool>("Scrap Item - Crowbar", "Crowbar is loaded", true, "Whether or not the Crowbar is loaded.");
			CrowbarSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Crowbar", "Crowbar is a scrap item", true, "Whether or not the Crowbar spawns as scrap.");
			CrowbarSpawnWeight = cfg.Bind<int>("Scrap Item - Crowbar", "Crowbar spawn weight", 30, "How often the Crowbar spawns as scrap.");
			CrowbarIsStoreItem = cfg.Bind<bool>("Scrap Item - Crowbar", "Crowbar is a store item", false, "Whether or not the Crowbar is a store item.");
			CrowbarStorePrice = cfg.Bind<int>("Scrap Item - Crowbar", "Crowbar store price", 55, "The store price of the Crowbar.");
			PadlockLoaded = cfg.Bind<bool>("Scrap Item - Padlock", "Padlock is loaded", true, "Whether or not the Padlock is loaded.");
			PadlockSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Padlock", "Padlock is a scrap item", true, "Whether or not the Padlock spawns as scrap.");
			PadlockSpawnWeight = cfg.Bind<int>("Scrap Item - Padlock", "Padlock spawn weight", 30, "How often the Padlock spawns as scrap.");
			PadlockIsStoreItem = cfg.Bind<bool>("Scrap Item - Padlock", "Padlock is a store item", false, "Whether or not the Padlock is a store item.");
			PadlockStorePrice = cfg.Bind<int>("Scrap Item - Padlock", "Padlock store price", 20, "The store price of the Padlock.");
			WalkingCaneLoaded = cfg.Bind<bool>("Scrap Item - Walking Cane", "Walking Cane is loaded", true, "Whether or not the Walking Cane is loaded.");
			WalkingCaneSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Walking Cane", "Walking Cane is a scrap item", true, "Whether or not the Walking Cane spawns as scrap.");
			WalkingCaneSpawnWeight = cfg.Bind<int>("Scrap Item - Walking Cane", "Walking Cane spawn weight", 20, "How often the Walking Cane spawns as scrap.");
			ScissorsLoaded = cfg.Bind<bool>("Scrap Item - Scissors", "Scissors are loaded", true, "Whether or not the Scissors are loaded.");
			ScissorsSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Scissors", "Scissors are a scrap item", true, "Whether or not the Scissors spawn as scrap.");
			ScissorsSpawnWeight = cfg.Bind<int>("Scrap Item - Scissors", "Scissors spawn weight", 30, "How often the Scissors spawn as scrap.");
			RoseLoaded = cfg.Bind<bool>("Scrap Item - Rose", "Rose is loaded", true, "Whether or not the Rose is loaded.");
			RoseSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Rose", "Rose is scrap item", true, "Whether or not the Rose spawns as scrap.");
			RoseSpawnWeight = cfg.Bind<int>("Scrap Item - Rose", "Rose spawn weight", 30, "How often the Rose spawns as scrap.");
			TicketLoaded = cfg.Bind<bool>("Scrap Item - Ticket", "Ticket is loaded", true, "Whether or not the Ticket is loaded.");
			TicketSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Ticket", "Ticket is a scrap item", true, "Whether or not the Ticket spawns as scrap.");
			TicketSpawnWeight = cfg.Bind<int>("Scrap Item - Ticket", "Ticket spawn weight", 40, "How often the Ticket spawns as scrap.");
			GoldenTicketLoaded = cfg.Bind<bool>("Scrap Item - Golden Ticket", "Golden Ticket is loaded", true, "Whether or not the Golden Ticket is loaded.");
			GoldenTicketSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Golden Ticket", "Golden Ticket is a scrap item", true, "Whether or not the Golden Ticket spawns as scrap.");
			GoldenTicketSpawnWeight = cfg.Bind<int>("Scrap Item - Golden Ticket", "Golden Ticket spawn weight", 10, "How often the Golden Ticket spawns as scrap.");
			CandyDispenserLoaded = cfg.Bind<bool>("Scrap Item - Candy Dispenser", "Candy Dispenser is loaded", true, "Whether or not the Candy Dispenser and its drops are loaded.");
			CandyDispenserSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Candy Dispenser", "Candy Dispenser is a scrap Item", true, "Whether or not the Candy Dispenser spawns as scrap.");
			CandyDispenserSpawnWeight = cfg.Bind<int>("Scrap Item - Candy Dispenser", "Candy Dispenser spawn weight", 30, "How often the Candy Dispenser spawns as scrap.");
			GloomyCapsuleLoaded = cfg.Bind<bool>("Scrap Item - Gloomy Capsule", "Gloomy Capsule is loaded", true, "Whether or not the Gloomy Capsule is loaded.");
			GloomyCapsuleSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Gloomy Capsule", "Gloomy Capsule is a scrap item", true, "Whether or not the Gloomy Capsule spawns as scrap.");
			GloomyCapsuleSpawnWeight = cfg.Bind<int>("Scrap Item - Gloomy Capsule", "Gloomy Capsule spawn weight", 25, "How often the Gloomy Capsule spawns as scrap.");
			FrigidCapsuleLoaded = cfg.Bind<bool>("Scrap Item - Frigid Capsule", "Frigid Capsule is loaded", true, "Whether or not the Frigid Capsule is loaded.");
			FrigidCapsuleSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Frigid Capsule", "Frigid Capsule is a scrap item", true, "Whether or not the Frigid Capsule spawns as scrap.");
			FrigidCapsuleSpawnWeight = cfg.Bind<int>("Scrap Item - Frigid Capsule", "Frigid Capsule spawn weight", 25, "How often the Frigid Capsule spawns as scrap.");
			HandlampLoaded = cfg.Bind<bool>("Store Item - Handlamp", "Handlamp is loaded", true, "Whether or not the Handlamp is loaded.");
			HandlampIsStoreItem = cfg.Bind<bool>("Store Item - Handlamp", "Handlamp is a store item", true, "Whether or not the Handlamp is a store item.");
			HandlampStorePrice = cfg.Bind<int>("Store Item - Handlamp", "Handlamp store price", 25, "The store price of the Handlamp.");
			BandagesLoaded = cfg.Bind<bool>("Store Item - Bandages", "Bandages are loaded", true, "Whether or not the Bandages are loaded.");
			BandagesIsStoreItem = cfg.Bind<bool>("Store Item - Bandages", "Bandages are a store item", true, "Whether or not the Bandages are a store item.");
			BandagesStorePrice = cfg.Bind<int>("Store Item - Bandages", "Bandages store price", 20, "The store price of the Bandages.");
			MedicalKitLoaded = cfg.Bind<bool>("Store Item - Medical Kit", "Medical Kit is loaded", true, "Whether or not the Medical Kit is loaded.");
			MedicalKitIsStoreItem = cfg.Bind<bool>("Store Item - Medical Kit", "Medical Kit is a store item", true, "Whether or not the Medical Kit is a store item.");
			MedicalKitStorePrice = cfg.Bind<int>("Store Item - Medical Kit", "Medical Kit store price", 120, "The store price of the Medical Kit.");
			DefibrillatorLoaded = cfg.Bind<bool>("Store Item - Defibrillator", "Defibrillator is loaded", true, "Whether or not the Defibrillator is loaded.");
			DefibrillatorIsStoreItem = cfg.Bind<bool>("Store Item - Defibrillator", "Defibrillator is a store item", true, "Whether or not the Defibrillator is a store item.");
			DefibrillatorStorePrice = cfg.Bind<int>("Store Item - Defibrillator", "Defibrillator store price", 375, "The store price of the Defibrillator.");
			DefibrillatorUsesLimited = cfg.Bind<bool>("Store Item - Defibrillator", "Defibrillators uses are limited", true, "Whether or not Defibrillators have limited uses.");
			DefibrillatorUseLimit = cfg.Bind<int>("Store Item - Defibrillator", "Defibrillators uses", 4, "The number of uses each Defibrillator has (Uses have a minimum of 1, uses are based on the amount of players the defib has successfully revived).");
			ShiftControllerLoaded = cfg.Bind<bool>("Store Item - Shift Controller", "Shift Controller is loaded", true, "Whether or not the Shift Controller is loaded.");
			ShiftControllerIsStoreItem = cfg.Bind<bool>("Store Item - Shift Controller", "Shift Controller is a store item", true, "Whether or not the Shift Controller is a store item.");
			ShiftControllerStorePrice = cfg.Bind<int>("Store Item - Shift Controller", "Shift Controller store price", 225, "The store price of the Shift Controller.");
			ShiftControllerGreatRange = cfg.Bind<int>("Store Item - Shift Controller", "Shift Controllers great/first connection range", 50, "The max range of the Shift Controller's great/first connection range. (The great/first connection range starts at 0 and stops at this value, The average/middle connection range starts at this value)");
			ShiftControllerPoorRange = cfg.Bind<int>("Store Item - Shift Controller", "Shift Controllers poor/last connection range", 175, "The range where the Shift Controller enters it's poor/last connection range. (The average/middle connection range stops at this value, The poor/last connection range starts at this value)");
			EmergencyInjectorLoaded = cfg.Bind<bool>("Store Item - Emergency Injector", "Emergency Injector is loaded", true, "Whether or not the Emergency Injector is loaded.");
			EmergencyInjectorIsStoreItem = cfg.Bind<bool>("Store Item - Emergency Injector", "Emergency Injector is a store item", true, "Whether or not the Emergency Injector is a store item.");
			EmergencyInjectorStorePrice = cfg.Bind<int>("Store Item - Emergency Injector", "Emergency Injector store price", 60, "The store price of the Emergency Injector.");
			ToolboxLoaded = cfg.Bind<bool>("Store Item - Toolbox", "Toolbox is loaded", true, "Whether or not the Toolbox is loaded.");
			ToolboxIsStoreItem = cfg.Bind<bool>("Store Item - Toolbox", "Toolbox is a store item", true, "Whether or not the Toolbox is a store item.");
			ToolboxStorePrice = cfg.Bind<int>("Store Item - Toolbox", "Toolbox store price", 115, "The store price of the Toolbox.");
			PocketWatchLoaded = cfg.Bind<bool>("General Items", "PocketWatch is loaded", true, "Whether or not the PocketWatch is loaded.");
			PocketWatchSpawnsAsScrap = cfg.Bind<bool>("General Items", "PocketWatch is a scrap item", true, "Whether or not the PocketWatch spawns as scrap.");
			PocketWatchSpawnWeight = cfg.Bind<int>("General Items", "PocketWatch spawn weight", 20, "How often the PocketWatch spawns as scrap.");
			CapsulesDisabledOnTheShip = cfg.Bind<bool>("General Mechanic Changes", "Capsules Disabled On The Ship", true, "Whether or not capsules are disabled on the ship when landed regardless of their individual mechanics (Capsules are disabled in orbit always).");
			ClearOrphanedEntries(cfg);
			cfg.Save();
			cfg.SaveOnConfigSet = true;
		}

		private static void ClearOrphanedEntries(ConfigFile cfg)
		{
			PropertyInfo propertyInfo = AccessTools.Property(typeof(ConfigFile), "OrphanedEntries");
			Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)propertyInfo.GetValue(cfg);
			dictionary.Clear();
		}
	}
}
namespace UsualScrap.Behaviors
{
	internal class BandagesScript : GrabbableObject
	{
		private int uses = 3;

		private ParticleSystem particle;

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (buttonDown && base.playerHeldBy.health < 100)
			{
				HealServerRpc();
			}
		}

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

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

		public void Heal()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			particle = ((Component)this).GetComponentInChildren<ParticleSystem>();
			ParticleSystem val = Object.Instantiate<ParticleSystem>(particle, ((Component)base.playerHeldBy).transform.position, Quaternion.identity, ((Component)base.playerHeldBy).transform);
			val.Play();
			if (uses > 1 && base.playerHeldBy.health < 80)
			{
				base.playerHeldBy.health = base.playerHeldBy.health + 20;
				uses--;
			}
			else if (uses > 1 && base.playerHeldBy.health >= 80 && base.playerHeldBy.health < 100)
			{
				base.playerHeldBy.health = base.playerHeldBy.health + (100 - base.playerHeldBy.health);
				uses--;
			}
			else if (uses <= 1 && base.playerHeldBy.health < 80)
			{
				base.playerHeldBy.health = base.playerHeldBy.health + 20;
				if (base.isHeld)
				{
					base.playerHeldBy.DespawnHeldObject();
				}
			}
			else if (uses <= 1 && base.playerHeldBy.health >= 80 && base.playerHeldBy.health < 100)
			{
				base.playerHeldBy.health = base.playerHeldBy.health + (100 - base.playerHeldBy.health);
				if (base.isHeld)
				{
					base.playerHeldBy.DespawnHeldObject();
				}
			}
			if (base.playerHeldBy.health > 20)
			{
				if (base.playerHeldBy.criticallyInjured || base.playerHeldBy.bleedingHeavily)
				{
					base.playerHeldBy.criticallyInjured = false;
					base.playerHeldBy.bleedingHeavily = false;
				}
				if ((Object)(object)base.playerHeldBy.playerBodyAnimator != (Object)null)
				{
					base.playerHeldBy.playerBodyAnimator.SetBool("Limp", false);
				}
				HUDManager.Instance.UpdateHealthUI(base.playerHeldBy.health, false);
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_BandagesScript()
		{
			//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(87823207u, new RpcReceiveHandler(__rpc_handler_87823207));
			NetworkManager.__rpc_func_table.Add(2085797069u, new RpcReceiveHandler(__rpc_handler_2085797069));
		}

		private static void __rpc_handler_87823207(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;
				((BandagesScript)(object)target).HealServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2085797069(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;
				((BandagesScript)(object)target).HealClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "BandagesScript";
		}
	}
	internal class CandyDispenserScript : GrabbableObject
	{
		private RaycastHit[] objectsHitByMeleeWeapon;

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

		private bool isHoldingButton;

		private bool reelingUp;

		private Coroutine reelingUpCoroutine;

		private PlayerControllerB previousPlayerHeldBy;

		private static Item _lollipopItem;

		private static Item _peppermintItem;

		private GameObject dispenserBase;

		private MeshRenderer dispenserMesh;

		private int meleeWeaponMask = 1084754248;

		private int meleeWeaponHitForce = 2;

		private AudioSource dispenserAudio;

		private AudioClip swing;

		private AudioClip Dispense;

		private AudioClip[] hitSFX;

		private Color setColor;

		public void Awake()
		{
			dispenserAudio = ((Component)((Component)this).transform.Find("CandyDispenserSounds")).gameObject.GetComponent<AudioSource>();
			AudioSource[] components = ((Component)((Component)this).transform.Find("CandyDispenserSounds")).gameObject.GetComponents<AudioSource>();
			swing = components[1].clip;
			Dispense = components[2].clip;
			hitSFX = (AudioClip[])(object)new AudioClip[1] { dispenserAudio.clip };
		}

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

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

		[ServerRpc(RequireOwnership = false)]
		public void SetColorServerRPC()
		{
			//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_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			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(3606619266u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3606619266u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					float num = new Random().Next(2, 11);
					float num2 = new Random().Next(2, 11);
					float num3 = new Random().Next(2, 11);
					float num4 = 0.9f / num;
					float num5 = 0.9f / num2;
					float num6 = 0.9f / num3;
					setColor = new Color(num4, num5, num6, 1f);
					SetColorClientRPC(setColor);
				}
			}
		}

		[ClientRpc]
		public void SetColorClientRPC(Color color)
		{
			//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_0114: 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(809217553u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref color);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 809217553u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					dispenserBase = ((Component)((Component)((Component)this).transform.Find("CandyDispenserModel")).gameObject.transform.Find("DispenserBase")).gameObject;
					dispenserMesh = dispenserBase.GetComponent<MeshRenderer>();
					((Renderer)dispenserMesh).material.color = color;
				}
			}
		}

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

		private IEnumerator reelUpMeleeWeapon()
		{
			base.playerHeldBy.activatingItem = true;
			base.playerHeldBy.twoHanded = true;
			base.playerHeldBy.playerBodyAnimator.ResetTrigger("shovelHit");
			base.playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true);
			yield return (object)new WaitForSeconds(0.35f);
			yield return (object)new WaitUntil((Func<bool>)(() => !isHoldingButton || !base.isHeld));
			SwingMeleeWeapon(!base.isHeld);
			yield return (object)new WaitForSeconds(0.13f);
			yield return (object)new WaitForEndOfFrame();
			HitMeleeWeapon(!base.isHeld);
			yield return (object)new WaitForSeconds(0.3f);
			reelingUp = false;
			reelingUpCoroutine = null;
		}

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

		public void HitMeleeWeapon(bool cancel = false)
		{
			//IL_0058: 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_0077: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: 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)
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: 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;
			bool flag2 = false;
			bool flag3 = false;
			int num = -1;
			if (!cancel)
			{
				previousPlayerHeldBy.twoHanded = false;
				objectsHitByMeleeWeapon = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.8f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.5f, meleeWeaponMask, (QueryTriggerInteraction)2);
				objectsHitByMeleeWeaponList = objectsHitByMeleeWeapon.OrderBy(delegate(RaycastHit x)
				{
					//IL_0000: Unknown result type (might be due to invalid IL or missing references)
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					RaycastHit val4 = x;
					return ((RaycastHit)(ref val4)).distance;
				}).ToList();
				List<EnemyAI> list = new List<EnemyAI>();
				IHittable val2 = default(IHittable);
				RaycastHit val3 = default(RaycastHit);
				for (int i = 0; i < objectsHitByMeleeWeaponList.Count; i++)
				{
					RaycastHit val = objectsHitByMeleeWeaponList[i];
					if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8)
					{
						val = objectsHitByMeleeWeaponList[i];
						if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11)
						{
							val = objectsHitByMeleeWeaponList[i];
							if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent<IHittable>(ref val2))
							{
								continue;
							}
							val = objectsHitByMeleeWeaponList[i];
							if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform)
							{
								continue;
							}
							val = objectsHitByMeleeWeaponList[i];
							if (!(((RaycastHit)(ref val)).point == Vector3.zero))
							{
								Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position;
								val = objectsHitByMeleeWeaponList[i];
								if (Physics.Linecast(position, ((RaycastHit)(ref val)).point, ref val3, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1))
								{
									continue;
								}
							}
							flag = true;
							Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward;
							try
							{
								val = objectsHitByMeleeWeaponList[i];
								EnemyAICollisionDetect component = ((Component)((RaycastHit)(ref val)).transform).GetComponent<EnemyAICollisionDetect>();
								if ((Object)(object)component != (Object)null)
								{
									if ((Object)(object)component.mainScript == (Object)null || list.Contains(component.mainScript))
									{
										continue;
									}
									goto IL_0369;
								}
								val = objectsHitByMeleeWeaponList[i];
								if (!((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent<PlayerControllerB>() != (Object)null))
								{
									goto IL_0369;
								}
								if (flag3)
								{
									continue;
								}
								flag3 = true;
								goto IL_0369;
								IL_0369:
								bool flag4 = val2.Hit(meleeWeaponHitForce, forward, previousPlayerHeldBy, true, 1);
								if (flag4 && (Object)(object)component != (Object)null)
								{
									list.Add(component.mainScript);
								}
								if (!flag2)
								{
									flag2 = flag4;
								}
							}
							catch (Exception arg)
							{
								MonoBehaviour.print((object)$"Error hitting object with Candy Dispenser {arg}, caused by playerInital: {previousPlayerHeldBy.playerClientId}");
							}
							continue;
						}
					}
					val = objectsHitByMeleeWeaponList[i];
					if (((RaycastHit)(ref val)).collider.isTrigger)
					{
						continue;
					}
					flag = true;
					val = objectsHitByMeleeWeaponList[i];
					string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag;
					for (int j = 0; j < StartOfRound.Instance.footstepSurfaces.Length; j++)
					{
						if (StartOfRound.Instance.footstepSurfaces[j].surfaceTag == tag)
						{
							num = j;
							dispenserAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX);
							break;
						}
					}
				}
				float num2 = new Random().Next(1, 20);
				if (num2 == 1f)
				{
					if (StartOfRound.Instance.inShipPhase || !StartOfRound.Instance.shipHasLanded || !TimeOfDay.Instance.currentLevel.planetHasTime)
					{
						MonoBehaviour.print((object)"Candy spawning disabled, land at a moon with a time cycle!");
						return;
					}
					dispenserAudio.PlayOneShot(Dispense);
					SpawnScrapServerRpc();
				}
			}
			if (flag)
			{
				int num3 = RoundManager.PlayRandomClip(dispenserAudio, hitSFX, true, 1f, 0, 1000);
				Object.FindObjectOfType<RoundManager>().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0);
				if (num != -1)
				{
					dispenserAudio.PlayOneShot(hitSFX[num3]);
					WalkieTalkie.TransmitOneShotAudio(dispenserAudio, hitSFX[num3], 1f);
				}
				base.playerHeldBy.playerBodyAnimator.SetTrigger("crowbarHit");
				HitMeleeWeaponServerRpc(num3);
			}
		}

		[ServerRpc]
		public void HitMeleeWeaponServerRpc(int sound)
		{
			//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(2363479380u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, sound);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2363479380u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				HitMeleeWeaponClientRpc(sound);
			}
		}

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

		private void HitSurfaceWithMeleeWeapon(int sound)
		{
			if (!((NetworkBehaviour)this).IsOwner)
			{
				dispenserAudio.PlayOneShot(hitSFX[sound]);
			}
			WalkieTalkie.TransmitOneShotAudio(dispenserAudio, hitSFX[sound], 1f);
		}

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

		public void SpawnCandy()
		{
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: 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_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			Item val = PullLollipop();
			Item val2 = PullPeppermint();
			int num = new Random().Next(1, 4);
			GameObject val3;
			if (num == 1 || num == 2)
			{
				val3 = Object.Instantiate<GameObject>(val.spawnPrefab, ((Component)base.playerHeldBy).transform.position + Vector3.up, Quaternion.identity);
				GrabbableObject component = val3.GetComponent<GrabbableObject>();
				component.fallTime = 0f;
				((NetworkBehaviour)component).NetworkObject.Spawn(false);
				component.SetScrapValue(10);
			}
			else
			{
				val3 = Object.Instantiate<GameObject>(val2.spawnPrefab, ((Component)base.playerHeldBy).transform.position + Vector3.up, Quaternion.identity);
				GrabbableObject component2 = val3.GetComponent<GrabbableObject>();
				component2.fallTime = 0f;
				((NetworkBehaviour)component2).NetworkObject.Spawn(false);
				component2.SetScrapValue(10);
			}
			if ((Object)(object)previousPlayerHeldBy != (Object)null && previousPlayerHeldBy.isInHangarShipRoom)
			{
				previousPlayerHeldBy.SetItemInElevator(true, true, val3.GetComponent<GrabbableObject>());
			}
		}

		public static Item PullLollipop()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			if ((Object)_lollipopItem == (Object)null)
			{
				_lollipopItem = StartOfRound.Instance.allItemsList.itemsList.First((Item i) => ((Object)i).name == "Lollipop_Item");
			}
			return _lollipopItem;
		}

		public static Item PullPeppermint()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			if ((Object)_peppermintItem == (Object)null)
			{
				_peppermintItem = StartOfRound.Instance.allItemsList.itemsList.First((Item i) => ((Object)i).name == "Peppermint_Item");
			}
			return _peppermintItem;
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_CandyDispenserScript()
		{
			//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(3606619266u, new RpcReceiveHandler(__rpc_handler_3606619266));
			NetworkManager.__rpc_func_table.Add(809217553u, new RpcReceiveHandler(__rpc_handler_809217553));
			NetworkManager.__rpc_func_table.Add(2363479380u, new RpcReceiveHandler(__rpc_handler_2363479380));
			NetworkManager.__rpc_func_table.Add(823714643u, new RpcReceiveHandler(__rpc_handler_823714643));
			NetworkManager.__rpc_func_table.Add(2364265404u, new RpcReceiveHandler(__rpc_handler_2364265404));
		}

		private static void __rpc_handler_3606619266(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;
				((CandyDispenserScript)(object)target).SetColorServerRPC();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_809217553(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)
			{
				Color colorClientRPC = default(Color);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref colorClientRPC);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((CandyDispenserScript)(object)target).SetColorClientRPC(colorClientRPC);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2363479380(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 sound = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref sound);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((CandyDispenserScript)(object)target).HitMeleeWeaponServerRpc(sound);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_823714643(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 sound = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref sound);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((CandyDispenserScript)(object)target).HitMeleeWeaponClientRpc(sound);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2364265404(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;
				((CandyDispenserScript)(object)target).SpawnScrapServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "CandyDispenserScript";
		}
	}
	internal class CandyScript : GrabbableObject
	{
		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (buttonDown)
			{
				((Component)base.playerHeldBy).gameObject.AddComponent<CandySpeedEffect>();
				base.playerHeldBy.DespawnHeldObject();
			}
		}

		[ServerRpc]
		public void DestroyRadarIconServerRpc()
		{
			//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(2453058261u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2453058261u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				DestroyRadarIconClientRpc();
			}
		}

		[ClientRpc]
		public void DestroyRadarIconClientRpc()
		{
			//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(1150975139u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1150975139u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Object.Destroy((Object)(object)((Component)base.radarIcon).gameObject);
				}
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_CandyScript()
		{
			//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(2453058261u, new RpcReceiveHandler(__rpc_handler_2453058261));
			NetworkManager.__rpc_func_table.Add(1150975139u, new RpcReceiveHandler(__rpc_handler_1150975139));
		}

		private static void __rpc_handler_2453058261(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;
				((CandyScript)(object)target).DestroyRadarIconServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1150975139(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;
				((CandyScript)(object)target).DestroyRadarIconClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "CandyScript";
		}
	}
	internal class CaneScript : GrabbableObject
	{
		private float movementbuff = 1f;

		public override void EquipItem()
		{
			((GrabbableObject)this).EquipItem();
			base.playerHeldBy.movementSpeed = base.playerHeldBy.movementSpeed + movementbuff;
		}

		public override void PocketItem()
		{
			((GrabbableObject)this).PocketItem();
			base.playerHeldBy.movementSpeed = base.playerHeldBy.movementSpeed - movementbuff;
		}

		public override void DiscardItem()
		{
			base.playerHeldBy.movementSpeed = base.playerHeldBy.movementSpeed - movementbuff;
			((GrabbableObject)this).DiscardItem();
		}

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

		protected internal override string __getTypeName()
		{
			return "CaneScript";
		}
	}
	internal class CrowbarScript : GrabbableObject
	{
		private PlayerControllerB previousPlayerHeldBy;

		private DoorLock viewedDoorLock;

		private int hitsToOpen = new Random().Next(2, 3);

		private AudioSource crowbarAudio;

		private AudioClip swing;

		private AudioClip[] hitSFX;

		public int meleeWeaponHitForce = 1;

		private bool isHoldingButton;

		private bool reelingUp;

		private Coroutine reelingUpCoroutine;

		private RaycastHit rayHit;

		private RaycastHit[] objectsHitByMeleeWeapon;

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

		public int meleeWeaponMask = 1084754248;

		public void Awake()
		{
			crowbarAudio = ((Component)((Component)this).transform.Find("CrowbarSounds")).gameObject.GetComponent<AudioSource>();
			AudioSource[] components = ((Component)((Component)this).transform.Find("CrowbarSounds")).gameObject.GetComponents<AudioSource>();
			swing = components[1].clip;
			hitSFX = (AudioClip[])(object)new AudioClip[1] { crowbarAudio.clip };
		}

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

		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(reelUpMeleeWeapon());
			}
		}

		private IEnumerator reelUpMeleeWeapon()
		{
			base.playerHeldBy.activatingItem = true;
			base.playerHeldBy.twoHanded = true;
			base.playerHeldBy.playerBodyAnimator.ResetTrigger("shovelHit");
			base.playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true);
			yield return (object)new WaitForSeconds(0.35f);
			yield return (object)new WaitUntil((Func<bool>)(() => !isHoldingButton || !base.isHeld));
			SwingMeleeWeapon(!base.isHeld);
			yield return (object)new WaitForSeconds(0.13f);
			yield return (object)new WaitForEndOfFrame();
			HitMeleeWeapon(!base.isHeld);
			yield return (object)new WaitForSeconds(0.3f);
			reelingUp = false;
			reelingUpCoroutine = null;
		}

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

		public void HitMeleeWeapon(bool cancel = false)
		{
			//IL_0058: 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_0077: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0561: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0414: Unknown result type (might be due to invalid IL or missing references)
			//IL_0429: Unknown result type (might be due to invalid IL or missing references)
			//IL_042e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: 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)
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: 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;
			bool flag2 = false;
			bool flag3 = false;
			int num = -1;
			if (!cancel)
			{
				previousPlayerHeldBy.twoHanded = false;
				objectsHitByMeleeWeapon = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.8f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.5f, meleeWeaponMask, (QueryTriggerInteraction)2);
				objectsHitByMeleeWeaponList = objectsHitByMeleeWeapon.OrderBy(delegate(RaycastHit x)
				{
					//IL_0000: Unknown result type (might be due to invalid IL or missing references)
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					RaycastHit val5 = x;
					return ((RaycastHit)(ref val5)).distance;
				}).ToList();
				List<EnemyAI> list = new List<EnemyAI>();
				IHittable val2 = default(IHittable);
				RaycastHit val3 = default(RaycastHit);
				for (int i = 0; i < objectsHitByMeleeWeaponList.Count; i++)
				{
					RaycastHit val = objectsHitByMeleeWeaponList[i];
					if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8)
					{
						val = objectsHitByMeleeWeaponList[i];
						if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11)
						{
							val = objectsHitByMeleeWeaponList[i];
							if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent<IHittable>(ref val2))
							{
								continue;
							}
							val = objectsHitByMeleeWeaponList[i];
							if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform)
							{
								continue;
							}
							val = objectsHitByMeleeWeaponList[i];
							if (!(((RaycastHit)(ref val)).point == Vector3.zero))
							{
								Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position;
								val = objectsHitByMeleeWeaponList[i];
								if (Physics.Linecast(position, ((RaycastHit)(ref val)).point, ref val3, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1))
								{
									continue;
								}
							}
							flag = true;
							Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward;
							try
							{
								val = objectsHitByMeleeWeaponList[i];
								EnemyAICollisionDetect component = ((Component)((RaycastHit)(ref val)).transform).GetComponent<EnemyAICollisionDetect>();
								if ((Object)(object)component != (Object)null)
								{
									if ((Object)(object)component.mainScript == (Object)null || list.Contains(component.mainScript))
									{
										continue;
									}
									goto IL_0369;
								}
								val = objectsHitByMeleeWeaponList[i];
								if (!((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent<PlayerControllerB>() != (Object)null))
								{
									goto IL_0369;
								}
								if (flag3)
								{
									continue;
								}
								flag3 = true;
								goto IL_0369;
								IL_0369:
								bool flag4 = val2.Hit(meleeWeaponHitForce, forward, previousPlayerHeldBy, true, 1);
								if (flag4 && (Object)(object)component != (Object)null)
								{
									list.Add(component.mainScript);
								}
								if (!flag2)
								{
									flag2 = flag4;
								}
							}
							catch (Exception arg)
							{
								MonoBehaviour.print((object)$"Error hitting object with crowbar {arg}, caused by playerInital: {previousPlayerHeldBy.playerClientId}");
							}
							continue;
						}
					}
					val = objectsHitByMeleeWeaponList[i];
					if (((RaycastHit)(ref val)).collider.isTrigger)
					{
						continue;
					}
					flag = true;
					val = objectsHitByMeleeWeaponList[i];
					string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag;
					for (int j = 0; j < StartOfRound.Instance.footstepSurfaces.Length; j++)
					{
						if (StartOfRound.Instance.footstepSurfaces[j].surfaceTag == tag)
						{
							num = j;
							crowbarAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX);
							break;
						}
					}
				}
				RaycastHit val4 = default(RaycastHit);
				if (Physics.Raycast(new Ray(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)base.playerHeldBy.gameplayCamera).transform.forward), ref val4, 3f, LayerMask.GetMask(new string[1] { "InteractableObject" })))
				{
					viewedDoorLock = ((Component)((RaycastHit)(ref val4)).transform).GetComponent<DoorLock>();
					if ((Object)(object)viewedDoorLock != (Object)null && viewedDoorLock.isLocked && hitsToOpen > 0)
					{
						hitsToOpen--;
					}
					else if ((Object)(object)viewedDoorLock != (Object)null && viewedDoorLock.isLocked && hitsToOpen == 0)
					{
						UnlockDoorServerRpc();
						OpenDoorServerRpc();
						hitsToOpen = new Random().Next(2, 3);
					}
					if ((Object)(object)viewedDoorLock != (Object)null && !viewedDoorLock.isLocked)
					{
						OpenDoorServerRpc();
					}
				}
			}
			if (flag)
			{
				int num2 = RoundManager.PlayRandomClip(crowbarAudio, hitSFX, true, 1f, 0, 1000);
				Object.FindObjectOfType<RoundManager>().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0);
				if (num != -1)
				{
					crowbarAudio.PlayOneShot(hitSFX[num2]);
					WalkieTalkie.TransmitOneShotAudio(crowbarAudio, hitSFX[num2], 1f);
				}
				base.playerHeldBy.playerBodyAnimator.SetTrigger("crowbarHit");
				HitMeleeWeaponServerRpc(num2);
			}
		}

		[ServerRpc]
		public void HitMeleeWeaponServerRpc(int sound)
		{
			//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(18646315u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, sound);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 18646315u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				HitMeleeWeaponClientRpc(sound);
			}
		}

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

		private void HitSurfaceWithMeleeWeapon(int sound)
		{
			if (!((NetworkBehaviour)this).IsOwner && sound != -1)
			{
				crowbarAudio.PlayOneShot(hitSFX[sound]);
			}
		}

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

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

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

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

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_CrowbarScript()
		{
			//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(18646315u, new RpcReceiveHandler(__rpc_handler_18646315));
			NetworkManager.__rpc_func_table.Add(292927352u, new RpcReceiveHandler(__rpc_handler_292927352));
			NetworkManager.__rpc_func_table.Add(121767703u, new RpcReceiveHandler(__rpc_handler_121767703));
			NetworkManager.__rpc_func_table.Add(4047106965u, new RpcReceiveHandler(__rpc_handler_4047106965));
			NetworkManager.__rpc_func_table.Add(1016317823u, new RpcReceiveHandler(__rpc_handler_1016317823));
			NetworkManager.__rpc_func_table.Add(3693078860u, new RpcReceiveHandler(__rpc_handler_3693078860));
		}

		private static void __rpc_handler_18646315(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 sound = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref sound);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((CrowbarScript)(object)target).HitMeleeWeaponServerRpc(sound);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_292927352(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 sound = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref sound);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((CrowbarScript)(object)target).HitMeleeWeaponClientRpc(sound);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_121767703(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;
				((CrowbarScript)(object)target).OpenDoorServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_4047106965(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;
				((CrowbarScript)(object)target).OpenDoorClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1016317823(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;
				((CrowbarScript)(object)target).UnlockDoorServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3693078860(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 (net