Decompiled source of Eatable BingBong v0.1.4

plugins/com.atomic.eatablebingbong.dll

Decompiled a week 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.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Peak.Afflictions;
using UnityEngine;
using Zorro.Core;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.atomic.eatablebingbong")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.1.4.0")]
[assembly: AssemblyInformationalVersion("0.1.4+5d19094378b5274c0f24c8b8032cfd6c66921ad5")]
[assembly: AssemblyProduct("com.atomic.eatablebingbong")]
[assembly: AssemblyTitle("Eatable_BingBong")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.4.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace Eatable_BingBong
{
	[BepInPlugin("com.atomic.eatablebingbong", "Eatable_BingBong", "0.1.4")]
	public class Plugin : BaseUnityPlugin
	{
		private static Harmony harmony;

		public const string Id = "com.atomic.eatablebingbong";

		internal static ManualLogSource Log { get; private set; }

		public static string Name => "Eatable_BingBong";

		public static string Version => "0.1.4";

		private void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			harmony = new Harmony("com.atomic.eatablebingbong");
			harmony.PatchAll();
			Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
			((Component)this).gameObject.AddComponent<CrabManager>();
			((Component)this).gameObject.AddComponent<ScoutmasterEffectManager>();
			((Component)this).gameObject.AddComponent<GhostManager>();
		}
	}
	public class ScoutmasterEffectManager : MonoBehaviour
	{
		public static ScoutmasterEffectManager instance;

		private readonly Dictionary<Character, float> activeEffects = new Dictionary<Character, float>();

		private void Awake()
		{
			instance = this;
		}

		private void Update()
		{
			if (activeEffects.Count == 0)
			{
				return;
			}
			List<Character> list = new List<Character>();
			Scoutmaster val = default(Scoutmaster);
			foreach (KeyValuePair<Character, float> activeEffect in activeEffects)
			{
				Character key = activeEffect.Key;
				float value = activeEffect.Value;
				if ((Object)(object)key == (Object)null || (Object)(object)key.data == (Object)null)
				{
					list.Add(key);
				}
				else if (Time.time < value)
				{
					key.data.myersDistance = 5f;
					if (key.IsLocal && Scoutmaster.GetPrimaryScoutmaster(ref val) && (Object)(object)val != (Object)null && (Object)(object)val.mat != (Object)null)
					{
						val.mat.SetFloat(Shader.PropertyToID("_Strength"), 1f);
						val.mat.SetFloat(Shader.PropertyToID("_GrainMult"), ((Object)(object)GUIManager.instance != (Object)null && GUIManager.instance.photosensitivity) ? 0f : 1f);
					}
				}
				else
				{
					list.Add(key);
				}
			}
			foreach (Character item in list)
			{
				activeEffects.Remove(item);
			}
		}

		public static void TriggerScoutmasterEffect(Character character, float duration)
		{
			if ((Object)(object)character == (Object)null)
			{
				Debug.LogError((object)"Cannot apply Scoutmaster effect to a null character.");
			}
			else if ((Object)(object)instance == (Object)null)
			{
				Debug.LogError((object)"ScoutmasterEffectManager instance is missing from the scene.");
			}
			else
			{
				instance.activeEffects[character] = Time.time + duration;
			}
		}
	}
	public class GhostManager : MonoBehaviour
	{
		private class OrbitData
		{
			public PlayerGhost ghost;

			public float angleOffset;

			public float bobSpeed;

			public float bobHeight;

			public bool isApproaching;
		}

		public static GhostManager instance = null;

		public static float OrbitSpeed = 0.5f;

		public static float OrbitRadius = 7f;

		private void Awake()
		{
			instance = this;
		}

		public static void SpawnGhosts(Character targetCharacter, int count, float duration)
		{
			if (!((Object)(object)targetCharacter == (Object)null) && targetCharacter.IsLocal)
			{
				if ((Object)(object)instance == (Object)null)
				{
					Debug.LogError((object)"GhostManager instance is missing from the scene.");
				}
				else
				{
					((MonoBehaviour)instance).StartCoroutine(GhostRoutine(targetCharacter, count, duration));
				}
			}
		}

		private static IEnumerator GhostRoutine(Character targetCharacter, int count, float duration)
		{
			GameObject val = Resources.Load<GameObject>("PlayerGhost");
			if ((Object)(object)val == (Object)null)
			{
				GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>();
				GameObject[] array2 = array;
				foreach (GameObject val2 in array2)
				{
					if (((Object)val2).name.Contains("Ghost") && (Object)(object)val2.GetComponent<PlayerGhost>() != (Object)null)
					{
						val = val2;
						break;
					}
				}
			}
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogWarning((object)"Could not find PlayerGhost prefab via Resources or memory search.");
				yield break;
			}
			List<PlayerGhost> activeGhosts = new List<PlayerGhost>();
			List<OrbitData> ghostDataList = new List<OrbitData>();
			Customization val3 = Singleton<Customization>.Instance;
			Vector3 val4 = default(Vector3);
			for (int j = 0; j < count; j++)
			{
				float num = (float)j * MathF.PI * 2f / (float)count;
				((Vector3)(ref val4))..ctor(Mathf.Cos(num) * OrbitRadius, 1f, Mathf.Sin(num) * OrbitRadius);
				Vector3 val5 = targetCharacter.Center + val4;
				GameObject val6 = Object.Instantiate<GameObject>(val, val5, Quaternion.identity);
				PlayerGhost component = val6.GetComponent<PlayerGhost>();
				if (!((Object)(object)component != (Object)null))
				{
					continue;
				}
				component.m_target = targetCharacter;
				component.m_owner = targetCharacter;
				if ((Object)(object)val3 != (Object)null)
				{
					PersistentPlayerData val7 = new PersistentPlayerData
					{
						customizationData = 
						{
							currentSkin = Random.Range(0, val3.skins.Count())
						},
						customizationData = 
						{
							currentEyes = Random.Range(0, val3.eyes.Count())
						},
						customizationData = 
						{
							currentMouth = Random.Range(0, val3.mouths.Count())
						},
						customizationData = 
						{
							currentAccessory = Random.Range(0, val3.accessories.Count())
						}
					};
					typeof(PlayerGhost).GetMethod("CustomizeGhost", BindingFlags.Instance | BindingFlags.NonPublic)?.Invoke(component, new object[1] { val7 });
				}
				if (component.PlayerRenderers != null)
				{
					Renderer[] playerRenderers = component.PlayerRenderers;
					foreach (Renderer val8 in playerRenderers)
					{
						if ((Object)(object)val8 != (Object)null)
						{
							val8.enabled = true;
						}
					}
				}
				if (component.EyeRenderers != null)
				{
					Renderer[] eyeRenderers = component.EyeRenderers;
					foreach (Renderer val9 in eyeRenderers)
					{
						if ((Object)(object)val9 != (Object)null)
						{
							val9.enabled = true;
						}
					}
				}
				if ((Object)(object)component.mouthRenderer != (Object)null)
				{
					component.mouthRenderer.enabled = true;
				}
				if ((Object)(object)component.accessoryRenderer != (Object)null)
				{
					component.accessoryRenderer.enabled = true;
				}
				if ((Object)(object)component.thirdEye != (Object)null)
				{
					component.thirdEye.SetActive(false);
				}
				activeGhosts.Add(component);
				ghostDataList.Add(new OrbitData
				{
					ghost = component,
					angleOffset = num,
					bobSpeed = Random.Range(1.5f, 3f),
					bobHeight = Random.Range(0.8f, 1.8f),
					isApproaching = false
				});
			}
			float elapsed = 0f;
			int targetJumpscares = 5;
			int jumpscaresTriggered = 0;
			float num2 = duration / ((float)targetJumpscares + 1f);
			float nextTriggerTime = Random.Range(num2 * 0.5f, num2 * 1.5f);
			Vector3 val10 = default(Vector3);
			while (elapsed < duration && !((Object)(object)targetCharacter == (Object)null))
			{
				if (jumpscaresTriggered < targetJumpscares && elapsed >= nextTriggerTime)
				{
					List<OrbitData> list = ghostDataList.Where((OrbitData d) => d != null && (Object)(object)d.ghost != (Object)null && !d.isApproaching).ToList();
					if (list.Count > 0)
					{
						OrbitData data = list[Random.Range(0, list.Count)];
						((MonoBehaviour)instance).StartCoroutine(GhostApproachRoutine(data, targetCharacter));
						jumpscaresTriggered++;
					}
					float num3 = Mathf.Max(1f, duration - elapsed);
					nextTriggerTime = elapsed + Random.Range(3f, num3 / (float)(targetJumpscares - jumpscaresTriggered + 1));
				}
				float num4 = Time.time * OrbitSpeed;
				for (int num5 = 0; num5 < ghostDataList.Count; num5++)
				{
					OrbitData orbitData = ghostDataList[num5];
					if ((Object)(object)orbitData.ghost != (Object)null && !orbitData.isApproaching)
					{
						float num6 = num4 + orbitData.angleOffset;
						float num7 = targetCharacter.Center.x + Mathf.Cos(num6) * OrbitRadius;
						float num8 = targetCharacter.Center.z + Mathf.Sin(num6) * OrbitRadius;
						float num9 = targetCharacter.Center.y + 1f + Mathf.Sin(Time.time * orbitData.bobSpeed + (float)num5) * orbitData.bobHeight;
						((Vector3)(ref val10))..ctor(num7, num9, num8);
						((Component)orbitData.ghost).transform.position = Vector3.Lerp(((Component)orbitData.ghost).transform.position, val10, Time.deltaTime * 5f);
						if ((Object)(object)MainCamera.instance != (Object)null && (Object)(object)MainCamera.instance.cam != (Object)null)
						{
							Quaternion val11 = Quaternion.LookRotation(((Component)MainCamera.instance.cam).transform.position - ((Component)orbitData.ghost).transform.position);
							((Component)orbitData.ghost).transform.rotation = Quaternion.Slerp(((Component)orbitData.ghost).transform.rotation, val11, Time.deltaTime * 5f);
						}
					}
				}
				elapsed += Time.deltaTime;
				yield return null;
			}
			foreach (PlayerGhost item in activeGhosts)
			{
				if ((Object)(object)item != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)item).gameObject);
				}
			}
		}

		private static IEnumerator GhostApproachRoutine(OrbitData data, Character targetCharacter)
		{
			PlayerGhost ghost = data.ghost;
			if ((Object)(object)ghost == (Object)null || (Object)(object)targetCharacter == (Object)null)
			{
				yield break;
			}
			data.isApproaching = true;
			Vector3 startPos = ((Component)ghost).transform.position;
			Transform camTransform = (((Object)(object)MainCamera.instance != (Object)null && (Object)(object)MainCamera.instance.cam != (Object)null) ? ((Component)MainCamera.instance.cam).transform : ((Component)targetCharacter).transform);
			Vector3 frontPos = camTransform.position + camTransform.forward * 1.8f;
			float elapsed = 0f;
			float duration = 0.35f;
			while (elapsed < duration && (Object)(object)ghost != (Object)null)
			{
				elapsed += Time.deltaTime;
				float num = elapsed / duration;
				((Component)ghost).transform.position = Vector3.Lerp(startPos, frontPos, num);
				if ((Object)(object)camTransform != (Object)null)
				{
					((Component)ghost).transform.rotation = Quaternion.LookRotation(camTransform.position - ((Component)ghost).transform.position);
				}
				yield return null;
			}
			float lingerElapsed = 0f;
			float lingerDuration = 1.5f;
			while (lingerElapsed < lingerDuration && (Object)(object)ghost != (Object)null)
			{
				lingerElapsed += Time.deltaTime;
				if ((Object)(object)camTransform != (Object)null)
				{
					frontPos = camTransform.position + camTransform.forward * 1.8f;
					((Component)ghost).transform.position = Vector3.Lerp(((Component)ghost).transform.position, frontPos, Time.deltaTime * 10f);
					((Component)ghost).transform.rotation = Quaternion.LookRotation(camTransform.position - ((Component)ghost).transform.position);
				}
				yield return null;
			}
			float retreatElapsed = 0f;
			float retreatDuration = 0.4f;
			Vector3 retreatStartPos = (((Object)(object)ghost != (Object)null) ? ((Component)ghost).transform.position : frontPos);
			Vector3 val = default(Vector3);
			while (retreatElapsed < retreatDuration && (Object)(object)ghost != (Object)null)
			{
				retreatElapsed += Time.deltaTime;
				float num2 = retreatElapsed / retreatDuration;
				float num3 = Time.time * OrbitSpeed;
				float num4 = num3 + data.angleOffset;
				float num5 = targetCharacter.Center.x + Mathf.Cos(num4) * OrbitRadius;
				float num6 = targetCharacter.Center.z + Mathf.Sin(num4) * OrbitRadius;
				float num7 = targetCharacter.Center.y + 1f + Mathf.Sin(Time.time * data.bobSpeed) * data.bobHeight;
				((Vector3)(ref val))..ctor(num5, num7, num6);
				((Component)ghost).transform.position = Vector3.Lerp(retreatStartPos, val, num2);
				if ((Object)(object)camTransform != (Object)null)
				{
					((Component)ghost).transform.rotation = Quaternion.LookRotation(camTransform.position - ((Component)ghost).transform.position);
				}
				yield return null;
			}
			data.isApproaching = false;
		}
	}
	public class CrabManager : MonoBehaviour
	{
		public static CrabManager instance;

		private void Awake()
		{
			instance = this;
		}

		public static void TriggerGiveCrab(Character character)
		{
			if ((Object)(object)character == (Object)null)
			{
				Debug.LogError((object)"Cannot give crab to a null character.");
			}
			else if ((Object)(object)instance == (Object)null)
			{
				Debug.LogError((object)"CrabManager instance is missing from the scene.");
			}
			else
			{
				((MonoBehaviour)instance).StartCoroutine(GiveCrabRoutine(character));
			}
		}

		private static IEnumerator GiveCrabRoutine(Character character)
		{
			yield return (object)new WaitForSeconds(60f);
			WaitForSeconds tick = new WaitForSeconds(1f);
			for (int i = 1; i < 50; i++)
			{
				if ((Object)(object)character == (Object)null)
				{
					break;
				}
				if ((Object)(object)character.refs.afflictions == (Object)null)
				{
					break;
				}
				if (i <= 4)
				{
					character.refs.afflictions.AddStatus((STATUSTYPE)6, 0.15f, false, true, true, false, false);
				}
				character.refs.afflictions.AddStatus((STATUSTYPE)4, 0.01f, false, true, true, false, false);
				yield return tick;
			}
		}
	}
	[HarmonyPatch]
	public static class PatchesBingBong
	{
		public static SFX_Instance Lollipop;

		public static void BingBong(Item __instance)
		{
			__instance.UIData.hasSecondInteract = true;
			__instance.UIData.secondaryInteractPrompt = "eat";
			__instance._useFeedback.useAnimation = "Eat";
			Item obj = __instance;
			obj.OnSecondaryStarted = (Action)Delegate.Combine(obj.OnSecondaryStarted, (Action)delegate
			{
				__instance._useFeedback.useAnimation = "Eat";
				__instance.usingTimePrimary = 2f;
			});
			Item obj2 = __instance;
			obj2.OnPrimaryStarted = (Action)Delegate.Combine(obj2.OnPrimaryStarted, (Action)delegate
			{
				__instance._useFeedback.useAnimation = "";
				__instance.usingTimePrimary = 0.25f;
			});
			Item obj3 = __instance;
			obj3.OnSecondaryFinishedCast = (Action)Delegate.Combine(obj3.OnSecondaryFinishedCast, (Action)delegate
			{
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_006e: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c1: Expected O, but got Unknown
				//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0109: Unknown result type (might be due to invalid IL or missing references)
				//IL_0114: Unknown result type (might be due to invalid IL or missing references)
				//IL_0120: Expected O, but got Unknown
				//IL_0120: Unknown result type (might be due to invalid IL or missing references)
				//IL_0125: Unknown result type (might be due to invalid IL or missing references)
				//IL_0136: Unknown result type (might be due to invalid IL or missing references)
				//IL_013d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0148: Unknown result type (might be due to invalid IL or missing references)
				//IL_015d: Expected O, but got Unknown
				ItemCooking component = ((Component)__instance.transform).GetComponent<ItemCooking>();
				GlobalEvents.TriggerItemConsumed(__instance, __instance.holderCharacter);
				Optionable<byte> currentSelectedSlot = __instance.holderCharacter.refs.items.currentSelectedSlot;
				__instance.holderCharacter.player.EmptySlot(currentSelectedSlot, true);
				__instance.holderCharacter.refs.items.EquipSlot(currentSelectedSlot);
				__instance.holderCharacter.refs.afflictions.AddStatus((STATUSTYPE)5, 0.1f * (float)(component.timesCookedLocal + 1), false, true, true, false, false);
				Action_RestoreHunger val = new Action_RestoreHunger
				{
					item = __instance,
					restorationAmount = 0.8f
				};
				((ItemActionBase)val).RunAction();
				ScoutmasterEffectManager.TriggerScoutmasterEffect(__instance.holderCharacter, 45f);
				GhostManager.SpawnGhosts(__instance.holderCharacter, 10, 45f);
				Affliction_AdjustDrowsyOverTime drowsyAffliction = new Affliction_AdjustDrowsyOverTime
				{
					character = __instance.holderCharacter,
					statusPerSecond = 0.1f,
					totalTime = 10f
				};
				Affliction_InfiniteStamina affl = new Affliction_InfiniteStamina
				{
					character = __instance.holderCharacter,
					drowsyAffliction = (Affliction)(object)drowsyAffliction,
					climbDelay = 3f,
					totalTime = 15f + (float)component.timesCookedLocal
				};
				ApplyAffliction(__instance, (Affliction)(object)affl);
			});
		}

		public static void AncientIdol(Item __instance)
		{
			__instance.UIData.hasMainInteract = true;
			__instance.UIData.mainInteractPrompt = "eat";
			__instance._useFeedback.useAnimation = "Eat";
			Item obj = __instance;
			obj.OnPrimaryStarted = (Action)Delegate.Combine(obj.OnPrimaryStarted, (Action)delegate
			{
				__instance._useFeedback.useAnimation = "Eat";
				__instance.usingTimePrimary = 2f;
			});
			Item obj2 = __instance;
			obj2.OnPrimaryFinishedCast = (Action)Delegate.Combine(obj2.OnPrimaryFinishedCast, (Action)delegate
			{
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: 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_00b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b9: 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)
				//IL_00d1: Expected O, but got Unknown
				//IL_0103: Unknown result type (might be due to invalid IL or missing references)
				//IL_0108: Unknown result type (might be due to invalid IL or missing references)
				//IL_0119: Unknown result type (might be due to invalid IL or missing references)
				//IL_0124: Unknown result type (might be due to invalid IL or missing references)
				//IL_0138: Expected O, but got Unknown
				//IL_0138: Unknown result type (might be due to invalid IL or missing references)
				//IL_013d: Unknown result type (might be due to invalid IL or missing references)
				//IL_014e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0155: Unknown result type (might be due to invalid IL or missing references)
				//IL_0162: Expected O, but got Unknown
				//IL_0162: Unknown result type (might be due to invalid IL or missing references)
				//IL_0167: Unknown result type (might be due to invalid IL or missing references)
				//IL_0178: Unknown result type (might be due to invalid IL or missing references)
				//IL_0183: Unknown result type (might be due to invalid IL or missing references)
				//IL_018e: Unknown result type (might be due to invalid IL or missing references)
				//IL_019b: Expected O, but got Unknown
				//IL_019b: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01be: Expected O, but got Unknown
				ItemCooking component = ((Component)__instance.transform).GetComponent<ItemCooking>();
				CrabManager.TriggerGiveCrab(__instance.holderCharacter);
				GlobalEvents.TriggerItemConsumed(__instance, __instance.holderCharacter);
				Optionable<byte> currentSelectedSlot = __instance.holderCharacter.refs.items.currentSelectedSlot;
				__instance.holderCharacter.player.EmptySlot(currentSelectedSlot, true);
				__instance.holderCharacter.refs.items.EquipSlot(currentSelectedSlot);
				__instance.holderCharacter.refs.afflictions.AddStatus((STATUSTYPE)5, 0.2f * (float)(component.timesCookedLocal + 1), false, true, true, false, false);
				Action_RestoreHunger val = new Action_RestoreHunger
				{
					item = __instance,
					restorationAmount = 1f
				};
				((ItemActionBase)val).RunAction();
				ScoutmasterEffectManager.TriggerScoutmasterEffect(__instance.holderCharacter, 90f);
				GhostManager.SpawnGhosts(__instance.holderCharacter, 15, 90f);
				Affliction_InfiniteStamina affl = new Affliction_InfiniteStamina
				{
					character = __instance.holderCharacter,
					climbDelay = 3f,
					totalTime = 10f + (float)component.timesCookedLocal
				};
				Affliction_Invincibility affl2 = new Affliction_Invincibility
				{
					character = __instance.holderCharacter,
					isFromMilk = true,
					totalTime = 60f
				};
				Affliction_FasterBoi affl3 = new Affliction_FasterBoi
				{
					character = __instance.holderCharacter,
					moveSpeedMod = 1.3f,
					climbSpeedMod = 1.3f,
					totalTime = 60f
				};
				Affliction_Numb affl4 = new Affliction_Numb
				{
					character = __instance.holderCharacter,
					totalTime = 60f
				};
				ApplyAffliction(__instance, (Affliction)(object)affl);
				ApplyAffliction(__instance, (Affliction)(object)affl2);
				ApplyAffliction(__instance, (Affliction)(object)affl3);
				ApplyAffliction(__instance, (Affliction)(object)affl4);
			});
		}

		public static void ApplyAffliction(Item __instance, Affliction affl)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			Action_ApplyAffliction val = new Action_ApplyAffliction
			{
				item = __instance,
				affliction = affl
			};
			((ItemActionBase)val).RunAction();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Item), "Awake")]
		public static void GetBingBong(Item __instance)
		{
			if (__instance.itemID == 13 || __instance.itemID == 124)
			{
				BingBong(__instance);
			}
			if (__instance.itemID == 47)
			{
				AncientIdol(__instance);
			}
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}