Decompiled source of LanternKeeper v1.0.9

LanternKeeper.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LanternKeeper.Behaviours;
using LanternKeeper.Managers;
using LanternKeeper.NetcodePatcher;
using LanternKeeper.Patches;
using LegaFusionCore;
using LegaFusionCore.Behaviours;
using LegaFusionCore.Managers;
using LegaFusionCore.Managers.NetworkManagers;
using LegaFusionCore.Utilities;
using LethalLib.Modules;
using LethalStatus.Managers;
using LethalStatus.StatusEffects;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("LanternKeeper")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LanternKeeper")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a49f9ee5-8230-433e-bb8a-2f35686646db")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[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: 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 LanternKeeper
{
	public class Constants
	{
		public const string GLOBAL = "_Global_";

		public const string LANTERN = "Lantern";

		public const string LANTERN_KEEPER_ENEMY = "Lantern Keeper (Enemy)";

		public const string POISON_DAGGER = "Poison Dagger";

		public const string POISON_MARK = "Poison Mark";

		public const string LANTERN_KEEPER = "Lantern Keeper";
	}
	[BepInPlugin("Lega.LanternKeeper", "Lantern Keeper", "1.0.9")]
	public class LanternKeeper : BaseUnityPlugin
	{
		internal const string modGUID = "Lega.LanternKeeper";

		internal const string modName = "Lantern Keeper";

		internal const string modVersion = "1.0.9";

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

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

		internal static ManualLogSource mls;

		public static ConfigFile configFile;

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

		public static GameObject daggerObj;

		public static GameObject poisonMarkObj;

		public static GameObject poisonBallObj;

		public static GameObject lanternObj;

		public static List<Lantern> spawnedLanterns = new List<Lantern>();

		public void Awake()
		{
			mls = Logger.CreateLogSource("LanternKeeper");
			configFile = ((BaseUnityPlugin)this).Config;
			ConfigManager.Load();
			LoadManager();
			NetcodePatcher();
			LoadItems();
			LoadEnemies();
			LoadNetworkPrefabs();
			harmony.PatchAll(typeof(StartOfRoundPatch));
		}

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

		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()
		{
			daggerObj = LFCObjectsManager.RegisterObject(typeof(PoisonDagger), bundle.LoadAsset<Item>("Assets/PoisonDagger/PoisonDaggerItem.asset")).spawnPrefab;
		}

		public static void LoadEnemies()
		{
			EnemyType val = bundle.LoadAsset<EnemyType>("Assets/LanternKeeper/LanternKeeperEnemy.asset");
			NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab);
			var (dictionary, dictionary2) = ConfigManager.GetEnemySpawns();
			Enemies.RegisterEnemy(val, dictionary, dictionary2, bundle.LoadAsset<TerminalNode>("Assets/LanternKeeper/LanternKeeperTN.asset"), bundle.LoadAsset<TerminalKeyword>("Assets/LanternKeeper/LanternKeeperTK.asset"));
		}

		public void LoadNetworkPrefabs()
		{
			HashSet<GameObject> hashSet = new HashSet<GameObject>
			{
				lanternObj = bundle.LoadAsset<GameObject>("Assets/Lantern/LK_Lantern.prefab"),
				poisonBallObj = bundle.LoadAsset<GameObject>("Assets/PoisonBall/PoisonBall.prefab"),
				poisonMarkObj = bundle.LoadAsset<GameObject>("Assets/Addons/PoisonMark.prefab")
			};
			foreach (GameObject item in hashSet)
			{
				NetworkPrefabs.RegisterNetworkPrefab(item);
				Utilities.FixMixerGroups(item);
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "LanternKeeper";

		public const string PLUGIN_NAME = "LanternKeeper";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace LanternKeeper.Patches
{
	internal class StartOfRoundPatch
	{
		[HarmonyPatch(typeof(StartOfRound), "Start")]
		[HarmonyBefore(new string[] { "evaisa.lethallib" })]
		[HarmonyPostfix]
		private static void StartRound(StartOfRound __instance)
		{
			if (NetworkManager.Singleton.IsHost && (Object)(object)LanternKeeperNetworkManager.Instance == (Object)null)
			{
				GameObject val = Object.Instantiate<GameObject>(LanternKeeper.managerPrefab, ((Component)__instance).transform.parent);
				val.GetComponent<NetworkObject>().Spawn(false);
				LanternKeeper.mls.LogInfo((object)"Spawning LanternKeeperNetworkManager");
			}
		}

		[HarmonyPatch(typeof(StartOfRound), "EndOfGame")]
		[HarmonyPostfix]
		public static void EndOfGame()
		{
			foreach (Lantern spawnedLantern in LanternKeeper.spawnedLanterns)
			{
				if (!((Object)(object)spawnedLantern == (Object)null) && ((NetworkBehaviour)spawnedLantern).IsSpawned)
				{
					((Component)spawnedLantern).GetComponent<NetworkObject>().Despawn(true);
				}
			}
			LanternKeeper.spawnedLanterns.Clear();
		}

		[HarmonyPatch(typeof(StartOfRound), "OnDisable")]
		[HarmonyPostfix]
		public static void OnDisable()
		{
			LanternKeeperNetworkManager.Instance = null;
		}
	}
}
namespace LanternKeeper.Managers
{
	public class ConfigManager
	{
		public static ConfigEntry<string> spawnWeights;

		public static ConfigEntry<int> enemyDirectDamage;

		public static ConfigEntry<int> enemyPoisonDamage;

		public static ConfigEntry<int> enemyPoisonDuration;

		public static ConfigEntry<int> daggerMinValue;

		public static ConfigEntry<int> daggerMaxValue;

		public static ConfigEntry<int> poisonMarkCooldown;

		public static void Load()
		{
			spawnWeights = LanternKeeper.configFile.Bind<string>("_Global_", "Spawn weights", "Vanilla:20,Modded:20", "Lantern Keeper (Enemy) spawn weights");
			enemyDirectDamage = LanternKeeper.configFile.Bind<int>("Lantern Keeper (Enemy)", "Direct Damage", 30, "Direct damage dealt by the Lantern Keeper");
			enemyPoisonDamage = LanternKeeper.configFile.Bind<int>("Lantern Keeper (Enemy)", "Poison Damage", 10, "Total damage dealt by the poison to the player");
			enemyPoisonDuration = LanternKeeper.configFile.Bind<int>("Lantern Keeper (Enemy)", "Poison Duration", 10, "Poison duration");
			daggerMinValue = LanternKeeper.configFile.Bind<int>("Poison Dagger", "Min Value", 50, "Poison Dagger min value");
			daggerMaxValue = LanternKeeper.configFile.Bind<int>("Poison Dagger", "Max Value", 90, "Poison Dagger max value");
			poisonMarkCooldown = LanternKeeper.configFile.Bind<int>("Poison Mark", "Cooldown", 45, "Cooldown duration of the Poison Mark");
		}

		public static (Dictionary<LevelTypes, int> spawnRateByLevelType, Dictionary<string, int> spawnRateByCustomLevelType) GetEnemySpawns()
		{
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<LevelTypes, int> dictionary = new Dictionary<LevelTypes, int>();
			Dictionary<string, int> dictionary2 = new Dictionary<string, int>();
			foreach (string item in from s in spawnWeights.Value.Split(',')
				select s.Trim())
			{
				string[] array = item.Split(':');
				if (array.Length != 2)
				{
					continue;
				}
				string text = array[0];
				if (int.TryParse(array[1], out var result))
				{
					if (Enum.TryParse<LevelTypes>(text, ignoreCase: true, out LevelTypes result2))
					{
						dictionary[result2] = result;
					}
					else
					{
						dictionary2[text] = result;
					}
				}
			}
			return (dictionary, dictionary2);
		}
	}
	public class LanternKeeperNetworkManager : NetworkBehaviour
	{
		public static LanternKeeperNetworkManager Instance;

		public void Awake()
		{
			Instance = this;
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void SpawnPoisonMarkEveryoneRpc(int playerId, int playerWhoHit)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1)
				{
					RpcAttributeParams val = new RpcAttributeParams
					{
						RequireOwnership = false
					};
					RpcParams val2 = default(RpcParams);
					FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(340606894u, val2, val, (SendTo)6, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val3, playerId);
					BytePacker.WriteValueBitPacked(val3, playerWhoHit);
					((NetworkBehaviour)this).__endSendRpc(ref val3, 340606894u, val2, val, (SendTo)6, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1)
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>();
					LFCGlobalManager.PlayParticle(LanternKeeper.poisonMarkObj, ((Component)component).transform.position, ((Component)component).transform.rotation, true, 1f, true);
					LSStatusEffectRegistry.ApplyStatus(((Component)component).gameObject, (StatusEffectType)2, playerWhoHit, 10, 100, (EnemyAI)null, (Action)null, (Action)null, (Action)null);
				}
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void SpawnPoisonMarkEveryoneRpc(NetworkObjectReference obj, int playerWhoHit)
		{
			//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)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: 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_0145: 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(4135177792u, val2, val, (SendTo)6, (RpcDelivery)0);
				((FastBufferWriter)(ref val3)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				BytePacker.WriteValueBitPacked(val3, playerWhoHit);
				((NetworkBehaviour)this).__endSendRpc(ref val3, 4135177792u, 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))
				{
					EnemyAI component = ((Component)val4).gameObject.GetComponent<EnemyAI>();
					Bounds bounds = ((Collider)((Component)component).GetComponentInChildren<BoxCollider>()).bounds;
					Vector3 size = ((Bounds)(ref bounds)).size;
					LFCGlobalManager.PlayParticle(LanternKeeper.poisonMarkObj, ((Component)component).transform.position, ((Component)component).transform.rotation, false, Mathf.Max(new float[3] { size.x, size.y, size.z }) / 2f, true);
					LSStatusEffectRegistry.ApplyStatus(((Component)component).gameObject, (StatusEffectType)2, playerWhoHit, 10, 100, (EnemyAI)null, (Action)null, (Action)null, (Action)null);
				}
			}
		}

		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(340606894u, new RpcReceiveHandler(__rpc_handler_340606894), "SpawnPoisonMarkEveryoneRpc");
			((NetworkBehaviour)this).__registerRpc(4135177792u, new RpcReceiveHandler(__rpc_handler_4135177792), "SpawnPoisonMarkEveryoneRpc");
			((NetworkBehaviour)this).__initializeRpcs();
		}

		private static void __rpc_handler_340606894(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				int playerWhoHit = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerWhoHit);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((LanternKeeperNetworkManager)(object)target).SpawnPoisonMarkEveryoneRpc(playerId, playerWhoHit);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_4135177792(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 playerWhoHit = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerWhoHit);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((LanternKeeperNetworkManager)(object)target).SpawnPoisonMarkEveryoneRpc(obj, playerWhoHit);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "LanternKeeperNetworkManager";
		}
	}
}
namespace LanternKeeper.Behaviours
{
	public class Lantern : NetworkBehaviour
	{
		public bool isLightOn;

		public bool isOutside;

		public LanternKeeperAI lanternKeeper;

		public InteractTrigger interactTrigger;

		public GameObject light1;

		public GameObject light2;

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void InitializeLanternEveryoneRpc(NetworkObjectReference enemyObject, bool isOutside)
		{
			//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(3165692755u, val2, val, (SendTo)6, (RpcDelivery)0);
				((FastBufferWriter)(ref val3)).WriteValueSafe<NetworkObjectReference>(ref enemyObject, default(ForNetworkSerializable));
				((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref isOutside, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendRpc(ref val3, 3165692755u, 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 enemyObject)).TryGet(ref val4, (NetworkManager)null))
				{
					lanternKeeper = ((Component)val4).gameObject.GetComponentInChildren<EnemyAI>() as LanternKeeperAI;
				}
				LanternKeeper.spawnedLanterns.Add(this);
				if (isOutside)
				{
					this.isOutside = true;
					Light component = light1.GetComponent<Light>();
					component.range *= 2f;
					Light component2 = light2.GetComponent<Light>();
					component2.range *= 2f;
				}
			}
		}

		public void LanternInteraction()
		{
			TeleportLanternKeeperServerRpc();
		}

		public void SwitchOnLantern()
		{
			SwitchOnLanternEveryoneRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId);
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void SwitchOnLanternEveryoneRpc(int playerId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_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_008e: 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_00c0: 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)
			//IL_0123: 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(3412568425u, val2, val, (SendTo)6, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val3, playerId);
				((NetworkBehaviour)this).__endSendRpc(ref val3, 3412568425u, val2, val, (SendTo)6, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1)
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				isLightOn = true;
				((Behaviour)interactTrigger).enabled = false;
				((Behaviour)light1.GetComponent<Light>()).enabled = true;
				((Behaviour)light2.GetComponent<Light>()).enabled = true;
				if (LFCUtilities.IsServer)
				{
					LanternKeeperAI lanternKeeperAI = lanternKeeper;
					PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>();
					((EnemyAI)lanternKeeperAI).HitEnemyOnLocalClient(20, default(Vector3), component, false, -1);
				}
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void TeleportLanternKeeperServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: 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_0081: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: 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(3304779191u, val2, val, (SendTo)2, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendRpc(ref val3, 3304779191u, val2, val, (SendTo)2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1)
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				if (Vector3.Distance(((Component)this).transform.position, ((Component)lanternKeeper).transform.position) > 15f)
				{
					Vector3 randomNavMeshPositionInRadiusSpherical = RoundManager.Instance.GetRandomNavMeshPositionInRadiusSpherical(((Component)this).transform.position, 10f, default(NavMeshHit));
					LFCNetworkManager.Instance.TeleportEnemyEveryoneRpc(NetworkObjectReference.op_Implicit(((EnemyAI)lanternKeeper).thisNetworkObject), randomNavMeshPositionInRadiusSpherical, isOutside);
					((EnemyAI)lanternKeeper).SetDestinationToPosition(((Component)this).transform.position, false);
				}
			}
		}

		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
			((NetworkBehaviour)this).__registerRpc(3165692755u, new RpcReceiveHandler(__rpc_handler_3165692755), "InitializeLanternEveryoneRpc");
			((NetworkBehaviour)this).__registerRpc(3412568425u, new RpcReceiveHandler(__rpc_handler_3412568425), "SwitchOnLanternEveryoneRpc");
			((NetworkBehaviour)this).__registerRpc(3304779191u, new RpcReceiveHandler(__rpc_handler_3304779191), "TeleportLanternKeeperServerRpc");
			((NetworkBehaviour)this).__initializeRpcs();
		}

		private static void __rpc_handler_3165692755(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 enemyObject = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref enemyObject, default(ForNetworkSerializable));
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Lantern)(object)target).InitializeLanternEveryoneRpc(enemyObject, flag);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3412568425(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Lantern)(object)target).SwitchOnLanternEveryoneRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "Lantern";
		}
	}
	public class LanternKeeperAI : EnemyAI
	{
		public enum State
		{
			WANDERING,
			CHASING,
			THROWING
		}

		[CompilerGenerated]
		private sealed class <BiteCoroutine>d__33 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public LanternKeeperAI <>4__this;

			public PlayerControllerB player;

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

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

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

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

			private bool MoveNext()
			{
				int num = <>1__state;
				LanternKeeperAI lanternKeeperAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = lanternKeeperAI.GetUpCoroutine();
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					lanternKeeperAI.DoAnimationEveryoneRpc("startBite");
					lanternKeeperAI.PlayBiteEveryoneRpc();
					<>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)lanternKeeperAI, "bite", 10f, 0);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					LFCNetworkManager.Instance.DamagePlayerEveryoneRpc((int)player.playerClientId, ConfigManager.enemyDirectDamage.Value, true, true, 6);
					lanternKeeperAI.DoAnimationEveryoneRpc("startIdle");
					<>2__current = lanternKeeperAI.GetDownCoroutine();
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -1;
					lanternKeeperAI.biteCoroutine = 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();
			}
		}

		[CompilerGenerated]
		private sealed class <GetDownCoroutine>d__27 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public LanternKeeperAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				int num = <>1__state;
				LanternKeeperAI lanternKeeperAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					((EnemyAI)lanternKeeperAI).agent.speed = 0f;
					lanternKeeperAI.DoAnimationEveryoneRpc("startGetDown");
					<>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)lanternKeeperAI, "getdown", 10f, 0);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					lanternKeeperAI.DoAnimationEveryoneRpc("startMove");
					lanternKeeperAI.getDownCoroutine = 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();
			}
		}

		[CompilerGenerated]
		private sealed class <GetUpCoroutine>d__24 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public LanternKeeperAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				int num = <>1__state;
				LanternKeeperAI lanternKeeperAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					((EnemyAI)lanternKeeperAI).agent.speed = 0f;
					lanternKeeperAI.DoAnimationEveryoneRpc("startGetUp");
					<>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)lanternKeeperAI, "getup", 10f, 0);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					lanternKeeperAI.DoAnimationEveryoneRpc("startIdle");
					lanternKeeperAI.getUpCoroutine = 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();
			}
		}

		[CompilerGenerated]
		private sealed class <StunCoroutine>d__20 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public LanternKeeperAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				int num = <>1__state;
				LanternKeeperAI lanternKeeperAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					lanternKeeperAI.CancelGetUpCoroutine();
					lanternKeeperAI.CancelGetDownCoroutine();
					lanternKeeperAI.CancelThrowCoroutine();
					lanternKeeperAI.CancelBiteCoroutine();
					((EnemyAI)lanternKeeperAI).agent.speed = 0f;
					lanternKeeperAI.DoAnimationEveryoneRpc("startStun");
					<>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)lanternKeeperAI, "stun", 10f, 0);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					goto IL_00a4;
				case 2:
					<>1__state = -1;
					goto IL_00a4;
				case 3:
					<>1__state = -1;
					goto IL_00ca;
				case 4:
					{
						<>1__state = -1;
						break;
					}
					IL_00a4:
					if (((EnemyAI)lanternKeeperAI).stunNormalizedTimer > 0f)
					{
						<>2__current = null;
						<>1__state = 2;
						return true;
					}
					goto IL_00ca;
					IL_00ca:
					if (((EnemyAI)lanternKeeperAI).postStunInvincibilityTimer > 0f)
					{
						<>2__current = null;
						<>1__state = 3;
						return true;
					}
					if (((EnemyAI)lanternKeeperAI).currentBehaviourStateIndex == 2)
					{
						lanternKeeperAI.DoAnimationEveryoneRpc("startGetDown");
						<>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)lanternKeeperAI, "getDown", 10f, 0);
						<>1__state = 4;
						return true;
					}
					break;
				}
				lanternKeeperAI.DoAnimationEveryoneRpc("startMove");
				if (((EnemyAI)lanternKeeperAI).currentBehaviourStateIndex == 0 && (Object)(object)((EnemyAI)lanternKeeperAI).stunnedByPlayer != (Object)null)
				{
					((EnemyAI)lanternKeeperAI).targetPlayer = ((EnemyAI)lanternKeeperAI).stunnedByPlayer;
					((EnemyAI)lanternKeeperAI).StopSearch(((EnemyAI)lanternKeeperAI).currentSearch, true);
					((EnemyAI)lanternKeeperAI).SwitchToBehaviourClientRpc(1);
				}
				lanternKeeperAI.stunCoroutine = 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();
			}
		}

		[CompilerGenerated]
		private sealed class <ThrowCoroutine>d__29 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public LanternKeeperAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: 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_008c: 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_009b: 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_00b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				LanternKeeperAI lanternKeeperAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
				{
					<>1__state = -1;
					lanternKeeperAI.canThrow = false;
					lanternKeeperAI.DoAnimationEveryoneRpc("startBite");
					lanternKeeperAI.PlayBiteEveryoneRpc();
					GameObject val = Object.Instantiate<GameObject>(LanternKeeper.poisonBallObj, ((Component)lanternKeeperAI.ThrowPoint).transform.position, Quaternion.identity);
					val.GetComponent<NetworkObject>().Spawn(false);
					((LFCBouncyAoEProjectile)val.GetComponent<PoisonBall>()).ThrowFromPositionEveryoneRpc(((NetworkBehaviour)lanternKeeperAI).NetworkObjectId, ((Component)lanternKeeperAI.ThrowPoint).transform.position, ((Component)((EnemyAI)lanternKeeperAI).targetPlayer).transform.position + Vector3.up * 1.5f - ((Component)lanternKeeperAI.ThrowPoint).transform.position, ((EnemyAI)lanternKeeperAI).isOutside);
					<>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)lanternKeeperAI, "bite", 10f, 0);
					<>1__state = 1;
					return true;
				}
				case 1:
					<>1__state = -1;
					lanternKeeperAI.DoAnimationEveryoneRpc("startIdle");
					lanternKeeperAI.throwCoroutine = 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 Transform TurnCompass;

		public AudioClip[] CrawlSounds = Array.Empty<AudioClip>();

		public AudioClip BiteSound;

		public Transform ThrowPoint;

		public float crawlTimer;

		public float throwTimer;

		public float throwCooldown = 5f;

		public bool canThrow;

		public Coroutine stunCoroutine;

		public Coroutine getUpCoroutine;

		public Coroutine getDownCoroutine;

		public Coroutine throwCoroutine;

		public Coroutine biteCoroutine;

		public override void Start()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).Start();
			base.currentBehaviourStateIndex = 0;
			((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null);
			SpawnLanternsForServer();
		}

		public void SpawnLanternsForServer()
		{
			LFCMapObjectsManager.SpawnScatteredMapObjectsForServer(2, 1, 1, (Action<Vector3, bool>)SpawnLanternForServer);
		}

		public void SpawnLanternForServer(Vector3 position, bool isOutside)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: 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_004f: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(LanternKeeper.lanternObj, position + Vector3.down * 0.5f, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform);
			Lantern component = val.GetComponent<Lantern>();
			if (isOutside)
			{
				Transform transform = ((Component)component).transform;
				transform.localScale *= 2f;
			}
			val.GetComponent<NetworkObject>().Spawn(true);
			component.InitializeLanternEveryoneRpc(NetworkObjectReference.op_Implicit(base.thisNetworkObject), isOutside);
		}

		public override void Update()
		{
			//IL_0054: 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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).Update();
			if (!base.isEnemyDead && !StartOfRound.Instance.allPlayersDead)
			{
				PlayCrawlSound();
				int currentBehaviourStateIndex = base.currentBehaviourStateIndex;
				if ((Object)(object)base.targetPlayer != (Object)null && (currentBehaviourStateIndex == 1 || currentBehaviourStateIndex == 2))
				{
					TurnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position);
					((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, TurnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime);
				}
				LFCUtilities.UpdateTimer(ref throwTimer, throwCooldown, !canThrow, (Action)delegate
				{
					canThrow = true;
				});
			}
		}

		public void PlayCrawlSound()
		{
			if (base.currentBehaviourStateIndex != 2)
			{
				crawlTimer -= Time.deltaTime;
				if (CrawlSounds.Length != 0 && crawlTimer <= 0f)
				{
					base.creatureSFX.PlayOneShot(CrawlSounds[Random.Range(0, CrawlSounds.Length)]);
					crawlTimer = ((base.currentBehaviourStateIndex == 0) ? 1.3f : 1.1f);
				}
			}
		}

		public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 1.34f, PlayerControllerB setStunnedByPlayer = null)
		{
			if (LFCUtilities.IsServer && setToStunned && stunCoroutine == null)
			{
				((EnemyAI)this).SetEnemyStunned(setToStunned, setToStunTime, setStunnedByPlayer);
				stunCoroutine = ((MonoBehaviour)this).StartCoroutine(StunCoroutine());
			}
		}

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

		public override void DoAIInterval()
		{
			((EnemyAI)this).DoAIInterval();
			if (!base.isEnemyDead && !StartOfRound.Instance.allPlayersDead)
			{
				switch (base.currentBehaviourStateIndex)
				{
				case 0:
					DoWandering();
					break;
				case 1:
					DoChasing();
					break;
				case 2:
					DoThrowing();
					break;
				}
			}
		}

		public void DoWandering()
		{
			base.agent.speed = 3f;
			if (LFCEnemyManager.FoundClosestPlayerInRange((EnemyAI)(object)this, 25, 10, 60f, false))
			{
				((EnemyAI)this).StopSearch(base.currentSearch, true);
				((EnemyAI)this).SwitchToBehaviourClientRpc(1);
			}
		}

		public void DoChasing()
		{
			//IL_0071: 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_00a8: Unknown result type (might be due to invalid IL or missing references)
			if (biteCoroutine != null || getUpCoroutine != null || getDownCoroutine != null)
			{
				return;
			}
			base.agent.speed = 6f;
			if (!LFCEnemyManager.TargetOutsideChasedPlayer((EnemyAI)(object)this))
			{
				float num = default(float);
				if (!LFCEnemyManager.TargetClosestPlayerInAnyCase((EnemyAI)(object)this, ref num, false) || (num > 25f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)))
				{
					((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null);
					((EnemyAI)this).SwitchToBehaviourClientRpc(0);
				}
				else if (CanThrow() && num <= 15f && (num <= 2f || ((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)))
				{
					getUpCoroutine = ((MonoBehaviour)this).StartCoroutine(GetUpCoroutine());
					((EnemyAI)this).SwitchToBehaviourServerRpc(2);
				}
				else
				{
					((EnemyAI)this).SetMovingTowardsTargetPlayer(base.targetPlayer);
				}
			}
		}

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

		public void CancelGetUpCoroutine()
		{
			if (getUpCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(getUpCoroutine);
				getUpCoroutine = null;
			}
		}

		public void DoThrowing()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			if (throwCoroutine == null && getUpCoroutine == null && getDownCoroutine == null)
			{
				base.agent.speed = 0f;
				float num = Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position);
				if (!CanThrow() || num > 20f || (num > 2f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)))
				{
					getDownCoroutine = ((MonoBehaviour)this).StartCoroutine(GetDownCoroutine());
					((EnemyAI)this).SwitchToBehaviourServerRpc(1);
				}
				else
				{
					throwCoroutine = ((MonoBehaviour)this).StartCoroutine(ThrowCoroutine());
				}
			}
		}

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

		public void CancelGetDownCoroutine()
		{
			if (getDownCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(getDownCoroutine);
				getDownCoroutine = null;
			}
		}

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

		public void CancelThrowCoroutine()
		{
			if (throwCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(throwCoroutine);
				throwCoroutine = null;
			}
		}

		public override void OnCollideWithPlayer(Collider other)
		{
			((EnemyAI)this).OnCollideWithPlayer(other);
			if (base.currentBehaviourStateIndex == 1)
			{
				PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false);
				if (LFCUtilities.ShouldBeLocalPlayer(val))
				{
					BiteServerRpc((int)val.playerClientId);
				}
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void BiteServerRpc(int playerId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_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_008e: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val2 = default(RpcParams);
				FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2368247695u, val2, val, (SendTo)2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val3, playerId);
				((NetworkBehaviour)this).__endSendRpc(ref val3, 2368247695u, val2, val, (SendTo)2, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				if (base.currentBehaviourStateIndex == 1 && biteCoroutine == null && getUpCoroutine == null && getDownCoroutine == null)
				{
					biteCoroutine = ((MonoBehaviour)this).StartCoroutine(BiteCoroutine(StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>()));
				}
			}
		}

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

		public void CancelBiteCoroutine()
		{
			if (biteCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(biteCoroutine);
				biteCoroutine = null;
			}
		}

		public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
		{
			if (!base.isEnemyDead)
			{
				((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID);
				base.enemyHP -= force;
				if (base.enemyHP <= 0 && ((NetworkBehaviour)this).IsOwner)
				{
					((EnemyAI)this).KillEnemyOnOwnerClient(false);
				}
			}
		}

		public override void KillEnemy(bool destroy = false)
		{
			//IL_002b: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).KillEnemy(false);
			if (LFCUtilities.IsServer)
			{
				CancelGetUpCoroutine();
				CancelThrowCoroutine();
				CancelBiteCoroutine();
				PoisonDagger poisonDagger = LFCObjectsManager.SpawnObjectForServer(LanternKeeper.daggerObj, ((Component)this).transform.position + Vector3.up * 0.5f) as PoisonDagger;
				poisonDagger.InitializeForServer();
			}
		}

		public bool CanThrow()
		{
			if (canThrow && (Object)(object)base.targetPlayer != (Object)null)
			{
				return !LSStatusEffectRegistry.HasStatus(((Component)base.targetPlayer).gameObject, (StatusEffectType)2);
			}
			return false;
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void PlayBiteEveryoneRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: 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_0081: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
				{
					RpcAttributeParams val = new RpcAttributeParams
					{
						RequireOwnership = false
					};
					RpcParams val2 = default(RpcParams);
					FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(322516899u, val2, val, (SendTo)6, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendRpc(ref val3, 322516899u, val2, val, (SendTo)6, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					base.creatureSFX.PlayOneShot(BiteSound);
				}
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void DoAnimationEveryoneRpc(string animationState)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: 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_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val2 = default(RpcParams);
				FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1403393729u, val2, val, (SendTo)6, (RpcDelivery)0);
				bool flag = animationState != null;
				((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val3)).WriteValueSafe(animationState, false);
				}
				((NetworkBehaviour)this).__endSendRpc(ref val3, 1403393729u, val2, val, (SendTo)6, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				base.creatureAnimator.SetTrigger(animationState);
			}
		}

		protected override void __initializeVariables()
		{
			((EnemyAI)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
			((NetworkBehaviour)this).__registerRpc(2368247695u, new RpcReceiveHandler(__rpc_handler_2368247695), "BiteServerRpc");
			((NetworkBehaviour)this).__registerRpc(322516899u, new RpcReceiveHandler(__rpc_handler_322516899), "PlayBiteEveryoneRpc");
			((NetworkBehaviour)this).__registerRpc(1403393729u, new RpcReceiveHandler(__rpc_handler_1403393729), "DoAnimationEveryoneRpc");
			((EnemyAI)this).__initializeRpcs();
		}

		private static void __rpc_handler_2368247695(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((LanternKeeperAI)(object)target).BiteServerRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		private static void __rpc_handler_1403393729(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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: 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 animationState = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref animationState, false);
				}
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((LanternKeeperAI)(object)target).DoAnimationEveryoneRpc(animationState);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "LanternKeeperAI";
		}
	}
	public class PoisonBall : LFCBouncyAoEProjectile
	{
		protected override void PlayExplosionFx(Vector3 position, Quaternion rotation)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			LFCGlobalManager.PlayParticle("Lega Fusion Core" + ((Object)LegaFusionCore.poisonExplosionParticle).name, position, rotation, true, 0.75f, true);
		}

		protected override void PlayExplosionSfx(Vector3 position)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			LFCGlobalManager.PlayAudio("Lega Fusion Core" + ((Object)LegaFusionCore.poisonExplosionAudio).name, position, true);
		}

		protected override void OnAffectPlayerServer(PlayerControllerB player)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			LSNetworkManager.Instance.ApplyStatusEveryoneRpc(base.throwingPlayer, (int)player.playerClientId, 2, 10, 10, default(NetworkObjectReference));
		}

		protected override void OnAffectEnemyServer(EnemyAI enemy)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			LSNetworkManager.Instance.ApplyStatusEveryoneRpc(base.throwingPlayer, NetworkObjectReference.op_Implicit(((NetworkBehaviour)enemy).NetworkObject), 2, 10, 100, default(NetworkObjectReference));
		}

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "PoisonBall";
		}
	}
	public class PoisonDagger : PhysicsProp
	{
		public AudioSource daggerAudio;

		public List<RaycastHit> objectsHitByDaggerList = new List<RaycastHit>();

		public PlayerControllerB previousPlayerHeldBy;

		public RaycastHit[] objectsHitByDagger;

		public int daggerHitForce = 1;

		public AudioClip[] hitSFX;

		public AudioClip[] swingSFX;

		public int daggerMask = 1084754248;

		public float timeAtLastDamageDealt;

		public void InitializeForServer()
		{
			InitializeEveryoneRpc(Random.Range(ConfigManager.daggerMinValue.Value, ConfigManager.daggerMaxValue.Value));
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void InitializeEveryoneRpc(int value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_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_008e: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
				{
					RpcAttributeParams val = new RpcAttributeParams
					{
						RequireOwnership = false
					};
					RpcParams val2 = default(RpcParams);
					FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2468794561u, val2, val, (SendTo)6, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val3, value);
					((NetworkBehaviour)this).__endSendRpc(ref val3, 2468794561u, val2, val, (SendTo)6, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					((GrabbableObject)this).SetScrapValue(value);
				}
			}
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			RoundManager.PlayRandomClip(daggerAudio, swingSFX, true, 1f, 0, 1000);
			if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)
			{
				previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy;
				if (((NetworkBehaviour)((GrabbableObject)this).playerHeldBy).IsOwner)
				{
					((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("UseHeldItem1");
				}
			}
			if (((NetworkBehaviour)this).IsOwner)
			{
				HitDagger();
			}
		}

		public void HitDagger(bool cancel = false)
		{
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: 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_008d: 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_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)previousPlayerHeldBy == (Object)null)
			{
				LanternKeeper.mls.LogError((object)"Previousplayerheldby is null on this client when HitDagger is called");
				return;
			}
			previousPlayerHeldBy.activatingItem = false;
			bool flag = false;
			bool flag2 = false;
			int num = -1;
			if (!cancel && Time.realtimeSinceStartup - timeAtLastDamageDealt > 0.43f)
			{
				previousPlayerHeldBy.twoHanded = false;
				objectsHitByDagger = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * 0.1f, 0.5f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 0.75f, daggerMask, (QueryTriggerInteraction)2);
				objectsHitByDaggerList = objectsHitByDagger.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList();
				IHittable val = default(IHittable);
				RaycastHit val2 = default(RaycastHit);
				foreach (RaycastHit objectsHitByDagger in objectsHitByDaggerList)
				{
					RaycastHit current = objectsHitByDagger;
					if (((Component)((RaycastHit)(ref current)).transform).gameObject.layer == 8 || ((Component)((RaycastHit)(ref current)).transform).gameObject.layer == 11)
					{
						if (((RaycastHit)(ref current)).collider.isTrigger)
						{
							continue;
						}
						flag = true;
						for (int i = 0; i < StartOfRound.Instance.footstepSurfaces.Length; i++)
						{
							if (StartOfRound.Instance.footstepSurfaces[i].surfaceTag == ((Component)((RaycastHit)(ref current)).collider).gameObject.tag)
							{
								num = i;
								break;
							}
						}
					}
					else
					{
						if (!((Component)((RaycastHit)(ref current)).transform).TryGetComponent<IHittable>(ref val) || (Object)(object)((RaycastHit)(ref current)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform || (!(((RaycastHit)(ref current)).point == Vector3.zero) && Physics.Linecast(((Component)previousPlayerHeldBy.gameplayCamera).transform.position, ((RaycastHit)(ref current)).point, ref val2, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)))
						{
							continue;
						}
						flag = true;
						try
						{
							if (Time.realtimeSinceStartup - timeAtLastDamageDealt > 0.43f)
							{
								timeAtLastDamageDealt = Time.realtimeSinceStartup;
								val.Hit(daggerHitForce, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, previousPlayerHeldBy, true, 5);
							}
							flag2 = true;
						}
						catch (Exception arg)
						{
							LanternKeeper.mls.LogError((object)$"Exception caught when hitting object with dagger from player #{previousPlayerHeldBy.playerClientId}: {arg}");
						}
					}
				}
			}
			if (flag)
			{
				RoundManager.PlayRandomClip(daggerAudio, hitSFX, true, 1f, 0, 1000);
				Object.FindObjectOfType<RoundManager>().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0);
				if (!flag2 && num != -1)
				{
					daggerAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX);
					WalkieTalkie.TransmitOneShotAudio(daggerAudio, StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX, 1f);
				}
				HitDaggerEveryoneRpc(num);
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void HitDaggerEveryoneRpc(int hitSurfaceID)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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_008e: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val2 = default(RpcParams);
				FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1245136389u, val2, val, (SendTo)6, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val3, hitSurfaceID);
				((NetworkBehaviour)this).__endSendRpc(ref val3, 1245136389u, val2, val, (SendTo)6, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				return;
			}
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			if (!((NetworkBehaviour)this).IsOwner)
			{
				RoundManager.PlayRandomClip(daggerAudio, hitSFX, true, 1f, 0, 1000);
				if (hitSurfaceID != -1)
				{
					HitSurfaceWithDagger(hitSurfaceID);
				}
			}
		}

		public void HitSurfaceWithDagger(int hitSurfaceID)
		{
			daggerAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX);
			WalkieTalkie.TransmitOneShotAudio(daggerAudio, StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX, 1f);
		}

		protected override void __initializeVariables()
		{
			((PhysicsProp)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(2468794561u, new RpcReceiveHandler(__rpc_handler_2468794561), "InitializeEveryoneRpc");
			((NetworkBehaviour)this).__registerRpc(1245136389u, new RpcReceiveHandler(__rpc_handler_1245136389), "HitDaggerEveryoneRpc");
			((PhysicsProp)this).__initializeRpcs();
		}

		private static void __rpc_handler_2468794561(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int value = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref value);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PoisonDagger)(object)target).InitializeEveryoneRpc(value);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1245136389(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int hitSurfaceID = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref hitSurfaceID);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PoisonDagger)(object)target).HitDaggerEveryoneRpc(hitSurfaceID);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "PoisonDagger";
		}
	}
}
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 LanternKeeper.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}

LanternKeeperAddon.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AddonFusion;
using AddonFusion.Behaviours.AddonComponents;
using AddonFusion.Behaviours.AddonProps;
using AddonFusion.Behaviours.Scripts;
using AddonFusion.Registries;
using BepInEx;
using GameNetcodeStuff;
using HarmonyLib;
using LanternKeeper.Behaviours;
using LanternKeeper.Managers;
using LanternKeeperAddon.Behaviours.AddonComponents;
using LanternKeeperAddon.Behaviours.AddonProps;
using LanternKeeperAddon.NetcodePatcher;
using LanternKeeperAddon.Patches;
using LegaFusionCore.Managers;
using LegaFusionCore.Utilities;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("LanternKeeperAddon")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LanternKeeperAddon")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("4d6d1795-a404-42ac-83a3-2b329190d4b0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[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: 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 LanternKeeperAddon
{
	[BepInPlugin("Lega.LanternKeeperAddon", "Lantern Keeper Addon", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class LanternKeeperAddon : BaseUnityPlugin
	{
		public const string modGUID = "Lega.LanternKeeperAddon";

		public const string modName = "Lantern Keeper Addon";

		public const string modVersion = "1.0.0";

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

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

		public static GameObject poisonProjectorObj;

		public void Awake()
		{
			LoadItems();
			LoadPrefabs();
			harmony.PatchAll(typeof(PoisonDaggerPatch));
		}

		public void LoadItems()
		{
			RegisterAddon(typeof(PoisonMark), "Poison Mark", typeof(PoisonMarkItem), bundle.LoadAsset<Item>("Assets/AddonProps/PoisonMarkItem.asset"));
		}

		public void RegisterAddon(Type addonType, string addonName, Type itemType, Item item)
		{
			item = LFCObjectsManager.RegisterObject(itemType, item);
			AddonObjectRegistry.Add(addonType, addonName, item.spawnPrefab);
		}

		public void LoadPrefabs()
		{
			HashSet<GameObject> hashSet = new HashSet<GameObject> { poisonProjectorObj = bundle.LoadAsset<GameObject>("Assets/AoEProjector/PoisonProjector.prefab") };
			foreach (GameObject item in hashSet)
			{
				Utilities.FixMixerGroups(item);
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "LanternKeeperAddon";

		public const string PLUGIN_NAME = "LanternKeeperAddon";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace LanternKeeperAddon.Patches
{
	public class PoisonDaggerPatch
	{
		[HarmonyPatch(typeof(PoisonDagger), "InitializeEveryoneRpc")]
		[HarmonyPostfix]
		public static void InitializeForEveryone(PoisonDagger __instance)
		{
			AFUtilities.SetAddonComponent<PoisonMark>((GrabbableObject)(object)__instance);
		}
	}
}
namespace LanternKeeperAddon.Behaviours.AddonProps
{
	public class PoisonMarkItem : AddonScroll
	{
		public override Type AddonType => typeof(PoisonMark);

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "PoisonMarkItem";
		}
	}
}
namespace LanternKeeperAddon.Behaviours.AddonComponents
{
	[AddonInfo(/*Could not decode attribute arguments.*/)]
	public class PoisonMark : AddonComponent
	{
		private readonly Collider[] overlapBuffer = (Collider[])(object)new Collider[64];

		public readonly float AoERadius = 1f;

		public readonly int AoEMask = 1084754248;

		public AoEProjector poisonProjector;

		public override string AddonName => "Poison Mark";

		public override bool IsPassive => false;

		public override void ActivateAddonAbility()
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			if (base.onCooldown || !StartOfRound.Instance.shipHasLanded || !((Object)(object)base.grabbableObject.playerHeldBy != (Object)null))
			{
				return;
			}
			base.isEnabled = !base.isEnabled;
			if (base.isEnabled)
			{
				GameObject val = Object.Instantiate<GameObject>(LanternKeeperAddon.poisonProjectorObj, ((Component)base.grabbableObject.playerHeldBy).transform.position, Quaternion.identity);
				poisonProjector = val.GetComponent<AoEProjector>();
			}
			else
			{
				if (!((Object)(object)poisonProjector != (Object)null))
				{
					return;
				}
				Vector3 val2 = default(Vector3);
				if (poisonProjector.TryConfirm(ref val2))
				{
					int num = Physics.OverlapSphereNonAlloc(val2, AoERadius, overlapBuffer, AoEMask, (QueryTriggerInteraction)2);
					PlayerControllerB val4 = default(PlayerControllerB);
					EnemyAICollisionDetect val5 = default(EnemyAICollisionDetect);
					for (int i = 0; i < num; i++)
					{
						Collider val3 = overlapBuffer[i];
						if ((Object)(object)val3 != (Object)null)
						{
							if (((Component)val3).gameObject.TryGetComponent<PlayerControllerB>(ref val4) && !val4.isPlayerDead && LFCUtilities.ShouldNotBeLocalPlayer(val4))
							{
								LanternKeeperNetworkManager.Instance.SpawnPoisonMarkEveryoneRpc((int)val4.playerClientId, (int)LFCUtilities.LocalPlayer.playerClientId);
							}
							if (((Component)val3).gameObject.TryGetComponent<EnemyAICollisionDetect>(ref val5) && (Object)(object)val5.mainScript != (Object)null && !val5.mainScript.isEnemyDead)
							{
								LanternKeeperNetworkManager.Instance.SpawnPoisonMarkEveryoneRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)val5.mainScript).NetworkObject), (int)LFCUtilities.LocalPlayer.playerClientId);
							}
						}
					}
				}
				Object.Destroy((Object)(object)((Component)poisonProjector).gameObject);
				((AddonComponent)this).StartCooldown(ConfigManager.poisonMarkCooldown.Value);
			}
		}

		public void Update()
		{
			if (base.isEnabled && ((Object)(object)base.grabbableObject == (Object)null || !base.grabbableObject.isHeld || base.grabbableObject.isPocketed) && (Object)(object)poisonProjector != (Object)null)
			{
				base.isEnabled = false;
				Object.Destroy((Object)(object)((Component)poisonProjector).gameObject);
			}
		}
	}
}
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 LanternKeeperAddon.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}