Decompiled source of TrickOrTreat v1.0.4

TrickOrTreat.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CursedScraps;
using CursedScraps.Behaviours;
using CursedScraps.Behaviours.Curses;
using CursedScraps.Managers;
using CursedScraps.Values;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using TrickOrTreat.Behaviours;
using TrickOrTreat.Managers;
using TrickOrTreat.NetcodePatcher;
using TrickOrTreat.Patches;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("TrickOrTreat")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TrickOrTreat")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("aa332fd3-7a30-4c63-9e45-c5d6f0cb377a")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ClientNetworkTransform")]
[assembly: IgnoresAccessChecksTo("DissonanceVoip")]
[assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Jobs")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")]
[assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")]
[assembly: IgnoresAccessChecksTo("Unity.Services.QoS")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Relay")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[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]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace TrickOrTreat
{
	internal class Constants
	{
		public const string INFORMATION = "Information";

		public const string MESSAGE_TRICK_OR_TREAT = "Trick or treat?";

		public const string MESSAGE_INFO_NO_CANDY = "You don't have any candy";

		public const string LITTLE_GIRL = "Little Girl";

		public const string HALLOWEEN_CANDY = "Halloween Candy";
	}
	[BepInPlugin("Lega.TrickOrTreat", "Trick Or Treat", "1.0.4")]
	public class TrickOrTreat : BaseUnityPlugin
	{
		private const string modGUID = "Lega.TrickOrTreat";

		private const string modName = "Trick Or Treat";

		private const string modVersion = "1.0.4";

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

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

		internal static ManualLogSource mls;

		public static ConfigFile configFile;

		public static GameObject halloweenCandySprite;

		public void Awake()
		{
			mls = Logger.CreateLogSource("TrickOrTreat");
			configFile = ((BaseUnityPlugin)this).Config;
			ConfigManager.Load();
			NetcodePatcher();
			LoadItems();
			LoadEnemies();
			LoadSprites();
			harmony.PatchAll(typeof(HUDManagerPatch));
			harmony.PatchAll(typeof(ObjectCSManagerPatch));
			harmony.PatchAll(typeof(PlayerControllerBPatch));
			harmony.PatchAll(typeof(BeltBagItemPatch));
			harmony.PatchAll(typeof(RoundManagerPatch));
		}

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

		public static void LoadItems()
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			List<CustomItem> list = new List<CustomItem>();
			list.Add(new CustomItem(typeof(HalloweenCandy), bundle.LoadAsset<Item>("Assets/HalloweenCandy/HalloweenCandyItem.asset"), true, ConfigManager.minHalloweenCandy.Value, ConfigManager.maxHalloweenCandy.Value, ConfigManager.halloweenCandyRarity.Value, 0));
			List<CustomItem> list2 = list;
			foreach (CustomItem item in list2)
			{
				Component obj = item.Item.spawnPrefab.AddComponent(item.Type);
				PhysicsProp val = (PhysicsProp)(object)((obj is PhysicsProp) ? obj : null);
				((GrabbableObject)val).grabbable = true;
				((GrabbableObject)val).grabbableToEnemies = true;
				((GrabbableObject)val).itemProperties = item.Item;
				if (item.Item.isScrap)
				{
					((GrabbableObject)val).scrapValue = item.Value;
				}
				NetworkPrefabs.RegisterNetworkPrefab(item.Item.spawnPrefab);
				Utilities.FixMixerGroups(item.Item.spawnPrefab);
				Items.RegisterItem(item.Item);
			}
			CursedScraps.customItems.AddRange(list2);
		}

		public static void LoadEnemies()
		{
			EnemyType val = bundle.LoadAsset<EnemyType>("Assets/LittleGirl/LittleGirlEnemy.asset");
			NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab);
			Enemies.RegisterEnemy(val, ConfigManager.littleGirlRarity.Value, (LevelTypes)(-1), (TerminalNode)null, (TerminalKeyword)null);
		}

		public static void LoadSprites()
		{
			halloweenCandySprite = bundle.LoadAsset<GameObject>("Assets/Images/HalloweenCandyImage.prefab");
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "TrickOrTreat";

		public const string PLUGIN_NAME = "TrickOrTreat";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace TrickOrTreat.Patches
{
	internal class BeltBagItemPatch
	{
		[HarmonyPatch(typeof(BeltBagItem), "PutObjectInBagLocalClient")]
		[HarmonyPrefix]
		private static bool PreGrabObject(ref GrabbableObject gObject)
		{
			if (gObject is HalloweenCandy halloweenCandy)
			{
				PlayerControllerBPatch.AddHalloweenCandy(halloweenCandy);
				return false;
			}
			return true;
		}
	}
	internal class HUDManagerPatch
	{
		public static GameObject halloweenCandyImage;

		[HarmonyPatch(typeof(HUDManager), "Start")]
		[HarmonyPostfix]
		private static void StartHUDManager()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: 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_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			if (ConfigManager.isHalloweenCandyIconOn.Value)
			{
				Transform transform = GameObject.Find("Systems/UI/Canvas/Panel/GameObject/PlayerScreen").transform;
				halloweenCandyImage = Object.Instantiate<GameObject>(TrickOrTreat.halloweenCandySprite, Vector3.zero, Quaternion.identity);
				halloweenCandyImage.transform.localPosition = Vector3.zero;
				RectTransform component = halloweenCandyImage.GetComponent<RectTransform>();
				((Transform)component).SetParent(transform, false);
				component.anchorMin = new Vector2(1f, 0f);
				component.anchorMax = new Vector2(1f, 0f);
				component.pivot = new Vector2(1f, 0f);
				component.anchoredPosition = new Vector2(ConfigManager.halloweenCandyPosX.Value, ConfigManager.halloweenCandyPosY.Value);
				component.sizeDelta = new Vector2(40f, 40f);
				SetActive(enable: false);
			}
		}

		public static void SetActive(bool enable)
		{
			if (ConfigManager.isHalloweenCandyIconOn.Value && !((Object)(object)halloweenCandyImage == (Object)null))
			{
				halloweenCandyImage.SetActive(enable);
			}
		}
	}
	internal class ObjectCSManagerPatch
	{
		[HarmonyPatch(typeof(ObjectCSManager), "AddNewItems")]
		[HarmonyPostfix]
		private static void ChangeRarity()
		{
			SpawnableEnemyWithRarity val = ((IEnumerable<SpawnableEnemyWithRarity>)RoundManager.Instance.currentLevel.Enemies).FirstOrDefault((Func<SpawnableEnemyWithRarity, bool>)((SpawnableEnemyWithRarity e) => e.enemyType.enemyName.Equals("Little Girl")));
			if (val != null)
			{
				int num = Object.FindObjectsOfType<HalloweenCandy>().Count();
				val.rarity = ConfigManager.littleGirlRarity.Value + num * ConfigManager.littleGirlRarityIncrement.Value;
			}
		}
	}
	internal class PlayerControllerBPatch
	{
		public static int currentStackedCandies;

		[HarmonyPatch(typeof(PlayerControllerB), "BeginGrabObject")]
		[HarmonyPrefix]
		private static bool PreGrabObject(ref PlayerControllerB __instance)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: 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_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			__instance.interactRay = new Ray(((Component)__instance.gameplayCamera).transform.position, ((Component)__instance.gameplayCamera).transform.forward);
			if (!Physics.Raycast(__instance.interactRay, ref __instance.hit, __instance.grabDistance, __instance.interactableObjectsMask) || ((Component)((RaycastHit)(ref __instance.hit)).collider).gameObject.layer == 8 || !(((Component)((RaycastHit)(ref __instance.hit)).collider).tag == "PhysicsProp") || __instance.twoHanded || __instance.sinkingValue > 0.73f || Physics.Linecast(((Component)__instance.gameplayCamera).transform.position, ((Component)((RaycastHit)(ref __instance.hit)).collider).transform.position + ((Component)__instance).transform.up * 0.16f, 1073741824, (QueryTriggerInteraction)1))
			{
				return true;
			}
			GrabbableObject component = ((Component)((Component)((RaycastHit)(ref __instance.hit)).collider).transform).gameObject.GetComponent<GrabbableObject>();
			if ((Object)(object)component != (Object)null && component is HalloweenCandy halloweenCandy)
			{
				AddHalloweenCandy(halloweenCandy);
				return false;
			}
			return true;
		}

		public static void AddHalloweenCandy(HalloweenCandy halloweenCandy)
		{
			halloweenCandy.DestroyObjectServerRpc();
			currentStackedCandies++;
			HUDManagerPatch.SetActive(enable: true);
		}
	}
	internal class RoundManagerPatch
	{
		[HarmonyPatch(typeof(RoundManager), "LoadNewLevel")]
		[HarmonyPostfix]
		private static void StartGame()
		{
			ResetStackedCandies();
		}

		[HarmonyPatch(typeof(RoundManager), "DetectElevatorIsRunning")]
		[HarmonyPostfix]
		private static void EndGame()
		{
			ResetStackedCandies();
		}

		public static void ResetStackedCandies()
		{
			PlayerControllerBPatch.currentStackedCandies = 0;
			HUDManagerPatch.SetActive(enable: false);
		}
	}
}
namespace TrickOrTreat.Managers
{
	internal class ConfigManager
	{
		public static ConfigEntry<int> littleGirlRarity;

		public static ConfigEntry<int> littleGirlRarityIncrement;

		public static ConfigEntry<int> waitingDuration;

		public static ConfigEntry<bool> isHalloweenCandyIconOn;

		public static ConfigEntry<float> halloweenCandyPosX;

		public static ConfigEntry<float> halloweenCandyPosY;

		public static ConfigEntry<int> halloweenCandyRarity;

		public static ConfigEntry<int> minHalloweenCandy;

		public static ConfigEntry<int> maxHalloweenCandy;

		internal static void Load()
		{
			littleGirlRarity = TrickOrTreat.configFile.Bind<int>("Little Girl", "Rarity", 5, "Little Girl base rarity.");
			littleGirlRarityIncrement = TrickOrTreat.configFile.Bind<int>("Little Girl", "Increment rarity", 3, "By how much the Little Girl's chances of spawning are increased for each Halloween Candy spawned?");
			waitingDuration = TrickOrTreat.configFile.Bind<int>("Little Girl", "Waiting duration", 5, "Time window during which a player can give a candy to the little girl before she sends her curse.");
			isHalloweenCandyIconOn = TrickOrTreat.configFile.Bind<bool>("Halloween Candy", "Is icon displayed", true, "Display the Halloween Candy icon when player has one");
			halloweenCandyPosX = TrickOrTreat.configFile.Bind<float>("Halloween Candy", "Dead curses pos X", -30f, "X position of the Halloween Candy icon");
			halloweenCandyPosY = TrickOrTreat.configFile.Bind<float>("Halloween Candy", "Dead curses pos Y", 40f, "Y position of the Halloween Candy icon");
			halloweenCandyRarity = TrickOrTreat.configFile.Bind<int>("Halloween Candy", "Rarity", 25, "Halloween Candy spawn rarity.");
			minHalloweenCandy = TrickOrTreat.configFile.Bind<int>("Halloween Candy", "Min spawn", 2, "Min Halloween Candy to spawn");
			maxHalloweenCandy = TrickOrTreat.configFile.Bind<int>("Halloween Candy", "Max spawn", 4, "Max Halloween Candy to spawn");
		}
	}
}
namespace TrickOrTreat.Behaviours
{
	public class HalloweenCandy : PhysicsProp
	{
		[ServerRpc(RequireOwnership = false)]
		public void DestroyObjectServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1674385760u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1674385760u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					DestroyObjectClientRpc();
				}
			}
		}

		[ClientRpc]
		public void DestroyObjectClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(505369659u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 505369659u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					((GrabbableObject)this).DestroyObjectInHand(((GrabbableObject)this).playerHeldBy);
				}
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_HalloweenCandy()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(1674385760u, new RpcReceiveHandler(__rpc_handler_1674385760));
			NetworkManager.__rpc_func_table.Add(505369659u, new RpcReceiveHandler(__rpc_handler_505369659));
		}

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "HalloweenCandy";
		}
	}
	public class LittleGirl : EnemyAI
	{
		public enum State
		{
			WANDERING,
			CHASING,
			INTERACTING,
			FLEEING
		}

		public Transform TurnCompass;

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

		public float footstepTimer;

		public bool isWaiting;

		public bool isBaited;

		public static Coroutine interactingCoroutine;

		public static Coroutine fleeingCoroutine;

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

		public override void Update()
		{
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).Update();
			base.creatureAnimator.SetBool("stunned", base.stunNormalizedTimer > 0f);
			if (base.stunNormalizedTimer > 0f)
			{
				base.agent.speed = 0f;
				if ((Object)(object)base.stunnedByPlayer != (Object)null)
				{
					base.targetPlayer = base.stunnedByPlayer;
					((EnemyAI)this).StopSearch(base.currentSearch, true);
					((EnemyAI)this).SwitchToBehaviourClientRpc(1);
				}
			}
			else
			{
				PlayFootstepSound();
				int currentBehaviourStateIndex = base.currentBehaviourStateIndex;
				if ((Object)(object)base.targetPlayer != (Object)null && (currentBehaviourStateIndex == 1 || currentBehaviourStateIndex == 2))
				{
					TurnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position);
					((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, TurnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime);
				}
			}
		}

		public void PlayFootstepSound()
		{
			if (base.currentBehaviourStateIndex != 2)
			{
				footstepTimer -= Time.deltaTime;
				if (FootstepSounds.Length != 0 && footstepTimer <= 0f)
				{
					base.creatureSFX.PlayOneShot(FootstepSounds[Random.Range(0, FootstepSounds.Length)]);
					footstepTimer = 0.6f;
				}
			}
		}

		public override void DoAIInterval()
		{
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).DoAIInterval();
			if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead)
			{
				return;
			}
			switch (base.currentBehaviourStateIndex)
			{
			case 0:
				base.agent.speed = 4f;
				if (FoundClosestPlayerInRange(25, 10))
				{
					((EnemyAI)this).StopSearch(base.currentSearch, true);
					DoAnimationClientRpc("startRun");
					((EnemyAI)this).SwitchToBehaviourClientRpc(1);
				}
				break;
			case 1:
			{
				base.agent.speed = 6f;
				float num = Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position);
				if (!TargetClosestPlayerInAnyCase() || (num > 20f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)))
				{
					((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null);
					DoAnimationClientRpc("startWalk");
					((EnemyAI)this).SwitchToBehaviourClientRpc(0);
				}
				else if (num <= 5f)
				{
					DoAnimationClientRpc("startIdle");
					((EnemyAI)this).SwitchToBehaviourServerRpc(2);
				}
				else
				{
					((EnemyAI)this).SetMovingTowardsTargetPlayer(base.targetPlayer);
				}
				break;
			}
			case 2:
				base.agent.speed = 0f;
				if (interactingCoroutine == null)
				{
					interactingCoroutine = ((MonoBehaviour)this).StartCoroutine(InteractingWithPlayerCoroutine());
				}
				break;
			case 3:
				base.agent.speed = 6f;
				if (fleeingCoroutine == null)
				{
					fleeingCoroutine = ((MonoBehaviour)this).StartCoroutine(FleeingCoroutine());
				}
				break;
			}
		}

		public bool FoundClosestPlayerInRange(int range, int senseRange)
		{
			PlayerControllerB val = ((EnemyAI)this).CheckLineOfSightForPlayer(60f, range, senseRange);
			if ((Object)(object)val == (Object)null || !((EnemyAI)this).PlayerIsTargetable(val, false, false))
			{
				return false;
			}
			return Object.op_Implicit((Object)(object)(base.targetPlayer = val));
		}

		public bool TargetClosestPlayerInAnyCase()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			base.mostOptimalDistance = 2000f;
			base.targetPlayer = null;
			for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++)
			{
				base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position);
				if (base.tempDist < base.mostOptimalDistance)
				{
					base.mostOptimalDistance = base.tempDist;
					base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i];
				}
			}
			return (Object)(object)base.targetPlayer != (Object)null;
		}

		public IEnumerator InteractingWithPlayerCoroutine()
		{
			BeginInteractingClientRpc("Trick or treat?", "Little Girl", (int)base.targetPlayer.playerClientId);
			int timePassed = 0;
			while (!isBaited)
			{
				yield return (object)new WaitForSeconds(1f);
				timePassed++;
				if (timePassed >= ConfigManager.waitingDuration.Value || Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 20f)
				{
					isWaiting = false;
					List<CurseEffect> eligibleCurses = CurseCSManager.GetEligibleCurseEffects(StartOfRound.Instance.currentLevel.PlanetName);
					PlayerCSBehaviour component = ((Component)base.targetPlayer).GetComponent<PlayerCSBehaviour>();
					if (component.activeCurses.Count > 0 && component.activeCurses.Count != eligibleCurses.Count)
					{
						eligibleCurses = eligibleCurses.Except(component.activeCurses).ToList();
					}
					DoAnimationClientRpc("startCurse");
					ScreamClientRpc();
					yield return null;
					AnimatorStateInfo currentAnimatorStateInfo = base.creatureAnimator.GetCurrentAnimatorStateInfo(0);
					yield return (object)new WaitForSeconds(((AnimatorStateInfo)(ref currentAnimatorStateInfo)).length);
					if (eligibleCurses.Count > 0)
					{
						CursedScrapsNetworkManager.Instance.SetPlayerCurseEffectServerRpc((int)base.targetPlayer.playerClientId, eligibleCurses[new Random().Next(eligibleCurses.Count)].CurseName, true);
					}
					else
					{
						CursedScrapsNetworkManager.Instance.KillPlayerServerRpc((int)base.targetPlayer.playerClientId, Vector3.zero, true, 0);
					}
					break;
				}
			}
			DoAnimationClientRpc("startRun");
			((EnemyAI)this).SwitchToBehaviourClientRpc(3);
			yield return (object)new WaitForSeconds(5f);
			EndInteractingClientRpc();
		}

		[ClientRpc]
		public void BeginInteractingClientRpc(string message, string sender, 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_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(251677412u, val, (RpcDelivery)0);
				bool flag = message != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(message, false);
				}
				bool flag2 = sender != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag2, default(ForPrimitives));
				if (flag2)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(sender, false);
				}
				BytePacker.WriteValueBitPacked(val2, playerId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 251677412u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				isWaiting = true;
				base.enemyType.canBeStunned = false;
				if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>())
				{
					HUDManager.Instance.AddChatMessage(message, sender);
				}
			}
		}

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

		[ClientRpc]
		public void EndInteractingClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1077734210u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1077734210u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					isWaiting = false;
					isBaited = false;
					base.enemyType.canBeStunned = true;
					interactingCoroutine = null;
				}
			}
		}

		public void InteractingWithEnemy()
		{
			if (!isWaiting)
			{
				return;
			}
			if (PlayerControllerBPatch.currentStackedCandies > 0)
			{
				GiveCandyServerRpc();
				PlayerControllerBPatch.currentStackedCandies--;
				if (PlayerControllerBPatch.currentStackedCandies <= 0)
				{
					HUDManagerPatch.SetActive(enable: false);
				}
			}
			else
			{
				HUDManager.Instance.DisplayTip("Information", "You don't have any candy", false, false, "LC_Tip1");
			}
		}

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

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

		public IEnumerator FleeingCoroutine()
		{
			Transform transform = ((Component)this).transform;
			if ((Object)(object)base.targetPlayer != (Object)null)
			{
				transform = ((EnemyAI)this).ChooseFarthestNodeFromPosition(((Component)base.targetPlayer).transform.position, false, 0, false, 50, false);
				((EnemyAI)this).SetDestinationToPosition(Object.op_Implicit((Object)(object)transform) ? transform.position : ((Component)this).transform.position, true);
				base.targetPlayer = null;
				yield return (object)new WaitForSeconds(5f);
			}
			((EnemyAI)this).StartSearch(transform.position, (AISearchRoutine)null);
			DoAnimationClientRpc("startWalk");
			((EnemyAI)this).SwitchToBehaviourClientRpc(0);
			fleeingCoroutine = null;
		}

		[ClientRpc]
		public void DoAnimationClientRpc(string animationState)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2521819027u, val, (RpcDelivery)0);
				bool flag = animationState != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(animationState, false);
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2521819027u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				base.creatureAnimator.SetTrigger(animationState);
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_LittleGirl()
		{
			//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
			NetworkManager.__rpc_func_table.Add(251677412u, new RpcReceiveHandler(__rpc_handler_251677412));
			NetworkManager.__rpc_func_table.Add(583603153u, new RpcReceiveHandler(__rpc_handler_583603153));
			NetworkManager.__rpc_func_table.Add(1077734210u, new RpcReceiveHandler(__rpc_handler_1077734210));
			NetworkManager.__rpc_func_table.Add(2331916039u, new RpcReceiveHandler(__rpc_handler_2331916039));
			NetworkManager.__rpc_func_table.Add(2990585674u, new RpcReceiveHandler(__rpc_handler_2990585674));
			NetworkManager.__rpc_func_table.Add(2521819027u, new RpcReceiveHandler(__rpc_handler_2521819027));
		}

		private static void __rpc_handler_251677412(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string message = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref message, false);
				}
				bool flag2 = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag2, default(ForPrimitives));
				string sender = null;
				if (flag2)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref sender, false);
				}
				int playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((LittleGirl)(object)target).BeginInteractingClientRpc(message, sender, playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

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

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

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

		private static void __rpc_handler_2521819027(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string animationState = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref animationState, false);
				}
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((LittleGirl)(object)target).DoAnimationClientRpc(animationState);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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