Decompiled source of SnatchinBrackenFORK v2.0.5

SnatchingBracken.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
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 DunGen;
using GameNetcodeStuff;
using HarmonyLib;
using LethalConfig;
using LethalConfig.ConfigItems;
using LethalConfig.ConfigItems.Options;
using Microsoft.CodeAnalysis;
using SnatchinBracken;
using SnatchinBracken.Patches;
using SnatchinBracken.Patches.data;
using SnatchingBracken;
using SnatchingBracken.NetcodePatcher;
using SnatchingBracken.Patches.dungeon;
using SnatchingBracken.Patches.network;
using SnatchingBracken.Patches.tasks;
using SnatchingBracken.Utils;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("SnatchingBracken")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SnatchingBracken")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("afcd9203-dbdd-4b28-85a1-fb12890f0d98")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[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]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 SnatchingBracken
{
	internal class LethalConfigAPIHook
	{
		public static void InitializeConfig()
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Expected O, but got Unknown
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Expected O, but got Unknown
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Expected O, but got Unknown
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Expected O, but got Unknown
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Expected O, but got Unknown
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Expected O, but got Unknown
			//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0303: Expected O, but got Unknown
			//IL_031d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0327: Expected O, but got Unknown
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_038b: Expected O, but got Unknown
			//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ef: Expected O, but got Unknown
			//IL_040e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0418: Expected O, but got Unknown
			//IL_046d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0472: Unknown result type (might be due to invalid IL or missing references)
			//IL_047c: Expected O, but got Unknown
			//IL_049b: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a5: Expected O, but got Unknown
			//IL_0500: Unknown result type (might be due to invalid IL or missing references)
			//IL_050a: Expected O, but got Unknown
			//IL_055e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0563: Unknown result type (might be due to invalid IL or missing references)
			//IL_056d: Expected O, but got Unknown
			//IL_058c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0596: Expected O, but got Unknown
			//IL_05f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fa: Expected O, but got Unknown
			//IL_064e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0653: Unknown result type (might be due to invalid IL or missing references)
			//IL_065d: Expected O, but got Unknown
			//IL_067c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0686: Expected O, but got Unknown
			//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06eb: Expected O, but got Unknown
			//IL_0745: Unknown result type (might be due to invalid IL or missing references)
			//IL_074f: Expected O, but got Unknown
			LethalConfigManager.SetModDescription("A mod that alters the behavior of the Bracken. The Bracken pulls players into a new spot before performing a kill. DON'T CHANGE SETTINGS WHILE THE BRACKEN IS ACTIVELY GRABBING!");
			ConfigEntry<bool> dropItemsOption = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<bool>("SnatchinBracken Settings", "Drop Items on Snatch", true, "Should players drop their items when a Bracken grabs them?");
			LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(dropItemsOption));
			SharedData.Instance.DropItems = dropItemsOption.Value;
			dropItemsOption.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.DropItems = dropItemsOption.Value;
				}
			};
			ConfigEntry<bool> turretOption = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<bool>("SnatchinBracken Settings", "Ignore Turrets on Snatch", true, "Should players be ignored by turrets when dragged?");
			LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(turretOption));
			SharedData.Instance.IgnoreTurrets = turretOption.Value;
			turretOption.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.IgnoreTurrets = turretOption.Value;
				}
			};
			ConfigEntry<bool> stuckForceKillOption = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<bool>("SnatchinBracken Settings", "Stuck Force Kill", false, "If enabled, Brackens will force kill when stuck at the same spot for at least 5 seconds.");
			LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(stuckForceKillOption));
			SharedData.Instance.StuckForceKill = stuckForceKillOption.Value;
			stuckForceKillOption.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.StuckForceKill = stuckForceKillOption.Value;
				}
			};
			ConfigEntry<bool> brackenRoomOption = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<bool>("SnatchinBracken Settings", "Force Set Favorite Location To Bracken Room", true, "If enabled, Brackens' favorite locations will be set to the Bracken room. The room sometimes doesn't spawn, so please don't be alarmed if they don't take you there if this is enabled.");
			LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(brackenRoomOption));
			SharedData.Instance.BrackenRoom = brackenRoomOption.Value;
			brackenRoomOption.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.BrackenRoom = brackenRoomOption.Value;
				}
			};
			ConfigEntry<bool> allowDraggedTps = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<bool>("SnatchinBracken Settings", "Allow teleports to save dragged players", true, "Should players be able to be saved through teleportation?");
			LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(allowDraggedTps));
			SharedData.Instance.AllowTeleports = allowDraggedTps.Value;
			allowDraggedTps.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.AllowTeleports = allowDraggedTps.Value;
				}
			};
			ConfigEntry<bool> mineOption = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<bool>("SnatchinBracken Settings", "Ignore Mines on Snatch", true, "Should players ignore Landmines while being dragged?");
			LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(mineOption));
			SharedData.Instance.IgnoreMines = mineOption.Value;
			mineOption.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.IgnoreMines = mineOption.Value;
				}
			};
			ConfigEntry<bool> monstersIgnorePlayersOption = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<bool>("SnatchinBracken Settings", "Enemies Ignore Dragged Players", true, "Should players be ignored by other monsters while being dragged?");
			BoolCheckBoxConfigItem val = new BoolCheckBoxConfigItem(monstersIgnorePlayersOption);
			SharedData.Instance.MonstersIgnorePlayers = monstersIgnorePlayersOption.Value;
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val);
			monstersIgnorePlayersOption.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.MonstersIgnorePlayers = monstersIgnorePlayersOption.Value;
				}
			};
			ConfigEntry<int> instaKillPercentEntry = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<int>("SnatchinBracken Settings", "Chance for Insta Kill", 0, "Percent chance for insta kill, 0 to disable.");
			IntSliderOptions val2 = new IntSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<int>)(object)val2).Min = 0;
			((BaseRangeOptions<int>)(object)val2).Max = 100;
			IntSliderOptions val3 = val2;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(instaKillPercentEntry, val3));
			SharedData.Instance.PercentChanceForInsta = instaKillPercentEntry.Value;
			instaKillPercentEntry.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.PercentChanceForInsta = instaKillPercentEntry.Value;
				}
			};
			ConfigEntry<bool> allowSecondsUntilAutoKill = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<bool>("SnatchinBracken Settings", "Allow Seconds Until Auto Kill", true, "If disabled, the Bracken won't kill based on time configured in \"Seconds Until Auto Kill\" (although may still kill if auto stuck is toggled off).");
			LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(allowSecondsUntilAutoKill));
			SharedData.Instance.KillBasedOffOfTime = allowSecondsUntilAutoKill.Value;
			allowSecondsUntilAutoKill.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.KillBasedOffOfTime = allowSecondsUntilAutoKill.Value;
				}
			};
			ConfigEntry<int> brackenKillTimeEntry = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<int>("SnatchinBracken Settings", "Seconds Until Auto Kill", 15, "Time in seconds until Bracken automatically kills when grabbed. Range: 1-60 seconds.");
			IntSliderOptions val4 = new IntSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<int>)(object)val4).Min = 1;
			((BaseRangeOptions<int>)(object)val4).Max = 60;
			IntSliderOptions val5 = val4;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(brackenKillTimeEntry, val5));
			SharedData.Instance.KillAtTime = brackenKillTimeEntry.Value;
			brackenKillTimeEntry.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.KillAtTime = brackenKillTimeEntry.Value;
				}
			};
			ConfigEntry<int> brackenNextAttemptEntry = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<int>("SnatchinBracken Settings", "Seconds Until Next Attempt", 5, "Time in seconds until Bracken is allowed to take another victim.");
			IntSliderOptions val6 = new IntSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<int>)(object)val6).Min = 1;
			((BaseRangeOptions<int>)(object)val6).Max = 60;
			IntSliderOptions val7 = val6;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(brackenNextAttemptEntry, val7));
			SharedData.Instance.SecondsBeforeNextAttempt = brackenNextAttemptEntry.Value;
			brackenNextAttemptEntry.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.SecondsBeforeNextAttempt = brackenNextAttemptEntry.Value;
				}
			};
			ConfigEntry<bool> doDamageOnIntervalEntry = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<bool>("SnatchinBracken Settings", "Do Gradual Damage", false, "Should players be hurt gradually while being dragged?");
			LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(doDamageOnIntervalEntry));
			SharedData.Instance.DoDamageOnInterval = doDamageOnIntervalEntry.Value;
			doDamageOnIntervalEntry.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.DoDamageOnInterval = doDamageOnIntervalEntry.Value;
				}
			};
			ConfigEntry<int> damageDealtProgressively = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<int>("SnatchinBracken Settings", "Damage Dealt At Interval", 5, "This only applies if you have \"Do Gradual Damage\" enabled. While dragged, every second this configured amount of damage will be dealt to the player. Keep in mind, players still regenerate in critical condition.");
			IntSliderOptions val8 = new IntSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<int>)(object)val8).Min = 1;
			((BaseRangeOptions<int>)(object)val8).Max = 100;
			IntSliderOptions val9 = val8;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(damageDealtProgressively, val9));
			SharedData.Instance.DamageDealtAtInterval = damageDealtProgressively.Value;
			damageDealtProgressively.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.DamageDealtAtInterval = damageDealtProgressively.Value;
				}
			};
			ConfigEntry<bool> allowDistanceBasedKiller = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<bool>("SnatchinBracken Settings", "Allow Distance Until Auto Kill", true, "If disabled, the Bracken won't kill based on distance from favorite spot configured in \"Distance For Kill\" (although may still kill if auto stuck is toggled off).");
			LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(allowDistanceBasedKiller));
			SharedData.Instance.KillBasedOffOfDistance = allowDistanceBasedKiller.Value;
			allowDistanceBasedKiller.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.KillBasedOffOfDistance = allowDistanceBasedKiller.Value;
				}
			};
			ConfigEntry<int> distanceAutoKillerEntry = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<int>("SnatchinBracken Settings", "Distance For Kill", 1, "How far should the Bracken be from its favorite spot to initiate a kill?");
			IntSliderOptions val10 = new IntSliderOptions
			{
				RequiresRestart = false
			};
			((BaseRangeOptions<int>)(object)val10).Min = 1;
			((BaseRangeOptions<int>)(object)val10).Max = 60;
			IntSliderOptions val11 = val10;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(distanceAutoKillerEntry, val11));
			SharedData.Instance.DistanceFromFavorite = distanceAutoKillerEntry.Value;
			distanceAutoKillerEntry.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.DistanceFromFavorite = distanceAutoKillerEntry.Value;
				}
			};
			ConfigEntry<bool> instaKillOption = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<bool>("SnatchinBracken Settings", "Instakill When Alone", false, "Should players be instantly killed if they're alone?");
			LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(instaKillOption));
			SharedData.Instance.InstantKillIfAlone = instaKillOption.Value;
			instaKillOption.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.InstantKillIfAlone = instaKillOption.Value;
				}
			};
			ConfigEntry<bool> snatchFloatingHeadOption = ((BaseUnityPlugin)SnatchinBrackenBase.Instance).Config.Bind<bool>("SnatchinBracken Settings", "Snatchin Floating Head", false, "If enabled, the floating head from Wesley's Enemy Variants will snatch you too instead of performing a vanilla kill.");
			LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(snatchFloatingHeadOption));
			SharedData.Instance.SnatchFloatingHead = snatchFloatingHeadOption.Value;
			snatchFloatingHeadOption.SettingChanged += delegate
			{
				if (((NetworkBehaviour)HUDManager.Instance).IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
				{
					SharedData.Instance.SnatchFloatingHead = snatchFloatingHeadOption.Value;
				}
			};
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("IHittable.Hit")]
		private static bool HitOverride(PlayerControllerB __instance, int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX = false)
		{
			if (SharedData.Instance.BindedDrags.ContainsValue(__instance) || (SharedData.Instance.DroppedTimestamp.ContainsKey(__instance) && SharedData.Instance.DroppedTimestamp[__instance] + 1f >= Time.time))
			{
				return false;
			}
			return true;
		}

		[HarmonyPrefix]
		[HarmonyPatch("Awake")]
		private static void onAwake(PlayerControllerB __instance)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			if ((Object)((Component)__instance).gameObject.GetComponent<FlowermanBinding>() == (Object)null)
			{
				((Component)__instance).gameObject.AddComponent<FlowermanBinding>();
			}
			FlowermanBinding.RegisterRpcHandlers();
		}

		[HarmonyPrefix]
		[HarmonyPatch("Start")]
		private static void onStart(PlayerControllerB __instance)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			if ((Object)((Component)__instance).gameObject.GetComponent<FlowermanBinding>() == (Object)null)
			{
				((Component)__instance).gameObject.AddComponent<FlowermanBinding>();
			}
			FlowermanBinding.RegisterRpcHandlers();
		}

		[HarmonyPrefix]
		[HarmonyPatch("KillPlayer")]
		private static void KillPlayerPatch(PlayerControllerB __instance, Vector3 bodyVelocity, bool spawnBody = true, CauseOfDeath causeOfDeath = (CauseOfDeath)0, int deathAnimation = 0)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Expected O, but got Unknown
			if (!SharedData.Instance.BindedDrags.ContainsValue(__instance))
			{
				return;
			}
			FlowermanAI val = GeneralUtils.SearchForCorrelatedFlowerman(__instance);
			if ((Object)val != (Object)null)
			{
				int playerId = SharedData.Instance.PlayerIDs[__instance];
				__instance.inSpecialInteractAnimation = false;
				FlowermanBinding component = ((Component)__instance).gameObject.GetComponent<FlowermanBinding>();
				if ((Object)component != (Object)null)
				{
					component.ResetEntityStatesClientRpc(playerId, ((NetworkBehaviour)val).NetworkObjectId);
					component.GiveChillPillClientRpc(playerId);
					component.RemoveBindingsClientRpc(playerId, ((NetworkBehaviour)val).NetworkObjectId);
				}
				GeneralUtils.StopGradualDamageCoroutine(val, __instance);
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch("SetPlayerSanityLevel")]
		private static bool SetSanityLevel(PlayerControllerB __instance)
		{
			if (SharedData.Instance.BindedDrags.ContainsValue(__instance))
			{
				return false;
			}
			return true;
		}
	}
}
namespace SnatchingBracken.Utils
{
	internal class GeneralUtils
	{
		private static GeneralUtils instance;

		public static GeneralUtils Instance
		{
			get
			{
				if (instance == null)
				{
					instance = new GeneralUtils();
				}
				return instance;
			}
		}

		public static FlowermanAI SearchForCorrelatedFlowerman(PlayerControllerB player)
		{
			foreach (KeyValuePair<FlowermanAI, PlayerControllerB> bindedDrag in SharedData.Instance.BindedDrags)
			{
				if (bindedDrag.Value.actualClientId == player.actualClientId)
				{
					return bindedDrag.Key;
				}
			}
			return null;
		}

		public static void ManuallyUnbindPlayer(FlowermanAI flowerman, PlayerControllerB player)
		{
			GeneralExtensions.GetValueSafe<PlayerControllerB, int>(SharedData.Instance.PlayerIDs, player);
			player.inSpecialInteractAnimation = false;
			flowerman.carryingPlayerBody = false;
			((EnemyAI)flowerman).creatureAnimator.SetBool("killing", false);
			((EnemyAI)flowerman).creatureAnimator.SetBool("carryingBody", false);
			flowerman.FinishKillAnimation(false);
			((EnemyAI)flowerman).stunnedByPlayer = null;
			((EnemyAI)flowerman).stunNormalizedTimer = 0f;
			((EnemyAI)flowerman).favoriteSpot = null;
		}

		public static void ManuallyDropPlayerOnHit(FlowermanAI __instance, PlayerControllerB player)
		{
			player.inSpecialInteractAnimation = false;
			player.inAnimationWithEnemy = null;
			__instance.carryingPlayerBody = false;
			((EnemyAI)__instance).creatureAnimator.SetBool("killing", false);
			((EnemyAI)__instance).creatureAnimator.SetBool("carryingBody", false);
			__instance.angerMeter = 0f;
			__instance.isInAngerMode = false;
			((EnemyAI)__instance).stunnedByPlayer = null;
			((EnemyAI)__instance).stunNormalizedTimer = 0f;
			__instance.evadeStealthTimer = 0.1f;
			__instance.timesThreatened = 0;
			__instance.FinishKillAnimation(false);
		}

		public static void RemoveDictionaryReferences(FlowermanAI __instance, PlayerControllerB player, int playerId)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			SharedData.Instance.GradualDamageCoroutineStarted.Remove(__instance);
			player.inSpecialInteractAnimation = false;
			FlowermanBinding component = ((Component)player).gameObject.GetComponent<FlowermanBinding>();
			if ((Object)component != (Object)null)
			{
				component.ResetEntityStatesClientRpc(playerId, ((NetworkBehaviour)__instance).NetworkObjectId);
				component.GiveChillPillClientRpc(playerId);
				component.RemoveBindingsClientRpc(playerId, ((NetworkBehaviour)__instance).NetworkObjectId);
			}
		}

		public static void StopGradualDamageCoroutine(FlowermanAI flowermanAI, PlayerControllerB player)
		{
			if (SharedData.Instance.GradualDamageCoroutineStarted.ContainsKey(flowermanAI))
			{
				((MonoBehaviour)flowermanAI).StopCoroutine(DoGradualDamage(flowermanAI, player, 1f, SharedData.Instance.DamageDealtAtInterval));
				SharedData.Instance.GradualDamageCoroutineStarted.Remove(flowermanAI);
			}
		}

		public static IEnumerator DoGradualDamage(FlowermanAI flowermanAI, PlayerControllerB player, float damageInterval, int damageAmount)
		{
			while (!player.isPlayerDead && (Object)flowermanAI != (Object)null && SharedData.Instance.BindedDrags.ContainsKey(flowermanAI))
			{
				yield return (object)new WaitForSeconds(damageInterval);
				if (!player.isPlayerDead && (Object)flowermanAI != (Object)null && SharedData.Instance.BindedDrags.ContainsKey(flowermanAI))
				{
					if (player.health - damageAmount <= 0)
					{
						StopGradualDamageCoroutine(flowermanAI, player);
						player.inSpecialInteractAnimation = false;
						int playerId = SharedData.Instance.PlayerIDs[player];
						FlowermanBinding component = ((Component)player).gameObject.GetComponent<FlowermanBinding>();
						if ((Object)component != (Object)null)
						{
							component.RemoveBindingsClientRpc(playerId, ((NetworkBehaviour)flowermanAI).NetworkObjectId);
							component.ResetEntityStatesClientRpc(playerId, ((NetworkBehaviour)flowermanAI).NetworkObjectId);
							component.UnmufflePlayerVoiceClientRpc(playerId);
							component.GiveChillPillClientRpc(playerId);
						}
						FlowermanLocationTask component2 = ((Component)flowermanAI).gameObject.GetComponent<FlowermanLocationTask>();
						if ((Object)component2 != (Object)null)
						{
							component2.StopCheckStuckCoroutine();
						}
						flowermanAI.carryingPlayerBody = false;
						flowermanAI.bodyBeingCarried = null;
						((EnemyAI)flowermanAI).creatureAnimator.SetBool("carryingBody", false);
						FinishKillAnimationNormally(flowermanAI, player, playerId);
					}
					else
					{
						int playerId2 = SharedData.Instance.PlayerIDs[player];
						FlowermanBinding component3 = ((Component)player).GetComponent<FlowermanBinding>();
						if ((Object)component3 != (Object)null)
						{
							component3.DamagePlayerClientRpc(playerId2, damageAmount);
						}
					}
				}
				else
				{
					StopGradualDamageCoroutine(flowermanAI, player);
				}
			}
		}

		public static void UnbindPlayerAndBracken(PlayerControllerB player, FlowermanAI __instance)
		{
			if (SharedData.Instance.PlayerIDs.ContainsKey(player))
			{
				int valueSafe = GeneralExtensions.GetValueSafe<PlayerControllerB, int>(SharedData.Instance.PlayerIDs, player);
				player.inSpecialInteractAnimation = false;
				player.inAnimationWithEnemy = null;
				__instance.carryingPlayerBody = true;
				((EnemyAI)__instance).creatureAnimator.SetBool("killing", false);
				((EnemyAI)__instance).creatureAnimator.SetBool("carryingBody", false);
				((EnemyAI)__instance).stunnedByPlayer = null;
				((EnemyAI)__instance).stunNormalizedTimer = 0f;
				__instance.angerMeter = 0f;
				__instance.isInAngerMode = false;
				__instance.timesThreatened = 0;
				__instance.FinishKillAnimation(false);
				RemoveDictionaryReferences(__instance, player, valueSafe);
			}
		}

		public static bool PrerequisiteKilling(FlowermanAI flowerman)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			if (SharedData.Instance.LastGrabbedTimeStamp.ContainsKey(flowerman))
			{
				float num = SharedData.Instance.LastGrabbedTimeStamp[flowerman];
				float num2 = (((Object)((EnemyAI)flowerman).favoriteSpot != (Object)null) ? Vector3.Distance(((Component)flowerman).transform.position, ((EnemyAI)flowerman).favoriteSpot.position) : float.MaxValue);
				if (Time.time - num >= SharedData.Instance.KillAtTime || num2 <= SharedData.Instance.DistanceFromFavorite)
				{
					return true;
				}
			}
			return false;
		}

		public static void FinishKillAnimationNormally(FlowermanAI __instance, PlayerControllerB playerControllerB, int playerId)
		{
			((EnemyAI)__instance).inSpecialAnimationWithPlayer = playerControllerB;
			playerControllerB.inSpecialInteractAnimation = true;
			__instance.KillPlayerAnimationClientRpc(playerId);
		}
	}
}
namespace SnatchingBracken.Patches.tasks
{
	public class FlowermanLocationTask : MonoBehaviour
	{
		private Coroutine checkStuckCoroutine;

		public void StartCheckStuckCoroutine(FlowermanAI flowermanAI, PlayerControllerB player)
		{
			checkStuckCoroutine = ((MonoBehaviour)this).StartCoroutine(CheckIfStuck(flowermanAI, player));
		}

		public void StopCheckStuckCoroutine()
		{
			if (checkStuckCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(checkStuckCoroutine);
				checkStuckCoroutine = null;
			}
		}

		private IEnumerator CheckIfStuck(FlowermanAI flowermanAI, PlayerControllerB player)
		{
			Vector3 val = ((Component)flowermanAI).transform.position;
			while ((Object)flowermanAI != (Object)null)
			{
				yield return (object)new WaitForSeconds(5f);
				Vector3 position = ((Component)flowermanAI).transform.position;
				if (Vector3.Distance(val, position) <= 1f)
				{
					HandleStuckFlowerman(flowermanAI, player);
				}
				val = position;
			}
		}

		private void HandleStuckFlowerman(FlowermanAI flowermanAI, PlayerControllerB player)
		{
			StopCheckStuckCoroutine();
			int playerId = SharedData.Instance.PlayerIDs[player];
			SharedData.UpdateTimestampNow(flowermanAI, player);
			GeneralUtils.UnbindPlayerAndBracken(player, flowermanAI);
			((Component)player).GetComponent<FlowermanBinding>().GiveChillPillServerRpc(playerId);
			GeneralUtils.FinishKillAnimationNormally(flowermanAI, player, playerId);
		}
	}
}
namespace SnatchingBracken.Patches.ship
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch("ShipLeave")]
		private static void PrefixShipLeave(StartOfRoundPatch __instance)
		{
			SharedData.Instance.BrackenRoomPosition = null;
			SharedData.FlushDictionaries();
			SharedData.GiveChillPillToAll();
		}

		[HarmonyPrefix]
		[HarmonyPatch("openingDoorsSequence")]
		private static void ClearPlayerSanityOnLand(StartOfRound __instance)
		{
			SharedData.GiveChillPillToAll();
		}
	}
}
namespace SnatchingBracken.Patches.network
{
	public class FlowermanBinding : NetworkBehaviour
	{
		private void Awake()
		{
			RegisterRpcHandlers();
		}

		protected override void __initializeRpcs()
		{
			((NetworkBehaviour)this).__initializeRpcs();
			RegisterRpcHandlers();
		}

		public static void RegisterRpcHandlers()
		{
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Expected O, but got Unknown
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Expected O, but got Unknown
			try
			{
				FieldInfo field = typeof(NetworkBehaviour).GetField("__rpc_func_table", BindingFlags.Static | BindingFlags.NonPublic);
				if (field != null)
				{
					Dictionary<Type, Dictionary<uint, RpcReceiveHandler>> dictionary = (Dictionary<Type, Dictionary<uint, RpcReceiveHandler>>)field.GetValue(null);
					if (dictionary != null)
					{
						if (!dictionary.TryGetValue(typeof(FlowermanBinding), out var value))
						{
							value = new Dictionary<uint, RpcReceiveHandler>();
							dictionary[typeof(FlowermanBinding)] = value;
						}
						MethodInfo[] methods = typeof(FlowermanBinding).GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
						foreach (MethodInfo methodInfo in methods)
						{
							if (!methodInfo.Name.StartsWith("__rpc_handler_"))
							{
								continue;
							}
							string s = methodInfo.Name.Substring("__rpc_handler_".Length);
							if (uint.TryParse(s, out var result))
							{
								try
								{
									RpcReceiveHandler value2 = (RpcReceiveHandler)Delegate.CreateDelegate(typeof(RpcReceiveHandler), methodInfo);
									value[result] = value2;
								}
								catch
								{
								}
							}
						}
					}
				}
				FieldInfo field2 = typeof(NetworkManager).GetField("__rpc_func_table", BindingFlags.Static | BindingFlags.NonPublic);
				if (!(field2 != null))
				{
					return;
				}
				Dictionary<uint, RpcReceiveHandler> dictionary2 = (Dictionary<uint, RpcReceiveHandler>)field2.GetValue(null);
				if (dictionary2 == null)
				{
					return;
				}
				MethodInfo[] methods2 = typeof(FlowermanBinding).GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
				foreach (MethodInfo methodInfo2 in methods2)
				{
					if (!methodInfo2.Name.StartsWith("__rpc_handler_"))
					{
						continue;
					}
					string s2 = methodInfo2.Name.Substring("__rpc_handler_".Length);
					if (uint.TryParse(s2, out var result2))
					{
						try
						{
							RpcReceiveHandler value3 = (RpcReceiveHandler)Delegate.CreateDelegate(typeof(RpcReceiveHandler), methodInfo2);
							dictionary2[result2] = value3;
						}
						catch
						{
						}
					}
				}
			}
			catch (Exception arg)
			{
				Debug.LogError((object)$"[SnatchinBracken] Error registering RPC handlers: {arg}");
			}
		}

		private static FlowermanAI GetFlowermanSafe(ulong flowermanId)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			if (SharedData.Instance.FlowermanIDs.TryGetValue(flowermanId, out var value) && (Object)value != (Object)null)
			{
				return value;
			}
			if ((Object)(object)NetworkManager.Singleton != (Object)null && NetworkManager.Singleton.SpawnManager != null && NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(flowermanId, out var value2) && (Object)value2 != (Object)null)
			{
				value = ((Component)value2).GetComponent<FlowermanAI>();
				if ((Object)value != (Object)null)
				{
					SharedData.Instance.FlowermanIDs[flowermanId] = value;
					return value;
				}
			}
			return null;
		}

		private static PlayerControllerB GetPlayerSafe(int playerId)
		{
			if ((Object)(object)StartOfRound.Instance != (Object)null && StartOfRound.Instance.allPlayerScripts != null && playerId >= 0 && playerId < StartOfRound.Instance.allPlayerScripts.Length)
			{
				return StartOfRound.Instance.allPlayerScripts[playerId];
			}
			return null;
		}

		[ServerRpc(RequireOwnership = false)]
		public void BindPlayerServerRpc(int playerId, ulong flowermanId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2841149136u, val2, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val, playerId);
					BytePacker.WriteValueBitPacked(val, flowermanId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 2841149136u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					AddBindingsClientRpc(playerId, flowermanId);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void UnbindPlayerServerRpc(int playerId, ulong flowermanId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1240084643u, val2, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val, playerId);
					BytePacker.WriteValueBitPacked(val, flowermanId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 1240084643u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					RemoveBindingsClientRpc(playerId, flowermanId);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void ResetEntityStatesServerRpc(int playerId, ulong flowermanId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3697084031u, val2, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val, playerId);
					BytePacker.WriteValueBitPacked(val, flowermanId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 3697084031u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ResetEntityStatesClientRpc(playerId, flowermanId);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void PrepForBindingServerRpc(int playerId, ulong flowermanId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3576432139u, val2, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val, playerId);
					BytePacker.WriteValueBitPacked(val, flowermanId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 3576432139u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					PrepForBindingClientRpc(playerId, flowermanId);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void DamagePlayerServerRpc(int playerId, int damage)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1928701905u, val2, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val, playerId);
					BytePacker.WriteValueBitPacked(val, damage);
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 1928701905u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					DamagePlayerClientRpc(playerId, damage);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void UpdateFavoriteSpotServerRpc(int playerId, ulong flowermanId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3595148175u, val2, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val, playerId);
					BytePacker.WriteValueBitPacked(val, flowermanId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 3595148175u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					UpdateFavoriteSpotClientRpc(playerId, flowermanId);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void MufflePlayerVoiceServerRpc(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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2582248323u, val2, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val, playerId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 2582248323u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					MufflePlayerVoiceClientRpc(playerId);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void UnmufflePlayerVoiceServerRpc(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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3509983500u, val2, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val, playerId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 3509983500u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					UnmufflePlayerVoiceClientRpc(playerId);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void MakeInsaneServerRpc(int playerId, float targetInsanity)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2823097549u, val2, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val, playerId);
					((FastBufferWriter)(ref val)).WriteValueSafe<float>(ref targetInsanity, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 2823097549u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					MakeInsaneClientRpc(playerId, targetInsanity);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void GiveChillPillServerRpc(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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3204958366u, val2, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val, playerId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 3204958366u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					GiveChillPillClientRpc(playerId);
				}
			}
		}

		[ClientRpc]
		public void UpdateFavoriteSpotClientRpc(int playerId, ulong flowermanId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Expected O, but got Unknown
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Expected O, but got Unknown
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1506678615u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, playerId);
				BytePacker.WriteValueBitPacked(val, flowermanId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 1506678615u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				PlayerControllerB playerSafe = GetPlayerSafe(playerId);
				FlowermanAI flowermanSafe = GetFlowermanSafe(flowermanId);
				if (!((Object)playerSafe == (Object)null) && !((Object)flowermanSafe == (Object)null))
				{
					Transform favoriteSpot = ((!SharedData.Instance.BrackenRoom || (Object)SharedData.Instance.BrackenRoomPosition == (Object)null) ? ((EnemyAI)flowermanSafe).ChooseFarthestNodeFromPosition(((Component)playerSafe).transform.position, false, 0, false, 50, -1) : SharedData.Instance.BrackenRoomPosition);
					((EnemyAI)flowermanSafe).favoriteSpot = favoriteSpot;
				}
			}
		}

		[ClientRpc]
		public void GiveChillPillClientRpc(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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Expected O, but got Unknown
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Expected O, but got Unknown
			//IL_00fd: Expected O, but got Unknown
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3079751162u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, playerId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 3079751162u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				PlayerControllerB playerSafe = GetPlayerSafe(playerId);
				if (!((Object)playerSafe == (Object)null) && (Object)playerSafe == (Object)StartOfRound.Instance.localPlayerController)
				{
					playerSafe.insanityLevel = 0f;
					StartOfRound.Instance.fearLevelIncreasing = false;
					StartOfRound.Instance.fearLevel = 0f;
				}
			}
		}

		[ClientRpc]
		public void MakeInsaneClientRpc(int playerId, float targetInsanity)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Expected O, but got Unknown
			//IL_00ff: 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_0118: Expected O, but got Unknown
			//IL_0118: Expected O, but got Unknown
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(182933403u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, playerId);
				((FastBufferWriter)(ref val)).WriteValueSafe<float>(ref targetInsanity, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 182933403u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				PlayerControllerB playerSafe = GetPlayerSafe(playerId);
				if (!((Object)playerSafe == (Object)null) && (Object)playerSafe == (Object)StartOfRound.Instance.localPlayerController)
				{
					playerSafe.JumpToFearLevel(targetInsanity, true);
				}
			}
		}

		[ClientRpc]
		public void MufflePlayerVoiceClientRpc(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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Expected O, but got Unknown
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Expected O, but got Unknown
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1450070789u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, playerId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 1450070789u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			PlayerControllerB playerSafe = GetPlayerSafe(playerId);
			if ((Object)playerSafe == (Object)null)
			{
				return;
			}
			if ((Object)playerSafe.currentVoiceChatAudioSource == (Object)null && (Object)(object)StartOfRound.Instance != (Object)null)
			{
				StartOfRound.Instance.RefreshPlayerVoicePlaybackObjects();
			}
			if ((Object)playerSafe.currentVoiceChatAudioSource != (Object)null)
			{
				AudioLowPassFilter component = ((Component)playerSafe.currentVoiceChatAudioSource).GetComponent<AudioLowPassFilter>();
				if ((Object)(object)component != (Object)null)
				{
					component.lowpassResonanceQ = 5f;
				}
				OccludeAudio component2 = ((Component)playerSafe.currentVoiceChatAudioSource).GetComponent<OccludeAudio>();
				if ((Object)(object)component2 != (Object)null)
				{
					component2.overridingLowPass = true;
					component2.lowPassOverride = 500f;
				}
				playerSafe.voiceMuffledByEnemy = true;
			}
		}

		[ClientRpc]
		public void UnmufflePlayerVoiceClientRpc(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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Expected O, but got Unknown
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Expected O, but got Unknown
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2434358873u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, playerId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 2434358873u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			PlayerControllerB playerSafe = GetPlayerSafe(playerId);
			if ((Object)playerSafe == (Object)null)
			{
				return;
			}
			if ((Object)playerSafe.currentVoiceChatAudioSource == (Object)null && (Object)(object)StartOfRound.Instance != (Object)null)
			{
				StartOfRound.Instance.RefreshPlayerVoicePlaybackObjects();
			}
			if ((Object)playerSafe.currentVoiceChatAudioSource != (Object)null)
			{
				AudioLowPassFilter component = ((Component)playerSafe.currentVoiceChatAudioSource).GetComponent<AudioLowPassFilter>();
				if ((Object)(object)component != (Object)null)
				{
					component.lowpassResonanceQ = 1f;
				}
				OccludeAudio component2 = ((Component)playerSafe.currentVoiceChatAudioSource).GetComponent<OccludeAudio>();
				if ((Object)(object)component2 != (Object)null)
				{
					component2.overridingLowPass = false;
					component2.lowPassOverride = 20000f;
				}
				playerSafe.voiceMuffledByEnemy = false;
			}
		}

		[ClientRpc]
		public void DamagePlayerClientRpc(int playerId, int damage)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Expected O, but got Unknown
			//IL_00f7: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1193047885u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, playerId);
				BytePacker.WriteValueBitPacked(val, damage);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 1193047885u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				PlayerControllerB playerSafe = GetPlayerSafe(playerId);
				if ((Object)playerSafe != (Object)null)
				{
					playerSafe.DamagePlayer(damage, true, true, (CauseOfDeath)5, 0, false, default(Vector3));
				}
			}
		}

		[ClientRpc]
		public void ResetEntityStatesClientRpc(int playerId, ulong flowermanId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Expected O, but got Unknown
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Expected O, but got Unknown
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Expected O, but got Unknown
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Expected O, but got Unknown
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2270563105u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, playerId);
				BytePacker.WriteValueBitPacked(val, flowermanId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 2270563105u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			PlayerControllerB playerSafe = GetPlayerSafe(playerId);
			FlowermanAI flowermanSafe = GetFlowermanSafe(flowermanId);
			if ((Object)playerSafe != (Object)null)
			{
				playerSafe.inSpecialInteractAnimation = false;
				playerSafe.inAnimationWithEnemy = null;
			}
			if ((Object)flowermanSafe != (Object)null)
			{
				flowermanSafe.carryingPlayerBody = false;
				if ((Object)((EnemyAI)flowermanSafe).creatureAnimator != (Object)null)
				{
					((EnemyAI)flowermanSafe).creatureAnimator.SetBool("killing", false);
					((EnemyAI)flowermanSafe).creatureAnimator.SetBool("carryingBody", false);
				}
				((EnemyAI)flowermanSafe).stunnedByPlayer = null;
				((EnemyAI)flowermanSafe).stunNormalizedTimer = 0f;
				flowermanSafe.angerMeter = 0f;
				flowermanSafe.isInAngerMode = false;
				flowermanSafe.timesThreatened = 0;
				flowermanSafe.inKillAnimation = false;
				flowermanSafe.evadeStealthTimer = 0.1f;
				((EnemyAI)flowermanSafe).inSpecialAnimationWithPlayer = null;
				((EnemyAI)flowermanSafe).inSpecialAnimation = false;
				((EnemyAI)flowermanSafe).SetClientCalculatingAI(false);
				if ((Object)((EnemyAI)flowermanSafe).agent != (Object)null)
				{
					((Behaviour)((EnemyAI)flowermanSafe).agent).enabled = true;
				}
				((EnemyAI)flowermanSafe).favoriteSpot = null;
				flowermanSafe.FinishKillAnimation(false);
			}
		}

		[ClientRpc]
		public void PrepForBindingClientRpc(int playerId, ulong flowermanId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Expected O, but got Unknown
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Expected O, but got Unknown
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Expected O, but got Unknown
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Expected O, but got Unknown
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1304423344u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, playerId);
				BytePacker.WriteValueBitPacked(val, flowermanId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 1304423344u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			PlayerControllerB playerSafe = GetPlayerSafe(playerId);
			FlowermanAI flowermanSafe = GetFlowermanSafe(flowermanId);
			if ((Object)flowermanSafe != (Object)null)
			{
				if ((Object)((EnemyAI)flowermanSafe).creatureAnimator != (Object)null)
				{
					((EnemyAI)flowermanSafe).creatureAnimator.SetBool("killing", false);
					((EnemyAI)flowermanSafe).creatureAnimator.SetBool("carryingBody", true);
				}
				flowermanSafe.carryingPlayerBody = true;
				flowermanSafe.inKillAnimation = false;
				((EnemyAI)flowermanSafe).targetPlayer = null;
			}
			if ((Object)playerSafe != (Object)null)
			{
				playerSafe.inSpecialInteractAnimation = true;
				playerSafe.inAnimationWithEnemy = (EnemyAI)flowermanSafe;
			}
		}

		[ClientRpc]
		public void AddBindingsClientRpc(int playerId, ulong flowermanId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Expected O, but got Unknown
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Expected O, but got Unknown
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1647441961u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, playerId);
				BytePacker.WriteValueBitPacked(val, flowermanId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 1647441961u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				PlayerControllerB playerSafe = GetPlayerSafe(playerId);
				FlowermanAI flowermanSafe = GetFlowermanSafe(flowermanId);
				if ((Object)playerSafe != (Object)null && (Object)flowermanSafe != (Object)null)
				{
					SharedData.Instance.BindedDrags[flowermanSafe] = playerSafe;
					SharedData.Instance.PlayerIDs[playerSafe] = playerId;
					SharedData.Instance.IDsToPlayerController[playerId] = playerSafe;
					SharedData.Instance.LastGrabbedTimeStamp[flowermanSafe] = Time.time;
				}
			}
		}

		[ClientRpc]
		public void RemoveBindingsClientRpc(int playerId, ulong flowermanID)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Expected O, but got Unknown
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2727274551u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, playerId);
				BytePacker.WriteValueBitPacked(val, flowermanID);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 2727274551u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				PlayerControllerB playerSafe = GetPlayerSafe(playerId);
				FlowermanAI flowermanSafe = GetFlowermanSafe(flowermanID);
				if ((Object)flowermanSafe != (Object)null)
				{
					SharedData.Instance.BindedDrags.Remove(flowermanSafe);
					SharedData.Instance.LastGrabbedTimeStamp[flowermanSafe] = Time.time;
				}
				if ((Object)playerSafe != (Object)null)
				{
					SharedData.Instance.DroppedTimestamp[playerSafe] = Time.time;
				}
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_FlowermanBinding()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Expected O, but got Unknown
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Expected O, but got Unknown
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected O, but got Unknown
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Expected O, but got Unknown
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Expected O, but got Unknown
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Expected O, but got Unknown
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Expected O, but got Unknown
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Expected O, but got Unknown
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Expected O, but got Unknown
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(2841149136u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_2841149136));
			NetworkManager.__rpc_func_table.Add(1240084643u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_1240084643));
			NetworkManager.__rpc_func_table.Add(3697084031u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_3697084031));
			NetworkManager.__rpc_func_table.Add(3576432139u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_3576432139));
			NetworkManager.__rpc_func_table.Add(1928701905u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_1928701905));
			NetworkManager.__rpc_func_table.Add(3595148175u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_3595148175));
			NetworkManager.__rpc_func_table.Add(2582248323u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_2582248323));
			NetworkManager.__rpc_func_table.Add(3509983500u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_3509983500));
			NetworkManager.__rpc_func_table.Add(2823097549u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_2823097549));
			NetworkManager.__rpc_func_table.Add(3204958366u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_3204958366));
			NetworkManager.__rpc_func_table.Add(1506678615u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_1506678615));
			NetworkManager.__rpc_func_table.Add(3079751162u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_3079751162));
			NetworkManager.__rpc_func_table.Add(182933403u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_182933403));
			NetworkManager.__rpc_func_table.Add(1450070789u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_1450070789));
			NetworkManager.__rpc_func_table.Add(2434358873u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_2434358873));
			NetworkManager.__rpc_func_table.Add(1193047885u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_1193047885));
			NetworkManager.__rpc_func_table.Add(2270563105u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_2270563105));
			NetworkManager.__rpc_func_table.Add(1304423344u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_1304423344));
			NetworkManager.__rpc_func_table.Add(1647441961u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_1647441961));
			NetworkManager.__rpc_func_table.Add(2727274551u, (RpcReceiveHandler)new RpcReceiveHandler(__rpc_handler_2727274551));
		}

		private static void __rpc_handler_2841149136(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);
				ulong flowermanId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlowermanBinding)(object)target).BindPlayerServerRpc(playerId, flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1240084643(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);
				ulong flowermanId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlowermanBinding)(object)target).UnbindPlayerServerRpc(playerId, flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3697084031(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);
				ulong flowermanId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlowermanBinding)(object)target).ResetEntityStatesServerRpc(playerId, flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3576432139(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);
				ulong flowermanId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlowermanBinding)(object)target).PrepForBindingServerRpc(playerId, flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1928701905(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 damage = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref damage);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlowermanBinding)(object)target).DamagePlayerServerRpc(playerId, damage);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3595148175(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);
				ulong flowermanId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((FlowermanBinding)(object)target).UpdateFavoriteSpotServerRpc(playerId, flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2582248323(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;
				((FlowermanBinding)(object)target).MufflePlayerVoiceServerRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3509983500(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;
				((FlowermanBinding)(object)target).UnmufflePlayerVoiceServerRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		private static void __rpc_handler_3204958366(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;
				((FlowermanBinding)(object)target).GiveChillPillServerRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1506678615(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);
				ulong flowermanId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((FlowermanBinding)(object)target).UpdateFavoriteSpotClientRpc(playerId, flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3079751162(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)2;
				((FlowermanBinding)(object)target).GiveChillPillClientRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		private static void __rpc_handler_1450070789(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)2;
				((FlowermanBinding)(object)target).MufflePlayerVoiceClientRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2434358873(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)2;
				((FlowermanBinding)(object)target).UnmufflePlayerVoiceClientRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1193047885(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 damage = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref damage);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((FlowermanBinding)(object)target).DamagePlayerClientRpc(playerId, damage);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2270563105(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);
				ulong flowermanId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((FlowermanBinding)(object)target).ResetEntityStatesClientRpc(playerId, flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1304423344(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);
				ulong flowermanId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((FlowermanBinding)(object)target).PrepForBindingClientRpc(playerId, flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1647441961(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);
				ulong flowermanId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((FlowermanBinding)(object)target).AddBindingsClientRpc(playerId, flowermanId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2727274551(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);
				ulong flowermanID = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref flowermanID);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((FlowermanBinding)(object)target).RemoveBindingsClientRpc(playerId, flowermanID);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "FlowermanBinding";
		}
	}
}
namespace SnatchingBracken.Patches.dungeon
{
	[HarmonyPatch(typeof(DungeonGenerator))]
	internal class DungeonGenPatch
	{
		private const string modGUID = "Ovchinikov.SnatchinBracken.Dungeon";

		private static ManualLogSource logger;

		static DungeonGenPatch()
		{
			logger = Logger.CreateLogSource("Ovchinikov.SnatchinBracken.Dungeon");
		}

		[HarmonyPatch("ChangeStatus")]
		[HarmonyPostfix]
		public static void OnChangeStatus(DungeonGenerator __instance)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invali