Decompiled source of RiskOfRainItems v0.2.7

plugins/RiskOfRainItems.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using MonoMod.RuntimeDetour;
using On;
using RiskOfRainItems.MonoBehaviours;
using Unity.Netcode;
using Unity.Netcode.Components;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("RiskOfRainItems")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RiskOfRainItems")]
[assembly: AssemblyTitle("RiskOfRainItems")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
internal class <Module>
{
	static <Module>()
	{
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<Vector3>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<Vector3>();
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>();
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace RiskOfRainItems
{
	internal class Config
	{
		public static ConfigEntry<int> CommonItemSpawnWeight;

		public static ConfigEntry<int> UncommonItemSpawnWeight;

		public static ConfigEntry<int> LegendaryItemSpawnWeight;

		public static ConfigEntry<bool> UkeleleEnabled;

		public static ConfigFile VolumeConfig;

		public static ConfigEntry<string> version;

		public static void Load()
		{
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Expected O, but got Unknown
			CommonItemSpawnWeight = Plugin.config.Bind<int>("Scrap", "CommonLoot", 15, "higher number = more common");
			UncommonItemSpawnWeight = Plugin.config.Bind<int>("Scrap", "UncommonLoot", 9, "higher number = more common");
			LegendaryItemSpawnWeight = Plugin.config.Bind<int>("Scrap", "LegendaryLoot", 3, "higher number = more common");
			version = Plugin.config.Bind<string>("Misc", "Version", "1.0.0", "Mod Version");
			VolumeConfig = new ConfigFile(Paths.ConfigPath + "\\RiskOfRainItems.AudioVolume.cfg", true);
		}
	}
	public class Content
	{
		public class CustomItem
		{
			public string name = "";

			public string itemPath = "";

			public string infoPath = "";

			public Action<Item> itemAction = delegate
			{
			};

			public bool enabled = true;

			public CustomItem(string name, string itemPath, string infoPath, Action<Item> action = null)
			{
				this.name = name;
				this.itemPath = itemPath;
				this.infoPath = infoPath;
				if (action != null)
				{
					itemAction = action;
				}
			}

			public static CustomItem Add(string name, string itemPath, string infoPath = null, Action<Item> action = null)
			{
				return new CustomItem(name, itemPath, infoPath, action);
			}
		}

		public class CustomScrap : CustomItem
		{
			public LevelTypes levelType = (LevelTypes)(-1);

			public int rarity = 0;

			public CustomScrap(string name, string itemPath, LevelTypes levelType, int rarity, Action<Item> action = null)
				: base(name, itemPath, null, action)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				this.levelType = levelType;
				this.rarity = rarity;
			}

			public static CustomScrap Add(string name, string itemPath, LevelTypes levelTypes, int rarity, Action<Item> action = null)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				return new CustomScrap(name, itemPath, levelTypes, rarity, action);
			}
		}

		public static AssetBundle MainAssets;

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

		public static List<CustomItem> customItems;

		public static GameObject ConfigManagerPrefab;

		public static void TryLoadAssets()
		{
			if ((Object)(object)MainAssets == (Object)null)
			{
				MainAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "riskofrainitems"));
				Plugin.logger.LogInfo((object)"we got them Assets");
			}
		}

		public static void Load()
		{
			//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
			TryLoadAssets();
			customItems = new List<CustomItem>
			{
				CustomScrap.Add("SoldierSyringe", "Assets/CustomAssets/ItemProperties/SoldierSyringe.asset", (LevelTypes)(-1), Config.CommonItemSpawnWeight.Value),
				CustomScrap.Add("TougherTimes", "Assets/CustomAssets/ItemProperties/TougherTimes.asset", (LevelTypes)(-1), Config.CommonItemSpawnWeight.Value),
				CustomScrap.Add("MonsterToothNecklace", "Assets/CustomAssets/ItemProperties/MonsterToothNecklace.asset", (LevelTypes)(-1), Config.CommonItemSpawnWeight.Value),
				CustomScrap.Add("LensMakersGlasses", "Assets/CustomAssets/ItemProperties/LensMakersGlasses.asset", (LevelTypes)(-1), Config.CommonItemSpawnWeight.Value),
				CustomScrap.Add("PaulsGoatHoof", "Assets/CustomAssets/ItemProperties/PaulsGoatHoof.asset", (LevelTypes)(-1), Config.CommonItemSpawnWeight.Value),
				CustomScrap.Add("BustlingFungus", "Assets/CustomAssets/ItemProperties/BustlingFungus.asset", (LevelTypes)(-1), Config.CommonItemSpawnWeight.Value),
				CustomScrap.Add("Crowbar", "Assets/CustomAssets/ItemProperties/Crowbar.asset", (LevelTypes)(-1), Config.CommonItemSpawnWeight.Value),
				CustomScrap.Add("TriTipDagger", "Assets/CustomAssets/ItemProperties/TriTipDagger.asset", (LevelTypes)(-1), Config.CommonItemSpawnWeight.Value),
				CustomScrap.Add("StickyBomb", "Assets/CustomAssets/ItemProperties/StickyBomb.asset", (LevelTypes)(-1), Config.CommonItemSpawnWeight.Value),
				CustomScrap.Add("Warbanner", "Assets/CustomAssets/ItemProperties/Warbanner.asset", (LevelTypes)(-1), Config.CommonItemSpawnWeight.Value),
				CustomScrap.Add("CautiousSlug", "Assets/CustomAssets/ItemProperties/CautiousSlug.asset", (LevelTypes)(-1), Config.CommonItemSpawnWeight.Value),
				CustomScrap.Add("PersonalShieldGenerator", "Assets/CustomAssets/ItemProperties/PersonalShieldGenerator.asset", (LevelTypes)(-1), Config.CommonItemSpawnWeight.Value),
				CustomScrap.Add("Ukulele", "Assets/CustomAssets/ItemProperties/Ukulele.asset", (LevelTypes)(-1), Config.UncommonItemSpawnWeight.Value),
				CustomScrap.Add("WillOTheWisp", "Assets/CustomAssets/ItemProperties/WilloWisp.asset", (LevelTypes)(-1), Config.UncommonItemSpawnWeight.Value),
				CustomScrap.Add("HopooFeather", "Assets/CustomAssets/ItemProperties/HopooFeather.asset", (LevelTypes)(-1), Config.UncommonItemSpawnWeight.Value),
				CustomScrap.Add("LeechingSeed", "Assets/CustomAssets/ItemProperties/LeechingSeed.asset", (LevelTypes)(-1), Config.UncommonItemSpawnWeight.Value),
				CustomScrap.Add("PredInstincts", "Assets/CustomAssets/ItemProperties/PredInstincts.asset", (LevelTypes)(-1), Config.UncommonItemSpawnWeight.Value),
				CustomScrap.Add("RedWhip", "Assets/CustomAssets/ItemProperties/RedWhip.asset", (LevelTypes)(-1), Config.UncommonItemSpawnWeight.Value),
				CustomScrap.Add("HarvestersScythe", "Assets/CustomAssets/ItemProperties/HarvestersScythe.asset", (LevelTypes)(-1), Config.UncommonItemSpawnWeight.Value),
				CustomScrap.Add("FuelCell", "Assets/CustomAssets/ItemProperties/FuelCell.asset", (LevelTypes)(-1), Config.UncommonItemSpawnWeight.Value),
				CustomScrap.Add("BrilliantBehemoth", "Assets/CustomAssets/ItemProperties/BrilliantBehemoth.asset", (LevelTypes)(-1), Config.LegendaryItemSpawnWeight.Value),
				CustomScrap.Add("FrostRelic", "Assets/CustomAssets/ItemProperties/FrostRelic.asset", (LevelTypes)(-1), Config.LegendaryItemSpawnWeight.Value),
				CustomScrap.Add("HappiestMask", "Assets/CustomAssets/ItemProperties/HappiestMask.asset", (LevelTypes)(-1), Config.LegendaryItemSpawnWeight.Value),
				CustomScrap.Add("CeremonialDagger", "Assets/CustomAssets/ItemProperties/CeremonialDagger.asset", (LevelTypes)(-1), Config.LegendaryItemSpawnWeight.Value),
				CustomScrap.Add("NkuhanasOpinion", "Assets/CustomAssets/ItemProperties/NkuhanasOpinion.asset", (LevelTypes)(-1), Config.LegendaryItemSpawnWeight.Value),
				CustomScrap.Add("UnstableTeslaCoil", "Assets/CustomAssets/ItemProperties/UnstableTeslaCoil.asset", (LevelTypes)(-1), Config.LegendaryItemSpawnWeight.Value),
				CustomScrap.Add("HeadStompers", "Assets/CustomAssets/ItemProperties/HeadStompers.asset", (LevelTypes)(-1), Config.LegendaryItemSpawnWeight.Value)
			};
			foreach (CustomItem customItem in customItems)
			{
				if (customItem.enabled)
				{
					Item val = MainAssets.LoadAsset<Item>(customItem.itemPath);
					Plugin.logger.LogInfo((object)customItem.itemPath);
					if ((Object)(object)val.spawnPrefab.GetComponent<NetworkTransform>() == (Object)null && (Object)(object)val.spawnPrefab.GetComponent<CustomNetworkTransform>() == (Object)null)
					{
						NetworkTransform val2 = val.spawnPrefab.AddComponent<NetworkTransform>();
						val2.SlerpPosition = false;
						val2.Interpolate = false;
						val2.SyncPositionX = false;
						val2.SyncPositionY = false;
						val2.SyncPositionZ = false;
						val2.SyncScaleX = false;
						val2.SyncScaleY = false;
						val2.SyncScaleZ = false;
						val2.UseHalfFloatPrecision = true;
					}
					Prefabs.Add(customItem.name, val.spawnPrefab);
					NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
					customItem.itemAction(val);
					if (customItem is CustomScrap)
					{
						Items.RegisterScrap(val, ((CustomScrap)customItem).rarity, ((CustomScrap)customItem).levelType);
					}
				}
			}
			foreach (KeyValuePair<string, GameObject> prefab in Prefabs)
			{
				GameObject value = prefab.Value;
				string key = prefab.Key;
				AudioSource[] componentsInChildren = value.GetComponentsInChildren<AudioSource>();
				if (componentsInChildren.Length != 0)
				{
					ConfigEntry<float> val3 = Config.VolumeConfig.Bind<float>("Volume", key ?? "", 100f, "Audio volume for " + key + " (0-100) ");
					AudioSource[] array = componentsInChildren;
					foreach (AudioSource val4 in array)
					{
						val4.volume *= val3.Value / 100f;
					}
				}
			}
		}
	}
	[BepInPlugin("Bread.RiskOfRainItems", "Risk of Scrap", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public const string PLUGIN_GUID = "Bread.RiskOfRainItems";

		public const string PLUGIN_NAME = "Risk of Scrap";

		public const string PLUGIN_VERSION = "1.0.0";

		public static ConfigFile config;

		public static ManualLogSource logger;

		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Bread.RiskOfRainItems is loaded!");
			Utilities.Init();
			logger = ((BaseUnityPlugin)this).Logger;
			config = ((BaseUnityPlugin)this).Config;
			Config.Load();
			Content.Load();
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
		}
	}
	public class Utilities
	{
		private static Dictionary<int, int> _masksByLayer;

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

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

		public static int MaskForLayer(int layer)
		{
			bool flag = true;
			return _masksByLayer[layer];
		}

		public static void LoadPrefab(string name, Vector3 position)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			if (Content.Prefabs.ContainsKey(name))
			{
				Plugin.logger.LogInfo((object)("Loading prefab " + name));
				GameObject val = Object.Instantiate<GameObject>(Content.Prefabs[name], position, Quaternion.identity);
				val.GetComponent<NetworkObject>().Spawn(false);
			}
			else
			{
				Plugin.logger.LogWarning((object)("Prefab " + name + " not found!"));
			}
		}

		public static void CreateExplosion(Vector3 explosionPosition, bool spawnExplosionEffect = false, int damage = 20, float minDamageRange = 0f, float maxDamageRange = 1f, int enemyHitForce = 6, CauseOfDeath causeOfDeath = 3, PlayerControllerB attacker = null)
		{
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Spawning explosion at pos: {explosionPosition}");
			Transform val = null;
			if ((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer.transform != (Object)null)
			{
				val = RoundManager.Instance.mapPropsContainer.transform;
			}
			if (spawnExplosionEffect)
			{
				Object.Instantiate<GameObject>(StartOfRound.Instance.explosionPrefab, explosionPosition, Quaternion.Euler(-90f, 0f, 0f), val).SetActive(true);
			}
			float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, explosionPosition);
			if (num < 14f)
			{
				HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
			}
			else if (num < 25f)
			{
				HUDManager.Instance.ShakeCamera((ScreenShakeType)0);
			}
			Collider[] array = Physics.OverlapSphere(explosionPosition, maxDamageRange, 2621448, (QueryTriggerInteraction)2);
			PlayerControllerB val2 = null;
			for (int i = 0; i < array.Length; i++)
			{
				float num2 = Vector3.Distance(explosionPosition, ((Component)array[i]).transform.position);
				if (num2 > 4f && Physics.Linecast(explosionPosition, ((Component)array[i]).transform.position + Vector3.up * 0.3f, 256, (QueryTriggerInteraction)1))
				{
					continue;
				}
				if (((Component)array[i]).gameObject.layer == 3)
				{
					val2 = ((Component)array[i]).gameObject.GetComponent<PlayerControllerB>();
					if ((Object)(object)val2 != (Object)null && ((NetworkBehaviour)val2).IsOwner)
					{
						float num3 = 1f - Mathf.Clamp01((num2 - minDamageRange) / (maxDamageRange - minDamageRange));
						val2.DamagePlayer((int)((float)damage * num3), true, true, causeOfDeath, 0, false, default(Vector3));
					}
				}
				else if (((Component)array[i]).gameObject.layer == 19)
				{
					EnemyAICollisionDetect componentInChildren = ((Component)array[i]).gameObject.GetComponentInChildren<EnemyAICollisionDetect>();
					if ((Object)(object)componentInChildren != (Object)null && ((NetworkBehaviour)componentInChildren.mainScript).IsOwner && num2 < 4.5f)
					{
						componentInChildren.mainScript.HitEnemyOnLocalClient(enemyHitForce, default(Vector3), attacker, false);
					}
				}
			}
			int num4 = ~LayerMask.GetMask(new string[1] { "Room" });
			num4 = ~LayerMask.GetMask(new string[1] { "Colliders" });
			array = Physics.OverlapSphere(explosionPosition, 10f, num4);
			for (int j = 0; j < array.Length; j++)
			{
				Rigidbody component = ((Component)array[j]).GetComponent<Rigidbody>();
				if ((Object)(object)component != (Object)null)
				{
					component.AddExplosionForce(70f, explosionPosition, 10f);
				}
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "RiskOfRainItems";

		public const string PLUGIN_NAME = "RiskOfRainItems";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace RiskOfRainItems.Patches
{
	public class Miscellaneous
	{
		public static void Load()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Expected O, but got Unknown
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Expected O, but got Unknown
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Expected O, but got Unknown
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Expected O, but got Unknown
			Hook val = new Hook((MethodBase)typeof(Object).GetMethod("Instantiate", new Type[3]
			{
				typeof(Object),
				typeof(Transform),
				typeof(bool)
			}), typeof(Miscellaneous).GetMethod("InstantiateOPI"));
			Hook val2 = new Hook((MethodBase)typeof(Object).GetMethod("Instantiate", new Type[2]
			{
				typeof(Object),
				typeof(Transform)
			}), typeof(Miscellaneous).GetMethod("InstantiateOP"));
			Hook val3 = new Hook((MethodBase)typeof(Object).GetMethod("Instantiate", new Type[1] { typeof(Object) }), typeof(Miscellaneous).GetMethod("InstantiateO"));
			Hook val4 = new Hook((MethodBase)typeof(Object).GetMethod("Instantiate", new Type[3]
			{
				typeof(Object),
				typeof(Vector3),
				typeof(Quaternion)
			}), typeof(Miscellaneous).GetMethod("InstantiateOPR"));
			Hook val5 = new Hook((MethodBase)typeof(Object).GetMethod("Instantiate", new Type[4]
			{
				typeof(Object),
				typeof(Vector3),
				typeof(Quaternion),
				typeof(Transform)
			}), typeof(Miscellaneous).GetMethod("InstantiateOPRP"));
		}

		public static Object InstantiateOPI(Func<Object, Transform, bool, Object> orig, Object original, Transform parent, bool instantiateInWorldSpace)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			Object val = orig(original, parent, instantiateInWorldSpace);
			if (val != (Object)null && val is GameObject)
			{
				GameObject val2 = (GameObject)val;
				Collider[] componentsInChildren = val2.GetComponentsInChildren<Collider>();
				foreach (Collider val3 in componentsInChildren)
				{
					if (!((Object)(object)((Component)val3).gameObject.GetComponent<RootMarker>() != (Object)null))
					{
						RootMarker rootMarker = ((Component)val3).gameObject.AddComponent<RootMarker>();
						rootMarker.root = val2.transform;
					}
				}
			}
			return val;
		}

		public static Object InstantiateOP(Func<Object, Transform, Object> orig, Object original, Transform parent)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			Object val = orig(original, parent);
			if (val != (Object)null && val is GameObject)
			{
				GameObject val2 = (GameObject)val;
				Collider[] componentsInChildren = val2.GetComponentsInChildren<Collider>();
				foreach (Collider val3 in componentsInChildren)
				{
					if (!((Object)(object)((Component)val3).gameObject.GetComponent<RootMarker>() != (Object)null))
					{
						RootMarker rootMarker = ((Component)val3).gameObject.AddComponent<RootMarker>();
						rootMarker.root = val2.transform;
					}
				}
			}
			return val;
		}

		public static Object InstantiateO(Func<Object, Object> orig, Object original)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			Object val = orig(original);
			if (val != (Object)null && val is GameObject)
			{
				GameObject val2 = (GameObject)val;
				Collider[] componentsInChildren = val2.GetComponentsInChildren<Collider>();
				foreach (Collider val3 in componentsInChildren)
				{
					if (!((Object)(object)((Component)val3).gameObject.GetComponent<RootMarker>() != (Object)null))
					{
						RootMarker rootMarker = ((Component)val3).gameObject.AddComponent<RootMarker>();
						rootMarker.root = val2.transform;
					}
				}
			}
			return val;
		}

		public static Object InstantiateOPR(Func<Object, Vector3, Quaternion, Object> orig, Object original, Vector3 position, Quaternion rotation)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			Object val = orig(original, position, rotation);
			if (val != (Object)null && val is GameObject)
			{
				GameObject val2 = (GameObject)val;
				Collider[] componentsInChildren = val2.GetComponentsInChildren<Collider>();
				foreach (Collider val3 in componentsInChildren)
				{
					if (!((Object)(object)((Component)val3).gameObject.GetComponent<RootMarker>() != (Object)null))
					{
						RootMarker rootMarker = ((Component)val3).gameObject.AddComponent<RootMarker>();
						rootMarker.root = val2.transform;
					}
				}
			}
			return val;
		}

		public static Object InstantiateOPRP(Func<Object, Vector3, Quaternion, Transform, Object> orig, Object original, Vector3 position, Quaternion rotation, Transform parent)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			Object val = orig(original, position, rotation, parent);
			if (val != (Object)null && val is GameObject)
			{
				GameObject val2 = (GameObject)val;
				Collider[] componentsInChildren = val2.GetComponentsInChildren<Collider>();
				foreach (Collider val3 in componentsInChildren)
				{
					if (!((Object)(object)((Component)val3).gameObject.GetComponent<RootMarker>() != (Object)null))
					{
						RootMarker rootMarker = ((Component)val3).gameObject.AddComponent<RootMarker>();
						rootMarker.root = val2.transform;
					}
				}
			}
			return val;
		}

		private static void StartOfRound_Start(orig_Start orig, StartOfRound self)
		{
			orig.Invoke(self);
			SelectableLevel[] levels = self.levels;
			foreach (SelectableLevel val in levels)
			{
				val.spawnableScrap.RemoveAll((SpawnableItemWithRarity scrap) => ((Object)scrap.spawnableItem).name == "dingus");
			}
			self.allItemsList.itemsList.RemoveAll((Item item) => ((Object)item).name == "dingus");
		}
	}
}
namespace RiskOfRainItems.Network
{
	public class ManageEvents : NetworkBehaviour
	{
		public static ManageEvents instance { get; private set; }

		public override void OnNetworkSpawn()
		{
			((NetworkBehaviour)this).OnNetworkSpawn();
			instance = this;
		}

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

		[ClientRpc]
		public void SpawnExplosionOnPlayerClientRPC(NetworkObjectReference playerRef, Vector3 location, int damage)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1245110646u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref playerRef, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref location);
					BytePacker.WriteValueBitPacked(val2, damage);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1245110646u, val, (RpcDelivery)0);
				}
				NetworkObject val3 = default(NetworkObject);
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref playerRef)).TryGet(ref val3, (NetworkManager)null))
				{
					PlayerControllerB componentInChildren = ((Component)val3).GetComponentInChildren<PlayerControllerB>();
					Utilities.CreateExplosion(location, spawnExplosionEffect: true, damage, 0f, 6.4f, 6, (CauseOfDeath)3);
				}
			}
		}

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

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

		private static void __rpc_handler_1245110646(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: 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_0080: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference playerRef = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref playerRef, default(ForNetworkSerializable));
				Vector3 location = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref location);
				int damage = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref damage);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((ManageEvents)(object)target).SpawnExplosionOnPlayerClientRPC(playerRef, location, damage);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "ManageEvents";
		}
	}
}
namespace RiskOfRainItems.MonoBehaviours
{
	public class CustomNetworkTransform : NetworkBehaviour
	{
		public bool syncPosition = true;

		public bool syncRotation = true;

		public bool syncScale = true;

		public float positionDiffLimit = 0.1f;

		public float rotationDiffLimit = 0.1f;

		public float scaleDiffLimit = 0.1f;

		public bool lerpPosition = true;

		public bool lerpRotation = true;

		public bool lerpScale = true;

		public float positionLerpSpeed = 10f;

		public float rotationLerpSpeed = 10f;

		public float scaleLerpSpeed = 10f;

		private Vector3 _lastPosition;

		private Vector3 _lastRotation;

		private Vector3 _lastScale;

		private Vector3 _targetPosition;

		private Quaternion _targetRotation;

		private Vector3 _targetScale;

		public void FixedUpdate()
		{
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: 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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			if (((NetworkBehaviour)this).IsServer)
			{
				if (syncPosition && Vector3.Distance(((Component)this).transform.position, _lastPosition) > positionDiffLimit)
				{
					_lastPosition = ((Component)this).transform.position;
					UpdatePositionClientRpc(((Component)this).transform.position);
				}
				if (syncRotation && Quaternion.Angle(Quaternion.Euler(((Component)this).transform.eulerAngles), Quaternion.Euler(_lastRotation)) > rotationDiffLimit)
				{
					_lastRotation = ((Component)this).transform.eulerAngles;
					UpdateRotationClientRpc(((Component)this).transform.eulerAngles);
				}
				if (syncScale && Vector3.Distance(((Component)this).transform.localScale, _lastScale) > scaleDiffLimit)
				{
					_lastScale = ((Component)this).transform.localScale;
					UpdateScaleClientRpc(((Component)this).transform.localScale);
				}
			}
			else
			{
				if (lerpPosition)
				{
					((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, _targetPosition, Time.fixedDeltaTime * positionLerpSpeed);
				}
				if (lerpRotation)
				{
					((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, _targetRotation, Time.fixedDeltaTime * rotationLerpSpeed);
				}
				if (lerpScale)
				{
					((Component)this).transform.localScale = Vector3.Lerp(((Component)this).transform.localScale, _targetScale, Time.fixedDeltaTime * scaleLerpSpeed);
				}
			}
		}

		[ClientRpc]
		public void UpdatePositionClientRpc(Vector3 position)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(536210770u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 536210770u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((NetworkBehaviour)this).IsServer && syncPosition)
			{
				if (lerpPosition)
				{
					_targetPosition = position;
				}
				else
				{
					((Component)this).transform.position = position;
				}
			}
		}

		[ClientRpc]
		public void UpdateRotationClientRpc(Vector3 rotation)
		{
			//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_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3098187538u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3098187538u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((NetworkBehaviour)this).IsServer && syncRotation)
			{
				if (lerpRotation)
				{
					_targetRotation = Quaternion.Euler(rotation);
				}
				else
				{
					((Component)this).transform.rotation = Quaternion.Euler(rotation);
				}
			}
		}

		[ClientRpc]
		public void UpdateScaleClientRpc(Vector3 scale)
		{
			//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_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2642620880u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref scale);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2642620880u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((NetworkBehaviour)this).IsServer && syncScale)
			{
				if (lerpScale)
				{
					_targetScale = scale;
				}
				else
				{
					((Component)this).transform.localScale = scale;
				}
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_CustomNetworkTransform()
		{
			//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
			NetworkManager.__rpc_func_table.Add(536210770u, new RpcReceiveHandler(__rpc_handler_536210770));
			NetworkManager.__rpc_func_table.Add(3098187538u, new RpcReceiveHandler(__rpc_handler_3098187538));
			NetworkManager.__rpc_func_table.Add(2642620880u, new RpcReceiveHandler(__rpc_handler_2642620880));
		}

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

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

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

		protected internal override string __getTypeName()
		{
			return "CustomNetworkTransform";
		}
	}
	public class HarvestersScythe : GrabbableObject
	{
		public int shovelHitForce = 1;

		public float chanceToHeal = 0.5f;

		public bool reelingUp;

		public bool isHoldingButton;

		private RaycastHit rayHit;

		private Coroutine reelingUpCoroutine;

		private RaycastHit[] objectsHitByShovel;

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

		public AudioClip reelUp;

		public AudioClip swing;

		public AudioClip[] hitSFX;

		public AudioSource shovelAudio;

		private PlayerControllerB previousPlayerHeldBy;

		private int shovelMask = 11012424;

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			if ((Object)(object)base.playerHeldBy == (Object)null)
			{
				return;
			}
			Debug.Log((object)$"Is player pressing down button?: {buttonDown}");
			isHoldingButton = buttonDown;
			Debug.Log((object)("PLAYER ACTIVATED ITEM TO HIT WITH SHOVEL. Who sent this log: " + ((Object)((Component)GameNetworkManager.Instance.localPlayerController).gameObject).name));
			if (!reelingUp && buttonDown)
			{
				reelingUp = true;
				previousPlayerHeldBy = base.playerHeldBy;
				Debug.Log((object)$"Set previousPlayerHeldBy: {previousPlayerHeldBy}");
				if (reelingUpCoroutine != null)
				{
					((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine);
				}
				reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(reelUpShovel());
			}
		}

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

		[ServerRpc]
		public void ReelUpSFXServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Invalid comparison between Unknown and I4
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Invalid comparison between Unknown and I4
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Invalid comparison between Unknown and I4
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: 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(712244304u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 712244304u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager2 == null || !networkManager2.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager2.IsClient || networkManager2.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager2.LocalClientId)
				{
					if ((int)networkManager2.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val3 = default(ServerRpcParams);
				FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendServerRpc(4113335123u, val3, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val4, 4113335123u, val3, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager2.IsServer || networkManager2.IsHost))
			{
				ReelUpSFXClientRpc();
			}
		}

		[ClientRpc]
		public void ReelUpSFXClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Invalid comparison between Unknown and I4
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Invalid comparison between Unknown and I4
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: 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_0118: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(178038074u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 178038074u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager2 != null && networkManager2.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager2.IsServer || networkManager2.IsHost))
				{
					ClientRpcParams val3 = default(ClientRpcParams);
					FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendClientRpc(2042054613u, val3, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val4, 2042054613u, val3, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager2.IsClient || networkManager2.IsHost) && !((NetworkBehaviour)this).IsOwner)
				{
					shovelAudio.PlayOneShot(reelUp);
				}
			}
		}

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

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

		public void HitShovel(bool cancel = false)
		{
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0514: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: 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_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_0303: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_0334: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			//IL_039a: Unknown result type (might be due to invalid IL or missing references)
			//IL_039f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0345: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0354: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)previousPlayerHeldBy == (Object)null)
			{
				Debug.LogError((object)"Previousplayerheldby is null on this client when HitShovel is called.");
				return;
			}
			previousPlayerHeldBy.activatingItem = false;
			Debug.Log((object)("PLAYER HIT WITH SHOVEL! who is sending this log: " + ((Object)((Component)GameNetworkManager.Instance.localPlayerController).gameObject).name));
			bool flag = false;
			int hitSurfaceID = -1;
			if (!cancel)
			{
				previousPlayerHeldBy.twoHanded = false;
				Debug.DrawRay(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward * 1.85f, Color.blue, 5f);
				objectsHitByShovel = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.75f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.85f, shovelMask, (QueryTriggerInteraction)2);
				objectsHitByShovelList = objectsHitByShovel.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList();
				Vector3 val = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position;
				IHittable val3 = default(IHittable);
				RaycastHit val5 = default(RaycastHit);
				for (int i = 0; i < objectsHitByShovelList.Count; i++)
				{
					RaycastHit val2 = objectsHitByShovelList[i];
					if (((Component)((RaycastHit)(ref val2)).transform).gameObject.layer != 8)
					{
						val2 = objectsHitByShovelList[i];
						if (((Component)((RaycastHit)(ref val2)).transform).gameObject.layer != 11)
						{
							val2 = objectsHitByShovelList[i];
							if (!((Component)((RaycastHit)(ref val2)).transform).TryGetComponent<IHittable>(ref val3))
							{
								continue;
							}
							val2 = objectsHitByShovelList[i];
							if ((Object)(object)((RaycastHit)(ref val2)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform)
							{
								continue;
							}
							val2 = objectsHitByShovelList[i];
							if (!(((RaycastHit)(ref val2)).point == Vector3.zero))
							{
								Vector3 val4 = val;
								val2 = objectsHitByShovelList[i];
								if (Physics.Linecast(val4, ((RaycastHit)(ref val2)).point, ref val5, StartOfRound.Instance.collidersAndRoomMaskAndDefault))
								{
									continue;
								}
							}
							float value = Random.value;
							flag = true;
							Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward;
							try
							{
								val3.Hit(shovelHitForce, forward, previousPlayerHeldBy, true);
								Plugin.logger.LogMessage((object)"Hit something living!, rolling for heal");
								Plugin.logger.LogMessage((object)$"Health Before : {previousPlayerHeldBy.health}");
								if (value <= chanceToHeal)
								{
									Plugin.logger.LogMessage((object)$"randValue was {value} so you got healed!");
									previousPlayerHeldBy.health = Mathf.Clamp(previousPlayerHeldBy.health + 20, 0, 100);
									HUDManager.Instance.UpdateHealthUI(previousPlayerHeldBy.health, true);
									Plugin.logger.LogMessage((object)$"Health After : {previousPlayerHeldBy.health}");
								}
								else
								{
									Plugin.logger.LogMessage((object)$"randValue was {value} so you didnt heal");
								}
							}
							catch (Exception arg)
							{
								Debug.Log((object)$"Exception caught when hitting object with shovel from player #{previousPlayerHeldBy.playerClientId}: {arg}");
							}
							continue;
						}
					}
					val2 = objectsHitByShovelList[i];
					Vector3 point = ((RaycastHit)(ref val2)).point;
					val2 = objectsHitByShovelList[i];
					val = point + ((RaycastHit)(ref val2)).normal * 0.01f;
					flag = true;
					val2 = objectsHitByShovelList[i];
					string tag = ((Component)((RaycastHit)(ref val2)).collider).gameObject.tag;
					for (int j = 0; j < StartOfRound.Instance.footstepSurfaces.Length; j++)
					{
						if (StartOfRound.Instance.footstepSurfaces[j].surfaceTag == tag)
						{
							shovelAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX);
							WalkieTalkie.TransmitOneShotAudio(shovelAudio, StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX, 1f);
							hitSurfaceID = j;
							break;
						}
					}
				}
			}
			if (flag)
			{
				RoundManager.PlayRandomClip(shovelAudio, hitSFX, true, 1f, 0);
				Object.FindObjectOfType<RoundManager>().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0);
				base.playerHeldBy.playerBodyAnimator.SetTrigger("shovelHit");
				HitShovelServerRpc(hitSurfaceID);
			}
		}

		[ServerRpc]
		public void HitShovelServerRpc(int hitSurfaceID)
		{
			//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
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Invalid comparison between Unknown and I4
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Invalid comparison between Unknown and I4
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: 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(327322144u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, hitSurfaceID);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 327322144u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager2 == null || !networkManager2.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager2.IsClient || networkManager2.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager2.LocalClientId)
				{
					if ((int)networkManager2.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val3 = default(ServerRpcParams);
				FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendServerRpc(2096026133u, val3, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val4, hitSurfaceID);
				((NetworkBehaviour)this).__endSendServerRpc(ref val4, 2096026133u, val3, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager2.IsServer || networkManager2.IsHost))
			{
				HitShovelClientRpc(hitSurfaceID);
			}
		}

		[ClientRpc]
		public void HitShovelClientRpc(int hitSurfaceID)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Invalid comparison between Unknown and I4
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Invalid comparison between Unknown and I4
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2271792914u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, hitSurfaceID);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2271792914u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager2 == null || !networkManager2.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager2.IsServer || networkManager2.IsHost))
			{
				ClientRpcParams val3 = default(ClientRpcParams);
				FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendClientRpc(275435223u, val3, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val4, hitSurfaceID);
				((NetworkBehaviour)this).__endSendClientRpc(ref val4, 275435223u, val3, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager2.IsClient || networkManager2.IsHost) && !((NetworkBehaviour)this).IsOwner)
			{
				RoundManager.PlayRandomClip(shovelAudio, hitSFX, true, 1f, 0);
				if (hitSurfaceID != -1)
				{
					HitSurfaceWithShovel(hitSurfaceID);
				}
			}
		}

		private void HitSurfaceWithShovel(int hitSurfaceID)
		{
			Plugin.logger.LogMessage((object)hitSurfaceID);
			shovelAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX);
			WalkieTalkie.TransmitOneShotAudio(shovelAudio, StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX, 1f);
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_HarvestersScythe()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(712244304u, new RpcReceiveHandler(__rpc_handler_712244304));
			NetworkManager.__rpc_func_table.Add(178038074u, new RpcReceiveHandler(__rpc_handler_178038074));
			NetworkManager.__rpc_func_table.Add(327322144u, new RpcReceiveHandler(__rpc_handler_327322144));
			NetworkManager.__rpc_func_table.Add(2271792914u, new RpcReceiveHandler(__rpc_handler_2271792914));
		}

		private static void __rpc_handler_712244304(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;
				((HarvestersScythe)(object)target).ReelUpSFXServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		private static void __rpc_handler_327322144(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 hitSurfaceID = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref hitSurfaceID);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((HarvestersScythe)(object)target).HitShovelServerRpc(hitSurfaceID);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2271792914(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 hitSurfaceID = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref hitSurfaceID);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((HarvestersScythe)(object)target).HitShovelClientRpc(hitSurfaceID);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "HarvestersScythe";
		}
	}
	public class LensMakersGlasses : GrabbableObject
	{
		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			Debug.Log((object)"Trying To Put ON Glasses!");
			if (((NetworkBehaviour)this).IsOwner)
			{
				base.playerHeldBy.playerBodyAnimator.SetBool("HoldMask", buttonDown);
				Debug.Log((object)"Glasses Are Being Put On");
				Debug.Log((object)$"Setting maskOn {buttonDown}");
				base.playerHeldBy.activatingItem = buttonDown;
			}
		}

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

		protected internal override string __getTypeName()
		{
			return "LensMakersGlasses";
		}
	}
	[RequireComponent(typeof(Rigidbody))]
	public class RigidBodyItem : GrabbableObject
	{
		public float gravity = 9.8f;

		internal Rigidbody rb;

		public override void Start()
		{
			rb = ((Component)this).GetComponent<Rigidbody>();
			rb.useGravity = false;
			base.itemProperties.itemSpawnsOnGround = false;
			((GrabbableObject)this).Start();
			EnablePhysics(enable: true);
		}

		public void EnablePhysics(bool enable)
		{
			for (int i = 0; i < base.propColliders.Length; i++)
			{
				if (!((Object)(object)base.propColliders[i] == (Object)null) && !((Component)base.propColliders[i]).gameObject.CompareTag("InteractTrigger") && !((Component)base.propColliders[i]).gameObject.CompareTag("DoNotSet"))
				{
					base.propColliders[i].enabled = enable;
				}
			}
			rb.isKinematic = !enable;
		}

		public override void Update()
		{
			base.fallTime = 1f;
			base.reachedFloorTarget = true;
			bool isHeld = base.isHeld;
			base.isHeld = true;
			((GrabbableObject)this).Update();
			base.isHeld = isHeld;
		}

		public void FixedUpdate()
		{
			//IL_005e: 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_0048: Unknown result type (might be due to invalid IL or missing references)
			if (((NetworkBehaviour)this).IsHost)
			{
				if (!rb.isKinematic && !base.isHeld)
				{
					rb.useGravity = false;
					rb.AddForce(Vector3.down * gravity, (ForceMode)5);
				}
				else
				{
					rb.AddForce(Vector3.zero, (ForceMode)2);
				}
			}
		}

		public override void LateUpdate()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: 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_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)base.parentObject != (Object)null && base.isHeld)
			{
				((Component)this).transform.rotation = base.parentObject.rotation;
				((Component)this).transform.Rotate(base.itemProperties.rotationOffset);
				((Component)this).transform.position = base.parentObject.position;
				Vector3 positionOffset = base.itemProperties.positionOffset;
				positionOffset = base.parentObject.rotation * positionOffset;
				Transform transform = ((Component)this).transform;
				transform.position += positionOffset;
			}
			if ((Object)(object)base.radarIcon != (Object)null)
			{
				base.radarIcon.position = ((Component)this).transform.position;
			}
		}

		public override void FallWithCurve()
		{
		}

		public void FallToGround(bool randomizePosition = false)
		{
		}

		public override void EquipItem()
		{
			((GrabbableObject)this).EquipItem();
			((Component)this).transform.SetParent((Transform)null, true);
		}

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

		protected internal override string __getTypeName()
		{
			return "RigidBodyItem";
		}
	}
	public class RootMarker : MonoBehaviour
	{
		public Transform root;
	}
	[ExecuteAlways]
	public class StickyBombRB : RigidBodyItem
	{
		private PlayerControllerB playerThrownBy;

		public Transform throwDirection;

		public float throwForce = 10f;

		public int explosionDamage = 200;

		private float t = 0f;

		public float fuseTimerLength = 5f;

		private float fuseTimer = 0f;

		public bool isThrown = false;

		public bool hasBeenThrownByActivation = false;

		private NetworkVariable<Vector3> throwDir = new NetworkVariable<Vector3>(Vector3.zero, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1);

		private NetworkVariable<bool> isKinematic = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		private NetworkVariable<bool> Explode = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1);

		public AudioClip StickSound;

		public AudioClip TickDownSound;

		public AudioSource audioSource;

		public GameObject trackingPoint;

		public BoxCollider collider;

		public List<PlayerControllerB> players;

		public bool countdownFinished = false;

		private void Awake()
		{
		}

		public override void Start()
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			base.Start();
			if (((NetworkBehaviour)this).IsHost)
			{
				rb.isKinematic = false;
				rb.AddForce(throwDirection.forward * throwForce, (ForceMode)1);
				t = 0f;
				isThrown = true;
			}
			ThrowStickyBombServerRpc(throwDirection.forward);
			collider = ((Component)this).GetComponent<BoxCollider>();
		}

		public override void EquipItem()
		{
			base.EquipItem();
			isThrown = false;
			rb.isKinematic = false;
			t = 0f;
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			playerThrownBy = ((GrabbableObject)this).playerHeldBy;
			if (((NetworkBehaviour)this).IsOwner)
			{
				Plugin.logger.LogInfo((object)$"playerThrownBy = {playerThrownBy.actualClientId} and playerHeldBy = {((GrabbableObject)this).playerHeldBy.actualClientId} ");
				PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy;
				Vector3 val = default(Vector3);
				playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, val, true);
				rb.isKinematic = false;
				Plugin.logger.LogMessage((object)"Forward {throwDirection.forward}");
				Plugin.logger.LogMessage((object)throwDir.Value);
				throwDir.Value = throwDirection.forward;
				RaycastHit val2 = default(RaycastHit);
				if (Physics.Raycast(((Component)playerThrownBy.gameplayCamera).transform.position, ((Component)playerThrownBy.gameplayCamera).transform.forward, ref val2, 100f, 11012424, (QueryTriggerInteraction)1))
				{
					Plugin.logger.LogMessage((object)$"game object layer = {((Component)this).gameObject.layer}");
					NetworkVariable<Vector3> obj = throwDir;
					val = ((RaycastHit)(ref val2)).point - throwDirection.position;
					obj.Value = ((Vector3)(ref val)).normalized;
				}
				hasBeenThrownByActivation = true;
				ThrowStickyBombServerRpc(throwDir.Value);
				DetonateWithCountdownServerRPC();
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void ThrowStickyBombServerRpc(Vector3 throwDir)
		{
			//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_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: 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(2003031787u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref throwDir);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2003031787u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					t = 0f;
					rb.isKinematic = false;
					isThrown = true;
					Plugin.logger.LogMessage((object)$"Throwing sticky bomb with velocity: {throwDir * throwForce}");
					rb.AddForce(throwDir * throwForce, (ForceMode)1);
				}
			}
		}

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

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

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

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

		public IEnumerator DetonateWithCountdown()
		{
			audioSource.PlayOneShot(TickDownSound);
			yield return (object)new WaitForSeconds(fuseTimerLength);
			countdownFinished = true;
			if (hasBeenThrownByActivation)
			{
				Explode.Value = true;
			}
		}

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

		[ClientRpc]
		public void ExplosionClientRPC()
		{
			//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_00c7: 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(4131351315u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4131351315u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Utilities.CreateExplosion(trackingPoint.transform.position, spawnExplosionEffect: true, explosionDamage, 0f, 6.4f, 6, (CauseOfDeath)3);
				}
			}
		}

		public override void Update()
		{
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			if (isKinematic.Value != rb.isKinematic && !((NetworkBehaviour)this).IsHost)
			{
				rb.isKinematic = isKinematic.Value;
			}
			else if (((NetworkBehaviour)this).IsHost && rb.isKinematic != isKinematic.Value)
			{
				Plugin.logger.LogMessage((object)$"rb.isKinematic = {rb.isKinematic} and isKinematic.value = {isKinematic.Value}");
				isKinematic.Value = rb.isKinematic;
			}
			if (isKinematic.Value)
			{
				((Collider)collider).isTrigger = true;
			}
			else
			{
				((Collider)collider).isTrigger = false;
			}
			if (((NetworkBehaviour)this).IsHost)
			{
				if (rb.isKinematic && !((GrabbableObject)this).isHeld)
				{
					rb.position = trackingPoint.transform.position;
					rb.rotation = trackingPoint.transform.rotation;
				}
				if (isThrown)
				{
					Vector3 velocity = rb.velocity;
					if (((Vector3)(ref velocity)).magnitude > 0.1f)
					{
						((Component)this).transform.LookAt(((Component)this).transform.position + rb.velocity);
					}
					else
					{
						rb.isKinematic = false;
						rb.AddForce(throwDirection.forward * throwForce, (ForceMode)1);
					}
					t += Time.deltaTime;
					if (t > 5f)
					{
						isThrown = false;
						rb.isKinematic = true;
					}
					RaycastHit val = default(RaycastHit);
					if (Physics.SphereCast(throwDirection.position, 0.01f, ((Component)this).transform.forward, ref val, 0.01f, 11012424, (QueryTriggerInteraction)1))
					{
						Transform transform = ((RaycastHit)(ref val)).transform;
						if (((Object)(object)playerThrownBy != (Object)null && ((Object)(object)transform == (Object)(object)((Component)playerThrownBy).transform || transform.IsChildOf(((Component)playerThrownBy).transform))) || (Object)(object)((Component)transform).GetComponent<StickyBombRB>() != (Object)null || (Object)(object)((Component)transform).GetComponentInParent<StickyBombRB>() != (Object)null)
						{
							return;
						}
						TryParent(((RaycastHit)(ref val)).collider);
						Plugin.logger.LogMessage((object)$"(1) Hit target ({transform}) wawa!!! Layer: ({((Component)transform).gameObject.layer})");
						PlayStickyBombHitSoundServerRpc();
						isThrown = false;
						rb.isKinematic = true;
					}
				}
				if (Explode.Value)
				{
					ExplosionServerRPC();
					if (((NetworkBehaviour)this).IsServer)
					{
						((Component)this).GetComponent<NetworkObject>().Despawn(true);
					}
				}
			}
			base.Update();
		}

		public void TryParent(Collider collider)
		{
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Expected O, but got Unknown
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Expected O, but got Unknown
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			RootMarker component = ((Component)collider).GetComponent<RootMarker>();
			if ((Object)(object)component != (Object)null)
			{
				Transform root = component.root;
				if ((Object)(object)((Component)root).GetComponent<StickyBombRB>() != (Object)null || (Object)(object)((Component)root).GetComponentInParent<StickyBombRB>() != (Object)null || ((Object)root).name == "StickyBombTrackingPoint")
				{
					SetParent(((Component)collider).transform);
				}
				Transform val = root;
				float num = Vector3.Distance(((Component)this).transform.position, val.position);
				foreach (Transform item in root)
				{
					Transform val2 = item;
					if (!((Object)(object)((Component)val2).GetComponent<StickyBombRB>() != (Object)null) && !(((Object)val2).name == "StickyBombTrackingPoint"))
					{
						float num2 = Vector3.Distance(((Component)this).transform.position, val2.position);
						if (num2 < num)
						{
							val = val2;
							num = num2;
						}
					}
				}
				SetParent(val);
			}
			else
			{
				bool flag = false;
				Transform val3 = ((Component)collider).transform;
				while (!flag && !((Object)(object)val3 == (Object)null))
				{
					if (Object.op_Implicit((Object)(object)((Component)val3).GetComponent<PlayerControllerB>()))
					{
						flag = true;
					}
					else
					{
						val3 = val3.parent;
					}
				}
				if (!flag)
				{
					SetParent(((Component)collider).transform);
				}
				else
				{
					Transform val4 = val3;
					float num3 = Vector3.Distance(((Component)this).transform.position, val4.position);
					foreach (Transform item2 in val3)
					{
						Transform val5 = item2;
						if (!((Object)(object)((Component)val5).GetComponent<StickyBombRB>() != (Object)null) && !(((Object)val5).name == "StickyBombTrackingPoint"))
						{
							float num4 = Vector3.Distance(((Component)this).transform.position, val5.position);
							if (num4 < num3)
							{
								val4 = val5;
								num3 = num4;
							}
						}
					}
					SetParent(val4);
				}
			}
			isKinematic.Value = true;
			rb.isKinematic = true;
			Plugin.logger.LogMessage((object)$"Parented to: {((Component)this).transform.parent}");
		}

		public void SetParent(Transform parent)
		{
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			Plugin.logger.LogInfo((object)("Setting parent to: " + ((Object)parent).name));
			if ((Object)(object)trackingPoint == (Object)null)
			{
				trackingPoint = new GameObject();
				((Object)trackingPoint).name = "StickyBombTrackingPoint";
				trackingPoint.transform.SetParent(parent);
				trackingPoint.transform.position = ((Component)this).transform.position;
				trackingPoint.transform.rotation = ((Component)this).transform.rotation;
			}
			else
			{
				trackingPoint.transform.SetParent(parent);
				trackingPoint.transform.position = ((Component)this).transform.position;
				trackingPoint.transform.rotation = ((Component)this).transform.rotation;
			}
		}

		public override void OnDestroy()
		{
			((NetworkBehaviour)this).OnDestroy();
			if ((Object)(object)trackingPoint != (Object)null)
			{
				Object.Destroy((Object)(object)trackingPoint);
			}
		}

		public void OnTriggerEnter(Collider collision)
		{
			if (((NetworkBehaviour)this).IsHost && !collision.isTrigger && (Object)(object)((Component)collision).gameObject.GetComponent<StickyBombRB>() == (Object)null && (Object)(object)((Component)collision).gameObject.GetComponentInParent<StickyBombRB>() == (Object)null && isThrown)
			{
				Transform transform = ((Component)collision).transform;
				Plugin.logger.LogMessage((object)$"(2) Hit target ({transform}) wawa!!! Layer: ({((Component)transform).gameObject.layer})");
				if (!((Object)(object)playerThrownBy != (Object)null) || (!((Object)(object)transform == (Object)(object)((Component)playerThrownBy).transform) && !transform.IsChild