Decompiled source of MoreItems v8.7.0

plugins/MoreItems/MoreItems.dll

Decompiled 3 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using MoreItems.Behaviours;
using MoreItems.NetcodePatcher;
using Unity.Netcode;
using UnityEngine;

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

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace MoreItems
{
	[BepInPlugin("LeoLR.MoreItems", "MoreItems", "8.7.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const string guid = "LeoLR.MoreItems";

		private const string name = "MoreItems";

		private const string version = "8.7.0";

		private Harmony harmony = new Harmony("LeoLR.MoreItems");

		public static Plugin instance;

		public AssetBundle bundle;

		private void Awake()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
			instance = this;
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "moreitems");
			bundle = AssetBundle.LoadFromFile(text);
			Item val = bundle.LoadAsset<Item>("Assets/Dynamite/DynamiteItem.asset");
			((GrabbableObject)val.spawnPrefab.AddComponent<DynamiteBehaviour>()).itemProperties = val;
			Utilities.FixMixerGroups(val.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
			TerminalNode val2 = ScriptableObject.CreateInstance<TerminalNode>();
			val2.clearPreviousText = true;
			val2.displayText = "Explodes after a few seconds";
			Items.RegisterShopItem(val, (TerminalNode)null, (TerminalNode)null, val2, 50);
			Item val3 = bundle.LoadAsset<Item>("Assets/Karma/KarmaItem.asset");
			((GrabbableObject)val3.spawnPrefab.AddComponent<KarmaBehaviour>()).itemProperties = val3;
			Utilities.FixMixerGroups(val3.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val3.spawnPrefab);
			TerminalNode val4 = ScriptableObject.CreateInstance<TerminalNode>();
			val4.clearPreviousText = true;
			val4.displayText = "A massive railgun, requires battery to fire and has a charge time";
			Items.RegisterShopItem(val3, (TerminalNode)null, (TerminalNode)null, val4, 500);
			Item val5 = bundle.LoadAsset<Item>("Assets/Sypo/SypoItem.asset");
			((GrabbableObject)val5.spawnPrefab.AddComponent<SypoBehaviour>()).itemProperties = val5;
			Utilities.FixMixerGroups(val5.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val5.spawnPrefab);
			Items.RegisterScrap(val5, 15, (LevelTypes)(-1));
			Item val6 = bundle.LoadAsset<Item>("Assets/Minikit/MinikitItem.asset");
			Utilities.FixMixerGroups(val6.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val6.spawnPrefab);
			Items.RegisterScrap(val6, 15, (LevelTypes)(-1));
			Item val7 = bundle.LoadAsset<Item>("Assets/GravityCoil/GravityCoilItem.asset");
			((GrabbableObject)val7.spawnPrefab.AddComponent<GravityCoilBehaviour>()).itemProperties = val7;
			Utilities.FixMixerGroups(val7.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val7.spawnPrefab);
			Items.RegisterScrap(val7, 15, (LevelTypes)(-1));
			Item val8 = bundle.LoadAsset<Item>("Assets/FramedPic/FramedPicItem.asset");
			((GrabbableObject)val8.spawnPrefab.AddComponent<FramedPicBehaviour>()).itemProperties = val8;
			Utilities.FixMixerGroups(val8.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val8.spawnPrefab);
			Items.RegisterScrap(val8, 15, (LevelTypes)(-1));
			Item val9 = bundle.LoadAsset<Item>("Assets/Phone/PhoneItem.asset");
			((GrabbableObject)val9.spawnPrefab.AddComponent<PhoneBehaviour>()).itemProperties = val9;
			Utilities.FixMixerGroups(val9.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val9.spawnPrefab);
			Items.RegisterScrap(val9, 15, (LevelTypes)(-1));
			Item val10 = bundle.LoadAsset<Item>("Assets/SlapHand/SlapHandItem.asset");
			((GrabbableObject)val10.spawnPrefab.AddComponent<SlapHandBehaviour>()).itemProperties = val10;
			Utilities.FixMixerGroups(val10.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val10.spawnPrefab);
			Items.RegisterScrap(val10, 15, (LevelTypes)(-1));
			Item val11 = bundle.LoadAsset<Item>("Assets/Adrenaline/AdrenalineItem.asset");
			((GrabbableObject)val11.spawnPrefab.AddComponent<AdrenalineBehaviour>()).itemProperties = val11;
			Utilities.FixMixerGroups(val11.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val11.spawnPrefab);
			TerminalNode val12 = ScriptableObject.CreateInstance<TerminalNode>();
			val12.clearPreviousText = true;
			val12.displayText = "Gives a temporary speed and stamina boost (stackable)";
			Items.RegisterShopItem(val11, (TerminalNode)null, (TerminalNode)null, val12, 35);
			Item val13 = bundle.LoadAsset<Item>("Assets/BananaPeel/BananaItem.asset");
			((GrabbableObject)val13.spawnPrefab.AddComponent<BananaBehaviour>()).itemProperties = val13;
			Utilities.FixMixerGroups(val13.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val13.spawnPrefab);
			Items.RegisterScrap(val13, 15, (LevelTypes)(-1));
			Item val14 = bundle.LoadAsset<Item>("Assets/Bottle/BottleItem.asset");
			((GrabbableObject)val14.spawnPrefab.AddComponent<BottleBehaviour>()).itemProperties = val14;
			Utilities.FixMixerGroups(val14.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val14.spawnPrefab);
			Items.RegisterScrap(val14, 15, (LevelTypes)(-1));
			harmony.PatchAll();
		}
	}
	internal class Utils
	{
		public static AudioSource getAudioSource(GameObject go, string rootNodeName, string gameObjectName)
		{
			return ((Component)go.transform.Find(rootNodeName).Find(gameObjectName)).gameObject.GetComponent<AudioSource>();
		}

		public static ParticleSystem getParticleSystem(GameObject go, string rootNodeName, string gameObjectName)
		{
			return ((Component)go.transform.Find(rootNodeName).Find(gameObjectName)).gameObject.GetComponent<ParticleSystem>();
		}

		public static Dictionary<string, ParticleSystem> getAllParticleSystems(GameObject go, string rootNodeName, string[] gameObjectsName)
		{
			Dictionary<string, ParticleSystem> dictionary = new Dictionary<string, ParticleSystem>();
			foreach (string text in gameObjectsName)
			{
				dictionary.Add(text, getParticleSystem(go, rootNodeName, text));
			}
			return dictionary;
		}

		public static Dictionary<string, AudioSource> getAllAudioSources(GameObject go, string rootNodeName, string[] gameObjectsName)
		{
			Dictionary<string, AudioSource> dictionary = new Dictionary<string, AudioSource>();
			foreach (string text in gameObjectsName)
			{
				dictionary.Add(text, getAudioSource(go, rootNodeName, text));
			}
			return dictionary;
		}

		public static void destroyObj(GameObject go, string obj)
		{
			try
			{
				Object.Destroy((Object)(object)((Component)go.transform.Find(obj)).gameObject);
			}
			catch
			{
				Debug.LogError((object)("Cannot destroy " + obj));
			}
		}

		public static void Explode(GameObject go, float radius, float baseDamage, float distanceInfluencedDamage, bool increaseHeightForLinecast = false)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: 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_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: 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_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: 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_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: 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_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			int mask = LayerMask.GetMask(new string[2] { "Player", "Enemies" });
			List<int> list = new List<int>();
			Collider[] array = Physics.OverlapSphere(go.transform.position, radius, mask);
			Collider[] array2 = array;
			foreach (Collider val in array2)
			{
				PlayerControllerB component = ((Component)val).GetComponent<PlayerControllerB>();
				GameObject playerColliderGameObject = ((Component)val).gameObject;
				Transform enemyColliderRoot = ((Component)val).transform.root;
				if ((Object)(object)component != (Object)null && !list.Exists((int i) => i == ((Object)playerColliderGameObject).GetInstanceID()))
				{
					list.Add(((Object)playerColliderGameObject).GetInstanceID());
					if (!Physics.Linecast(((Component)component).transform.position + Vector3.up * 0.5f, go.transform.position + Vector3.up * (increaseHeightForLinecast ? 0.5f : 0f), StartOfRound.Instance.collidersAndRoomMaskAndDefault) && component.playerClientId == GameNetworkManager.Instance.localPlayerController.playerClientId)
					{
						float num = Vector3.Distance(((Component)component).transform.position + Vector3.up * 0.5f, go.transform.position);
						float num2 = distanceInfluencedDamage / num + baseDamage;
						component.DamagePlayer((int)num2, true, true, (CauseOfDeath)3, 0, false, default(Vector3));
					}
				}
				EnemyAI component2 = ((Component)enemyColliderRoot).GetComponent<EnemyAI>();
				if (!((Object)(object)component2 != (Object)null) || list.Exists((int i) => i == ((Object)((Component)enemyColliderRoot).gameObject).GetInstanceID()))
				{
					continue;
				}
				list.Add(((Object)((Component)enemyColliderRoot).gameObject).GetInstanceID());
				if (!Physics.Linecast(((Component)component2).transform.position + Vector3.up * 0.5f, go.transform.position + Vector3.up * (increaseHeightForLinecast ? 0.5f : 0f), StartOfRound.Instance.collidersAndRoomMaskAndDefault))
				{
					if ((Object)(object)component2.creatureVoice != (Object)null && (Object)(object)component2.dieSFX != (Object)null)
					{
						component2.creatureVoice.PlayOneShot(component2.dieSFX);
					}
					component2.KillEnemy(true);
				}
			}
			list.Clear();
		}

		public static bool frameCount(int interval)
		{
			return Time.frameCount % interval != 0;
		}

		public static bool isLocalPlayerHosting()
		{
			return ((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsHost || ((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsServer;
		}
	}
}
namespace MoreItems.Behaviours
{
	internal class AdrenalineBehaviour : GrabbableObject
	{
		private float runSpeedMultiplier = 1.5f;

		private bool triggered = false;

		private float timer = 15f;

		private PlayerControllerB playerActiveOn = null;

		private string[] sources = new string[1] { "useSFX" };

		private Dictionary<string, AudioSource> sourcesDict = new Dictionary<string, AudioSource>();

		private void Awake()
		{
			base.grabbable = true;
			base.grabbableToEnemies = true;
			sourcesDict = Utils.getAllAudioSources(((Component)this).gameObject, "AdrSFX", sources);
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if ((Object)(object)base.playerHeldBy != (Object)null)
			{
				activateSyringeServerRpc();
			}
		}

		private IEnumerator StartTimer()
		{
			yield return (object)new WaitForSeconds(timer);
			triggered = false;
			PlayerControllerB obj = playerActiveOn;
			obj.movementSpeed /= runSpeedMultiplier;
			yield return (object)new WaitForSeconds(0.5f);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}

		public override void Update()
		{
			((GrabbableObject)this).Update();
			if (triggered && (Object)(object)playerActiveOn != (Object)null)
			{
				playerActiveOn.sprintMeter = 1f;
			}
		}

		public override void OnDestroy()
		{
			((NetworkBehaviour)this).OnDestroy();
			if ((Object)(object)playerActiveOn != (Object)null)
			{
				playerActiveOn.movementSpeed = 4.6f;
			}
		}

		public override void OnNetworkDespawn()
		{
			((NetworkBehaviour)this).OnNetworkDespawn();
			if ((Object)(object)playerActiveOn != (Object)null)
			{
				playerActiveOn.movementSpeed = 4.6f;
			}
		}

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

		[ClientRpc]
		private void activateSyringeClientRpc()
		{
			//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(404489912u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 404489912u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					sourcesDict["useSFX"].Play();
					playerActiveOn = base.playerHeldBy;
					PlayerControllerB obj = playerActiveOn;
					obj.movementSpeed *= runSpeedMultiplier;
					playerActiveOn.health = 100;
					((GrabbableObject)this).DestroyObjectInHand(playerActiveOn);
					base.grabbable = false;
					base.grabbableToEnemies = false;
					triggered = true;
					Utils.destroyObj(((Component)this).gameObject, "SyringeBody");
					((MonoBehaviour)this).StartCoroutine(StartTimer());
				}
			}
		}

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

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

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

		private static void __rpc_handler_404489912(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;
				((AdrenalineBehaviour)(object)target).activateSyringeClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "AdrenalineBehaviour";
		}
	}
	internal class BananaBehaviour : GrabbableObject
	{
		private string[] sources = new string[1] { "slipSFX" };

		private Dictionary<string, AudioSource> sourcesDict = new Dictionary<string, AudioSource>();

		private List<PlayerControllerB> playerSlipping = new List<PlayerControllerB>();

		private Vector2 forwardVector = new Vector2(0f, 1f);

		private List<EnemyAI> enemySlipping = new List<EnemyAI>();

		private float slipTime = 3f;

		private void Awake()
		{
			base.grabbable = true;
			base.grabbableToEnemies = true;
			sourcesDict = Utils.getAllAudioSources(((Component)this).gameObject, "BananaSFX", sources);
		}

		public override void Update()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: 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)
			((GrabbableObject)this).Update();
			if (Utils.frameCount(20) || Object.op_Implicit((Object)(object)base.playerHeldBy))
			{
				return;
			}
			int mask = LayerMask.GetMask(new string[2] { "Player", "Enemies" });
			Collider[] array = Physics.OverlapSphere(((Component)this).gameObject.transform.position + Vector3.up * 0.1f, 0.5f, mask);
			Collider[] array2 = array;
			foreach (Collider val in array2)
			{
				PlayerControllerB player = ((Component)val).GetComponent<PlayerControllerB>();
				if ((Object)(object)player != (Object)null && !playerSlipping.Exists((PlayerControllerB i) => i.playerClientId == player.playerClientId) && player.moveInputVector != Vector2.zero)
				{
					playerSlipping.Add(player);
					((MonoBehaviour)this).StartCoroutine(TriggerSlip(player));
				}
			}
		}

		private IEnumerator TriggerSlip(PlayerControllerB player)
		{
			float timer = 0f;
			playSlipSoundServerRpc();
			player.disableMoveInput = true;
			Vector3 camera = ((Component)player.gameplayCamera).transform.forward;
			Vector3 val = new Vector3(camera.x, 0f, camera.z);
			Vector3 forward = ((Vector3)(ref val)).normalized;
			Vector2 moveVector = player.moveInputVector;
			float angle = Vector3.Angle(Vector2.op_Implicit(forwardVector), Vector2.op_Implicit(moveVector));
			if (moveVector.x < 0f || moveVector.y < 0f)
			{
				angle *= -1f;
			}
			Vector3 direction = Quaternion.Euler(0f, angle, 0f) * forward;
			float forceMult = player.movementSpeed * 2f;
			while (timer < slipTime)
			{
				player.externalForces = direction * forceMult;
				timer += Time.fixedDeltaTime;
				yield return (object)new WaitForEndOfFrame();
			}
			playerSlipping.Remove(player);
			player.disableMoveInput = false;
		}

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

		[ClientRpc]
		private void playSlipSoundClientRpc()
		{
			//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(948241539u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 948241539u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					sourcesDict["slipSFX"].Play();
				}
			}
		}

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

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

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

		private static void __rpc_handler_948241539(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;
				((BananaBehaviour)(object)target).playSlipSoundClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "BananaBehaviour";
		}
	}
	internal class BottleBehaviour : GrabbableObject
	{
		private string[] sources = new string[1] { "drinkSFX" };

		private Dictionary<string, AudioSource> sourcesDict = new Dictionary<string, AudioSource>();

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

		private bool drinking = false;

		private bool destroyedOnClient = false;

		private void Awake()
		{
			base.grabbable = true;
			base.grabbableToEnemies = true;
			sourcesDict = Utils.getAllAudioSources(((Component)this).gameObject, "BottleSFX", sources);
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (!empty.Value && !drinking)
			{
				drinking = true;
				drinkServerRpc();
			}
		}

		private void FixedUpdate()
		{
			if (!Utils.frameCount(20) && !destroyedOnClient && empty.Value)
			{
				Utils.destroyObj(((Component)this).gameObject, "liquid");
				destroyedOnClient = true;
			}
		}

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

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

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

		private IEnumerator Drink()
		{
			base.playerHeldBy.activatingItem = true;
			base.playerHeldBy.playerBodyAnimator.SetBool("useTZPItem", true);
			sourcesDict["drinkSFX"].Play();
			((MonoBehaviour)this).StartCoroutine(DrinkAnimation(new Vector3(0.1f, 0.15f, 0.25f), new Vector3(120f, 100f, -95f)));
			yield return (object)new WaitForSeconds(4f);
			base.playerHeldBy.drunkness = 1f;
			base.playerHeldBy.drunknessSpeed = 0.35f;
			base.playerHeldBy.activatingItem = false;
			base.playerHeldBy.playerBodyAnimator.SetBool("useTZPItem", false);
			Utils.destroyObj(((Component)this).gameObject, "liquid");
			destroyedOnClient = true;
			((MonoBehaviour)this).StartCoroutine(DrinkAnimation(new Vector3(-0.15f, 0.08f, 0f), new Vector3(120f, 0f, -95f), 3f));
			emptyBottleServerRpc();
			drinking = false;
		}

		private IEnumerator DrinkAnimation(Vector3 targetPos, Vector3 targetRot, float multiplier = 1f)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			while (base.itemProperties.positionOffset != targetPos || base.itemProperties.rotationOffset != targetRot)
			{
				base.itemProperties.positionOffset = Vector3.MoveTowards(base.itemProperties.positionOffset, targetPos, Time.deltaTime * multiplier);
				base.itemProperties.rotationOffset = Vector3.MoveTowards(base.itemProperties.rotationOffset, targetRot, Time.deltaTime * 1000f);
				yield return (object)new WaitForEndOfFrame();
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_BottleBehaviour()
		{
			//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(3850970635u, new RpcReceiveHandler(__rpc_handler_3850970635));
			NetworkManager.__rpc_func_table.Add(1269875293u, new RpcReceiveHandler(__rpc_handler_1269875293));
			NetworkManager.__rpc_func_table.Add(2141237889u, new RpcReceiveHandler(__rpc_handler_2141237889));
		}

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

		private static void __rpc_handler_1269875293(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;
				((BottleBehaviour)(object)target).drinkClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		protected internal override string __getTypeName()
		{
			return "BottleBehaviour";
		}
	}
	internal class DynamiteBehaviour : GrabbableObject
	{
		public Ray grenadeThrowRay;

		public RaycastHit grenadeHit;

		private float explodeTimer = 0f;

		private float timeToExplode = 5f;

		private int interval = 10;

		private AudioSource MeshBurnSFX;

		private AudioSource ExplosionSFX;

		private AudioSource EarRingSFX;

		private ParticleSystem MeshSmoke;

		private ParticleSystem LingeringFire;

		private ParticleSystem MainBlast;

		private ParticleSystem Smoke;

		private bool active = false;

		private void Awake()
		{
			base.grabbable = true;
			base.grabbableToEnemies = true;
			MeshBurnSFX = Utils.getAudioSource(((Component)this).gameObject, "DynamiteSFX", "MeshBurnSFX");
			ExplosionSFX = Utils.getAudioSource(((Component)this).gameObject, "DynamiteSFX", "ExplosionSFX");
			EarRingSFX = Utils.getAudioSource(((Component)this).gameObject, "DynamiteSFX", "EarRingSFX");
			MeshSmoke = Utils.getParticleSystem(((Component)this).gameObject, "DynamiteParticles", "MeshSmoke");
			LingeringFire = Utils.getParticleSystem(((Component)this).gameObject, "DynamiteParticles", "LingeringFire");
			MainBlast = Utils.getParticleSystem(((Component)this).gameObject, "DynamiteParticles", "MainBlast");
			Smoke = Utils.getParticleSystem(((Component)this).gameObject, "DynamiteParticles", "Smoke");
		}

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

		[ClientRpc]
		private void startDynamiteBurnClientRpc()
		{
			//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(1004844402u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1004844402u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					MeshBurnSFX.Play();
					WalkieTalkie.TransmitOneShotAudio(MeshBurnSFX, MeshBurnSFX.clip, 1f);
					MeshSmoke.Play();
					Utils.destroyObj(((Component)this).gameObject, "Mesh");
				}
			}
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (!((Object)(object)base.playerHeldBy != (Object)null))
			{
				return;
			}
			if (!active)
			{
				active = true;
				if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer)
				{
					startDynamiteBurnClientRpc();
				}
				else
				{
					startDynamiteBurnServerRpc();
				}
			}
			else
			{
				base.playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, GetGrenadeThrowDestination(), true);
			}
		}

		public override void PocketItem()
		{
			((GrabbableObject)this).PocketItem();
			editMeshAnimServerRpc(active: false);
		}

		public override void EquipItem()
		{
			((GrabbableObject)this).EquipItem();
			if (active)
			{
				editMeshAnimServerRpc(active: true);
			}
		}

		public override void Update()
		{
			((GrabbableObject)this).Update();
			if (Utils.frameCount(interval) || !active)
			{
				return;
			}
			if (explodeTimer > timeToExplode)
			{
				active = false;
				if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer)
				{
					ExplodeDynamiteClientRpc();
				}
				else
				{
					ExplodeDynamiteServerRpc();
				}
			}
			explodeTimer += Time.deltaTime * (float)interval;
		}

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

		[ClientRpc]
		public void ExplodeDynamiteClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3225364544u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3225364544u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				base.grabbable = false;
				base.grabbableToEnemies = false;
				MeshBurnSFX.Stop();
				MeshSmoke.Stop();
				ExplosionSFX.Play();
				WalkieTalkie.TransmitOneShotAudio(ExplosionSFX, ExplosionSFX.clip, 1f);
				MainBlast.Play();
				LingeringFire.Play();
				Smoke.Play();
				explodeTimer = 0f;
				Utils.Explode(((Component)this).gameObject, 8f, 50f, 300f, (Object)(object)base.playerHeldBy == (Object)null);
				if ((Object)(object)base.playerHeldBy != (Object)null)
				{
					((GrabbableObject)this).DestroyObjectInHand(base.playerHeldBy);
				}
				Utils.destroyObj(((Component)this).gameObject, "Base");
				Object.Destroy((Object)(object)((Component)this).gameObject, ExplosionSFX.clip.length);
			}
		}

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

		[ClientRpc]
		private void editMeshAnimClientRpc(bool active)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3393819655u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref active, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3393819655u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (active)
				{
					MeshSmoke.Play();
				}
				else
				{
					MeshSmoke.Stop();
				}
			}
		}

		public Vector3 GetGrenadeThrowDestination()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: 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_00c7: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: 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)
			Debug.DrawRay(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)base.playerHeldBy.gameplayCamera).transform.forward, Color.yellow, 15f);
			grenadeThrowRay = new Ray(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)base.playerHeldBy.gameplayCamera).transform.forward);
			Vector3 val = ((!Physics.Raycast(grenadeThrowRay, ref grenadeHit, 12f, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) ? ((Ray)(ref grenadeThrowRay)).GetPoint(10f) : ((Ray)(ref grenadeThrowRay)).GetPoint(((RaycastHit)(ref grenadeHit)).distance - 0.05f));
			Debug.DrawRay(val, Vector3.down, Color.blue, 15f);
			grenadeThrowRay = new Ray(val, Vector3.down);
			return (!Physics.Raycast(grenadeThrowRay, ref grenadeHit, 30f, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) ? ((Ray)(ref grenadeThrowRay)).GetPoint(30f) : (((RaycastHit)(ref grenadeHit)).point + Vector3.up * 0.05f);
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_DynamiteBehaviour()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(347468879u, new RpcReceiveHandler(__rpc_handler_347468879));
			NetworkManager.__rpc_func_table.Add(1004844402u, new RpcReceiveHandler(__rpc_handler_1004844402));
			NetworkManager.__rpc_func_table.Add(4084733013u, new RpcReceiveHandler(__rpc_handler_4084733013));
			NetworkManager.__rpc_func_table.Add(3225364544u, new RpcReceiveHandler(__rpc_handler_3225364544));
			NetworkManager.__rpc_func_table.Add(2021433102u, new RpcReceiveHandler(__rpc_handler_2021433102));
			NetworkManager.__rpc_func_table.Add(3393819655u, new RpcReceiveHandler(__rpc_handler_3393819655));
		}

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

		private static void __rpc_handler_1004844402(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;
				((DynamiteBehaviour)(object)target).startDynamiteBurnClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		private static void __rpc_handler_3225364544(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;
				((DynamiteBehaviour)(object)target).ExplodeDynamiteClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

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

		protected internal override string __getTypeName()
		{
			return "DynamiteBehaviour";
		}
	}
	internal class FramedPicBehaviour : GrabbableObject
	{
		private string[] possiblePhotos = new string[6] { "Pigeon", "Toto", "Prospector", "Boowomp", "Gambling", "ManMug" };

		private NetworkVariable<int> index = new NetworkVariable<int>(-1, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		private MeshRenderer picture;

		private Transform listOfPossiblePhotos;

		private void Awake()
		{
			base.grabbable = true;
			base.grabbableToEnemies = true;
			picture = ((Component)((Component)this).transform.Find("Photo")).GetComponent<MeshRenderer>();
			listOfPossiblePhotos = ((Component)this).transform.Find("PossiblePhotoMaterials");
		}

		public void FixedUpdate()
		{
			if (Utils.frameCount(100))
			{
				return;
			}
			if (index.Value == -1 && Utils.isLocalPlayerHosting())
			{
				SetIndexServerRpc();
				return;
			}
			try
			{
				((Renderer)picture).material = ((Renderer)((Component)listOfPossiblePhotos.Find(possiblePhotos[index.Value])).GetComponent<MeshRenderer>()).material;
			}
			catch
			{
				Debug.LogError((object)"Cannot set picture material");
			}
		}

		[ServerRpc(RequireOwnership = true)]
		private void SetIndexServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Invalid comparison between Unknown and I4
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1258018194u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1258018194u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				index.Value = Random.Range(0, possiblePhotos.Length - 1);
			}
		}

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

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

		private static void __rpc_handler_1258018194(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;
				((FramedPicBehaviour)(object)target).SetIndexServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "FramedPicBehaviour";
		}
	}
	internal class GravityCoilBehaviour : GrabbableObject
	{
		private string[] sources = new string[1] { "jumpSFX" };

		private Dictionary<string, AudioSource> sourcesDict = new Dictionary<string, AudioSource>();

		private float baseJumpForce = 13f;

		private float multiplier = 2f;

		private bool shouldPlayJumpSFX = false;

		private PlayerControllerB boostedPlayer = null;

		private bool active = false;

		private void Awake()
		{
			base.grabbable = true;
			base.grabbableToEnemies = true;
			sourcesDict = Utils.getAllAudioSources(((Component)this).gameObject, "CoilSFX", sources);
		}

		public override void Update()
		{
			((GrabbableObject)this).Update();
			if (!active || (Object)(object)base.playerHeldBy == (Object)null || !base.wasOwnerLastFrame || Utils.frameCount(10) || !base.playerHeldBy.thisController.isGrounded || base.playerHeldBy.inSpecialInteractAnimation || Object.op_Implicit((Object)(object)base.playerHeldBy.inAnimationWithEnemy) || base.playerHeldBy.isClimbingLadder || base.playerHeldBy.isPlayerDead || base.playerHeldBy.inTerminalMenu || base.playerHeldBy.isTypingChat || base.playerHeldBy.isCrouching)
			{
				return;
			}
			if (base.playerHeldBy.playerActions.FindAction("Jump", false).IsPressed())
			{
				if (shouldPlayJumpSFX)
				{
					shouldPlayJumpSFX = false;
					PlayJumpSFXServerRpc();
				}
			}
			else
			{
				shouldPlayJumpSFX = true;
			}
		}

		public override void OnHitGround()
		{
			((GrabbableObject)this).OnHitGround();
			defaultJump();
		}

		public override void GrabItem()
		{
			((GrabbableObject)this).GrabItem();
			boostedPlayer = base.playerHeldBy;
		}

		public override void GrabItemFromEnemy(EnemyAI enemy)
		{
			((GrabbableObject)this).GrabItemFromEnemy(enemy);
			boostedPlayer = base.playerHeldBy;
		}

		public override void PocketItem()
		{
			((GrabbableObject)this).PocketItem();
			boostedPlayer.jumpForce = baseJumpForce;
			active = false;
		}

		public override void EquipItem()
		{
			((GrabbableObject)this).EquipItem();
			boostedPlayer = base.playerHeldBy;
			boostedPlayer.jumpForce = baseJumpForce * multiplier;
			active = true;
		}

		public override void OnPlaceObject()
		{
			((GrabbableObject)this).OnPlaceObject();
			defaultJump();
		}

		public override void DestroyObjectInHand(PlayerControllerB playerHolding)
		{
			((GrabbableObject)this).DestroyObjectInHand(playerHolding);
			defaultJump(ref playerHolding);
		}

		public override void DiscardItem()
		{
			((GrabbableObject)this).DiscardItem();
			defaultJump();
		}

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

		public override void OnNetworkDespawn()
		{
			((NetworkBehaviour)this).OnNetworkDespawn();
			defaultJump();
		}

		private void defaultJump()
		{
			if (!((Object)(object)boostedPlayer == (Object)null))
			{
				boostedPlayer.jumpForce = baseJumpForce;
				boostedPlayer = null;
			}
		}

		private void defaultJump(ref PlayerControllerB player)
		{
			if (!((Object)(object)player == (Object)null))
			{
				player.jumpForce = baseJumpForce;
			}
		}

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

		[ClientRpc]
		private void PlayJumpSFXClientRpc()
		{
			//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(3013580887u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3013580887u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					sourcesDict["jumpSFX"].Play();
				}
			}
		}

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

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

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

		private static void __rpc_handler_3013580887(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;
				((GravityCoilBehaviour)(object)target).PlayJumpSFXClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "GravityCoilBehaviour";
		}
	}
	internal class KarmaBehaviour : GrabbableObject
	{
		private NetworkVariable<bool> coolingDown = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

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

		private float cooldown = 10f;

		private float timeSinceShot = 0f;

		private float maxChargeBeforeShooting = 2f;

		private float maxChargeBeforeExplode = 2.9f;

		private float chargeTime = 0f;

		private float energyLostPerShot = 0.5f;

		private int interval = 10;

		private bool charging = false;

		private bool activated = false;

		private bool shoot = false;

		private string[] sources = new string[8] { "ChargeSFX", "ShootSFX", "TrailSFX", "WarningSFX", "ExplosionSFX", "CooldownSFX", "CoolupSFX", "OnCdShotSFX" };

		private Dictionary<string, AudioSource> sourcesDict = new Dictionary<string, AudioSource>();

		private string[] ps = new string[4] { "MuzzleFlash", "Trail", "LingeringFire", "MainBlast" };

		private Dictionary<string, ParticleSystem> psDict = new Dictionary<string, ParticleSystem>();

		private Color readyColor = Color32.op_Implicit(new Color32((byte)20, (byte)20, (byte)20, byte.MaxValue));

		private Color shootColor = Color32.op_Implicit(new Color32((byte)20, (byte)200, (byte)20, byte.MaxValue));

		private Color dangerColor = Color32.op_Implicit(new Color32((byte)200, (byte)20, (byte)20, byte.MaxValue));

		private Color unreadyColor = Color32.op_Implicit(new Color32((byte)250, (byte)100, (byte)0, byte.MaxValue));

		private GameObject laserLight;

		private GameObject ScopeChargeTimer;

		private void Awake()
		{
			base.grabbable = true;
			base.grabbableToEnemies = true;
			sourcesDict = Utils.getAllAudioSources(((Component)this).gameObject, "KarmaSFX", sources);
			psDict = Utils.getAllParticleSystems(((Component)this).gameObject, "KarmaParticles", ps);
			ScopeChargeTimer = ((Component)((Component)this).gameObject.transform.Find("ScopeChargeTimer")).gameObject;
			laserLight = ((Component)((Component)this).gameObject.transform.Find("laserLight")).gameObject;
			base.insertedBattery.charge = 1f;
		}

		public override void PocketItem()
		{
			((GrabbableObject)this).PocketItem();
			activated = false;
			StopChargingServerRpc(hasShot: false);
			((Behaviour)laserLight.GetComponent<Light>()).enabled = false;
		}

		public override void EquipItem()
		{
			((GrabbableObject)this).EquipItem();
			((Behaviour)laserLight.GetComponent<Light>()).enabled = true;
		}

		public override void OnHitGround()
		{
			((GrabbableObject)this).OnHitGround();
			StopChargingServerRpc(hasShot: false);
			activated = false;
			if (!coolingDown.Value && base.insertedBattery.charge > 0f && !broken.Value && Utils.isLocalPlayerHosting() && Random.Range(1, 20) == 1)
			{
				ShootServerRpc();
			}
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (!((Object)(object)base.playerHeldBy != (Object)null) || base.isPocketed || !base.wasOwnerLastFrame || broken.Value)
			{
				return;
			}
			if (buttonDown)
			{
				if (!coolingDown.Value && base.insertedBattery.charge > 0f)
				{
					activated = true;
				}
				else
				{
					sourcesDict["OnCdShotSFX"].Play();
				}
			}
			else
			{
				activated = false;
			}
		}

		public override void ChargeBatteries()
		{
			((GrabbableObject)this).ChargeBatteries();
			RepairServerRpc();
		}

		public override void Update()
		{
			((GrabbableObject)this).Update();
			if (broken.Value)
			{
				return;
			}
			if (coolingDown.Value)
			{
				if (!Utils.frameCount(interval))
				{
					timeSinceShot += Time.deltaTime * (float)interval;
					if (timeSinceShot > cooldown)
					{
						ResetCooldownServerRpc();
					}
				}
			}
			else
			{
				if (!base.wasOwnerLastFrame || Utils.frameCount(interval))
				{
					return;
				}
				if (activated)
				{
					StartChargingServerRpc();
					if (chargeTime > maxChargeBeforeExplode)
					{
						ExplodeServerRpc();
					}
					chargeTime += Time.deltaTime * (float)interval;
				}
				else if (chargeTime >= maxChargeBeforeShooting && chargeTime <= maxChargeBeforeExplode)
				{
					StopChargingServerRpc(hasShot: true);
					if (!shoot)
					{
						shoot = true;
						ShootServerRpc();
					}
				}
				else
				{
					StopChargingServerRpc(hasShot: false);
				}
			}
		}

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

		[ClientRpc]
		private void ShootClientRpc()
		{
			//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_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: 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(1904272454u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1904272454u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			sourcesDict["ShootSFX"].Play();
			sourcesDict["TrailSFX"].PlayDelayed(0.1f);
			psDict["MuzzleFlash"].Play();
			psDict["Trail"].Play();
			Battery insertedBattery = base.insertedBattery;
			insertedBattery.charge -= energyLostPerShot;
			sourcesDict["CooldownSFX"].PlayDelayed(0.35f);
			changeCooldownValueServerRpc(value: true);
			((Renderer)ScopeChargeTimer.GetComponent<MeshRenderer>()).material.color = unreadyColor;
			if ((Object)(object)base.playerHeldBy != (Object)null && base.playerHeldBy.playerClientId == GameNetworkManager.Instance.localPlayerController.playerClientId)
			{
				HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
			}
			int mask = LayerMask.GetMask(new string[3] { "Player", "Enemies", "Room" });
			RaycastHit val3 = default(RaycastHit);
			if (Physics.Raycast(((Component)psDict["Trail"]).transform.position, ((Component)psDict["Trail"]).transform.forward, ref val3, float.MaxValue, mask))
			{
				PlayerControllerB component = ((Component)((RaycastHit)(ref val3)).collider).GetComponent<PlayerControllerB>();
				if ((Object)(object)component != (Object)null)
				{
					if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer)
					{
						component.DamagePlayerFromOtherClientClientRpc(100, ((Component)psDict["Trail"]).transform.forward, (int)component.playerClientId, component.health - 100);
					}
					else
					{
						component.DamagePlayerFromOtherClientServerRpc(100, ((Component)psDict["Trail"]).transform.forward, (int)component.playerClientId);
					}
				}
				EnemyAI component2 = ((Component)((Component)((RaycastHit)(ref val3)).collider).transform.root).GetComponent<EnemyAI>();
				if ((Object)(object)component2 != (Object)null)
				{
					component2.HitEnemy(100, base.playerHeldBy, true, -1);
				}
			}
			shoot = false;
		}

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

		[ClientRpc]
		private void StartChargingClientRpc()
		{
			//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_010c: 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(3561213357u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3561213357u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (!charging)
				{
					charging = true;
					sourcesDict["ChargeSFX"].Play();
				}
				if (chargeTime > maxChargeBeforeShooting)
				{
					((Renderer)ScopeChargeTimer.GetComponent<MeshRenderer>()).material.color = shootColor;
				}
			}
		}

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

		[ClientRpc]
		private void StopChargingClientRpc(bool hasShot)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: 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(1420212340u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref hasShot, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1420212340u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && charging)
			{
				charging = false;
				sourcesDict["ChargeSFX"].Stop();
				chargeTime = 0f;
				if (!hasShot)
				{
					((Renderer)ScopeChargeTimer.GetComponent<MeshRenderer>()).material.color = readyColor;
				}
			}
		}

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

		[ClientRpc]
		private void ResetCooldownClientRpc()
		{
			//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_00f6: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(207933736u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 207933736u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					timeSinceShot = 0f;
					changeCooldownValueServerRpc(value: false);
					sourcesDict["CoolupSFX"].Play();
					((Renderer)ScopeChargeTimer.GetComponent<MeshRenderer>()).material.color = readyColor;
				}
			}
		}

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

		[ClientRpc]
		private void ExplodeClientRpc()
		{
			//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_010a: 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(4122591548u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4122591548u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					activated = false;
					changeBrokenValueServerRpc(value: true);
					StopChargingServerRpc(hasShot: false);
					sourcesDict["ExplosionSFX"].Play();
					base.insertedBattery.charge = 0f;
					((Renderer)ScopeChargeTimer.GetComponent<MeshRenderer>()).material.color = dangerColor;
					psDict["LingeringFire"].Play();
					psDict["MainBlast"].Play();
					Utils.Explode(((Component)this).gameObject, 5f, 50f, 180f);
				}
			}
		}

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

		[ClientRpc]
		private void RepairClientRpc()
		{
			//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_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(463714746u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 463714746u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				changeBrokenValueServerRpc(value: false);
				if (coolingDown.Value)
				{
					((Renderer)ScopeChargeTimer.GetComponent<MeshRenderer>()).material.color = unreadyColor;
				}
				else
				{
					((Renderer)ScopeChargeTimer.GetComponent<MeshRenderer>()).material.color = readyColor;
				}
			}
		}

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

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

		protected override void __initializeVariables()
		{
			if (coolingDown == null)
			{
				throw new Exception("KarmaBe