Decompiled source of LanternKeeper v1.0.8

LanternKeeper.dll

Decompiled 4 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.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.Behaviours.Addons;
using LegaFusionCore.Managers;
using LegaFusionCore.Managers.NetworkManagers;
using LegaFusionCore.Registries;
using LegaFusionCore.Utilities;
using LethalLib.Modules;
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("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("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[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 TOXIC_BALL = "Toxic Ball";

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

		internal const string modName = "Lantern Keeper";

		internal const string modVersion = "1.0.8";

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

		public Item RegisterItem(Type type, Item item)
		{
			if ((Object)(object)item.spawnPrefab.GetComponent<PhysicsProp>() == (Object)null)
			{
				Component obj = item.spawnPrefab.AddComponent(type);
				PhysicsProp val = (PhysicsProp)(object)((obj is PhysicsProp) ? obj : null);
				((GrabbableObject)val).grabbable = true;
				((GrabbableObject)val).grabbableToEnemies = true;
				((GrabbableObject)val).itemProperties = item;
			}
			NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab);
			Utilities.FixMixerGroups(item.spawnPrefab);
			Items.RegisterItem(item);
			return item;
		}

		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")
			};
			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(ref 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> toxicBallCooldown;

		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");
			toxicBallCooldown = LanternKeeper.configFile.Bind<int>("Toxic Ball", "Cooldown", 45, "Cooldown duration of the Toxic Ball");
		}

		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);
		}
	}
	internal class LanternKeeperNetworkManager : NetworkBehaviour
	{
		public static LanternKeeperNetworkManager Instance;

		public void Awake()
		{
			Instance = this;
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void ThrowPoisonBallServerRpc(int playerId, Vector3 position, Vector3 direction)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Invalid comparison between Unknown and I4
			//IL_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_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: 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_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			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(3539040122u, val2, val, (SendTo)2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val3, playerId);
				((FastBufferWriter)(ref val3)).WriteValueSafe(ref position);
				((FastBufferWriter)(ref val3)).WriteValueSafe(ref direction);
				((NetworkBehaviour)this).__endSendRpc(ref val3, 3539040122u, val2, val, (SendTo)2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1)
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				if (((Vector3)(ref direction)).sqrMagnitude < 0.5f)
				{
					direction = ((Component)StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>()).transform.forward;
				}
				direction = ((Vector3)(ref direction)).normalized;
				GameObject val4 = Object.Instantiate<GameObject>(LanternKeeper.poisonBallObj, position, Quaternion.identity);
				val4.GetComponent<NetworkObject>().Spawn(false);
				((LFCBouncyAoEProjectile)val4.GetComponent<PoisonBall>()).ThrowFromPlayerEveryoneRpc(playerId, position, direction);
			}
		}

		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
			((NetworkBehaviour)this).__registerRpc(3539040122u, new RpcReceiveHandler(__rpc_handler_3539040122), "ThrowPoisonBallServerRpc");
			((NetworkBehaviour)this).__initializeRpcs();
		}

		private static void __rpc_handler_3539040122(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: 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_0063: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				Vector3 position = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
				Vector3 direction = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref direction);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((LanternKeeperNetworkManager)(object)target).ThrowPoisonBallServerRpc(playerId, position, direction);
				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
		}

		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());
			}
		}

		public IEnumerator StunCoroutine()
		{
			CancelGetUpCoroutine();
			CancelGetDownCoroutine();
			CancelThrowCoroutine();
			CancelBiteCoroutine();
			base.agent.speed = 0f;
			DoAnimationEveryoneRpc("startStun");
			yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "stun", 10f, 0);
			while (base.stunNormalizedTimer > 0f)
			{
				yield return null;
			}
			while (base.postStunInvincibilityTimer > 0f)
			{
				yield return null;
			}
			if (base.currentBehaviourStateIndex == 2)
			{
				DoAnimationEveryoneRpc("startGetDown");
				yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "getDown", 10f, 0);
			}
			DoAnimationEveryoneRpc("startMove");
			if (base.currentBehaviourStateIndex == 0 && (Object)(object)base.stunnedByPlayer != (Object)null)
			{
				base.targetPlayer = base.stunnedByPlayer;
				((EnemyAI)this).StopSearch(base.currentSearch, true);
				((EnemyAI)this).SwitchToBehaviourClientRpc(1);
			}
			stunCoroutine = null;
		}

		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);
				}
			}
		}

		public IEnumerator GetUpCoroutine()
		{
			base.agent.speed = 0f;
			DoAnimationEveryoneRpc("startGetUp");
			yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "getup", 10f, 0);
			DoAnimationEveryoneRpc("startIdle");
			getUpCoroutine = null;
		}

		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());
				}
			}
		}

		public IEnumerator GetDownCoroutine()
		{
			base.agent.speed = 0f;
			DoAnimationEveryoneRpc("startGetDown");
			yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "getdown", 10f, 0);
			DoAnimationEveryoneRpc("startMove");
			getDownCoroutine = null;
		}

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

		public IEnumerator ThrowCoroutine()
		{
			canThrow = false;
			DoAnimationEveryoneRpc("startBite");
			PlayBiteEveryoneRpc();
			GameObject val = Object.Instantiate<GameObject>(LanternKeeper.poisonBallObj, ((Component)ThrowPoint).transform.position, Quaternion.identity);
			val.GetComponent<NetworkObject>().Spawn(false);
			((LFCBouncyAoEProjectile)val.GetComponent<PoisonBall>()).ThrowFromPositionEveryoneRpc(((NetworkBehaviour)this).NetworkObjectId, ((Component)ThrowPoint).transform.position, ((Component)base.targetPlayer).transform.position + Vector3.up * 1.5f - ((Component)ThrowPoint).transform.position, base.isOutside);
			yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "bite", 10f, 0);
			DoAnimationEveryoneRpc("startIdle");
			throwCoroutine = null;
		}

		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>()));
				}
			}
		}

		public IEnumerator BiteCoroutine(PlayerControllerB player)
		{
			yield return GetUpCoroutine();
			DoAnimationEveryoneRpc("startBite");
			PlayBiteEveryoneRpc();
			yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "bite", 10f, 0);
			LFCNetworkManager.Instance.DamagePlayerEveryoneRpc((int)player.playerClientId, ConfigManager.enemyDirectDamage.Value, true, true, 6);
			DoAnimationEveryoneRpc("startIdle");
			yield return GetDownCoroutine();
			biteCoroutine = null;
		}

		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 !LFCStatusEffectRegistry.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, 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)
		{
			LFCNetworkManager.Instance.ApplyStatusEveryoneRpc(base.throwingPlayer, (int)player.playerClientId, 2, 10, 10);
		}

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

		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()
		{
			int value = Random.Range(ConfigManager.daggerMinValue.Value, ConfigManager.daggerMaxValue.Value);
			InitializeEveryoneRpc(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);
					LFCUtilities.SetAddonComponent<ToxicBall>((GrabbableObject)(object)this, "Toxic Ball", false);
				}
			}
		}

		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_02c3: 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_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			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)
					{
						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)))
						{
							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";
		}
	}
	public class ToxicBall : AddonComponent
	{
		public override void ActivateAddonAbility()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			if (!base.onCooldown && StartOfRound.Instance.shipHasLanded)
			{
				PlayerControllerB val = ((Component)this).GetComponentInParent<GrabbableObject>()?.playerHeldBy;
				if ((Object)(object)val != (Object)null)
				{
					Vector3 position = ((Component)val.localVisor).transform.position + ((Component)val.gameplayCamera).transform.forward;
					((AddonComponent)this).StartCooldown(ConfigManager.toxicBallCooldown.Value);
					LanternKeeperNetworkManager.Instance.ThrowPoisonBallServerRpc((int)val.playerClientId, position, ((Component)val.gameplayCamera).transform.forward);
				}
			}
		}
	}
}
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
	{
	}
}