Decompiled source of VoidLeak v1.13.1

BepInEx/plugins/TestAccount666.VoidLeak/VoidLeak.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TestAccount666.VoidLeak.NetcodePatcher;
using TestAccountCore;
using TestAccountCore.Dependencies;
using TestAccountCore.Dependencies.Compatibility;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Serialization;
using VoidLeak.NetworkBehaviours;

[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("SoulWithMae")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("AssetWarehouse had a breach. (BONELAB/BONEWORKS scrap items)")]
[assembly: AssemblyFileVersion("1.13.1")]
[assembly: AssemblyInformationalVersion("1.13.1+6aa97ef73cc53d08ae4633fa34e46ea8f2d7812b")]
[assembly: AssemblyProduct("VoidLeak")]
[assembly: AssemblyTitle("TestAccount666.VoidLeak")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.13.1.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace VoidLeak
{
	public static class DevGunConfig
	{
		public static readonly HashSet<DevGun.DevGunAction> ActionSet = new HashSet<DevGun.DevGunAction>
		{
			DevGun.DevGunAction.MULTIPLY,
			DevGun.DevGunAction.DIVIDE,
			DevGun.DevGunAction.DESTROY,
			DevGun.DevGunAction.SUBTRACT,
			DevGun.DevGunAction.ADD
		};

		private static ConfigEntry<int>? _divideWeight;

		private static ConfigEntry<int>? _multiplyWeight;

		private static ConfigEntry<int>? _destroyWeight;

		private static ConfigEntry<int>? _subtractWeight;

		private static ConfigEntry<int>? _addWeight;

		private static ConfigEntry<int>? _divideMinimum;

		private static ConfigEntry<int>? _multiplyMinimum;

		private static ConfigEntry<int>? _subtractMinimum;

		private static ConfigEntry<int>? _addMinimum;

		private static ConfigEntry<int>? _divideMaximum;

		private static ConfigEntry<int>? _multiplyMaximum;

		private static ConfigEntry<int>? _subtractMaximum;

		private static ConfigEntry<int>? _addMaximum;

		internal static void Initialize(ConfigFile configFile)
		{
			_divideWeight = configFile.Bind<int>("Dev Manipulator", "6. Divide Weight", DevGun.DevGunAction.DIVIDE.GetWeight(), "The higher the weight, the more common");
			_multiplyWeight = configFile.Bind<int>("Dev Manipulator", "7. Multiply Weight", DevGun.DevGunAction.MULTIPLY.GetWeight(), "The higher the weight, the more common");
			_destroyWeight = configFile.Bind<int>("Dev Manipulator", "8. Destroy Weight", DevGun.DevGunAction.DESTROY.GetWeight(), "The higher the weight, the more common");
			_subtractWeight = configFile.Bind<int>("Dev Manipulator", "9. Subtract Weight", DevGun.DevGunAction.SUBTRACT.GetWeight(), "The higher the weight, the more common");
			_addWeight = configFile.Bind<int>("Dev Manipulator", "10. Add Weight", DevGun.DevGunAction.ADD.GetWeight(), "The higher the weight, the more common");
			_divideMinimum = configFile.Bind<int>("Dev Manipulator", "11. Divide Minimum", DevGun.DevGunAction.DIVIDE.GetMinimum(), "The minimum operand to use");
			_divideMaximum = configFile.Bind<int>("Dev Manipulator", "12. Divide Maximum", DevGun.DevGunAction.DIVIDE.GetMaximum(), "The maximum operand to use");
			_multiplyMinimum = configFile.Bind<int>("Dev Manipulator", "13. Multiply Minimum", DevGun.DevGunAction.MULTIPLY.GetMinimum(), "The minimum operand to use");
			_multiplyMaximum = configFile.Bind<int>("Dev Manipulator", "14. Multiply Maximum", DevGun.DevGunAction.MULTIPLY.GetMaximum(), "The maximum operand to use");
			_subtractMinimum = configFile.Bind<int>("Dev Manipulator", "15. Subtract Minimum", DevGun.DevGunAction.SUBTRACT.GetMinimum(), "The minimum operand to use");
			_subtractMaximum = configFile.Bind<int>("Dev Manipulator", "16. Subtract Maximum", DevGun.DevGunAction.SUBTRACT.GetMaximum(), "The maximum operand to use");
			_addMinimum = configFile.Bind<int>("Dev Manipulator", "17. Add Minimum", DevGun.DevGunAction.ADD.GetMinimum(), "The minimum operand to use");
			_addMaximum = configFile.Bind<int>("Dev Manipulator", "18. Add Maximum", DevGun.DevGunAction.ADD.GetMaximum(), "The maximum operand to use");
		}

		public static int GetWeight(this DevGun.DevGunAction devGunAction)
		{
			if (1 == 0)
			{
			}
			int result = devGunAction switch
			{
				DevGun.DevGunAction.DIVIDE => _divideWeight?.Value ?? 10, 
				DevGun.DevGunAction.MULTIPLY => _multiplyWeight?.Value ?? 15, 
				DevGun.DevGunAction.DESTROY => _destroyWeight?.Value ?? 12, 
				DevGun.DevGunAction.SUBTRACT => _subtractWeight?.Value ?? 45, 
				DevGun.DevGunAction.ADD => _addWeight?.Value ?? 65, 
				_ => throw new ArgumentOutOfRangeException("devGunAction", devGunAction, "Is not implemented, yet???"), 
			};
			if (1 == 0)
			{
			}
			return result;
		}

		public static int GetMinimum(this DevGun.DevGunAction devGunAction)
		{
			if (1 == 0)
			{
			}
			int result = devGunAction switch
			{
				DevGun.DevGunAction.DIVIDE => _divideMinimum?.Value ?? 2, 
				DevGun.DevGunAction.MULTIPLY => _multiplyMinimum?.Value ?? 2, 
				DevGun.DevGunAction.SUBTRACT => _subtractMinimum?.Value ?? 30, 
				DevGun.DevGunAction.ADD => _addMinimum?.Value ?? 30, 
				_ => throw new ArgumentOutOfRangeException("devGunAction", devGunAction, "Is not implemented, yet???"), 
			};
			if (1 == 0)
			{
			}
			return result;
		}

		public static int GetMaximum(this DevGun.DevGunAction devGunAction)
		{
			if (1 == 0)
			{
			}
			int result = devGunAction switch
			{
				DevGun.DevGunAction.DIVIDE => _divideMinimum?.Value ?? 4, 
				DevGun.DevGunAction.MULTIPLY => _multiplyMinimum?.Value ?? 4, 
				DevGun.DevGunAction.SUBTRACT => _subtractMinimum?.Value ?? 56, 
				DevGun.DevGunAction.ADD => _addMinimum?.Value ?? 56, 
				_ => throw new ArgumentOutOfRangeException("devGunAction", devGunAction, "Is not implemented, yet???"), 
			};
			if (1 == 0)
			{
			}
			return result;
		}
	}
	[BepInPlugin("TestAccount666.VoidLeak", "VoidLeak", "1.13.1")]
	[BepInDependency("TestAccount666.TestAccountCore", "1.3.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public static ManualLogSource logger = null;

		private static Harmony? _harmony;

		private static readonly Version _CurrentConfigVersion = "2.0.0".ParseVersion();

		private readonly ConfigDefinition _configVersionDefinition = new ConfigDefinition("0. Config Version", "Do not touch!");

		private void Awake()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			logger = ((BaseUnityPlugin)this).Logger;
			if (_harmony == null)
			{
				_harmony = new Harmony("TestAccount666.VoidLeak");
			}
			CompareConfigVersion();
			if (DependencyChecker.IsLobbyCompatibilityInstalled())
			{
				logger.LogInfo((object)"Found LobbyCompatibility Mod, initializing support :)");
				LobbyCompatibilitySupport.Initialize("TestAccount666.VoidLeak", "1.13.1", (CompatibilityLevel)2, (VersionStrictness)2);
			}
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			Netcode.ExecuteNetcodePatcher(executingAssembly);
			AssetLoader.LoadBundle(executingAssembly, "voidleak");
			logger.LogInfo((object)"Loaded asset bundle. Registering items.");
			AssetLoader.LoadItems(((BaseUnityPlugin)this).Config);
			DevGunConfig.Initialize(((BaseUnityPlugin)this).Config);
			logger.LogInfo((object)"Plugin TestAccount666.VoidLeak is loaded, version 1.13.1");
		}

		private Version GetConfigVersion()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			ConfigEntry<string> val = ((BaseUnityPlugin)this).Config.Bind<string>(_configVersionDefinition, "1.0.0", new ConfigDescription("The config version. Might reset config, if touched!", (AcceptableValueBase)null, Array.Empty<object>()));
			return val.Value.ParseVersion();
		}

		private void SetConfigVersionEntry()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			((BaseUnityPlugin)this).Config.Bind<string>(_configVersionDefinition, _CurrentConfigVersion.ToString(), new ConfigDescription("The config version. Might reset config, if touched!", (AcceptableValueBase)null, Array.Empty<object>()));
		}

		private void CompareConfigVersion()
		{
			try
			{
				Version configVersion = GetConfigVersion();
				int num = configVersion.CompareTo(_CurrentConfigVersion);
				int num2 = num;
				int num3 = num2;
				if (num3 <= 0)
				{
					if (num3 < 0)
					{
						((BaseUnityPlugin)this).Logger.LogWarning((object)"Found an old config! Config will be reset!");
						((BaseUnityPlugin)this).Config.Clear();
						SetConfigVersionEntry();
						((BaseUnityPlugin)this).Config.Save();
						CompareConfigVersion();
					}
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogWarning((object)"Found a more recent config! proceed with caution!");
				}
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)("An error occurred while comparing config versions: " + ex.Message));
			}
		}
	}
	public class Version : IComparable<Version>
	{
		private readonly int _major;

		private readonly int _minor;

		private readonly int _patch;

		public Version(int major, int minor, int patch)
		{
			_major = major;
			_minor = minor;
			_patch = patch;
			base..ctor();
		}

		public int CompareTo(Version? other)
		{
			if (other == null)
			{
				throw new ArgumentNullException("other", "Cannot compare to null!");
			}
			if (this == other)
			{
				return 0;
			}
			int num = _major.CompareTo(other._major);
			int num2 = num;
			int num3 = num2;
			if (num3 >= 0)
			{
				if (num3 > 0)
				{
					Plugin.logger.LogDebug((object)$"Other major was smaller: {_major} -> {other._major}");
				}
			}
			else
			{
				Plugin.logger.LogDebug((object)$"Other major was bigger: {_major} -> {other._major}");
			}
			if (num != 0)
			{
				return num;
			}
			int num4 = _minor.CompareTo(other._minor);
			int num5 = num4;
			int num6 = num5;
			if (num6 >= 0)
			{
				if (num6 > 0)
				{
					Plugin.logger.LogDebug((object)$"Other minor was smaller: {_minor} -> {other._minor}");
				}
			}
			else
			{
				Plugin.logger.LogDebug((object)$"Other minor was bigger: {_major} -> {other._major}");
			}
			if (num4 != 0)
			{
				return num4;
			}
			int num7 = _patch.CompareTo(other._patch);
			int num8 = num7;
			int num9 = num8;
			if (num9 >= 0)
			{
				if (num9 > 0)
				{
					Plugin.logger.LogDebug((object)$"Other patch was smaller: {_patch} -> {other._patch}");
				}
			}
			else
			{
				Plugin.logger.LogDebug((object)$"Other patch was bigger: {_patch} -> {other._patch}");
			}
			return num7;
		}

		public override string ToString()
		{
			return $"{_major}.{_minor}.{_patch}";
		}
	}
	internal static class VersionParser
	{
		public static Version ParseVersion(this string versionString)
		{
			string[] array = versionString.Split(".");
			if (array == null || array.Length != 3)
			{
				throw new ArgumentException("Version string must contain at three segments and cannot be null.", "versionString");
			}
			if (!int.TryParse(array[0], NumberStyles.Integer, CultureInfo.InvariantCulture, out var result))
			{
				throw new FormatException("Invalid format in version string: " + versionString);
			}
			if (!int.TryParse(array[1], NumberStyles.Integer, CultureInfo.InvariantCulture, out var result2))
			{
				throw new FormatException("Invalid format in version string: " + versionString);
			}
			if (!int.TryParse(array[2], NumberStyles.Integer, CultureInfo.InvariantCulture, out var result3))
			{
				throw new FormatException("Invalid format in version string: " + versionString);
			}
			return new Version(result, result2, result3);
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "TestAccount666.VoidLeak";

		public const string PLUGIN_NAME = "VoidLeak";

		public const string PLUGIN_VERSION = "1.13.1";
	}
}
namespace VoidLeak.NetworkBehaviours
{
	[AddComponentMenu("Weather Electric/Void Leak/Destroy On Timer")]
	public class DestroyOnTimer : NetworkBehaviour
	{
		[Tooltip("The object to destroy. If null, the script will destroy whatever object the script is on.")]
		public GameObject objectToDestroy;

		[Space(10f)]
		[Tooltip("The time to destroy the object.")]
		public float timeToDestroy = 5f;

		private void Start()
		{
			((MonoBehaviour)this).StartCoroutine(Destroy((GameObject)(((Object)(object)objectToDestroy == (Object)null) ? ((object)((Component)this).gameObject) : ((object)objectToDestroy)), timeToDestroy));
		}

		private IEnumerator Destroy(GameObject obj, float time)
		{
			yield return (object)new WaitForSeconds(time);
			if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer)
			{
				NetworkObject networkObject = obj.GetComponent<NetworkObject>();
				if (networkObject != null)
				{
					networkObject.Despawn(true);
				}
				Object.Destroy((Object)(object)obj);
			}
		}

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "DestroyOnTimer";
		}
	}
	public class DevGun : PhysicsProp
	{
		public enum DevGunAction
		{
			DIVIDE,
			MULTIPLY,
			DESTROY,
			SUBTRACT,
			ADD
		}

		private static readonly Random _Random = new Random();

		[SerializeField]
		private Animator? animator;

		[SerializeField]
		private Transform? gunLaserPoint;

		[FormerlySerializedAs("particleSystem")]
		[SerializeField]
		private ParticleSystem? shootParticles;

		[SerializeField]
		private ParticleSystem? steamParticles;

		[SerializeField]
		private AudioSource? audioSource;

		[SerializeField]
		private AudioClip? shootAudioClip;

		[SerializeField]
		private List<AudioClip>? noObjectAudioClips;

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

		public override void PocketItem()
		{
			((GrabbableObject)this).PocketItem();
			StopParticles();
		}

		private void StopParticles()
		{
			ParticleSystem? obj = shootParticles;
			if (obj != null)
			{
				obj.Stop();
			}
			ParticleSystem? obj2 = steamParticles;
			if (obj2 != null)
			{
				obj2.Stop();
			}
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (Object.op_Implicit((Object)(object)((GrabbableObject)this).playerHeldBy) && Object.op_Implicit((Object)(object)((GrabbableObject)this).playerHeldBy.playerEye))
			{
				GrabbableObject grabbableObject = GetGrabbableObject();
				if (grabbableObject == null)
				{
					PlayNoObjectSoundServerRpc();
				}
				else
				{
					UseDevGunServerRpc(NetworkObjectReference.op_Implicit(((Component)grabbableObject).GetComponent<NetworkObject>()));
				}
			}
		}

		[ClientRpc]
		public void UseDevGunClientRpc(NetworkObjectReference grabbableObject, int newValue)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: 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(2965608862u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref grabbableObject, default(ForNetworkSerializable));
					BytePacker.WriteValueBitPacked(val2, newValue);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2965608862u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					GrabbableObject component = ((Component)NetworkObjectReference.op_Implicit(grabbableObject)).GetComponent<GrabbableObject>();
					((MonoBehaviour)this).StartCoroutine(SetValue(component, newValue));
					((MonoBehaviour)this).StartCoroutine(PlayParticles());
				}
			}
		}

		private static IEnumerator SetValue(GrabbableObject? grabbableObject, int newValue)
		{
			if (grabbableObject != null)
			{
				int currentValue = grabbableObject.scrapValue;
				float startTime = Time.time;
				while (Time.time - startTime < 1f)
				{
					float normalizedTime = (Time.time - startTime) / 1f;
					float interpolatedValue = Mathf.Lerp((float)currentValue, (float)newValue, normalizedTime);
					grabbableObject.SetScrapValue((int)interpolatedValue);
					yield return null;
				}
				grabbableObject.SetScrapValue(newValue);
			}
		}

		private IEnumerator PlayParticles()
		{
			if (audioSource != null && shootAudioClip != null)
			{
				audioSource.clip = shootAudioClip;
				audioSource.Play();
			}
			ParticleSystem? obj = shootParticles;
			if (obj != null)
			{
				obj.Play();
			}
			yield return (object)new WaitForSeconds(0.8f);
			ParticleSystem? obj2 = steamParticles;
			if (obj2 != null)
			{
				obj2.Play();
			}
		}

		private GrabbableObject? GetGrabbableObject()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			if (((GrabbableObject)this).playerHeldBy.playerEye == null)
			{
				return null;
			}
			RaycastHit val = default(RaycastHit);
			if (!Physics.Raycast(((GrabbableObject)this).playerHeldBy.playerEye.position, ((GrabbableObject)this).playerHeldBy.playerEye.forward, ref val, 5f, 64, (QueryTriggerInteraction)1))
			{
				return null;
			}
			if (Physics.Linecast(((GrabbableObject)this).playerHeldBy.playerEye.position, ((RaycastHit)(ref val)).point, 117440769, (QueryTriggerInteraction)1))
			{
				return null;
			}
			GrabbableObject component = ((Component)((RaycastHit)(ref val)).collider).GetComponent<GrabbableObject>();
			if (component != null)
			{
				return (!component.itemProperties.isScrap) ? null : component;
			}
			Plugin.logger.LogError((object)"Dev gun found no object???");
			return null;
		}

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

		[ClientRpc]
		public void PlayNoObjectSoundClientRpc()
		{
			//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(2891085166u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2891085166u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && audioSource != null)
			{
				List<AudioClip> list = noObjectAudioClips;
				if (list != null && list.Count > 0)
				{
					audioSource.clip = noObjectAudioClips[_Random.Next(0, noObjectAudioClips.Count)];
					audioSource.Play();
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void UseDevGunServerRpc(NetworkObjectReference grabbableObjectReference)
		{
			//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_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2660396695u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref grabbableObjectReference, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2660396695u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				NetworkObject val3 = NetworkObjectReference.op_Implicit(grabbableObjectReference);
				GrabbableObject component = ((Component)val3).GetComponent<GrabbableObject>();
				if (component == null)
				{
					PlayNoObjectSoundClientRpc();
					return;
				}
				int currentValue = component.scrapValue;
				DevGunAction action = GenerateAction();
				ExecuteAction(action, ref currentValue, component, val3);
				UseDevGunClientRpc(NetworkObjectReference.op_Implicit(val3), currentValue);
			}
		}

		private void ExecuteAction(DevGunAction action, ref int currentValue, GrabbableObject grabbableObject, NetworkObject networkObject)
		{
			GrabbableObject grabbableObject2 = grabbableObject;
			NetworkObject networkObject2 = networkObject;
			switch (action)
			{
			case DevGunAction.DESTROY:
				currentValue += 1600;
				((MonoBehaviour)this).StartCoroutine(DelayedAction(delegate
				{
					//IL_0012: Unknown result type (might be due to invalid IL or missing references)
					SpawnExplosionClientRpc(((Component)grabbableObject2).transform.position);
					networkObject2.Despawn(true);
					Object.Destroy((Object)(object)((Component)grabbableObject2).gameObject);
				}));
				break;
			case DevGunAction.ADD:
				currentValue += _Random.Next(action.GetMinimum(), action.GetMaximum());
				break;
			case DevGunAction.SUBTRACT:
				currentValue -= _Random.Next(action.GetMinimum(), action.GetMaximum());
				break;
			case DevGunAction.MULTIPLY:
				currentValue *= _Random.Next(action.GetMinimum(), action.GetMaximum());
				break;
			case DevGunAction.DIVIDE:
				currentValue /= _Random.Next(action.GetMinimum(), action.GetMaximum());
				break;
			default:
				throw new ArgumentOutOfRangeException("action", action, "Is not implemented, yet???");
			}
		}

		[ClientRpc]
		private void SpawnExplosionClientRpc(Vector3 position)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: 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(3251247325u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3251247325u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Landmine.SpawnExplosion(position, true, 0.5f, 3f, 25, 1f, (GameObject)null, false);
				}
			}
		}

		private static IEnumerator DelayedAction(Action action)
		{
			yield return (object)new WaitForSeconds(1f);
			action();
		}

		private static DevGunAction GenerateAction()
		{
			int num = _Random.Next(0, 300);
			while (true)
			{
				foreach (DevGunAction item in DevGunConfig.ActionSet)
				{
					num -= item.GetWeight();
					if (num > 0)
					{
						continue;
					}
					return item;
				}
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_DevGun()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(2965608862u, new RpcReceiveHandler(__rpc_handler_2965608862));
			NetworkManager.__rpc_func_table.Add(3930581728u, new RpcReceiveHandler(__rpc_handler_3930581728));
			NetworkManager.__rpc_func_table.Add(2891085166u, new RpcReceiveHandler(__rpc_handler_2891085166));
			NetworkManager.__rpc_func_table.Add(2660396695u, new RpcReceiveHandler(__rpc_handler_2660396695));
			NetworkManager.__rpc_func_table.Add(3251247325u, new RpcReceiveHandler(__rpc_handler_3251247325));
		}

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

		private static void __rpc_handler_3930581728(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;
				((DevGun)(object)target).PlayNoObjectSoundServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2891085166(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;
				((DevGun)(object)target).PlayNoObjectSoundClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string? __getTypeName()
		{
			return "DevGun";
		}
	}
	[AddComponentMenu("Weather Electric/Void Leak/Ice Axe")]
	public class IceAxe : KnifeItem
	{
		[SerializeField]
		public Animator? animator;

		private static readonly int _SmashAnimatorHash = Animator.StringToHash("Smash");

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((KnifeItem)this).ItemActivate(used, buttonDown);
			Animator? obj = animator;
			if (obj != null)
			{
				obj.SetTrigger(_SmashAnimatorHash);
			}
		}

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "IceAxe";
		}
	}
	[AddComponentMenu("Soup")]
	public class SoupBehaviour : NetworkBehaviour
	{
		private const float KICK_STRENGTH = 0.5f;

		[Tooltip("The rigidBody of this object.")]
		[SerializeField]
		public Rigidbody rigidBody;

		[Tooltip("The audio source of this object.")]
		[SerializeField]
		public AudioSource collideAudioSource;

		private void OnTriggerEnter(Collider other)
		{
			HandleCollision(other);
		}

		private void OnTriggerStay(Collider other)
		{
			HandleCollision(other);
		}

		private void HandleCollision(Collider other)
		{
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)other.attachedRigidbody == (Object)(object)rigidBody) && (((Component)other).CompareTag("PlayerBody") || ((Component)other).CompareTag("Player")))
			{
				if (!collideAudioSource.isPlaying)
				{
					collideAudioSource.Play();
				}
				if (this != null && ((NetworkBehaviour)this).IsHost)
				{
					Vector3 val = ((Component)other).transform.forward;
					((Vector3)(ref val)).Normalize();
					val = -val;
					val.y = 0.7f;
					rigidBody.AddForce(val * 0.5f, (ForceMode)1);
				}
			}
		}

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "SoupBehaviour";
		}
	}
	public class SoupTrigger : NetworkBehaviour
	{
		private static bool _underTheInfluence;

		[SerializeField]
		private NetworkObject? networkObject;

		[SerializeField]
		private GameObject? parentObject;

		public void Interact()
		{
			if (this != null && parentObject != null && networkObject != null)
			{
				if (_underTheInfluence)
				{
					HUDManager.Instance.DisplayTip("Soup???", "Nah, I think I'm good :)", false, false, "LC_Tip1");
					return;
				}
				HUDManager.Instance.DisplayTip("Soup???", "You feel refreshed!", false, false, "LC_Tip1");
				PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController;
				((MonoBehaviour)localPlayerController).StartCoroutine(Energize(localPlayerController, localPlayerController.sprintTime));
				EatSoupServerRpc();
			}
		}

		private static IEnumerator Energize(PlayerControllerB? localPlayer, float sprintTime)
		{
			if ((Object)(object)localPlayer == (Object)null)
			{
				_underTheInfluence = false;
				yield break;
			}
			_underTheInfluence = true;
			localPlayer.sprintMeter = 1f;
			localPlayer.sprintTime = 666f;
			yield return (object)new WaitForSeconds(12f);
			if ((Object)(object)localPlayer == (Object)null)
			{
				_underTheInfluence = false;
				yield break;
			}
			localPlayer.sprintTime = sprintTime;
			int times = 0;
			while (!((Object)(object)localPlayer == (Object)null) && !localPlayer.isPlayerDead && times < 20)
			{
				yield return (object)new WaitForSeconds(0.5f);
				localPlayer.sprintMeter = 0f;
				localPlayer.drunkness += 0.1f;
				if (times < 10)
				{
					localPlayer.DamagePlayer(1, true, true, (CauseOfDeath)5, 0, false, default(Vector3));
				}
				times++;
			}
			yield return (object)new WaitForSeconds(0.5f);
			_underTheInfluence = false;
		}

		[ServerRpc(RequireOwnership = false)]
		public void EatSoupServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3671298775u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3671298775u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					EatSoupClientRpc();
				}
			}
		}

		[ClientRpc]
		public void EatSoupClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(334741291u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 334741291u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer))
			{
				NetworkObject? obj = networkObject;
				if (obj != null)
				{
					obj.Despawn(true);
				}
				Object.Destroy((Object)(object)parentObject);
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_SoupTrigger()
		{
			//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(3671298775u, new RpcReceiveHandler(__rpc_handler_3671298775));
			NetworkManager.__rpc_func_table.Add(334741291u, new RpcReceiveHandler(__rpc_handler_334741291));
		}

		private static void __rpc_handler_3671298775(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;
				((SoupTrigger)(object)target).EatSoupServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_334741291(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;
				((SoupTrigger)(object)target).EatSoupClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string? __getTypeName()
		{
			return "SoupTrigger";
		}
	}
	[AddComponentMenu("Weather Electric/Void Leak/Spawn Gun")]
	public class SpawnGun : GrabbableObject
	{
		[Space(30f)]
		public Transform firePoint;

		[Space(10f)]
		public GameObject spawnObject;

		[Space(10f)]
		public float raycastDistance = 15f;

		[Space(10f)]
		public AudioSource spawnAudio;

		[Space(10f)]
		public AudioSource missFireAudio;

		[Space(10f)]
		public GameObject laser;

		[Space(10f)]
		public Animator animator;

		private static readonly int _Shoot = Animator.StringToHash("Shoot");

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_0081: 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_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (base.playerHeldBy == null || (Object)(object)base.playerHeldBy != (Object)(object)GameNetworkManager.Instance.localPlayerController)
			{
				return;
			}
			if (!((NetworkBehaviour)this).IsHost)
			{
				ShootSpawnGunServerRpc();
			}
			else
			{
				ShootSpawnGunClientRpc();
			}
			if (!(base.insertedBattery.charge <= 0f))
			{
				Vector3 position = firePoint.position + firePoint.forward * raycastDistance;
				Ray val = default(Ray);
				((Ray)(ref val))..ctor(firePoint.position, firePoint.forward);
				RaycastHit val2 = default(RaycastHit);
				if (Physics.Raycast(val, ref val2, raycastDistance))
				{
					position = ((RaycastHit)(ref val2)).point;
				}
				if (!((NetworkBehaviour)this).IsHost)
				{
					UseSpawnGunServerRpc(position);
				}
				else
				{
					SpawnSoupClientRpc(position);
				}
			}
		}

		public override void ChargeBatteries()
		{
			((GrabbableObject)this).ChargeBatteries();
			SetActive(active: true);
		}

		[ServerRpc(RequireOwnership = false)]
		private void UseSpawnGunServerRpc(Vector3 position)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: 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(387090984u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 387090984u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					SpawnSoupClientRpc(position);
				}
			}
		}

		[ClientRpc]
		private void SpawnSoupClientRpc(Vector3 position)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			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(1203730062u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1203730062u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				Battery insertedBattery = base.insertedBattery;
				insertedBattery.charge -= 0.1f;
				if (base.insertedBattery.charge <= 0f)
				{
					SetActive(active: false);
				}
				if (((NetworkBehaviour)this).IsHost)
				{
					GameObject val3 = Object.Instantiate<GameObject>(spawnObject, position, Quaternion.identity);
					NetworkObject component = val3.GetComponent<NetworkObject>();
					component.Spawn(false);
				}
			}
		}

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

		[ClientRpc]
		private void ShootSpawnGunClientRpc()
		{
			//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(2638741765u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2638741765u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (base.insertedBattery.charge <= 0f)
				{
					missFireAudio.Play();
					SetActive(active: false);
				}
				else
				{
					animator.SetTrigger(_Shoot);
					spawnAudio.Play();
				}
			}
		}

		public override void UseUpBatteries()
		{
			((GrabbableObject)this).UseUpBatteries();
			SetActive(active: false);
		}

		public override void DiscardItem()
		{
			((GrabbableObject)this).DiscardItem();
			SetActive(active: false);
		}

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

		public override void GrabItem()
		{
			((GrabbableObject)this).GrabItem();
			if (base.insertedBattery.charge <= 0f)
			{
				SetActive(active: false);
			}
			else
			{
				SetActive(active: true);
			}
		}

		public override void EquipItem()
		{
			((GrabbableObject)this).EquipItem();
			if (base.insertedBattery.charge <= 0f)
			{
				SetActive(active: false);
			}
			else
			{
				SetActive(active: true);
			}
		}

		private void SetActive(bool active)
		{
			active = active && base.playerHeldBy != null;
			if (laser.activeSelf != active)
			{
				laser.SetActive(active);
				MeshRenderer component = laser.GetComponent<MeshRenderer>();
				if (component != null && ((Renderer)component).enabled != active)
				{
					((Renderer)component).enabled = active;
				}
			}
			if (base.playerHeldBy != null)
			{
				base.playerHeldBy.equippedUsableItemQE = true;
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_SpawnGun()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(387090984u, new RpcReceiveHandler(__rpc_handler_387090984));
			NetworkManager.__rpc_func_table.Add(1203730062u, new RpcReceiveHandler(__rpc_handler_1203730062));
			NetworkManager.__rpc_func_table.Add(3351750699u, new RpcReceiveHandler(__rpc_handler_3351750699));
			NetworkManager.__rpc_func_table.Add(2638741765u, new RpcReceiveHandler(__rpc_handler_2638741765));
		}

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

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

		private static void __rpc_handler_3351750699(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;
				((SpawnGun)(object)target).ShootSpawnGunServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2638741765(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;
				((SpawnGun)(object)target).ShootSpawnGunClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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