Decompiled source of AddonFusion v2.0.0

AddonFusion.dll

Decompiled 4 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AddonFusion.Behaviours.AddonComponents;
using AddonFusion.Behaviours.AddonProps;
using AddonFusion.Behaviours.Scripts;
using AddonFusion.Managers;
using AddonFusion.NetcodePatcher;
using AddonFusion.Patches;
using AddonFusion.Registries;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LegaFusionCore;
using LegaFusionCore.Managers;
using LegaFusionCore.Managers.NetworkManagers;
using LegaFusionCore.Registries;
using LegaFusionCore.Utilities;
using LethalCompanyInputUtils.Api;
using LethalLib.Extras;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ClientNetworkTransform")]
[assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")]
[assembly: IgnoresAccessChecksTo("DissonanceVoip")]
[assembly: IgnoresAccessChecksTo("DunGen")]
[assembly: IgnoresAccessChecksTo("DunGen.Integration.ASPP")]
[assembly: IgnoresAccessChecksTo("DunGen.Integration.UnityNav")]
[assembly: IgnoresAccessChecksTo("EasyTextEffects")]
[assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Jobs")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")]
[assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")]
[assembly: IgnoresAccessChecksTo("Unity.Services.QoS")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Relay")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.XR.CoreUtils")]
[assembly: IgnoresAccessChecksTo("Unity.XR.Management")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.ConformanceAutomation")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MetaQuestSupport")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MockRuntime")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.OculusQuestSupport")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.RuntimeDebugger")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.SpatialTracking")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: IgnoresAccessChecksTo("UnityEngine.XR.LegacyInputHelpers")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("AddonFusion")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AddonFusion")]
[assembly: AssemblyTitle("AddonFusion")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace AddonFusion
{
	[BepInPlugin("Lega.AddonFusion", "Addon Fusion", "2.0.0")]
	public class AddonFusion : BaseUnityPlugin
	{
		public const string modGUID = "Lega.AddonFusion";

		public const string modName = "Addon Fusion";

		public const string modVersion = "2.0.0";

		private readonly Harmony harmony = new Harmony("Lega.AddonFusion");

		private static readonly AssetBundle bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "addonfusion"));

		internal static ManualLogSource mls;

		public static ConfigFile configFile;

		public static GameObject managerPrefab = NetworkPrefabs.CreateNetworkPrefab("AddonFusionNetworkManager");

		public static GameObject parryAudio;

		public void Awake()
		{
			mls = Logger.CreateLogSource("AddonFusion");
			configFile = ((BaseUnityPlugin)this).Config;
			ConfigManager.Load();
			LoadManager();
			NetcodePatcher();
			LoadItems();
			LoadUnlockables();
			LoadNetworkPrefabs();
			harmony.PatchAll(typeof(GameNetworkManagerPatch));
			harmony.PatchAll(typeof(StartOfRoundPatch));
			harmony.PatchAll(typeof(PlayerControllerBPatch));
			harmony.PatchAll(typeof(GrabbableObjectPatch));
			harmony.PatchAll(typeof(ShotgunItemPatch));
			harmony.PatchAll(typeof(SprayPaintItemPatch));
			harmony.PatchAll(typeof(EnemyAIPatch));
		}

		public static void LoadManager()
		{
			Utilities.FixMixerGroups(managerPrefab);
			managerPrefab.AddComponent<AddonFusionNetworkManager>();
		}

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

		public void LoadItems()
		{
			RegisterAddon(typeof(BladeSharpener), "Blade Sharpener", typeof(BladeSharpenerItem), bundle.LoadAsset<Item>("Assets/AddonProps/BladeSharpenerItem.asset"), 0, 2, ConfigManager.bladeSharpenerRarity.Value, ConfigManager.bladeSharpenerMinValue.Value, ConfigManager.bladeSharpenerMaxValue.Value, ConfigManager.isBladeSharpenerPurchasable.Value, ConfigManager.bladeSharpenerPrice.Value, "");
			RegisterAddon(typeof(EchoScanner), "Echo Scanner", typeof(EchoScannerItem), bundle.LoadAsset<Item>("Assets/AddonProps/EchoScannerItem.asset"), 0, 2, ConfigManager.echoScannerRarity.Value, ConfigManager.echoScannerMinValue.Value, ConfigManager.echoScannerMaxValue.Value, ConfigManager.isEchoScannerPurchasable.Value, ConfigManager.echoScannerPrice.Value, "");
			RegisterAddon(typeof(FlashlightLens), "Flashlight Lens", typeof(FlashlightLensItem), bundle.LoadAsset<Item>("Assets/AddonProps/FlashlightLensItem.asset"), 0, 2, ConfigManager.flashlightLensRarity.Value, ConfigManager.flashlightLensMinValue.Value, ConfigManager.flashlightLensMaxValue.Value, ConfigManager.isFlashlightLensPurchasable.Value, ConfigManager.flashlightLensPrice.Value, "");
			RegisterAddon(typeof(MarkerCompound), "Maker Compound", typeof(MarkerCompoundItem), bundle.LoadAsset<Item>("Assets/AddonProps/MarkerCompoundItem.asset"), 0, 2, ConfigManager.markerCompoundRarity.Value, ConfigManager.markerCompoundMinValue.Value, ConfigManager.markerCompoundMaxValue.Value, ConfigManager.isMarkerCompoundPurchasable.Value, ConfigManager.markerCompoundPrice.Value, "");
			RegisterAddon(typeof(ProtectiveCord), "Protective Cord", typeof(ProtectiveCordItem), bundle.LoadAsset<Item>("Assets/AddonProps/ProtectiveCordItem.asset"), 0, 2, ConfigManager.protectiveCordRarity.Value, ConfigManager.protectiveCordMinValue.Value, ConfigManager.protectiveCordMaxValue.Value, ConfigManager.isProtectiveCordPurchasable.Value, ConfigManager.protectiveCordPrice.Value, "");
			RegisterAddon(typeof(SaltTank), "Salt Tank", typeof(SaltTankItem), bundle.LoadAsset<Item>("Assets/AddonProps/SaltTankItem.asset"), 0, 2, ConfigManager.saltTankRarity.Value, ConfigManager.saltTankMinValue.Value, ConfigManager.saltTankMaxValue.Value, ConfigManager.isSaltTankPurchasable.Value, ConfigManager.saltTankPrice.Value, "");
			RegisterAddon(typeof(SpectralFrequency), "Spectral Frequency", typeof(SpectralFrequencyItem), bundle.LoadAsset<Item>("Assets/AddonProps/SpectralFrequencyItem.asset"), 0, 2, ConfigManager.spectralFrequencyRarity.Value, ConfigManager.spectralFrequencyMinValue.Value, ConfigManager.spectralFrequencyMaxValue.Value, ConfigManager.isSpectralFrequencyPurchasable.Value, ConfigManager.spectralFrequencyPrice.Value, "");
		}

		public static void RegisterAddon(Type addonType, string addonName, Type itemType, Item item, int minSpawn, int maxSpawn, int rarity, int minValue, int maxValue, bool isPurchasable, int price, string nodeText)
		{
			LFCSpawnableItemRegistry.Add(itemType, item, minSpawn, maxSpawn, rarity, minValue, maxValue);
			if (isPurchasable)
			{
				TerminalNode val = ScriptableObject.CreateInstance<TerminalNode>();
				val.clearPreviousText = true;
				val.displayText = nodeText;
				Items.RegisterShopItem(item, (TerminalNode)null, (TerminalNode)null, val, price);
			}
			AddonObjectRegistry.Add(addonType, addonName, item.spawnPrefab);
		}

		public void LoadUnlockables()
		{
			UnlockableItemDef val = bundle.LoadAsset<UnlockableItemDef>("Assets/AddonCapsule/AddonCapsuleItem.asset");
			NetworkPrefabs.RegisterNetworkPrefab(val.unlockable.prefabObject);
			Utilities.FixMixerGroups(val.unlockable.prefabObject);
			Unlockables.RegisterUnlockable(val, (StoreType)1, (TerminalNode)null, (TerminalNode)null, bundle.LoadAsset<TerminalNode>("Assets/AddonCapsule/AddonCapsuleTN.asset"), 30);
		}

		public void LoadNetworkPrefabs()
		{
			HashSet<GameObject> hashSet = new HashSet<GameObject> { parryAudio = bundle.LoadAsset<GameObject>("Assets/SFX/ParryAudio.prefab") };
			foreach (GameObject item in hashSet)
			{
				NetworkPrefabs.RegisterNetworkPrefab(item);
				Utilities.FixMixerGroups(item);
			}
		}
	}
	public class AFUtilities
	{
		public static void SetAddonComponent(Type addonType, GrabbableObject grabbableObject)
		{
			if (addonType != null && typeof(AddonComponent).IsAssignableFrom(addonType) && !TryGetAddonComponent<AddonComponent>(grabbableObject, out var _))
			{
				AddonComponent addonComponent2 = ((Component)grabbableObject).gameObject.AddComponent(addonType) as AddonComponent;
				addonComponent2.grabbableObject = grabbableObject;
				ScanNodeProperties val = default(ScanNodeProperties);
				if (LFCUtilities.TryGetComponentInChildren<ScanNodeProperties>(((Component)grabbableObject).gameObject, ref val))
				{
					ScanNodeProperties obj = val;
					obj.subText = obj.subText + ((val.subText != null) ? "\n" : "") + "Addon: " + addonComponent2.AddonName;
				}
			}
		}

		public static void SetAddonComponent<T>(GrabbableObject grabbableObject) where T : AddonComponent
		{
			SetAddonComponent(typeof(T), grabbableObject);
		}

		public static bool TryGetAddonComponent<T>(PlayerControllerB player, out T addonComponent) where T : AddonComponent
		{
			addonComponent = null;
			if ((Object)(object)player != (Object)null)
			{
				for (int i = 0; i < player.ItemSlots.Length; i++)
				{
					if (TryGetAddonComponent<T>(player.ItemSlots[i], out addonComponent))
					{
						return true;
					}
				}
			}
			return false;
		}

		public static bool TryGetAddonComponent<T>(GrabbableObject grabbableObject, out T addonComponent) where T : AddonComponent
		{
			addonComponent = ((grabbableObject != null) ? ((Component)grabbableObject).GetComponent<T>() : null);
			return (Object)(object)addonComponent != (Object)null;
		}

		public static void SetControlTipsForAddon(GrabbableObject grabbableObject)
		{
			if (TryGetAddonComponent<AddonComponent>(grabbableObject, out var addonComponent) && !addonComponent.IsPassive)
			{
				addonComponent.SetTipsForItem(new string[1] { AddonInput.Instance.GetAddonToolTip() });
			}
		}
	}
	public class Constants
	{
		public const string BLADE_SHARPENER = "Blade Sharpener";

		public const string ECHO_SCANNER = "Echo Scanner";

		public const string FLASHLIGHT_LENS = "Flashlight Lens";

		public const string MARKER_COMPOUND = "Maker Compound";

		public const string PROTECTIVE_CORD = "Protective Cord";

		public const string SALT_TANK = "Salt Tank";

		public const string SPECTRAL_FREQUENCY = "Spectral Frequency";
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "AddonFusion";

		public const string PLUGIN_NAME = "AddonFusion";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace AddonFusion.Registries
{
	public class AddonObjectRegistry
	{
		private static readonly Dictionary<Type, (string, GameObject)> addonObjectByType = new Dictionary<Type, (string, GameObject)>();

		private static readonly Dictionary<string, (Type, GameObject)> addonObjectByName = new Dictionary<string, (Type, GameObject)>();

		public static void Add(Type addonType, string addonName, GameObject addonObj)
		{
			addonObjectByType[addonType] = (addonName, addonObj);
			addonObjectByName[addonName] = (addonType, addonObj);
		}

		public static bool TryGetAddonObject(Type addonType, out GameObject addonObj)
		{
			addonObj = null;
			if (addonObjectByType.TryGetValue(addonType, out var value))
			{
				return (Object)(object)(addonObj = value.Item2) != (Object)null;
			}
			return false;
		}

		public static bool TryGetAddonName(Type addonType, out string addonName)
		{
			addonName = null;
			if (addonObjectByType.TryGetValue(addonType, out var value))
			{
				return (addonName = value.Item1) != null;
			}
			return false;
		}

		public static bool TryGetAddonType(string addonName, out Type addonType)
		{
			addonType = null;
			if (addonObjectByName.TryGetValue(addonName, out var value))
			{
				return (addonType = value.Item1) != null;
			}
			return false;
		}
	}
}
namespace AddonFusion.Patches
{
	public class EnemyAIPatch
	{
		[HarmonyPatch(typeof(EnemyAI), "MeetsStandardPlayerCollisionConditions")]
		[HarmonyPostfix]
		public static void ProtectiveCordParry(EnemyAI __instance, ref PlayerControllerB __result)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)__result != (Object)null && (Object)(object)__result.currentlyHeldObjectServer != (Object)null && AFUtilities.TryGetAddonComponent<ProtectiveCord>(__result.currentlyHeldObjectServer, out var addonComponent) && addonComponent.isParrying)
			{
				LFCNetworkManager.Instance.StunEnemyEveryoneRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)__instance).NetworkObject), true, 1f, (int)__result.playerClientId);
				LFCNetworkManager.Instance.PlayAudioEveryoneRpc("Addon Fusion" + ((Object)AddonFusion.parryAudio).name, ((Component)__result.currentlyHeldObjectServer).transform.position, true);
				__result = null;
			}
		}

		[HarmonyPatch(typeof(EnemyAI), "HitEnemyOnLocalClient")]
		[HarmonyPrefix]
		public static bool BladeSharpenerHit(EnemyAI __instance, ref int force, PlayerControllerB playerWhoHit)
		{
			if ((Object)(object)playerWhoHit != (Object)null && (Object)(object)playerWhoHit.currentlyHeldObjectServer != (Object)null && AFUtilities.TryGetAddonComponent<BladeSharpener>(playerWhoHit.currentlyHeldObjectServer, out var _) && Random.Range(1, 101) < 5)
			{
				force = __instance.enemyHP;
			}
			return true;
		}

		[HarmonyPatch(typeof(EnemyAI), "HitEnemy")]
		[HarmonyPrefix]
		public static bool SaltTankHit(EnemyAI __instance, PlayerControllerB playerWhoHit)
		{
			if ((Object)(object)playerWhoHit != (Object)null && (Object)(object)playerWhoHit.currentlyHeldObjectServer != (Object)null && AFUtilities.TryGetAddonComponent<SaltTank>(playerWhoHit.currentlyHeldObjectServer, out var _))
			{
				DressGirlAI val = (DressGirlAI)(object)((__instance is DressGirlAI) ? __instance : null);
				if (val != null)
				{
					val.StopChasing();
					if (LFCUtilities.IsServer)
					{
						val.ChooseNewHauntingPlayerClientRpc();
					}
				}
			}
			return true;
		}
	}
	public class GameNetworkManagerPatch
	{
		[HarmonyPatch(typeof(GameNetworkManager), "SaveItemsInShip")]
		[HarmonyPostfix]
		public static void SaveAddons(GameNetworkManager __instance)
		{
			List<GrabbableObject> allAs = LFCSpawnRegistry.GetAllAs<GrabbableObject>();
			if (allAs == null || allAs.Count == 0 || StartOfRound.Instance.isChallengeFile)
			{
				ES3.DeleteKey("shipAddonIDs", __instance.currentSaveFileName);
				return;
			}
			List<string> list = new List<string>();
			for (int i = 0; i < allAs.Count && i <= StartOfRound.Instance.maxShipItemCapacity; i++)
			{
				if (!StartOfRound.Instance.allItemsList.itemsList.Contains(allAs[i].itemProperties) || allAs[i].deactivated || allAs[i].itemUsedUp)
				{
					if ((Object)(object)allAs[i].itemProperties.spawnPrefab == (Object)null)
					{
						AddonFusion.mls.LogError((object)("Item '" + allAs[i].itemProperties.itemName + "' has no spawn prefab set!"));
					}
					continue;
				}
				for (int j = 0; j < StartOfRound.Instance.allItemsList.itemsList.Count; j++)
				{
					if ((Object)(object)StartOfRound.Instance.allItemsList.itemsList[j] == (Object)(object)allAs[i].itemProperties && AFUtilities.TryGetAddonComponent<AddonComponent>(allAs[i], out var addonComponent))
					{
						list.Add($"{j},{addonComponent.AddonName}");
					}
				}
			}
			if (list.Count > 0)
			{
				ES3.Save<string[]>("shipAddonIDs", list.ToArray(), __instance.currentSaveFileName);
			}
		}
	}
	public class GrabbableObjectPatch
	{
		[HarmonyPatch(typeof(GrabbableObject), "SetScrapValue")]
		[HarmonyPostfix]
		public static void SetAddonScanNode(GrabbableObject __instance)
		{
			if (AFUtilities.TryGetAddonComponent<AddonComponent>(__instance, out var addonComponent))
			{
				string text = "Addon: " + addonComponent.AddonName;
				ScanNodeProperties val = default(ScanNodeProperties);
				if (LFCUtilities.TryGetComponentInChildren<ScanNodeProperties>(((Component)__instance).gameObject, ref val) && (val.subText == null || !val.subText.Contains(text)))
				{
					ScanNodeProperties obj = val;
					obj.subText = obj.subText + ((val.subText != null) ? "\n" : "") + text;
				}
			}
		}

		[HarmonyPatch(typeof(GrabbableObject), "SetControlTipsForItem")]
		[HarmonyPostfix]
		public static void SetControlTipsForAddon(GrabbableObject __instance)
		{
			AFUtilities.SetControlTipsForAddon(__instance);
		}
	}
	public class PlayerControllerBPatch
	{
		[HarmonyPatch(typeof(PlayerControllerB), "IHittable.Hit")]
		[HarmonyPrefix]
		public static bool HitPlayer(PlayerControllerB __instance, PlayerControllerB playerWhoHit)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)__instance.currentlyHeldObjectServer != (Object)null && AFUtilities.TryGetAddonComponent<ProtectiveCord>(__instance.currentlyHeldObjectServer, out var addonComponent) && addonComponent.isParrying)
			{
				__instance.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true);
				LFCNetworkManager.Instance.PlayAudioEveryoneRpc("Addon Fusion" + ((Object)AddonFusion.parryAudio).name, ((Component)__instance.currentlyHeldObjectServer).transform.position, true);
				return false;
			}
			return true;
		}
	}
	public class ShotgunItemPatch
	{
		[HarmonyPatch(typeof(ShotgunItem), "SetControlTipsForItem")]
		[HarmonyPostfix]
		public static void SetControlTipsForAddon(ShotgunItem __instance)
		{
			AFUtilities.SetControlTipsForAddon((GrabbableObject)(object)__instance);
		}
	}
	public class SprayPaintItemPatch
	{
		[HarmonyPatch(typeof(SprayPaintItem), "AddSprayPaintLocal")]
		[HarmonyPostfix]
		public static void SprayPaintDecal(SprayPaintItem __instance, bool __result)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB playerHeldBy = ((GrabbableObject)__instance).playerHeldBy;
			if (!__result || !((Object)(object)playerHeldBy != (Object)null) || !AFUtilities.TryGetAddonComponent<MarkerCompound>((GrabbableObject)(object)__instance, out var addonComponent) || !addonComponent.isEnabled)
			{
				return;
			}
			int num = 1084754760;
			RaycastHit[] array = Physics.RaycastAll(new Ray(((Component)playerHeldBy.gameplayCamera).transform.position, ((Component)playerHeldBy.gameplayCamera).transform.forward), 5f, num);
			GrabbableObject val2 = default(GrabbableObject);
			PlayerControllerB val3 = default(PlayerControllerB);
			EnemyAICollisionDetect val4 = default(EnemyAICollisionDetect);
			for (int i = 0; i < array.Length; i++)
			{
				RaycastHit val = array[i];
				if (((Component)((RaycastHit)(ref val)).transform).TryGetComponent<GrabbableObject>(ref val2))
				{
					addonComponent.AddTargetEntity(((Component)val2).gameObject, Color.yellow);
				}
				else if (((Component)((RaycastHit)(ref val)).transform).TryGetComponent<PlayerControllerB>(ref val3) && (Object)(object)val3 != (Object)(object)playerHeldBy && LFCUtilities.ShouldNotBeLocalPlayer(val3))
				{
					addonComponent.AddTargetEntity(((Component)val3).gameObject, Color.yellow);
				}
				else if (((Component)((RaycastHit)(ref val)).transform).TryGetComponent<EnemyAICollisionDetect>(ref val4) && (Object)(object)val4.mainScript != (Object)null)
				{
					addonComponent.AddTargetEntity(((Component)val4.mainScript).gameObject, Color.red);
				}
			}
		}
	}
	public class StartOfRoundPatch
	{
		[HarmonyPatch(typeof(StartOfRound), "Start")]
		[HarmonyBefore(new string[] { "evaisa.lethallib" })]
		[HarmonyPostfix]
		public static void StartRound(StartOfRound __instance)
		{
			AddonInput.Instance.EnableInput();
			if (NetworkManager.Singleton.IsHost)
			{
				if ((Object)(object)AddonFusionNetworkManager.Instance == (Object)null)
				{
					GameObject val = Object.Instantiate<GameObject>(AddonFusion.managerPrefab, ((Component)__instance).transform.parent);
					val.GetComponent<NetworkObject>().Spawn(false);
					AddonFusion.mls.LogInfo((object)"Spawning AddonFusionNetworkManager");
				}
				LoadAddons(__instance);
			}
		}

		[HarmonyPatch(typeof(StartOfRound), "UpdatePlayerVoiceEffects")]
		[HarmonyPostfix]
		public static void SpectralFrequencyVoiceEffects()
		{
			GrabbableObject obj = LFCUtilities.LocalPlayer?.currentlyHeldObjectServer;
			WalkieTalkie val = (WalkieTalkie)(object)((obj is WalkieTalkie) ? obj : null);
			if (!((Object)(object)val != (Object)null) || !LFCUtilities.LocalPlayer.holdingWalkieTalkie || !((GrabbableObject)val).isBeingUsed || !AFUtilities.TryGetAddonComponent<SpectralFrequency>((GrabbableObject)(object)val, out var addonComponent) || !addonComponent.isEnabled)
			{
				return;
			}
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB val2 in allPlayerScripts)
			{
				if (val2.isPlayerDead && (Object)(object)val2 != (Object)(object)LFCUtilities.LocalPlayer)
				{
					AudioSource currentVoiceChatAudioSource = val2.currentVoiceChatAudioSource;
					((Behaviour)((Component)currentVoiceChatAudioSource).GetComponent<AudioLowPassFilter>()).enabled = true;
					((Behaviour)((Component)currentVoiceChatAudioSource).GetComponent<AudioHighPassFilter>()).enabled = true;
					currentVoiceChatAudioSource.panStereo = 0.4f;
					currentVoiceChatAudioSource.spatialBlend = 0f;
					val2.currentVoiceChatIngameSettings.set2D = true;
					val2.voicePlayerState.Volume = 1f;
				}
			}
		}

		[HarmonyPatch(typeof(StartOfRound), "OnClientConnect")]
		[HarmonyPostfix]
		public static void SyncItems()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (!LFCUtilities.IsServer)
			{
				return;
			}
			foreach (GrabbableObject allA in LFCSpawnRegistry.GetAllAs<GrabbableObject>())
			{
				if (AFUtilities.TryGetAddonComponent<AddonComponent>(allA, out var addonComponent))
				{
					AddonFusionNetworkManager.Instance.SetAddonComponentEveryoneRpc(addonComponent.AddonName, NetworkObjectReference.op_Implicit(((Component)allA).GetComponent<NetworkObject>()));
				}
			}
		}

		public static void LoadAddons(StartOfRound startOfRound)
		{
			if (!ES3.KeyExists("shipAddonIDs", GameNetworkManager.Instance.currentSaveFileName))
			{
				AddonFusion.mls.LogWarning((object)"Key 'shipAddonIDs' does not exist");
				return;
			}
			string[] array = ES3.Load<string[]>("shipAddonIDs", GameNetworkManager.Instance.currentSaveFileName);
			if (array == null || array == null)
			{
				AddonFusion.mls.LogError((object)"Ship addon list loaded from file returns a null value!");
				return;
			}
			string[] array2 = array;
			foreach (string text in array2)
			{
				string[] array3 = text.Split(',');
				int itemID = int.Parse(array3[0]);
				string addonName = array3[1];
				if ((Object)(object)startOfRound.allItemsList.itemsList[itemID] != (Object)null)
				{
					GrabbableObject val = ((IEnumerable<GrabbableObject>)LFCSpawnRegistry.GetAllAs<GrabbableObject>()).FirstOrDefault((Func<GrabbableObject, bool>)((GrabbableObject g) => (Object)(object)g.itemProperties == (Object)(object)startOfRound.allItemsList.itemsList[itemID]));
					if ((Object)(object)val != (Object)null && AddonObjectRegistry.TryGetAddonType(addonName, out var addonType))
					{
						AFUtilities.SetAddonComponent(addonType, val);
					}
				}
			}
		}

		[HarmonyPatch(typeof(StartOfRound), "ShipLeave")]
		[HarmonyPostfix]
		public static void EndRound()
		{
			foreach (GrabbableObject allA in LFCSpawnRegistry.GetAllAs<GrabbableObject>())
			{
				if (AFUtilities.TryGetAddonComponent<AddonComponent>(allA, out var addonComponent))
				{
					addonComponent.StopCooldown();
				}
			}
		}

		[HarmonyPatch(typeof(StartOfRound), "OnDisable")]
		[HarmonyPostfix]
		public static void OnDisable()
		{
			AddonInput.Instance.DisableInput();
			AddonFusionNetworkManager.Instance = null;
		}
	}
}
namespace AddonFusion.Managers
{
	public class AddonFusionNetworkManager : NetworkBehaviour
	{
		public static AddonFusionNetworkManager Instance;

		public void Awake()
		{
			Instance = this;
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void SetAddonComponentEveryoneRpc(string addonName, NetworkObjectReference obj)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Invalid comparison between Unknown and I4
			//IL_0043: 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_005f: 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_0072: 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_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val2 = default(RpcParams);
				FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3529161795u, val2, val, (SendTo)6, (RpcDelivery)0);
				bool flag = addonName != null;
				((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val3)).WriteValueSafe(addonName, false);
				}
				((FastBufferWriter)(ref val3)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendRpc(ref val3, 3529161795u, val2, val, (SendTo)6, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1)
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				NetworkObject val4 = default(NetworkObject);
				GrabbableObject grabbableObject = default(GrabbableObject);
				if (((NetworkObjectReference)(ref obj)).TryGet(ref val4, (NetworkManager)null) && LFCUtilities.TryGetComponentInChildren<GrabbableObject>(((Component)val4).gameObject, ref grabbableObject) && AddonObjectRegistry.TryGetAddonType(addonName, out var addonType))
				{
					AFUtilities.SetAddonComponent(addonType, grabbableObject);
				}
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void EnableAddonEveryoneRpc(NetworkObjectReference obj, bool enable)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Invalid comparison between Unknown and I4
			//IL_0043: 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_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val2 = default(RpcParams);
				FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3043855815u, val2, val, (SendTo)6, (RpcDelivery)0);
				((FastBufferWriter)(ref val3)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref enable, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendRpc(ref val3, 3043855815u, val2, val, (SendTo)6, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1)
			{
				return;
			}
			base.__rpc_exec_stage = (__RpcExecStage)0;
			NetworkObject val4 = default(NetworkObject);
			GrabbableObject val5 = default(GrabbableObject);
			if (((NetworkObjectReference)(ref obj)).TryGet(ref val4, (NetworkManager)null) && LFCUtilities.TryGetComponentInChildren<GrabbableObject>(((Component)val4).gameObject, ref val5) && AFUtilities.TryGetAddonComponent<AddonComponent>(val5, out var addonComponent))
			{
				addonComponent.isEnabled = enable;
				if (LFCUtilities.ShouldBeLocalPlayer(val5.playerHeldBy))
				{
					HUDManager.Instance.DisplayTip("Information", enable ? "The addon ability is enabled" : "The addon ability is disabled", false, false, "LC_Tip1");
				}
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void StartAddonCooldownEveryoneRpc(NetworkObjectReference obj, int cooldown)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_0043: 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_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val2 = default(RpcParams);
				FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1855243820u, val2, val, (SendTo)6, (RpcDelivery)0);
				((FastBufferWriter)(ref val3)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				BytePacker.WriteValueBitPacked(val3, cooldown);
				((NetworkBehaviour)this).__endSendRpc(ref val3, 1855243820u, val2, val, (SendTo)6, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1)
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				NetworkObject val4 = default(NetworkObject);
				GrabbableObject grabbableObject = default(GrabbableObject);
				if (((NetworkObjectReference)(ref obj)).TryGet(ref val4, (NetworkManager)null) && LFCUtilities.TryGetComponentInChildren<GrabbableObject>(((Component)val4).gameObject, ref grabbableObject) && AFUtilities.TryGetAddonComponent<AddonComponent>(grabbableObject, out var addonComponent))
				{
					addonComponent.onCooldown = true;
					addonComponent.cooldownCoroutine = ((MonoBehaviour)this).StartCoroutine(addonComponent.StartCooldownCoroutine(cooldown));
				}
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void BlindPlayerEveryoneRpc(int playerId, float flashFilter)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_0043: 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_005f: 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_0072: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val2 = default(RpcParams);
				FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3708219736u, val2, val, (SendTo)6, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val3, playerId);
				((FastBufferWriter)(ref val3)).WriteValueSafe<float>(ref flashFilter, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendRpc(ref val3, 3708219736u, val2, val, (SendTo)6, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1)
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				if (LFCUtilities.ShouldBeLocalPlayer(StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>()))
				{
					HUDManager.Instance.flashFilter = Math.Max(HUDManager.Instance.flashFilter, flashFilter);
				}
			}
		}

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

		protected override void __initializeRpcs()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			((NetworkBehaviour)this).__registerRpc(3529161795u, new RpcReceiveHandler(__rpc_handler_3529161795), "SetAddonComponentEveryoneRpc");
			((NetworkBehaviour)this).__registerRpc(3043855815u, new RpcReceiveHandler(__rpc_handler_3043855815), "EnableAddonEveryoneRpc");
			((NetworkBehaviour)this).__registerRpc(1855243820u, new RpcReceiveHandler(__rpc_handler_1855243820), "StartAddonCooldownEveryoneRpc");
			((NetworkBehaviour)this).__registerRpc(3708219736u, new RpcReceiveHandler(__rpc_handler_3708219736), "BlindPlayerEveryoneRpc");
			((NetworkBehaviour)this).__initializeRpcs();
		}

		private static void __rpc_handler_3529161795(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_0067: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string addonName = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref addonName, false);
				}
				NetworkObjectReference obj = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((AddonFusionNetworkManager)(object)target).SetAddonComponentEveryoneRpc(addonName, obj);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3043855815(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference obj = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				bool enable = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref enable, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((AddonFusionNetworkManager)(object)target).EnableAddonEveryoneRpc(obj, enable);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1855243820(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 obj = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				int cooldown = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref cooldown);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((AddonFusionNetworkManager)(object)target).StartAddonCooldownEveryoneRpc(obj, cooldown);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3708219736(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				float flashFilter = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref flashFilter, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((AddonFusionNetworkManager)(object)target).BlindPlayerEveryoneRpc(playerId, flashFilter);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "AddonFusionNetworkManager";
		}
	}
	public class ConfigManager
	{
		public static ConfigEntry<int> bladeSharpenerRarity;

		public static ConfigEntry<int> bladeSharpenerMinValue;

		public static ConfigEntry<int> bladeSharpenerMaxValue;

		public static ConfigEntry<bool> isBladeSharpenerPurchasable;

		public static ConfigEntry<int> bladeSharpenerPrice;

		public static ConfigEntry<int> echoScannerRarity;

		public static ConfigEntry<int> echoScannerMinValue;

		public static ConfigEntry<int> echoScannerMaxValue;

		public static ConfigEntry<bool> isEchoScannerPurchasable;

		public static ConfigEntry<int> echoScannerPrice;

		public static ConfigEntry<int> flashlightLensRarity;

		public static ConfigEntry<int> flashlightLensMinValue;

		public static ConfigEntry<int> flashlightLensMaxValue;

		public static ConfigEntry<bool> isFlashlightLensPurchasable;

		public static ConfigEntry<int> flashlightLensPrice;

		public static ConfigEntry<int> flashlightLensCooldown;

		public static ConfigEntry<int> markerCompoundRarity;

		public static ConfigEntry<int> markerCompoundMinValue;

		public static ConfigEntry<int> markerCompoundMaxValue;

		public static ConfigEntry<bool> isMarkerCompoundPurchasable;

		public static ConfigEntry<int> markerCompoundPrice;

		public static ConfigEntry<int> protectiveCordRarity;

		public static ConfigEntry<int> protectiveCordMinValue;

		public static ConfigEntry<int> protectiveCordMaxValue;

		public static ConfigEntry<bool> isProtectiveCordPurchasable;

		public static ConfigEntry<int> protectiveCordPrice;

		public static ConfigEntry<float> protectiveCordWindowDuration;

		public static ConfigEntry<int> protectiveCordCooldown;

		public static ConfigEntry<int> saltTankRarity;

		public static ConfigEntry<int> saltTankMinValue;

		public static ConfigEntry<int> saltTankMaxValue;

		public static ConfigEntry<bool> isSaltTankPurchasable;

		public static ConfigEntry<int> saltTankPrice;

		public static ConfigEntry<int> spectralFrequencyRarity;

		public static ConfigEntry<int> spectralFrequencyMinValue;

		public static ConfigEntry<int> spectralFrequencyMaxValue;

		public static ConfigEntry<bool> isSpectralFrequencyPurchasable;

		public static ConfigEntry<int> spectralFrequencyPrice;

		internal static void Load()
		{
			bladeSharpenerRarity = AddonFusion.configFile.Bind<int>("Blade Sharpener", "Rarity", 20, "Blade Sharpener spawn rarity");
			bladeSharpenerMinValue = AddonFusion.configFile.Bind<int>("Blade Sharpener", "Min value", 15, "Blade Sharpener min value");
			bladeSharpenerMaxValue = AddonFusion.configFile.Bind<int>("Blade Sharpener", "Max value", 25, "Blade Sharpener max value");
			isBladeSharpenerPurchasable = AddonFusion.configFile.Bind<bool>("Blade Sharpener", "Purchasable", false, "Is the Blade Sharpener purchasable?");
			bladeSharpenerPrice = AddonFusion.configFile.Bind<int>("Blade Sharpener", "Price", 30, "Blade Sharpener price");
			echoScannerRarity = AddonFusion.configFile.Bind<int>("Echo Scanner", "Rarity", 10, "Echo Scanner spawn rarity");
			echoScannerMinValue = AddonFusion.configFile.Bind<int>("Echo Scanner", "Min value", 60, "Echo Scanner min value");
			echoScannerMaxValue = AddonFusion.configFile.Bind<int>("Echo Scanner", "Max value", 70, "Echo Scanner max value");
			isEchoScannerPurchasable = AddonFusion.configFile.Bind<bool>("Echo Scanner", "Purchasable", false, "Is the Echo Scanner purchasable?");
			echoScannerPrice = AddonFusion.configFile.Bind<int>("Echo Scanner", "Price", 75, "Echo Scanner price");
			flashlightLensRarity = AddonFusion.configFile.Bind<int>("Flashlight Lens", "Rarity", 10, "Flashlight Lens spawn rarity");
			flashlightLensMinValue = AddonFusion.configFile.Bind<int>("Flashlight Lens", "Min value", 65, "Flashlight Lens min value");
			flashlightLensMaxValue = AddonFusion.configFile.Bind<int>("Flashlight Lens", "Max value", 75, "Flashlight Lens max value");
			isFlashlightLensPurchasable = AddonFusion.configFile.Bind<bool>("Flashlight Lens", "Purchasable", false, "Is the Flashlight Lens purchasable?");
			flashlightLensPrice = AddonFusion.configFile.Bind<int>("Flashlight Lens", "Price", 80, "Flashlight Lens price");
			flashlightLensCooldown = AddonFusion.configFile.Bind<int>("Flashlight Lens", "Spam cooldown", 10, "Cooldown duration per use");
			markerCompoundRarity = AddonFusion.configFile.Bind<int>("Maker Compound", "Rarity", 5, "Maker Compound spawn rarity");
			markerCompoundMinValue = AddonFusion.configFile.Bind<int>("Maker Compound", "Min value", 75, "Maker Compound min value");
			markerCompoundMaxValue = AddonFusion.configFile.Bind<int>("Maker Compound", "Max value", 85, "Maker Compound max value");
			isMarkerCompoundPurchasable = AddonFusion.configFile.Bind<bool>("Maker Compound", "Purchasable", false, "Is the Maker Compound purchasable?");
			markerCompoundPrice = AddonFusion.configFile.Bind<int>("Maker Compound", "Price", 90, "Maker Compound price");
			protectiveCordRarity = AddonFusion.configFile.Bind<int>("Protective Cord", "Rarity", 15, "Protective Cord spawn rarity");
			protectiveCordMinValue = AddonFusion.configFile.Bind<int>("Protective Cord", "Min value", 40, "Protective Cord min value");
			protectiveCordMaxValue = AddonFusion.configFile.Bind<int>("Protective Cord", "Max value", 50, "Protective Cord max value");
			isProtectiveCordPurchasable = AddonFusion.configFile.Bind<bool>("Protective Cord", "Purchasable", false, "Is the Protective Cord purchasable?");
			protectiveCordPrice = AddonFusion.configFile.Bind<int>("Protective Cord", "Price", 55, "Protective Cord price");
			protectiveCordWindowDuration = AddonFusion.configFile.Bind<float>("Protective Cord", "Window duration", 0.35f, "Parrying window duration");
			protectiveCordCooldown = AddonFusion.configFile.Bind<int>("Protective Cord", "Spam cooldown", 2, "Cooldown duration per use");
			saltTankRarity = AddonFusion.configFile.Bind<int>("Salt Tank", "Rarity", 20, "Salt Tank spawn rarity");
			saltTankMinValue = AddonFusion.configFile.Bind<int>("Salt Tank", "Min value", 10, "Salt Tank min value");
			saltTankMaxValue = AddonFusion.configFile.Bind<int>("Salt Tank", "Max value", 20, "Salt Tank max value");
			isSaltTankPurchasable = AddonFusion.configFile.Bind<bool>("Salt Tank", "Purchasable", false, "Is the Salt Tank purchasable?");
			saltTankPrice = AddonFusion.configFile.Bind<int>("Salt Tank", "Price", 25, "Salt Tank price");
			spectralFrequencyRarity = AddonFusion.configFile.Bind<int>("Spectral Frequency", "Rarity", 5, "Spectral Frequency spawn rarity");
			spectralFrequencyMinValue = AddonFusion.configFile.Bind<int>("Spectral Frequency", "Min value", 80, "Spectral Frequency min value");
			spectralFrequencyMaxValue = AddonFusion.configFile.Bind<int>("Spectral Frequency", "Max value", 90, "Spectral Frequency max value");
			isSpectralFrequencyPurchasable = AddonFusion.configFile.Bind<bool>("Spectral Frequency", "Purchasable", false, "Is the Spectral Frequency purchasable?");
			spectralFrequencyPrice = AddonFusion.configFile.Bind<int>("Spectral Frequency", "Price", 95, "Spectral Frequency price");
		}
	}
}
namespace AddonFusion.Behaviours.Scripts
{
	[AttributeUsage(AttributeTargets.Class)]
	public class AddonInfoAttribute : Attribute
	{
		public AddonTargetDatabase.AddonTargetType TargetType;

		public AddonInfoAttribute(AddonTargetDatabase.AddonTargetType targetType)
		{
			TargetType = targetType;
		}
	}
	public class AddonInput : LcInputActions
	{
		private static AddonInput instance;

		public static AddonInput Instance
		{
			get
			{
				if (instance == null)
				{
					instance = new AddonInput();
				}
				return instance;
			}
			private set
			{
				instance = value;
			}
		}

		[InputAction(/*Could not decode attribute arguments.*/)]
		public InputAction AddonKey { get; set; }

		public void EnableInput()
		{
			AddonKey.performed += ActivateAddonAbility;
		}

		public void DisableInput()
		{
			AddonKey.performed -= ActivateAddonAbility;
		}

		public void ActivateAddonAbility(CallbackContext context)
		{
			if (((CallbackContext)(ref context)).performed && AFUtilities.TryGetAddonComponent<AddonComponent>(LFCUtilities.LocalPlayer?.currentlyHeldObjectServer, out var addonComponent) && !addonComponent.IsPassive)
			{
				addonComponent.ActivateAddonAbility();
			}
		}

		public string GetAddonToolTip()
		{
			return $"Addon Ability : [{InputActionRebindingExtensions.GetBindingDisplayString(AddonKey, (DisplayStringOptions)0, (string)null).First()}]";
		}
	}
	public static class AddonTargetDatabase
	{
		public enum AddonTargetType
		{
			ALL,
			FLASHLIGHT,
			KNIFE,
			SHOVEL,
			SPRAY_PAINT,
			WALKIE_TALKIE,
			BOOMBOX,
			SHOTGUN
		}

		public static readonly List<string> flashlightNames = new List<string>(2) { "Pro-flashlight", "Flashlight" };

		public static readonly List<string> knifeNames = new List<string>(2) { "Kitchen knife", "Poison Dagger" };

		public static readonly List<string> shovelNames = new List<string>(1) { "Shovel" };

		public static readonly List<string> sprayPaintNames = new List<string>(1) { "Spray paint" };

		public static readonly List<string> walkieTalkieNames = new List<string>(1) { "Walkie-talkie" };

		public static readonly List<string> boomboxNames = new List<string>(1) { "Boombox" };

		public static readonly List<string> shotgunNames = new List<string>(1) { "Shotgun" };
	}
	public class AoEProjector : MonoBehaviour
	{
		public float surfaceOffset = 0.05f;

		public LayerMask groundMask;

		public Vector3 CurrentPosition { get; private set; }

		public bool HasValidTarget { get; private set; }

		private void Update()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: 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_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)LFCUtilities.LocalPlayer == (Object)null))
			{
				RaycastHit val = default(RaycastHit);
				if (Physics.Raycast(new Ray(((Component)LFCUtilities.LocalPlayer.gameplayCamera).transform.position, ((Component)LFCUtilities.LocalPlayer.gameplayCamera).transform.forward), ref val, 50f, LayerMask.op_Implicit(groundMask), (QueryTriggerInteraction)1))
				{
					HasValidTarget = true;
					CurrentPosition = ((RaycastHit)(ref val)).point + Vector3.up * surfaceOffset;
					((Component)this).transform.position = CurrentPosition;
					((Component)this).transform.up = ((RaycastHit)(ref val)).normal;
				}
				else
				{
					HasValidTarget = false;
				}
			}
		}

		public bool TryConfirm(out Vector3 position)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: 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_002a: Unknown result type (might be due to invalid IL or missing references)
			return (position = (Vector3)(HasValidTarget ? CurrentPosition : default(Vector3))) != default(Vector3);
		}
	}
}
namespace AddonFusion.Behaviours.Furnitures
{
	public class AddonCapsule : NetworkBehaviour
	{
		public void RemoveAddon()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			GrabbableObject val = LFCUtilities.LocalPlayer?.currentlyHeldObjectServer;
			NetworkObject val2 = default(NetworkObject);
			if ((Object)(object)val != (Object)null && ((Component)val).TryGetComponent<NetworkObject>(ref val2) && AFUtilities.TryGetAddonComponent<AddonComponent>(val, out var addonComponent))
			{
				if (!addonComponent.onCooldown)
				{
					RemoveAddonEveryoneRpc(NetworkObjectReference.op_Implicit(val2));
					SpawnAddonItemServerRpc(NetworkObjectReference.op_Implicit(val2), ((Component)LFCUtilities.LocalPlayer).transform.position);
				}
				else
				{
					HUDManager.Instance.DisplayTip("Information", "The addon cannot be removed while on cooldown", false, false, "LC_Tip1");
				}
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void RemoveAddonEveryoneRpc(NetworkObjectReference obj)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Invalid comparison between Unknown and I4
			//IL_0043: 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_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val2 = default(RpcParams);
				FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4123247600u, val2, val, (SendTo)6, (RpcDelivery)0);
				((FastBufferWriter)(ref val3)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendRpc(ref val3, 4123247600u, val2, val, (SendTo)6, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1)
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				NetworkObject val4 = default(NetworkObject);
				if (((NetworkObjectReference)(ref obj)).TryGet(ref val4, (NetworkManager)null) && AFUtilities.TryGetAddonComponent<AddonComponent>(((Component)val4).gameObject.GetComponentInChildren<GrabbableObject>(), out var addonComponent))
				{
					addonComponent.RemoveAddon();
				}
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void SpawnAddonItemServerRpc(NetworkObjectReference obj, 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_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_0043: 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_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val2 = default(RpcParams);
				FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(596883848u, val2, val, (SendTo)2, (RpcDelivery)0);
				((FastBufferWriter)(ref val3)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				((FastBufferWriter)(ref val3)).WriteValueSafe(ref position);
				((NetworkBehaviour)this).__endSendRpc(ref val3, 596883848u, val2, val, (SendTo)2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1)
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				NetworkObject val4 = default(NetworkObject);
				if (((NetworkObjectReference)(ref obj)).TryGet(ref val4, (NetworkManager)null) && AFUtilities.TryGetAddonComponent<AddonComponent>(((Component)val4).gameObject.GetComponentInChildren<GrabbableObject>(), out var addonComponent) && AddonObjectRegistry.TryGetAddonObject(((object)addonComponent).GetType(), out var addonObj))
				{
					LFCObjectsManager.SpawnObjectForServer(addonObj, position);
				}
			}
		}

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

		protected override void __initializeRpcs()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			((NetworkBehaviour)this).__registerRpc(4123247600u, new RpcReceiveHandler(__rpc_handler_4123247600), "RemoveAddonEveryoneRpc");
			((NetworkBehaviour)this).__registerRpc(596883848u, new RpcReceiveHandler(__rpc_handler_596883848), "SpawnAddonItemServerRpc");
			((NetworkBehaviour)this).__initializeRpcs();
		}

		private static void __rpc_handler_4123247600(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 obj = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((AddonCapsule)(object)target).RemoveAddonEveryoneRpc(obj);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_596883848(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_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_0060: 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 obj = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				Vector3 position = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((AddonCapsule)(object)target).SpawnAddonItemServerRpc(obj, position);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "AddonCapsule";
		}
	}
}
namespace AddonFusion.Behaviours.AddonProps
{
	public class AddonScroll : PhysicsProp
	{
		public virtual Type AddonType { get; }

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			RaycastHit val = default(RaycastHit);
			GrabbableObject val2 = default(GrabbableObject);
			if (buttonDown && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && typeof(AddonComponent).IsAssignableFrom(AddonType) && Physics.Raycast(new Ray(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward), ref val, 3f, 832) && ((Component)((RaycastHit)(ref val)).transform).TryGetComponent<GrabbableObject>(ref val2))
			{
				AddonComponent addonComponent = default(AddonComponent);
				string addonName;
				if (!IsValidForItem(val2.itemProperties?.itemName))
				{
					HUDManager.Instance.DisplayTip("Impossible action", "This addon cannot be assigned to this item", false, false, "LC_Tip1");
				}
				else if (((Component)val2).TryGetComponent<AddonComponent>(ref addonComponent))
				{
					HUDManager.Instance.DisplayTip("Impossible action", "This item already has an addon", false, false, "LC_Tip1");
				}
				else if (AddonObjectRegistry.TryGetAddonName(AddonType, out addonName))
				{
					AddonFusionNetworkManager.Instance.SetAddonComponentEveryoneRpc(addonName, NetworkObjectReference.op_Implicit(((Component)val2).GetComponent<NetworkObject>()));
					LFCNetworkManager.Instance.DestroyObjectEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)this).GetComponent<NetworkObject>()));
				}
			}
		}

		public bool IsValidForItem(string itemName)
		{
			AddonTargetDatabase.AddonTargetType addonTargetType = AddonType.GetCustomAttribute<AddonInfoAttribute>()?.TargetType ?? AddonTargetDatabase.AddonTargetType.ALL;
			bool flag = !string.IsNullOrEmpty(itemName);
			bool flag2 = flag;
			if (flag2)
			{
				flag2 = addonTargetType switch
				{
					AddonTargetDatabase.AddonTargetType.ALL => true, 
					AddonTargetDatabase.AddonTargetType.FLASHLIGHT => AddonTargetDatabase.flashlightNames.Contains(itemName), 
					AddonTargetDatabase.AddonTargetType.KNIFE => AddonTargetDatabase.knifeNames.Contains(itemName), 
					AddonTargetDatabase.AddonTargetType.SHOVEL => AddonTargetDatabase.shovelNames.Contains(itemName), 
					AddonTargetDatabase.AddonTargetType.SPRAY_PAINT => AddonTargetDatabase.sprayPaintNames.Contains(itemName), 
					AddonTargetDatabase.AddonTargetType.WALKIE_TALKIE => AddonTargetDatabase.walkieTalkieNames.Contains(itemName), 
					AddonTargetDatabase.AddonTargetType.BOOMBOX => AddonTargetDatabase.boomboxNames.Contains(itemName), 
					AddonTargetDatabase.AddonTargetType.SHOTGUN => AddonTargetDatabase.shotgunNames.Contains(itemName), 
					_ => false, 
				};
			}
			return flag2;
		}

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "AddonScroll";
		}
	}
	public class BladeSharpenerItem : AddonScroll
	{
		public override Type AddonType => typeof(BladeSharpener);

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "BladeSharpenerItem";
		}
	}
	public class EchoScannerItem : AddonScroll
	{
		public override Type AddonType => typeof(EchoScanner);

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "EchoScannerItem";
		}
	}
	public class FlashlightLensItem : AddonScroll
	{
		public override Type AddonType => typeof(FlashlightLens);

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "FlashlightLensItem";
		}
	}
	public class MarkerCompoundItem : AddonScroll
	{
		public override Type AddonType => typeof(MarkerCompound);

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "MarkerCompoundItem";
		}
	}
	public class ProtectiveCordItem : AddonScroll
	{
		public override Type AddonType => typeof(ProtectiveCord);

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "ProtectiveCordItem";
		}
	}
	public class SaltTankItem : AddonScroll
	{
		public override Type AddonType => typeof(SaltTank);

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "SaltTankItem";
		}
	}
	public class SpectralFrequencyItem : AddonScroll
	{
		public override Type AddonType => typeof(SpectralFrequency);

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "SpectralFrequencyItem";
		}
	}
}
namespace AddonFusion.Behaviours.AddonComponents
{
	public abstract class AddonComponent : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <StartCooldownCoroutine>d__11 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public int cooldown;

			public AddonComponent <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <StartCooldownCoroutine>d__11(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				int num = <>1__state;
				AddonComponent addonComponent = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					break;
				case 1:
					<>1__state = -1;
					cooldown--;
					addonComponent.SetCooldownTipsForItem(cooldown);
					break;
				}
				if (cooldown > 0)
				{
					<>2__current = (object)new WaitForSecondsRealtime(1f);
					<>1__state = 1;
					return true;
				}
				addonComponent.onCooldown = false;
				addonComponent.cooldownCoroutine = null;
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public GrabbableObject grabbableObject;

		public bool isEnabled;

		public bool onCooldown;

		public Coroutine cooldownCoroutine;

		public abstract string AddonName { get; }

		public abstract bool IsPassive { get; }

		public virtual void ActivateAddonAbility()
		{
		}

		public void StartCooldown(int cooldown)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			NetworkObject val = default(NetworkObject);
			if (!onCooldown && !IsPassive && (Object)(object)grabbableObject != (Object)null && ((Component)grabbableObject).TryGetComponent<NetworkObject>(ref val))
			{
				AddonFusionNetworkManager.Instance.StartAddonCooldownEveryoneRpc(NetworkObjectReference.op_Implicit(val), cooldown);
			}
		}

		public void StopCooldown()
		{
			if (onCooldown && cooldownCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(cooldownCoroutine);
				cooldownCoroutine = null;
				onCooldown = false;
				SetCooldownTipsForItem(0);
			}
		}

		[IteratorStateMachine(typeof(<StartCooldownCoroutine>d__11))]
		public IEnumerator StartCooldownCoroutine(int cooldown)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <StartCooldownCoroutine>d__11(0)
			{
				<>4__this = this,
				cooldown = cooldown
			};
		}

		public void SetCooldownTipsForItem(int timeLeft)
		{
			if ((Object)(object)grabbableObject != (Object)null && grabbableObject.isHeld && !grabbableObject.isPocketed)
			{
				string text = ((timeLeft > 0) ? $"[On cooldown: {timeLeft}]" : "");
				SetTipsForItem((!IsPassive) ? new string[2]
				{
					AddonInput.Instance.GetAddonToolTip(),
					text
				} : new string[1] { text });
			}
		}

		public void SetTipsForItem(string[] toolTips)
		{
			if (LFCUtilities.ShouldBeLocalPlayer(grabbableObject?.playerHeldBy))
			{
				HUDManager.Instance.ChangeControlTipMultiple(grabbableObject.itemProperties.toolTips.Concat(toolTips).ToArray(), true, grabbableObject.itemProperties);
			}
		}

		public void RemoveAddon()
		{
			if (!((Object)(object)grabbableObject != (Object)null))
			{
				return;
			}
			ScanNodeProperties val = default(ScanNodeProperties);
			if (LFCUtilities.TryGetComponentInChildren<ScanNodeProperties>(((Component)grabbableObject).gameObject, ref val))
			{
				string[] array = new string[2]
				{
					"\nAddon: " + AddonName,
					"Addon: " + AddonName
				};
				string[] array2 = array;
				foreach (string text in array2)
				{
					int num = val.subText.IndexOf(text);
					if (num >= 0)
					{
						val.subText = val.subText.Remove(num, text.Length);
						break;
					}
				}
			}
			if (LFCUtilities.ShouldBeLocalPlayer(grabbableObject.playerHeldBy))
			{
				HUDManager.Instance.ClearControlTips();
				HUDManager.Instance.ChangeControlTipMultiple(grabbableObject.itemProperties.toolTips, true, grabbableObject.itemProperties);
			}
			Object.Destroy((Object)(object)this);
		}
	}
	[AddonInfo(AddonTargetDatabase.AddonTargetType.KNIFE)]
	public class BladeSharpener : AddonComponent
	{
		public override string AddonName => "Blade Sharpener";

		public override bool IsPassive => true;
	}
	[AddonInfo(AddonTargetDatabase.AddonTargetType.BOOMBOX)]
	public class EchoScanner : AddonComponent
	{
		private readonly Collider[] overlapBuffer = (Collider[])(object)new Collider[64];

		public readonly float AoERadius = 15f;

		public readonly int AoEMask = 1084754760;

		public readonly float AuraCooldown = 2f;

		public float auraTimer;

		public bool canReveal = true;

		public override string AddonName => "Echo Scanner";

		public override bool IsPassive => false;

		public override void ActivateAddonAbility()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			NetworkObject val = default(NetworkObject);
			if (grabbableObject is BoomboxItem && ((Component)grabbableObject).TryGetComponent<NetworkObject>(ref val))
			{
				AddonFusionNetworkManager.Instance.EnableAddonEveryoneRpc(NetworkObjectReference.op_Implicit(val), !isEnabled);
			}
		}

		public void Update()
		{
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			LFCUtilities.UpdateTimer(ref auraTimer, AuraCooldown, !canReveal, (Action)delegate
			{
				canReveal = true;
				LFCCustomPassManager.RemoveAuraByTag(string.Format("{0}{1}", "Addon Fusion", ((Component)this).gameObject));
			});
			if (!isEnabled)
			{
				return;
			}
			GrabbableObject obj = grabbableObject;
			BoomboxItem val = (BoomboxItem)(object)((obj is BoomboxItem) ? obj : null);
			if (val == null || !((GrabbableObject)val).isBeingUsed)
			{
				return;
			}
			if (((GrabbableObject)val).insertedBattery.charge > 0f)
			{
				Battery insertedBattery = ((GrabbableObject)val).insertedBattery;
				insertedBattery.charge -= Time.deltaTime / ((GrabbableObject)val).itemProperties.batteryUsage;
			}
			if (!canReveal)
			{
				return;
			}
			canReveal = false;
			HashSet<GameObject> hashSet = new HashSet<GameObject>();
			int num = Physics.OverlapSphereNonAlloc(((Component)val).transform.position, AoERadius, overlapBuffer, AoEMask, (QueryTriggerInteraction)2);
			for (int i = 0; i < num; i++)
			{
				GameObject validTarget = GetValidTarget(overlapBuffer[i], ((GrabbableObject)val).isHeld);
				if ((Object)(object)validTarget != (Object)null)
				{
					hashSet.Add(validTarget);
				}
			}
			if (hashSet.Count > 0)
			{
				Color val2 = (((GrabbableObject)val).isHeld ? Color.yellow : Color.red);
				LFCCustomPassManager.SetupAuraForObjects(hashSet.ToArray(), LegaFusionCore.wallhackShader, string.Format("{0}{1}", "Addon Fusion", ((Component)this).gameObject), val2);
			}
		}

		public GameObject GetValidTarget(Collider collider, bool isHeld)
		{
			if ((Object)(object)collider != (Object)null)
			{
				GrabbableObject val = default(GrabbableObject);
				if (isHeld && ((Component)collider).gameObject.TryGetComponent<GrabbableObject>(ref val))
				{
					return ((Component)val).gameObject;
				}
				PlayerControllerB val2 = default(PlayerControllerB);
				if (isHeld && ((Component)collider).gameObject.TryGetComponent<PlayerControllerB>(ref val2) && !val2.isPlayerDead && LFCUtilities.ShouldNotBeLocalPlayer(val2))
				{
					return ((Component)val2).gameObject;
				}
				EnemyAICollisionDetect val3 = default(EnemyAICollisionDetect);
				if (!isHeld && ((Component)collider).gameObject.TryGetComponent<EnemyAICollisionDetect>(ref val3) && (Object)(object)val3.mainScript != (Object)null)
				{
					return ((Component)val3.mainScript).gameObject;
				}
			}
			return null;
		}
	}
	[AddonInfo(AddonTargetDatabase.AddonTargetType.FLASHLIGHT)]
	public class FlashlightLens : AddonComponent
	{
		[CompilerGenerated]
		private sealed class <BlindCoroutine>d__8<T> : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public FlashlightLens <>4__this;

			public T entity;

			private FlashlightItem <flashlight>5__2;

			private float <flashDuration>5__3;

			private float <timePassed>5__4;

			private float <defaultSpotAngle>5__5;

			private float <minSpotAngle>5__6;

			private bool <hasBeenBlinded>5__7;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <BlindCoroutine>d__8(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<flashlight>5__2 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0094: Expected O, but got Unknown
				//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c5: Expected O, but got Unknown
				//IL_0184: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				FlashlightLens flashlightLens = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
				{
					<>1__state = -1;
					ref FlashlightItem reference = ref <flashlight>5__2;
					GrabbableObject grabbableObject = flashlightLens.grabbableObject;
					reference = (FlashlightItem)(object)((grabbableObject is FlashlightItem) ? grabbableObject : null);
					<flashDuration>5__3 = 3f;
					<timePassed>5__4 = 0f;
					<defaultSpotAngle>5__5 = <flashlight>5__2.flashlightBulb.spotAngle;
					<minSpotAngle>5__6 = <defaultSpotAngle>5__5 / 3f;
					<hasBeenBlinded>5__7 = false;
					goto IL_012d;
				}
				case 1:
				{
					<>1__state = -1;
					<timePassed>5__4 += 0.1f;
					<flashlight>5__2.flashlightBulb.spotAngle = Mathf.Lerp(<defaultSpotAngle>5__5, <minSpotAngle>5__6, <timePassed>5__4 / <flashDuration>5__3);
					object obj = entity;
					PlayerControllerB val = (PlayerControllerB)((obj is PlayerControllerB) ? obj : null);
					if (val != null)
					{
						AddonFusionNetworkManager.Instance.BlindPlayerEveryoneRpc((int)val.playerClientId, <timePassed>5__4 / <flashDuration>5__3);
					}
					if (!(<timePassed>5__4 >= <flashDuration>5__3))
					{
						goto IL_012d;
					}
					<hasBeenBlinded>5__7 = true;
					goto IL_013e;
				}
				case 2:
					{
						<>1__state = -1;
						break;
					}
					IL_013e:
					if (<hasBeenBlinded>5__7)
					{
						<flashlight>5__2.flashlightBulb.spotAngle = <defaultSpotAngle>5__5 * 2f;
						object obj2 = entity;
						EnemyAI val2 = (EnemyAI)((obj2 is EnemyAI) ? obj2 : null);
						if (val2 != null)
						{
							LFCNetworkManager.Instance.StunEnemyEveryoneRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)val2).NetworkObject), true, 1f, (int)((GrabbableObject)<flashlight>5__2).playerHeldBy.playerClientId);
						}
						flashlightLens.StartCooldown(ConfigManager.flashlightLensCooldown.Value);
						<>2__current = (object)new WaitForSeconds(0.1f);
						<>1__state = 2;
						return true;
					}
					break;
					IL_012d:
					if (flashlightLens.CanBeBlinded(entity))
					{
						<>2__current = (object)new WaitForSeconds(0.1f);
						<>1__state = 1;
						return true;
					}
					goto IL_013e;
				}
				<flashlight>5__2.flashlightBulb.spotAngle = <defaultSpotAngle>5__5;
				flashlightLens.blindCoroutine = null;
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public Coroutine blindCoroutine;

		public override string AddonName => "Flashlight Lens";

		public override bool IsPassive => false;

		public override void ActivateAddonAbility()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			NetworkObject val = default(NetworkObject);
			if (grabbableObject is FlashlightItem && ((Component)grabbableObject).TryGetComponent<NetworkObject>(ref val))
			{
				AddonFusionNetworkManager.Instance.EnableAddonEveryoneRpc(NetworkObjectReference.op_Implicit(val), !isEnabled);
			}
		}

		public void Update()
		{
			if (!isEnabled || onCooldown)
			{
				return;
			}
			GrabbableObject obj = grabbableObject;
			FlashlightItem val = (FlashlightItem)(object)((obj is FlashlightItem) ? obj : null);
			if (val == null || !((GrabbableObject)val).isBeingUsed)
			{
				return;
			}
			if (((GrabbableObject)val).insertedBattery.charge > 0f)
			{
				Battery insertedBattery = ((GrabbableObject)val).insertedBattery;
				insertedBattery.charge -= Time.deltaTime / ((GrabbableObject)val).itemProperties.batteryUsage;
			}
			PlayerControllerB val2 = grabbableObject?.playerHeldBy;
			if (!LFCUtilities.ShouldBeLocalPlayer(val2) || blindCoroutine != null)
			{
				return;
			}
			foreach (EnemyAI allA in LFCSpawnRegistry.GetAllAs<EnemyAI>())
			{
				if (CanBeBlinded<EnemyAI>(allA))
				{
					blindCoroutine = ((MonoBehaviour)this).StartCoroutine(BlindCoroutine<EnemyAI>(allA));
					return;
				}
			}
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB entity in allPlayerScripts)
			{
				if (CanBeBlinded<PlayerControllerB>(entity))
				{
					blindCoroutine = ((MonoBehaviour)this).StartCoroutine(BlindCoroutine<PlayerControllerB>(entity));
					break;
				}
			}
		}

		public bool CanBeBlinded<T>(T entity)
		{
			//IL_00e4: 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_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_00a7: 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)
			GrabbableObject obj = grabbableObject;
			FlashlightItem val = (FlashlightItem)(object)((obj is FlashlightItem) ? obj : null);
			object obj2 = entity;
			PlayerControllerB val2 = (PlayerControllerB)((obj2 is PlayerControllerB) ? obj2 : null);
			if (val2 == null)
			{
				object obj3 = entity;
				EnemyAI val3 = (EnemyAI)((obj3 is EnemyAI) ? obj3 : null);
				if (val3 != null && (Object)(object)val3.enemyType != (Object)null && val3.enemyType.canBeStunned && (Object)(object)val3.eye != (Object)null && val3.CheckLineOfSightForPosition(((Component)val.flashlightBulb).transform.position, 90f, 15, -1f, (Transform)null))
				{
					return Mathf.Abs(Vector3.Angle(((Component)val.flashlightBulb).transform.forward, val3.eye.position - ((Component)val.flashlightBulb).transform.position)) < 15f;
				}
				return false;
			}
			if (val2.isPlayerControlled && LFCUtilities.ShouldNotBeLocalPlayer(val2) && val2.HasLineOfSightToPosition(((Component)val.flashlightBulb).transform.position + Vector3.up * 0.4f, 60f, 15, -1f, -1))
			{
				return Mathf.Abs(Vector3.Angle(((Component)val.flashlightBulb).transform.forward, val2.playerEye.position - ((Component)val.flashlightBulb).transform.position)) < 15f;
			}
			return false;
		}

		[IteratorStateMachine(typeof(<BlindCoroutine>d__8<>))]
		public IEnumerator BlindCoroutine<T>(T entity)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <BlindCoroutine>d__8<T>(0)
			{
				<>4__this = this,
				entity = entity
			};
		}
	}
	[AddonInfo(AddonTargetDatabase.AddonTargetType.SPRAY_PAINT)]
	public class MarkerCompound : AddonComponent
	{
		public Dictionary<GameObject, Color> targetEntities = new Dictionary<GameObject, Color>();

		public override string AddonName => "Maker Compound";

		public override bool IsPassive => false;

		public void AddTargetEntity(GameObject entity, Color color)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			if (!targetEntities.ContainsKey(entity))
			{
				targetEntities.Add(entity, color);
			}
		}

		public override void ActivateAddonAbility()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			NetworkObject val = default(NetworkObject);
			if (grabbableObject is SprayPaintItem && ((Component)grabbableObject).TryGetComponent<NetworkObject>(ref val))
			{
				AddonFusionNetworkManager.Instance.EnableAddonEveryoneRpc(NetworkObjectReference.op_Implicit(val), !isEnabled);
			}
		}

		public void Update()
		{
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			if (!isEnabled)
			{
				return;
			}
			GrabbableObject obj = grabbableObject;
			SprayPaintItem val = (SprayPaintItem)(object)((obj is SprayPaintItem) ? obj : null);
			if (val == null)
			{
				return;
			}
			if (val.isSpraying && ((GrabbableObject)val).isHeld && val.sprayCanTank > 0f)
			{
				if (LFCUtilities.ShouldBeLocalPlayer(((GrabbableObject)val).playerHeldBy))
				{
					foreach (KeyValuePair<GameObject, Color> targetEntity in targetEntities)
					{
						LFCCustomPassManager.SetupAuraForObject(targetEntity.Key, LegaFusionCore.wallhackShader, string.Format("{0}{1}", "Addon Fusion", ((Component)this).gameObject), targetEntity.Value);
					}
				}
				val.sprayCanTank = Mathf.Max(val.sprayCanTank - Time.deltaTime / 30f, 0f);
			}
			else if (LFCUtilities.ShouldBeLocalPlayer(((GrabbableObject)val).playerHeldBy))
			{
				LFCCustomPassManager.RemoveAuraByTag(string.Format("{0}{1}", "Addon Fusion", ((Component)this).gameObject));
			}
		}
	}
	[AddonInfo(AddonTargetDatabase.AddonTargetType.SHOVEL)]
	public class ProtectiveCord : AddonComponent
	{
		[CompilerGenerated]
		private sealed class <ParryCoroutine>d__6 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public ProtectiveCord <>4__this;

			public Shovel shovel;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <ParryCoroutine>d__6(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0047: Expected O, but got Unknown
				int num = <>1__state;
				ProtectiveCord protectiveCord = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					protectiveCord.isParrying = true;
					protectiveCord.ReelingUpShovel(enable: true, ref shovel);
					<>2__current = (object)new WaitForSeconds(ConfigManager.protectiveCordWindowDuration.Value);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					protectiveCord.ReelingUpShovel(enable: false, ref shovel);
					protectiveCord.isParrying = false;
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public bool isParrying;

		public override string AddonName => "Protective Cord";

		public override bool IsPassive => false;

		public override void ActivateAddonAbility()
		{
			if (onCooldown)
			{
				HUDManager.Instance.DisplayTip("Information", "On cooldown!", false, false, "LC_Tip1");
				return;
			}
			PlayerControllerB val = grabbableObject?.playerHeldBy;
			if ((Object)(object)val != (Object)null)
			{
				GrabbableObject obj = grabbableObject;
				Shovel val2 = (Shovel)(object)((obj is Shovel) ? obj : null);
				if (val2 != null && !val2.reelingUp)
				{
					StartCooldown(ConfigManager.protectiveCordCooldown.Value);
					val2.previousPlayerHeldBy = val;
					((MonoBehaviour)this).StartCoroutine(ParryCoroutine(val2));
				}
			}
		}

		[IteratorStateMachine(typeof(<ParryCoroutine>d__6))]
		private IEnumerator ParryCoroutine(Shovel shovel)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <ParryCoroutine>d__6(0)
			{
				<>4__this = this,
				shovel = shovel
			};
		}

		public void ReelingUpShovel(bool enable, ref Shovel shovel)
		{
			shovel.reelingUp = enable;
			shovel.previousPlayerHeldBy.activatingItem = enable;
			shovel.previousPlayerHeldBy.twoHanded = enable;
			shovel.previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", enable);
			if (enable)
			{
				if (shovel.reelingUpCoroutine != null)
				{
					((MonoBehaviour)shovel).StopCoroutine(shovel.reelingUpCoroutine);
				}
				shovel.previousPlayerHeldBy.playerBodyAnimator.ResetTrigger("shovelHit");
				shovel.shovelAudio.PlayOneShot(shovel.reelUp);
				shovel.ReelUpSFXServerRpc();
			}
		}
	}
	[AddonInfo(AddonTargetDatabase.AddonTargetType.SHOTGUN)]
	public class SaltTank : AddonComponent
	{
		public override string AddonName => "Protective Cord";

		public override bool IsPassive => true;
	}
	[AddonInfo(AddonTargetDatabase.AddonTargetType.WALKIE_TALKIE)]
	public class SpectralFrequency : AddonComponent
	{
		public override string AddonName => "Spectral Frequency";

		public override bool IsPassive => false;

		public override void ActivateAddonAbility()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			NetworkObject val = default(NetworkObject);
			if (grabbableObject is WalkieTalkie && ((Component)grabbableObject).TryGetComponent<NetworkObject>(ref val))
			{
				AddonFusionNetworkManager.Instance.EnableAddonEveryoneRpc(NetworkObjectReference.op_Implicit(val), !isEnabled);
			}
		}

		public void Update()
		{
			if (isEnabled)
			{
				GrabbableObject obj = grabbableObject;
				WalkieTalkie val = (WalkieTalkie)(object)((obj is WalkieTalkie) ? obj : null);
				if (val != null && ((GrabbableObject)val).isBeingUsed && ((GrabbableObject)val).insertedBattery.charge > 0f)
				{
					Battery insertedBattery = ((GrabbableObject)val).insertedBattery;
					insertedBattery.charge -= Time.deltaTime / ((GrabbableObject)val).itemProperties.batteryUsage;
				}
			}
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}
namespace __GEN
{
	internal class NetworkVariableSerializationHelper
	{
		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeSerialization()
		{
		}
	}
}
namespace AddonFusion.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}