Decompiled source of Chef Overcooked v1.2.5

Chef_Overcooked.dll

Decompiled a week 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.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using HG;
using HG.Reflection;
using IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using R2API;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Achievements;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.ExpansionManagement;
using RoR2.Items;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using RoR2BepInExPack.GameAssetPaths.Version_1_35_0;
using RoR2BepInExPack.GameAssetPathsBetter;
using ShaderSwapper;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Chef_Overcooked")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+4bb974fb301287f5099a7954a402b21ee15cd59b")]
[assembly: AssemblyProduct("Chef_Overcooked")]
[assembly: AssemblyTitle("Chef_Overcooked")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
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 ChefOvercooked
{
	public abstract class BuffBase : GenericBase<BuffDef>
	{
		protected virtual Color Color => Color.white;

		protected virtual Sprite IconSprite => null;

		protected virtual StackingDisplayMethod StackDisplay => (StackingDisplayMethod)0;

		protected virtual bool IgnoreGrowthNectar => true;

		protected virtual bool IsCooldown => false;

		protected virtual bool IsDebuff => false;

		protected virtual bool IsHidden => false;

		protected virtual bool IsStackable => false;

		protected override void Create()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			Value = ScriptableObject.CreateInstance<BuffDef>();
			((Object)Value).name = $"bd{Name}";
			Value.buffColor = Color;
			Value.iconSprite = IconSprite;
			Value.stackingDisplayMethod = StackDisplay;
			Value.ignoreGrowthNectar = IgnoreGrowthNectar;
			Value.isCooldown = IsCooldown;
			Value.isDebuff = IsDebuff;
			Value.isHidden = IsHidden;
			Value.canStack = IsStackable;
			ContentAddition.AddBuffDef(Value);
		}
	}
	public abstract class EquipmentBase : GenericBase<EquipmentDef>
	{
		protected virtual ExpansionDef RequiredExpansion => null;

		protected virtual bool CanRandomTrigger => false;

		protected virtual bool IsConsumed => false;

		protected virtual bool CanDrop => true;

		protected virtual float Cooldown => 0f;

		protected virtual GameObject PickupModelPrefab => null;

		protected virtual Sprite PickupIconSprite => null;

		protected virtual string DisplayName => null;

		protected virtual string Description => null;

		protected virtual string PickupText => null;

		protected virtual string Lore => null;

		protected virtual ItemDisplayRuleDict ItemDisplay()
		{
			return null;
		}

		protected override void Create()
		{
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Expected O, but got Unknown
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Expected O, but got Unknown
			Value = ScriptableObject.CreateInstance<EquipmentDef>();
			((Object)Value).name = Name;
			Value.canBeRandomlyTriggered = CanRandomTrigger;
			Value.isConsumed = IsConsumed;
			Value.canDrop = CanDrop;
			Value.cooldown = Cooldown;
			Value.pickupModelPrefab = PickupModelPrefab;
			Value.pickupIconSprite = PickupIconSprite;
			if (Object.op_Implicit((Object)(object)Value))
			{
				Value.AutoPopulateTokens();
				if (!string.IsNullOrWhiteSpace(DisplayName))
				{
					Value.nameToken = HelperLanguage.LanguageAdd(Value.nameToken, DisplayName);
				}
				if (!string.IsNullOrWhiteSpace(Description))
				{
					Value.descriptionToken = HelperLanguage.LanguageAdd(Value.descriptionToken, Description);
				}
				if (!string.IsNullOrWhiteSpace(PickupText))
				{
					Value.pickupToken = HelperLanguage.LanguageAdd(Value.pickupToken, PickupText);
				}
				if (!string.IsNullOrWhiteSpace(Lore))
				{
					Value.loreToken = HelperLanguage.LanguageAdd(Value.loreToken, Lore);
				}
				LogDisplay();
			}
			if (Object.op_Implicit((Object)(object)RequiredExpansion))
			{
				Value.requiredExpansion = RequiredExpansion;
			}
			ItemAPI.Add(new CustomEquipment(Value, ItemDisplay()));
			EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(EquipmentSlot_PerformEquipmentAction);
		}

		internal bool EquipmentSlot_PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef)
		{
			if (Object.op_Implicit((Object)(object)equipmentDef) && (Object)(object)equipmentDef == (Object)(object)Value)
			{
				return ActivateEquip(self);
			}
			return orig.Invoke(self, equipmentDef);
		}

		protected virtual bool ActivateEquip(EquipmentSlot slot)
		{
			return false;
		}

		protected virtual void LogDisplay()
		{
		}
	}
	public abstract class GenericBase<T> where T : Object
	{
		protected T Value;

		protected abstract string Name { get; }

		public GenericBase()
		{
			if (IsEnabled())
			{
				Create();
				Initialize();
			}
		}

		protected virtual bool IsEnabled()
		{
			return true;
		}

		protected virtual void Create()
		{
		}

		protected virtual void Initialize()
		{
		}

		public T Get()
		{
			return Value;
		}
	}
	public abstract class ItemBase : GenericBase<ItemDef>
	{
		protected virtual bool IsConsumed => false;

		protected virtual bool IsRemovable => false;

		protected virtual bool IsHidden => false;

		protected virtual GameObject PickupModelPrefab => null;

		protected virtual Sprite PickupIconSprite => null;

		protected virtual ItemTag[] Tags => Array.Empty<ItemTag>();

		protected virtual CombinedItemTier Tier => (ItemTier)5;

		protected virtual string DisplayName => null;

		protected virtual string Description => null;

		protected virtual string PickupText => null;

		protected virtual string Lore => null;

		protected virtual ItemDisplayRuleDict ItemDisplay()
		{
			return null;
		}

		protected override void Create()
		{
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Expected O, but got Unknown
			Value = ScriptableObject.CreateInstance<ItemDef>();
			((Object)Value).name = Name;
			Value.isConsumed = IsConsumed;
			Value.canRemove = IsRemovable;
			Value.hidden = IsHidden;
			Value.pickupModelPrefab = PickupModelPrefab;
			Value.pickupIconSprite = PickupIconSprite;
			Value.tags = Tags;
			Value.tier = Tier;
			Value._itemTierDef = Tier;
			Value.deprecatedTier = Tier;
			if (Object.op_Implicit((Object)(object)Value))
			{
				Value.AutoPopulateTokens();
				if (!string.IsNullOrWhiteSpace(DisplayName))
				{
					Value.nameToken = HelperLanguage.LanguageAdd(Value.nameToken, DisplayName);
				}
				if (!string.IsNullOrWhiteSpace(Description))
				{
					Value.descriptionToken = HelperLanguage.LanguageAdd(Value.descriptionToken, Description);
				}
				if (!string.IsNullOrWhiteSpace(PickupText))
				{
					Value.pickupToken = HelperLanguage.LanguageAdd(Value.pickupToken, PickupText);
				}
				if (!string.IsNullOrWhiteSpace(Lore))
				{
					Value.loreToken = HelperLanguage.LanguageAdd(Value.loreToken, Lore);
				}
				LogDisplay();
			}
			ItemAPI.Add(new CustomItem(Value, ItemDisplay()));
		}

		protected virtual void LogDisplay()
		{
		}
	}
	public abstract class SkillBase : GenericBase<SkillDef>
	{
		protected virtual string DisplaySkillName => null;

		protected virtual string SkillDescription => null;

		protected virtual Sprite SkillSprite => null;

		protected virtual InterruptPriority InterruptPriority => (InterruptPriority)0;

		protected virtual string ActivationStateMachine => null;

		protected virtual SerializableEntityStateType ActivationState => default(SerializableEntityStateType);

		protected virtual bool IsCombatSkill => false;

		protected virtual bool MustKeyPress => false;

		protected virtual bool CancelSprintOnActivation => false;

		protected virtual bool ForceSprintDuringState => false;

		protected virtual bool CanceledFromSprinting => false;

		protected virtual bool CooldownOnSkillEnd => false;

		protected virtual float BaseCooldown => 0f;

		protected virtual int BaseMaxStock => 0;

		protected virtual int RechargeStock => 0;

		protected virtual int RequiredStock => 0;

		protected virtual int StockToConsume => 0;

		protected override void Create()
		{
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			Value = ScriptableObject.CreateInstance<SkillDef>();
			Value.skillName = Name;
			Value.skillNameToken = HelperLanguage.LanguageAdd(ChefOverCookedPlugin.TokenPrefix + Name.ToUpper() + "_NAME", DisplaySkillName);
			Value.skillDescriptionToken = HelperLanguage.LanguageAdd(ChefOverCookedPlugin.TokenPrefix + Name.ToUpper() + "_DESC", SkillDescription);
			Value.icon = SkillSprite;
			Value.interruptPriority = InterruptPriority;
			Value.activationStateMachineName = ActivationStateMachine;
			Value.activationState = ActivationState;
			Value.isCombatSkill = IsCombatSkill;
			Value.mustKeyPress = MustKeyPress;
			Value.beginSkillCooldownOnSkillEnd = CooldownOnSkillEnd;
			Value.cancelSprintingOnActivation = CancelSprintOnActivation;
			Value.forceSprintDuringState = ForceSprintDuringState;
			Value.canceledFromSprinting = CanceledFromSprinting;
			Value.baseRechargeInterval = BaseCooldown;
			Value.baseMaxStock = BaseMaxStock;
			Value.rechargeStock = RechargeStock;
			Value.requiredStock = RequiredStock;
			Value.stockToConsume = StockToConsume;
			ContentAddition.AddSkillDef(Value);
		}

		protected virtual UnlockableDef UnlockDef(Sprite unlockIcon, string unlockName, string internalName)
		{
			UnlockableDef val = ScriptableObject.CreateInstance<UnlockableDef>();
			((Object)val).name = internalName;
			val.cachedName = internalName;
			val.nameToken = HelperLanguage.LanguageAdd(val.nameToken, unlockName);
			val.achievementIcon = unlockIcon;
			val.hidden = false;
			ContentAddition.AddUnlockableDef(val);
			return val;
		}
	}
	public static class PluginConfig
	{
		public enum ItemOptions
		{
			FoodTier,
			Ingredients,
			Both
		}

		public enum MathProcess
		{
			Max,
			Min
		}

		public static ConfigEntry<bool> Set_Default;

		public static ConfigEntry<int> Round_To;

		public static ConfigEntry<ItemOptions> FoodDrops;

		public static ConfigEntry<int> Attack_Instances;

		public static ConfigEntry<int> Damage_Coefficient;

		public static ConfigEntry<float> Proc_Coefficient;

		public static ConfigEntry<float> Attack_Rate;

		public static ConfigEntry<float> Radius;

		public static ConfigEntry<float> Execute_Threshold;

		public static ConfigEntry<float> Execute_Leniency;

		public static ConfigEntry<float> Temp_Duration;

		public static ConfigEntry<float> Claw_Base_Bleed;

		public static ConfigEntry<float> Claw_Damage_Stack;

		public static ConfigEntry<int> Claw_Stack_Cap;

		public static ConfigEntry<int> Claw_Stack_Increase;

		public static ConfigEntry<float> Kebab_Base_Damage;

		public static ConfigEntry<float> Kebab_Stack_Damage;

		public static ConfigEntry<float> Kebab_Lem_Damage;

		public static ConfigEntry<int> Kebab_Lem_Cap;

		public static ConfigEntry<float> Golem_Percent_Barrier;

		public static ConfigEntry<float> Golem_Flat_Barrier;

		public static ConfigEntry<float> Golem_Base_Armor;

		public static ConfigEntry<float> Golem_Stack_Armor;

		public static ConfigEntry<float> Jelly_Cooldown_Base;

		public static ConfigEntry<float> Jelly_Cooldown_Stack;

		public static ConfigEntry<float> Jelly_Stun_Duration;

		public static ConfigEntry<float> Jelly_Stun_Range;

		public static ConfigEntry<float> Eye_Range_Base;

		public static ConfigEntry<float> Eye_Range_Stack;

		public static ConfigEntry<float> Eye_Bleed_Damage;

		public static ConfigEntry<float> Eye_Slow_Coefficient;

		public static ConfigEntry<float> Carbonated_Proc_Chance;

		public static ConfigEntry<float> Carbonated_Base_Heal;

		public static ConfigEntry<float> Carbonated_Heal_Stack;

		public static ConfigEntry<float> Stalk_Nullify_Chance;

		public static ConfigEntry<float> Stalk_Base_Duration;

		public static ConfigEntry<float> Stalk_Duration_Stack;

		public static ConfigEntry<bool> Stalk_Luck_Affected;

		public static void Init()
		{
			GeneralInit();
			SkillInit();
			ItemInit();
		}

		private static void GeneralInit()
		{
			string text = "! General !";
			Set_Default = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<bool>(text, "Default Configs", true, "[ True = Resets configs on launch (Except Enable Toggles) | False = Configs can be changed ]\nUseful for when Default Values get updated");
			Round_To = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<int>(text, "Item Stat Rounding", 0, "[ 0 = Whole | 1 = Tenths | 2 = Hundrenths | 3 = ... ]\nRounds item values to respective decimal point");
		}

		private static void SkillInit()
		{
			string text = "Chef Special - Cook";
			FoodDrops = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<ItemOptions>(text, "Food Items from Skill", ItemOptions.FoodTier, "[ Which Items will be temporarily created. Overwritten regardless if Alloyed Collective is disabled ]").PostConfig<ItemOptions>();
			Attack_Instances = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<int>(text, "Attack Count", 6, "[ # of Times this Skill will deal Damage ]").PostConfig(MathProcess.Max, 1);
			Damage_Coefficient = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<int>(text, "Damage Number", 150, "[ #% of Base Damage for this Skill to Deal per Attack ]").PostConfig(MathProcess.Max, 0);
			Proc_Coefficient = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text, "Proc Coefficient", 1f, "[ # Proc Coefficient set per Attack ]").PostConfig(MathProcess.Max, 0f);
			Attack_Rate = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text, "Attack Duration", 1f, "[ # Seconds this Attack will last ]").PostConfig(MathProcess.Max, 0f);
			Radius = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text, "Attack Radius", 7.5f, "[ # Meters for the Radius of this Skill ]").PostConfig(MathProcess.Max, 0f);
			Execute_Threshold = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text, "Execute Threshold", 0.1f, "[ # (0 - 1), converted to % of Execute Health when using this Skill ]").PostConfig(MathProcess.Max, 0f).PostConfig(MathProcess.Min, 1f);
			Execute_Leniency = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text, "Execute Leniency", 1f, "[ # Seconds extra to Execute when using this Skill ]").PostConfig(MathProcess.Max, 0f);
			Temp_Duration = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text, "Temp Food Stack", 0.5f, "[ One Temporary Food item is worth # compared to one stack ]").PostConfig(MathProcess.Max, 0f);
		}

		private static void ItemInit()
		{
			string text = "Uncommon Item - Primitive Claws";
			Claw_Base_Bleed = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text, "Bleed Chance", 5f, "[ #% Bleed Chance ]").PostConfig(MathProcess.Max, 0f);
			Claw_Damage_Stack = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text, "Damage per Buff", 8f, "[ #% Damage Increase for each stack from inflicting Bleed ]").PostConfig(MathProcess.Max, 0f);
			Claw_Stack_Cap = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<int>(text, "Base Buff Cap", 3, "[ # of Max Buffs from inflicting Bleed ]").PostConfig(MathProcess.Max, 0);
			Claw_Stack_Increase = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<int>(text, "Buff Cap Stack", 2, "[ # of Max Buffs added per single item stack ]").PostConfig(MathProcess.Max, 0);
			string text2 = "Meal Item - Grilled Lizard Kebab";
			Kebab_Base_Damage = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text2, "Base Damage", 30f, "[ #% Damage Dealt increased ]").PostConfig(MathProcess.Max, 0f);
			Kebab_Stack_Damage = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text2, "Damage per Stack", 15f, "[ #% Damage Dealt increased per stack of Item ]").PostConfig(MathProcess.Max, 0f);
			Kebab_Lem_Damage = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text2, "Lemurian Damage Inherit", 500f, "[ #% Damage Inherited for the Lemurian ]").PostConfig(MathProcess.Max, 0f);
			Kebab_Lem_Cap = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<int>(text2, "Lemurian Cap", 1, "[ # of Lemurians that can spawn ]").PostConfig(MathProcess.Max, 0);
			string text3 = "Meal Item - Golem Essence with a Twist";
			Golem_Percent_Barrier = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text3, "Percent Barrier Gain", 30f, "[ #% Temporary Barrier gained on Item pickups ]").PostConfig(MathProcess.Max, 0f);
			Golem_Flat_Barrier = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text3, "Flat Barrier Gain", 30f, "[ # Temporary Barrier gained on Collectible pickups ]").PostConfig(MathProcess.Max, 0f);
			Golem_Base_Armor = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text3, "Base Armor", 40f, "[ # Armor increased ]").PostConfig(MathProcess.Max, 0f);
			Golem_Stack_Armor = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text3, "Armor per Stack", 20f, "[ # Armor per Item stack ]").PostConfig(MathProcess.Max, 0f);
			string text4 = "Meal Item - Glowing Jelly Pasta";
			Jelly_Cooldown_Base = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text4, "Base Cooldown Reduction", 1f, "[ #s Flat Cooldown Reduction ]").PostConfig(MathProcess.Max, 0f);
			Jelly_Cooldown_Stack = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text4, "Cooldown Reduction per Stack", 0.5f, "[ #s Flat Cooldown Reduction per Item stack ]").PostConfig(MathProcess.Max, 0f);
			Jelly_Stun_Duration = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text4, "Stun Duration", 3f, "[ #s for the Stun Dration ]").PostConfig(MathProcess.Max, 0f);
			Jelly_Stun_Range = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text4, "Stun Radius", 25f, "[ #m Stun Radius when Utility Skill is used ]").PostConfig(MathProcess.Max, 0f);
			string text5 = "Meal Item - Blood Candied Eye";
			Eye_Range_Base = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text5, "Base Radius", 10f, "[ #m Radius for enemies and projectiles ]").PostConfig(MathProcess.Max, 0f);
			Eye_Range_Stack = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text5, "Radius per Stack", 5f, "[ #m Radius per Item Stack for enemies and projectiles ]").PostConfig(MathProcess.Max, 0f);
			Eye_Bleed_Damage = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text5, "Bleed Damage Percent", 500f, "[ #% Base Damage to Bleed Damage ]").PostConfig(MathProcess.Max, 0f);
			Eye_Slow_Coefficient = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text5, "Slow Down Coefficient", 80f, "[ #% Slowed Down to projectiles within the Radius ]").PostConfig(MathProcess.Max, 0f);
			string text6 = "Meal Item - Carbonated Storm";
			Carbonated_Proc_Chance = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text6, "Proc Chance", 20f, "[ #% Chance for Bottle Cap to drop ]").PostConfig(MathProcess.Max, 0f);
			Carbonated_Base_Heal = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text6, "Base Heal", 25f, "[ # Flat Health when picking up a Bottle Cap ]").PostConfig(MathProcess.Max, 0f);
			Carbonated_Heal_Stack = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text6, "Heal per Stack", 25f, "[ # Flat Health per Item stack ]").PostConfig(MathProcess.Max, 0f);
			string text7 = "Uncommon Item - Warping Stalk";
			Stalk_Nullify_Chance = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text7, "Nullify Chance", 15f, "[ #% Chance for incoming damage to nullify, and activate this Item ]").PostConfig(MathProcess.Max, 0f);
			Stalk_Base_Duration = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text7, "Intangible Duration", 1f, "[ #s Duration for Intangibility ]").PostConfig(MathProcess.Max, 0f);
			Stalk_Duration_Stack = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<float>(text7, "Intangible Duration per Stack", 1f, "[ #s Duration per Item stack for Intangibility ]").PostConfig(MathProcess.Max, 0f);
			Stalk_Luck_Affected = ((BaseUnityPlugin)ChefOverCookedPlugin.Instance).Config.Bind<bool>(text7, "Affected by Luck", false, "[ If Luck should affect the Nullify chance ]").PostConfig<bool>();
		}

		public static ConfigEntry<T> PostConfig<T>(this ConfigEntry<T> config)
		{
			if (Set_Default.Value)
			{
				((ConfigEntryBase)config).BoxedValue = ((ConfigEntryBase)config).DefaultValue;
			}
			return config;
		}

		public static ConfigEntry<float> PostConfig(this ConfigEntry<float> config, MathProcess capType, float capNum)
		{
			config = config.PostConfig<float>();
			if (capType == MathProcess.Max)
			{
				((ConfigEntryBase)config).BoxedValue = Mathf.Max((float)((ConfigEntryBase)config).BoxedValue, capNum);
			}
			else
			{
				((ConfigEntryBase)config).BoxedValue = Mathf.Min((float)((ConfigEntryBase)config).BoxedValue, capNum);
			}
			return config;
		}

		public static ConfigEntry<int> PostConfig(this ConfigEntry<int> config, MathProcess capType, int capNum)
		{
			config = config.PostConfig<int>();
			if (capType == MathProcess.Max)
			{
				((ConfigEntryBase)config).BoxedValue = Mathf.Max((int)((ConfigEntryBase)config).BoxedValue, capNum);
			}
			else
			{
				((ConfigEntryBase)config).BoxedValue = Mathf.Min((int)((ConfigEntryBase)config).BoxedValue, capNum);
			}
			return config;
		}
	}
	public class CookedBuff : BuffBase
	{
		public static BuffDef BuffDef;

		protected override string Name => "ChefCookedMarked";

		protected override Sprite IconSprite => ChefOverCookedPlugin.Bundle.LoadAsset<Sprite>("texChefCookedMarked");

		protected override bool IsHidden => false;

		protected override void Initialize()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			BuffDef = Value;
			GlobalEventManager.OnCharacterDeath += new Manipulator(GlobalEventManager_OnCharacterDeath);
		}

		private void GlobalEventManager_OnCharacterDeath(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			int varOneIndex = -1;
			int varTwoIndex = -1;
			int varThreeIndex = -1;
			int varFourIndex = -1;
			int num = default(int);
			if (val.TryGotoNext(new Func<Instruction, bool>[10]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref varOneIndex),
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref varTwoIndex),
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref varThreeIndex),
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref varFourIndex),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "CookingChopped")
			}))
			{
				if (val.TryGotoNext(new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
					(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "CookingChopped"),
					(Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, typeof(CharacterBody), "HasBuff")
				}))
				{
					val.MoveAfterLabels();
					val.Emit(OpCodes.Ldarg_1);
					val.EmitDelegate<Func<DamageReport, bool>>((Func<DamageReport, bool>)delegate(DamageReport damageReport)
					{
						CharacterBody victimBody = damageReport.victimBody;
						return Object.op_Implicit((Object)(object)victimBody) && victimBody.HasBuff(BuffDef);
					});
					ILLabel val2 = val.MarkLabel();
					val.Emit(OpCodes.Brfalse, (object)val2);
					val.Emit(OpCodes.Ldloc, varOneIndex);
					val.EmitDelegate<Func<float, float>>((Func<float, float>)((float num) => num + 1f));
					val.Emit(OpCodes.Stloc, varOneIndex);
					val.Emit(OpCodes.Ldloc, varTwoIndex);
					val.EmitDelegate<Func<float, float>>((Func<float, float>)((float num) => num + 2f));
					val.Emit(OpCodes.Stloc, varTwoIndex);
					val.Emit(OpCodes.Ldloc, varThreeIndex);
					val.EmitDelegate<Func<float, float>>((Func<float, float>)((float num) => num + 0.04f));
					val.Emit(OpCodes.Stloc, varThreeIndex);
					val.Emit(OpCodes.Ldloc, varFourIndex);
					val.EmitDelegate<Func<float, float>>((Func<float, float>)((float num) => num + 0.75f));
					val.Emit(OpCodes.Stloc, varFourIndex);
					val.MarkLabel(val2);
				}
				else
				{
					Log.Error(((Object)BuffDef).name + " failed to ILHook #2");
				}
			}
			else
			{
				Log.Error(((Object)BuffDef).name + " failed to ILHook #1");
			}
		}
	}
	public class CookingBuff : BuffBase
	{
		public static BuffDef BuffDef;

		protected override string Name => "ChefCooking";

		protected override bool IsHidden => true;

		protected override void Initialize()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			BuffDef = Value;
			GlobalEventManager.ProcessHitEnemy += new hook_ProcessHitEnemy(GlobalEventManager_ProcessHitEnemy);
		}

		private void GlobalEventManager_ProcessHitEnemy(orig_ProcessHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			orig.Invoke(self, damageInfo, victim);
			CharacterBody val = (Object.op_Implicit((Object)(object)victim) ? victim.GetComponent<CharacterBody>() : null);
			CharacterBody val2 = (Object.op_Implicit((Object)(object)damageInfo.attacker) ? damageInfo.attacker.GetComponent<CharacterBody>() : null);
			CharacterMaster val3 = (Object.op_Implicit((Object)(object)val2) ? val2.master : null);
			if (Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)val) && val2.HasBuff(BuffDef))
			{
				val.AddBuff(CookedBuff.BuffDef);
			}
		}
	}
	public class DamageOnBleedBuff : BuffBase
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Manipulator <>9__14_0;

			public static Manipulator <>9__14_1;

			internal void <Initialize>b__14_0(ILContext il)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Expected O, but got Unknown
				OverlayHelper.UpdateOverlayHook(new ILCursor(il), BuffDef, (Material[])(object)new Material[1] { MatOverlay });
			}

			internal void <Initialize>b__14_1(ILContext il)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				OverlayHelper.UpdateOverlayStateHook(new ILCursor(il), BuffDef);
			}
		}

		public static BuffDef BuffDef;

		private static Material MatOverlay;

		protected override string Name => "DamageOnBleed";

		protected override Sprite IconSprite => ChefOverCookedPlugin.Bundle.LoadAsset<Sprite>("texDamageOnBleed");

		protected override Color Color => new Color(0.91f, 0.506f, 0.239f);

		protected override bool IgnoreGrowthNectar => false;

		protected override bool IsStackable => true;

		protected override bool IsHidden => false;

		protected override void Initialize()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: 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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_005d: 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_0068: Expected O, but got Unknown
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Expected O, but got Unknown
			BuffDef = Value;
			CreateOverlay();
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
			DotController.onDotInflictedServerGlobal += new OnDotInflictedServerGlobalDelegate(DotController_onDotInflictedServerGlobal);
			CharacterBody.AddTimedBuff_BuffDef_float += new hook_AddTimedBuff_BuffDef_float(CharacterBody_AddTimedBuff_BuffDef_float);
			object obj = <>c.<>9__14_0;
			if (obj == null)
			{
				Manipulator val = delegate(ILContext il)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_001e: Expected O, but got Unknown
					OverlayHelper.UpdateOverlayHook(new ILCursor(il), BuffDef, (Material[])(object)new Material[1] { MatOverlay });
				};
				<>c.<>9__14_0 = val;
				obj = (object)val;
			}
			CharacterModel.UpdateOverlays += (Manipulator)obj;
			object obj2 = <>c.<>9__14_1;
			if (obj2 == null)
			{
				Manipulator val2 = delegate(ILContext il)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_0011: Expected O, but got Unknown
					OverlayHelper.UpdateOverlayStateHook(new ILCursor(il), BuffDef);
				};
				<>c.<>9__14_1 = val2;
				obj2 = (object)val2;
			}
			CharacterModel.UpdateOverlayStates += (Manipulator)obj2;
		}

		private void CreateOverlay()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = Addressables.LoadAssetAsync<Texture2D>((object)RoR2_Base_Common_ColorRamps.texRampDroneFire_png).WaitForCompletion();
			MatOverlay = new Material(Addressables.LoadAssetAsync<Material>((object)RoR2_DLC2_Chef_Buffs.matChefOiledDebuffOverlay_mat).WaitForCompletion());
			MatOverlay.SetInt("_SrcBlend", 1);
			MatOverlay.SetInt("_DstBlend", 1);
			MatOverlay.SetFloat("_FresnelPower", 0.8f);
			MatOverlay.SetFloat("_AlphaBoost", 0.5f);
			MatOverlay.SetFloat("_AlphaBias", 1f);
			MatOverlay.SetColor("_TintColor", new Color(1f, 0.439f, 0f));
			MatOverlay.SetTexture("_RemapTex", (Texture)(object)val);
		}

		private void DotController_onDotInflictedServerGlobal(DotController dotController, ref InflictDotInfo inflictDotInfo)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Invalid comparison between Unknown and I4
			if (((int)inflictDotInfo.dotIndex == 0 || (int)inflictDotInfo.dotIndex == 6) && Object.op_Implicit((Object)(object)inflictDotInfo.attackerObject))
			{
				GameObject attackerObject = inflictDotInfo.attackerObject;
				CharacterBody component = attackerObject.GetComponent<CharacterBody>();
				Inventory val = (Object.op_Implicit((Object)(object)component) ? component.inventory : null);
				int num = (Object.op_Implicit((Object)(object)val) ? val.GetItemCountEffective(PrimitiveClawsItem.ItemDef) : 0);
				if (num > 0)
				{
					component.AddTimedBuff(BuffDef, inflictDotInfo.duration);
				}
			}
		}

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			args.damageMultAdd += (float)sender.GetBuffCount(BuffDef) * PluginConfig.Claw_Damage_Stack.Value / 100f;
		}

		private void CharacterBody_AddTimedBuff_BuffDef_float(orig_AddTimedBuff_BuffDef_float orig, CharacterBody self, BuffDef buffDef, float duration)
		{
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Expected O, but got Unknown
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && (Object)(object)buffDef == (Object)(object)BuffDef)
			{
				int num = (Object.op_Implicit((Object)(object)self.inventory) ? self.inventory.GetItemCountEffective(PrimitiveClawsItem.ItemDef) : 0);
				int num2 = PluginConfig.Claw_Stack_Cap.Value + PluginConfig.Claw_Stack_Increase.Value * (num - 1);
				int num3 = 0;
				int num4 = -1;
				float num5 = 999f;
				for (int i = 0; i < self.timedBuffs.Count; i++)
				{
					TimedBuff val = self.timedBuffs[i];
					if (val.buffIndex == BuffDef.buffIndex)
					{
						num3++;
						if (val.timer < num5)
						{
							num4 = i;
							num5 = val.timer;
						}
					}
				}
				if (num3 < num2)
				{
					self.timedBuffs.Add(new TimedBuff
					{
						buffIndex = BuffDef.buffIndex,
						timer = duration,
						totalDuration = duration
					});
					self.AddBuff(buffDef.buffIndex);
				}
				else if (num4 != -1)
				{
					self.timedBuffs[num4].timer = duration;
					self.timedBuffs[num4].totalDuration = duration;
				}
			}
			else
			{
				orig.Invoke(self, buffDef, duration);
			}
		}
	}
	public class MeatTimerBuff : BuffBase
	{
		public static BuffDef BuffDef;

		protected override string Name => "MeatTimerBuff";

		protected override bool IsHidden => true;

		protected override bool IsStackable => false;

		protected override void Initialize()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			BuffDef = Value;
			CharacterBody.OnBuffFinalStackLost += new hook_OnBuffFinalStackLost(CharacterBody_OnBuffFinalStackLost);
		}

		private void CharacterBody_OnBuffFinalStackLost(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef)
		{
			if ((Object)(object)buffDef != (Object)(object)BuffDef)
			{
				orig.Invoke(self, buffDef);
			}
			bool flag = self.HasBuff(BuffDef);
			bool flag2 = Object.op_Implicit((Object)(object)self.inventory) && self.inventory.GetItemCountEffective(MonsterMeatItem.ItemDef) > 0;
			bool flag3 = Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)((Component)self).GetComponent<ChefController>());
			if (!flag && flag2 && flag3)
			{
				EntityStateMachine.FindByCustomName(((Component)self).gameObject, "Weapon").SetState((EntityState)(object)new CookingState());
			}
			orig.Invoke(self, buffDef);
		}
	}
	public class SpectralBuff : BuffBase
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Manipulator <>9__7_0;

			public static Manipulator <>9__7_1;

			public static Func<Instruction, bool> <>9__10_0;

			public static Func<Instruction, bool> <>9__10_3;

			public static Func<Instruction, bool> <>9__10_4;

			public static Func<Instruction, bool> <>9__10_5;

			public static Func<CharacterModel, Material, Material> <>9__10_2;

			internal void <Initialize>b__7_0(ILContext il)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_002e: Expected O, but got Unknown
				OverlayHelper.UpdateOverlayHook(new ILCursor(il), BuffDef, (Material[])(object)new Material[3] { OverlayMatOne, OverlayMatTwo, OverlayMatThree });
			}

			internal void <Initialize>b__7_1(ILContext il)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				OverlayHelper.UpdateOverlayStateHook(new ILCursor(il), BuffDef, 3);
			}

			internal bool <CharacterModel_UpdateRendererMaterials>b__10_0(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdnull(x);
			}

			internal bool <CharacterModel_UpdateRendererMaterials>b__10_3(Instruction x)
			{
				ILLabel val = default(ILLabel);
				return ILPatternMatchingExt.MatchBr(x, ref val);
			}

			internal bool <CharacterModel_UpdateRendererMaterials>b__10_4(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdarg(x, 0);
			}

			internal bool <CharacterModel_UpdateRendererMaterials>b__10_5(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdfld(x, typeof(CharacterModel), "particleMaterialOverride");
			}

			internal Material <CharacterModel_UpdateRendererMaterials>b__10_2(CharacterModel self, Material material)
			{
				if (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(BuffDef))
				{
					return InvisMat;
				}
				return material;
			}
		}

		public static BuffDef BuffDef;

		private static Material OverlayMatOne;

		private static Material OverlayMatTwo;

		private static Material OverlayMatThree;

		private static Material InvisMat;

		protected override string Name => "Spectral";

		protected override void Initialize()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Expected O, but got Unknown
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Expected O, but got Unknown
			//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_0057: Expected O, but got Unknown
			BuffDef = Value;
			CreateOverlay();
			object obj = <>c.<>9__7_0;
			if (obj == null)
			{
				Manipulator val = delegate(ILContext il)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_002e: Expected O, but got Unknown
					OverlayHelper.UpdateOverlayHook(new ILCursor(il), BuffDef, (Material[])(object)new Material[3] { OverlayMatOne, OverlayMatTwo, OverlayMatThree });
				};
				<>c.<>9__7_0 = val;
				obj = (object)val;
			}
			CharacterModel.UpdateOverlays += (Manipulator)obj;
			object obj2 = <>c.<>9__7_1;
			if (obj2 == null)
			{
				Manipulator val2 = delegate(ILContext il)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_0011: Expected O, but got Unknown
					OverlayHelper.UpdateOverlayStateHook(new ILCursor(il), BuffDef, 3);
				};
				<>c.<>9__7_1 = val2;
				obj2 = (object)val2;
			}
			CharacterModel.UpdateOverlayStates += (Manipulator)obj2;
			CharacterModel.UpdateRendererMaterials += new Manipulator(CharacterModel_UpdateRendererMaterials);
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
		}

		private void CreateOverlay()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			//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_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_003e: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Expected O, but got Unknown
			OverlayMatOne = new Material(Addressables.LoadAssetAsync<Material>((object)RoR2_DLC3_Items_WyrmOnHit.matWyrmProjectile1_mat).WaitForCompletion());
			OverlayMatTwo = new Material(Addressables.LoadAssetAsync<Material>((object)RoR2_DLC3_Items_WyrmOnHit.matWyrmProjectile2_mat).WaitForCompletion());
			OverlayMatThree = new Material(Addressables.LoadAssetAsync<Material>((object)RoR2_DLC3_Items_WyrmOnHit.matWyrmProjectile3_mat).WaitForCompletion());
			InvisMat = new Material(Addressables.LoadAssetAsync<Material>((object)RoR2_Base_Common.matCloakedEffect_mat).WaitForCompletion());
		}

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			if (sender.HasBuff(BuffDef) && Object.op_Implicit((Object)(object)sender.master))
			{
				args.attackSpeedMultAdd += 0.15f;
				args.moveSpeedMultAdd += 0.14f;
				Deployable component = ((Component)sender.master).GetComponent<Deployable>();
				CharacterMaster val = (Object.op_Implicit((Object)(object)component) ? component.ownerMaster : null);
				CharacterBody val2 = (Object.op_Implicit((Object)(object)val) ? val.GetBody() : null);
				if (Object.op_Implicit((Object)(object)val))
				{
					args.baseDamageAdd += val2.damage * PluginConfig.Kebab_Base_Damage.Value / 100f;
				}
			}
		}

		private void CharacterModel_UpdateRendererMaterials(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			int matIndex = -1;
			val.TryGotoNext(new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdnull(x),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref matIndex)
			});
			ILLabel val2 = default(ILLabel);
			if (matIndex != -1 && val.TryGotoNext((MoveType)1, new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchBr(x, ref val2),
				(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
				(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(CharacterModel), "particleMaterialOverride")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.Emit(OpCodes.Ldloc, matIndex);
				val.EmitDelegate<Func<CharacterModel, Material, Material>>((Func<CharacterModel, Material, Material>)((CharacterModel self, Material material) => (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(BuffDef)) ? InvisMat : material));
				val.Emit(OpCodes.Stloc, matIndex);
			}
			else
			{
				Log.Error("STALKBUFF_MATERIAL failed to ILHook");
			}
		}
	}
	public class StalkBuff : BuffBase
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Manipulator <>9__12_0;

			public static Manipulator <>9__12_1;

			public static Func<Instruction, bool> <>9__16_0;

			public static Func<Instruction, bool> <>9__16_3;

			public static Func<Instruction, bool> <>9__16_4;

			public static Func<Instruction, bool> <>9__16_5;

			public static Func<CharacterModel, Material, Material> <>9__16_2;

			internal void <Initialize>b__12_0(ILContext il)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Expected O, but got Unknown
				OverlayHelper.UpdateOverlayHook(new ILCursor(il), BuffDef, (Material[])(object)new Material[1] { OverlayMat });
			}

			internal void <Initialize>b__12_1(ILContext il)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				OverlayHelper.UpdateOverlayStateHook(new ILCursor(il), BuffDef);
			}

			internal bool <CharacterModel_UpdateRendererMaterials>b__16_0(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdnull(x);
			}

			internal bool <CharacterModel_UpdateRendererMaterials>b__16_3(Instruction x)
			{
				ILLabel val = default(ILLabel);
				return ILPatternMatchingExt.MatchBr(x, ref val);
			}

			internal bool <CharacterModel_UpdateRendererMaterials>b__16_4(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdarg(x, 0);
			}

			internal bool <CharacterModel_UpdateRendererMaterials>b__16_5(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdfld(x, typeof(CharacterModel), "particleMaterialOverride");
			}

			internal Material <CharacterModel_UpdateRendererMaterials>b__16_2(CharacterModel self, Material material)
			{
				if (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(BuffDef))
				{
					return InvisMat;
				}
				return material;
			}
		}

		public static BuffDef BuffDef;

		private static EffectDef StalkEffect;

		private static Material OverlayMat;

		private static Material InvisMat;

		protected override string Name => "Stalk";

		protected override Sprite IconSprite => ChefOverCookedPlugin.Bundle.LoadAsset<Sprite>("texStalkIcon");

		protected override bool IgnoreGrowthNectar => false;

		protected override bool IsStackable => true;

		protected override void Initialize()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Expected O, but got Unknown
			//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_0057: Expected O, but got Unknown
			BuffDef = Value;
			CreateEffects();
			object obj = <>c.<>9__12_0;
			if (obj == null)
			{
				Manipulator val = delegate(ILContext il)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_001e: Expected O, but got Unknown
					OverlayHelper.UpdateOverlayHook(new ILCursor(il), BuffDef, (Material[])(object)new Material[1] { OverlayMat });
				};
				<>c.<>9__12_0 = val;
				obj = (object)val;
			}
			CharacterModel.UpdateOverlays += (Manipulator)obj;
			object obj2 = <>c.<>9__12_1;
			if (obj2 == null)
			{
				Manipulator val2 = delegate(ILContext il)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_0011: Expected O, but got Unknown
					OverlayHelper.UpdateOverlayStateHook(new ILCursor(il), BuffDef);
				};
				<>c.<>9__12_1 = val2;
				obj2 = (object)val2;
			}
			CharacterModel.UpdateOverlayStates += (Manipulator)obj2;
			CharacterModel.UpdateRendererMaterials += new Manipulator(CharacterModel_UpdateRendererMaterials);
			CharacterBody.onBuffFirstStackGained += CharacterBody_onBuffFirstStackGained;
			CharacterBody.onBuffFinalStackLost += CharacterBody_onBuffFinalStackLost;
		}

		private void CharacterBody_onBuffFirstStackGained(CharacterBody self, BuffDef buff)
		{
			if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && !((Object)(object)buff != (Object)(object)Value))
			{
				BlinkParticle(self);
				if (Object.op_Implicit((Object)(object)self.hurtBoxGroup))
				{
					HurtBoxGroup hurtBoxGroup = self.hurtBoxGroup;
					int hurtBoxesDeactivatorCounter = hurtBoxGroup.hurtBoxesDeactivatorCounter;
					hurtBoxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter + 1;
				}
			}
		}

		private void CharacterBody_onBuffFinalStackLost(CharacterBody self, BuffDef buff)
		{
			if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && !((Object)(object)buff != (Object)(object)Value))
			{
				BlinkParticle(self);
				if (Object.op_Implicit((Object)(object)self.hurtBoxGroup))
				{
					HurtBoxGroup hurtBoxGroup = self.hurtBoxGroup;
					int hurtBoxesDeactivatorCounter = hurtBoxGroup.hurtBoxesDeactivatorCounter;
					hurtBoxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter - 1;
				}
			}
		}

		private void BlinkParticle(CharacterBody self)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			Util.PlaySound("Play_voidBarnacle_m1_impact", ((Component)self).gameObject);
			EffectManager.SpawnEffect(StalkEffect.prefab, new EffectData
			{
				origin = Util.GetCorePosition(self),
				rotation = Random.rotation
			}, true);
		}

		private void CharacterModel_UpdateRendererMaterials(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			int matIndex = -1;
			val.TryGotoNext(new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdnull(x),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref matIndex)
			});
			ILLabel val2 = default(ILLabel);
			if (matIndex != -1 && val.TryGotoNext((MoveType)1, new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchBr(x, ref val2),
				(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
				(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(CharacterModel), "particleMaterialOverride")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.Emit(OpCodes.Ldloc, matIndex);
				val.EmitDelegate<Func<CharacterModel, Material, Material>>((Func<CharacterModel, Material, Material>)((CharacterModel self, Material material) => (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(BuffDef)) ? InvisMat : material));
				val.Emit(OpCodes.Stloc, matIndex);
			}
			else
			{
				Log.Error("STALKBUFF_MATERIAL failed to ILHook");
			}
		}

		private void CreateEffects()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: 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)
			//IL_00d2: Expected O, but got Unknown
			//IL_00d7: 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_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Expected O, but got Unknown
			OverlayMat = new Material(Addressables.LoadAssetAsync<Material>((object)RoR2_Base_Common.matRevealedEffect_mat).WaitForCompletion());
			OverlayMat.SetTexture("_RemapTex", (Texture)(object)ChefOverCookedPlugin.Bundle.LoadAsset<Texture2D>("texStalkRamp"));
			OverlayMat.SetTexture("_Cloud1Tex", (Texture)(object)Addressables.LoadAssetAsync<Texture2D>((object)RoR2_Base_Common_TiledTextures.texCloudOrganicNormal_png).WaitForCompletion());
			OverlayMat.SetTextureScale("_Cloud1Tex", new Vector2(1f, 0.1f));
			OverlayMat.SetVector("_CutoffScroll", Vector4.op_Implicit(new Vector2(1f, 10f)));
			OverlayMat.SetFloat("_Boost", 2f);
			InvisMat = new Material(Addressables.LoadAssetAsync<Material>((object)RoR2_Base_Common.matCloakedEffect_mat).WaitForCompletion());
			GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Imp.ImpBlinkEffect_prefab).WaitForCompletion(), "StalkBlinkEffect");
			Transform val2 = val.transform.Find("Particles");
			Object.Destroy((Object)(object)((Component)val2.Find("Dash")).gameObject);
			val2.Find("NoiseTrails").localScale = Vector3.one * 2f;
			StalkEffect = new EffectDef
			{
				prefab = val,
				prefabName = "StalkBlinkEffect",
				prefabEffectComponent = val.GetComponent<EffectComponent>()
			};
			ContentAddition.AddEffect(StalkEffect.prefab);
		}
	}
	public class CookDamageType
	{
		public class MeatTolerance : MonoBehaviour
		{
			private CharacterBody LastAttacker;

			private float Duration;

			public CharacterBody GetAttacker()
			{
				return LastAttacker;
			}

			public void SetAttacker(CharacterBody attacker)
			{
				LastAttacker = attacker;
				Duration = PluginConfig.Execute_Leniency.Value;
			}

			public void Awake()
			{
				Duration = PluginConfig.Execute_Leniency.Value;
			}

			public void FixedUpdate()
			{
				Duration -= Time.fixedDeltaTime;
				if (Duration < 0f)
				{
					Object.Destroy((Object)(object)this);
				}
			}
		}

		public class MeatOrb : ItemTransferOrb
		{
			private static GameObject MeatEffect;

			private CharacterBody chefBody;

			public float speed;

			public static void CreatePrefab()
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: 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)
				MeatEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common_VFX.ItemTransferOrbEffect_prefab).WaitForCompletion(), "MeatOrbEffect");
				GameObject val = Object.Instantiate<GameObject>(ChefOverCookedPlugin.Bundle.LoadAsset<GameObject>("monsterMeatModel"), MeatEffect.transform);
				GameObject gameObject = ((Component)val.transform.Find("mdlMeat")).gameObject;
				Transform transform = gameObject.transform;
				transform.localScale *= 0.3f;
				gameObject.AddComponent<MeatSpin>();
				((Component)MeatEffect.transform.Find("BillboardBase")).gameObject.SetActive(false);
				((Component)MeatEffect.transform.Find("Trail Parent")).gameObject.SetActive(false);
				ContentAddition.AddEffect(MeatEffect);
			}

			public override void Begin()
			{
				chefBody = (Object.op_Implicit((Object)(object)((Orb)this).target.healthComponent) ? ((Orb)this).target.healthComponent.body : null);
				base.travelDuration = Random.Range(1f, 1.5f);
				GameObject orbEffectPrefab = ItemTransferOrb.orbEffectPrefab;
				ItemTransferOrb.orbEffectPrefab = MeatEffect;
				((ItemTransferOrb)this).Begin();
				ItemTransferOrb.orbEffectPrefab = orbEffectPrefab;
			}

			public override void OnArrival()
			{
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_002b: 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_0083: Unknown result type (might be due to invalid IL or missing references)
				((ItemTransferOrb)this).OnArrival();
				if (!Object.op_Implicit((Object)(object)chefBody))
				{
					return;
				}
				EffectManager.SimpleSoundEffect(AllSounds.Play_Meat_Pickup.index, chefBody.corePosition, true);
				CharacterMaster master = chefBody.master;
				object obj;
				if (master == null)
				{
					obj = null;
				}
				else
				{
					PlayerCharacterMasterController playerCharacterMasterController = master.playerCharacterMasterController;
					if (playerCharacterMasterController == null)
					{
						obj = null;
					}
					else
					{
						NetworkUser networkUser = playerCharacterMasterController.networkUser;
						if (networkUser == null)
						{
							obj = null;
						}
						else
						{
							LocalUser localUser = networkUser.localUser;
							obj = ((localUser != null) ? localUser.userProfile : null);
						}
					}
				}
				UserProfile val = (UserProfile)obj;
				if (val != null)
				{
					val.DiscoverPickup(PickupCatalog.FindPickupIndex(MonsterMeatItem.ItemDef.itemIndex));
				}
				chefBody.AddTimedBuff(MeatTimerBuff.BuffDef, 1.75f);
			}
		}

		public class MeatSpin : MonoBehaviour
		{
			private Vector3 randomAxis;

			private float randomSpeed;

			public void Awake()
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				randomAxis = Random.onUnitSphere;
				randomSpeed = Random.Range(200f, 360f);
			}

			public void FixedUpdate()
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				((Component)this).transform.Rotate(randomAxis * randomSpeed * Time.fixedDeltaTime, (Space)1);
			}
		}

		public static ModdedDamageType DamageType;

		public CookDamageType()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Expected O, but got Unknown
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Expected O, but got Unknown
			DamageType = DamageAPI.ReserveDamageType();
			ItemDef.AttemptGrant += new Manipulator(ItemDef_AttemptGrant);
			HealthComponent.TakeDamageProcess += new Manipulator(HealthComponent_TakeDamageProcess);
			GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
			GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
			ExecuteAPI.CalculateAdditiveExecuteThresholdForViewer = (CalculateAdditiveExecuteThresholdForViewerEventHandler)Delegate.Combine((Delegate?)(object)ExecuteAPI.CalculateAdditiveExecuteThresholdForViewer, (Delegate?)new CalculateAdditiveExecuteThresholdForViewerEventHandler(CookExecuteVisual));
			MeatOrb.CreatePrefab();
		}

		private void ItemDef_AttemptGrant(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			ILLabel breakState = null;
			int pickupDefIndex = -1;
			int duplicateIndex = -1;
			val.TryGotoNext(new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(PickupDef), "itemIndex"),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref pickupDefIndex)
			});
			val.TryGotoNext(new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Items), "Duplicator"),
				(Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, typeof(Inventory), "GetItemCountEffective"),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref duplicateIndex)
			});
			int num = default(int);
			if (pickupDefIndex == -1 || duplicateIndex == -1 || !val.TryGotoNext(new Func<Instruction, bool>[6]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
				(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0),
				(Instruction x) => ILPatternMatchingExt.MatchCgt(x),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
				(Instruction x) => ILPatternMatchingExt.MatchAnd(x),
				(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref breakState)
			}) || breakState == null)
			{
				return;
			}
			val.MoveAfterLabels();
			val.Emit(OpCodes.Ldarg_0);
			val.Emit(OpCodes.Ldobj, typeof(GrantContext));
			val.Emit(OpCodes.Ldloc, pickupDefIndex);
			val.Emit(OpCodes.Ldloc, duplicateIndex);
			val.EmitDelegate<Action<GrantContext, ItemIndex, int>>((Action<GrantContext, ItemIndex, int>)delegate(GrantContext context, ItemIndex itemIndex, int itemCount)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_0034: 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_003b: 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_004d: Expected O, but got Unknown
				//IL_0060: 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_0067: Unknown result type (might be due to invalid IL or missing references)
				bool flag = !context.controller.Duplicated;
				CharacterBody body = context.body;
				if (itemCount > 0 && flag)
				{
					EffectData val2 = new EffectData
					{
						origin = body.corePosition,
						start = body.corePosition,
						scale = body.radius
					};
					EffectManager.SpawnEffect(CommonAssets.duplicatorPrefab, val2, true);
					body.inventory.GiveItemTemp(itemIndex, context.controller.pickup.decayValue);
				}
			});
			val.Emit(OpCodes.Br, (object)breakState);
		}

		private void HealthComponent_TakeDamageProcess(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			int executeIndex = -1;
			int num = default(int);
			if (val.TryGotoNext(new Func<Instruction, bool>[6]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref executeIndex),
				(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
				(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(HealthComponent), "body"),
				(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(CharacterBody), "bodyFlags"),
				(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num)
			}) && executeIndex != -1)
			{
				ILLabel val2 = default(ILLabel);
				if (val.TryGotoNext(new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
					(Instruction x) => ILPatternMatchingExt.MatchCall(x, typeof(HealthComponent), "get_isInFrozenState"),
					(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val2)
				}))
				{
					val.MoveAfterLabels();
					val.Emit(OpCodes.Ldarg_0);
					val.Emit(OpCodes.Ldarg_1);
					val.Emit(OpCodes.Ldloc, executeIndex);
					val.EmitDelegate<Func<HealthComponent, DamageInfo, float, float>>((Func<HealthComponent, DamageInfo, float, float>)delegate(HealthComponent self, DamageInfo damageInfo, float damagePercent)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						if (DamageAPI.HasModdedDamageType(damageInfo, DamageType) && damagePercent <= PluginConfig.Execute_Threshold.Value)
						{
							damagePercent = PluginConfig.Execute_Threshold.Value;
						}
						return damagePercent;
					});
					val.Emit(OpCodes.Stloc, executeIndex);
				}
				else
				{
					Log.Error("COOK_DAMAGE_TYPE_TAKEDAMAGEPROCESS failed to ILHook #2");
				}
			}
			else
			{
				Log.Error("COOKDAMAGETYPE_TAKEDAMAGEPROCESS failed to ILHook #1");
			}
		}

		private void GlobalEventManager_onCharacterDeathGlobal(DamageReport report)
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			CharacterBody attackerBody = report.attackerBody;
			CharacterBody victimBody = report.victimBody;
			DamageInfo damageInfo = report.damageInfo;
			if ((Object)(object)attackerBody != (Object)null && (Object)(object)victimBody != (Object)null && damageInfo != null)
			{
				bool flag = DamageAPI.HasModdedDamageType(report.damageInfo, DamageType);
				bool flag2 = Object.op_Implicit((Object)(object)((Component)victimBody).GetComponent<MeatTolerance>());
				if (flag || flag2)
				{
					attackerBody = (flag2 ? ((Component)victimBody).GetComponent<MeatTolerance>().GetAttacker() : attackerBody);
					MeatOrb meatOrb = new MeatOrb
					{
						stack = 1,
						origin = victimBody.corePosition,
						target = attackerBody.mainHurtBox,
						itemIndex = MonsterMeatItem.ItemDef.itemIndex,
						inventoryToGrantTo = attackerBody.inventory
					};
					OrbManager.instance.AddOrb((Orb)(object)meatOrb);
				}
			}
		}

		private void GlobalEventManager_onServerDamageDealt(DamageReport report)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			CharacterBody attackerBody = report.attackerBody;
			CharacterBody victimBody = report.victimBody;
			DamageInfo damageInfo = report.damageInfo;
			if ((Object)(object)attackerBody != (Object)null && (Object)(object)victimBody != (Object)null && damageInfo != null && DamageAPI.HasModdedDamageType(report.damageInfo, DamageType))
			{
				(((Component)victimBody).GetComponent<MeatTolerance>() ?? ((Component)victimBody).gameObject.AddComponent<MeatTolerance>())?.SetAttacker(attackerBody);
			}
		}

		private void CookExecuteVisual(CharacterBody victimBody, CharacterBody viewerBody, ref float executeFractionAdd)
		{
			if (!((Object)(object)victimBody == (Object)null) && !((Object)(object)viewerBody == (Object)null) && Object.op_Implicit((Object)(object)((Component)viewerBody).GetComponent<ChefController>()))
			{
				GenericSkill val = (Object.op_Implicit((Object)(object)viewerBody.skillLocator) ? viewerBody.skillLocator.special : null);
				SkillDef val2 = (Object.op_Implicit((Object)(object)val) ? val.skillDef : null);
				if (!((Object)(object)val2 != (Object)(object)SpecialCookSkill.SkillDef))
				{
					executeFractionAdd = Mathf.Clamp(executeFractionAdd, PluginConfig.Execute_Threshold.Value, 1f);
				}
			}
		}
	}
	public class CookingState : GenericCharacterMain
	{
		private class MealWeight(ItemDef itemDef)
		{
			public ItemDef itemDef = itemDef;

			public int GetFrequency()
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Invalid comparison between Unknown and I4
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				//IL_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_009c: Unknown result type (might be due to invalid IL or missing references)
				if ((int)itemDef.tier != 10)
				{
					return (int)Mathf.Pow((float)NumFromTier(PickupCatalog.FindPickupIndex(itemDef.itemIndex)), 1f / Mathf.Log10(4f));
				}
				RecipeEntry[] array = CraftableCatalog.FindAllRelatedRecipes(PickupCatalog.FindPickupIndex(itemDef.itemIndex));
				float num = 0f;
				RecipeEntry[] array2 = array;
				foreach (RecipeEntry val in array2)
				{
					foreach (PickupIndex allPickup in val.GetAllPickups())
					{
						num = ((num == 0f) ? ((float)NumFromTier(allPickup)) : ((num + (float)NumFromTier(allPickup)) / 2f));
					}
				}
				return (int)Mathf.Pow(num, 1f / Mathf.Log10(4f));
			}

			private int NumFromTier(PickupIndex pickupIndex)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: Expected I4, but got Unknown
				ItemDef val = ItemCatalog.GetItemDef(((PickupIndex)(ref pickupIndex)).itemIndex);
				if (Object.op_Implicit((Object)(object)val))
				{
					ItemTier tier = val.tier;
					if (1 == 0)
					{
					}
					int result = (tier - 1) switch
					{
						0 => 3, 
						1 => 2, 
						3 => 1, 
						_ => 4, 
					};
					if (1 == 0)
					{
					}
					return result;
				}
				return 4;
			}
		}

		private static List<MealWeight> RunMealItemDefs;

		private static List<ItemDef> WeightedMealItemDefs;

		private bool hasPlayedSound;

		private bool hasPlayedAnim;

		public static void CreateEffects()
		{
			Run.onRunStartGlobal += Run_onRunStartGlobal;
		}

		private static void Run_onRunStartGlobal(Run instance)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: 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_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Invalid comparison between Unknown and I4
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Invalid comparison between Unknown and I4
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Invalid comparison between Unknown and I4
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Invalid comparison between Unknown and I4
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Invalid comparison between Unknown and I4
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Invalid comparison between Unknown and I4
			PluginConfig.ItemOptions value = PluginConfig.FoodDrops.Value;
			bool flag = instance.IsExpansionEnabled(ChefOverCookedPlugin.AlloyedCollective);
			RunMealItemDefs = new List<MealWeight>();
			WeightedMealItemDefs = new List<ItemDef>();
			if (value == PluginConfig.ItemOptions.Ingredients || !flag)
			{
				Enumerator<ItemDef> enumerator = ItemCatalog.allItemDefs.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						ItemDef current = enumerator.Current;
						if (!((Object)(object)current == (Object)null) && instance.IsItemAvailable(current.itemIndex) && !current.DoesNotContainTag((ItemTag)28))
						{
							ItemTier tier = current.tier;
							ItemTier val = tier;
							if ((int)val <= 2 || (int)val == 4)
							{
								RunMealItemDefs.Add(new MealWeight(current));
							}
						}
					}
				}
				finally
				{
					((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose();
				}
			}
			else if (value == PluginConfig.ItemOptions.FoodTier)
			{
				Enumerator<ItemDef> enumerator2 = ItemCatalog.allItemDefs.GetEnumerator();
				try
				{
					while (enumerator2.MoveNext())
					{
						ItemDef current2 = enumerator2.Current;
						if (!((Object)(object)current2 == (Object)null) && instance.IsItemAvailable(current2.itemIndex) && (int)current2.tier == 10 && !((Object)(object)current2 == (Object)(object)MonsterMeatItem.ItemDef))
						{
							RunMealItemDefs.Add(new MealWeight(current2));
						}
					}
				}
				finally
				{
					((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose();
				}
			}
			else
			{
				Enumerator<ItemDef> enumerator3 = ItemCatalog.allItemDefs.GetEnumerator();
				try
				{
					while (enumerator3.MoveNext())
					{
						ItemDef current3 = enumerator3.Current;
						if ((Object)(object)current3 == (Object)null || !instance.IsItemAvailable(current3.itemIndex) || (Object)(object)current3 == (Object)(object)MonsterMeatItem.ItemDef)
						{
							continue;
						}
						if ((int)current3.tier == 10)
						{
							RunMealItemDefs.Add(new MealWeight(current3));
						}
						else if (current3.ContainsTag((ItemTag)28))
						{
							ItemTier tier2 = current3.tier;
							ItemTier val2 = tier2;
							if ((int)val2 <= 2 || (int)val2 == 4)
							{
								RunMealItemDefs.Add(new MealWeight(current3));
							}
						}
					}
				}
				finally
				{
					((IDisposable)enumerator3/*cast due to .constrained prefix*/).Dispose();
				}
			}
			foreach (MealWeight runMealItemDef in RunMealItemDefs)
			{
				Log.Info($"Cook Item Pool - {((Object)runMealItemDef.itemDef).name} ... {runMealItemDef.GetFrequency()}x");
				for (int i = 0; i < runMealItemDef.GetFrequency(); i++)
				{
					WeightedMealItemDefs.Add(runMealItemDef.itemDef);
				}
			}
		}

		private PickupIndex RandomPickupIndex()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: 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_0046: Unknown result type (might be due to invalid IL or missing references)
			return (WeightedMealItemDefs.Count > 0) ? PickupCatalog.FindPickupIndex(WeightedMealItemDefs[Random.Range(0, WeightedMealItemDefs.Count)].itemIndex) : PickupCatalog.FindPickupIndex(Items.ExtraLifeConsumed.itemIndex);
		}

		public override void OnEnter()
		{
			((GenericCharacterMain)this).OnEnter();
			hasPlayedSound = false;
			hasPlayedAnim = false;
		}

		public override void OnExit()
		{
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Invalid comparison between Unknown and I4
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Expected O, but got Unknown
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active)
			{
				return;
			}
			Inventory inventory = ((EntityState)this).characterBody.inventory;
			int itemCountEffective = inventory.GetItemCountEffective(MonsterMeatItem.ItemDef);
			if (((EntityState)this).characterBody.isPlayerControlled)
			{
				for (int i = 0; i < itemCountEffective; i++)
				{
					Vector3 val = ((EntityState)this).GetModelTransform().forward * (float)(i + 10);
					((Vector3)(ref val))..ctor(val.x, (float)(12 + i * 2), val.z);
					UniquePickup val2 = new UniquePickup
					{
						pickupIndex = RandomPickupIndex(),
						decayValue = PluginConfig.Temp_Duration.Value
					};
					PickupDropletController.CreatePickupDroplet(val2, ((EntityState)this).characterBody.corePosition, val, false, false);
				}
			}
			else
			{
				string baseToken = (((int)((EntityState)this).teamComponent.teamIndex == 1) ? "PLAYER_PICKUP" : "MONSTER_PICKUP");
				for (int j = 0; j < itemCountEffective; j++)
				{
					PickupDef pickupDef = PickupCatalog.GetPickupDef(RandomPickupIndex());
					ItemIndex itemIndex = pickupDef.itemIndex;
					((EntityState)this).characterBody.inventory.GiveItemTemp(itemIndex, PluginConfig.Temp_Duration.Value);
					PlayerPickupChatMessage val3 = new PlayerPickupChatMessage();
					((SubjectChatMessage)val3).subjectAsCharacterBody = ((EntityState)this).characterBody;
					((SubjectChatMessage)val3).baseToken = baseToken;
					val3.pickupQuantity = 1u;
					val3.pickupColor = Color32.op_Implicit(pickupDef.baseColor);
					val3.pickupToken = Language.GetStringFormatted("ITEM_MODIFIER_TEMP", new object[1] { Language.GetStringFormatted(pickupDef.nameToken, Array.Empty<object>()) });
					Chat.SendBroadcastChat((ChatMessageBase)(object)val3);
				}
			}
			inventory.RemoveItemPermanent(MonsterMeatItem.ItemDef, itemCountEffective);
			((GenericCharacterMain)this).OnExit();
		}

		public override void FixedUpdate()
		{
			((GenericCharacterMain)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory) && ((EntityState)this).characterBody.inventory.GetItemCountEffective(MonsterMeatItem.ItemDef) <= 0)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
			if (!hasPlayedAnim)
			{
				hasPlayedAnim = true;
				((EntityState)this).PlayAnimation("Gesture, Override", "FireYesChef", "FireYesChef.playbackRate", 1f, 0f);
			}
			if ((double)((EntityState)this).fixedAge >= 0.25 && !hasPlayedSound)
			{
				hasPlayedSound = true;
				Util.PlaySound("Play_chef_skill4_boost_activate", ((EntityState)this).gameObject);
			}
			if ((double)((EntityState)this).fixedAge >= 1.05 && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			((EntityState)this).OnSerialize(writer);
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)9;
		}
	}
	public class CookState : GenericCharacterMain
	{
		private static EffectDef SpinEffect;

		private static EffectDef SliceEffect;

		private ChefController chefControl;

		private EffectComponent sliceImpact;

		private float setDuration;

		private int attackCount;

		private bool isCrit;

		public static void CreateEffects()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Expected O, but got Unknown
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Expected O, but got Unknown
			GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_Chef.BoostedRolyPolyGhost_prefab).WaitForCompletion(), "CookSpinEffect");
			EffectComponent val2 = val.AddComponent<EffectComponent>();
			DestroyOnTimer component = val.GetComponent<DestroyOnTimer>();
			((Behaviour)component).enabled = true;
			component.duration = Math.Max(0.5f, PluginConfig.Attack_Rate.Value / (float)PluginConfig.Attack_Instances.Value);
			val2.parentToReferencedTransform = true;
			val2.positionAtReferencedTransform = true;
			val.AddComponent<VFXAttributes>();
			Object.Destroy((Object)(object)val.GetComponent<ProjectileGhostController>());
			Vector3 val3 = Vector3.one * 0.75f * PluginConfig.Radius.Value / 2f;
			((Vector3)(ref val3))..ctor(val3.x, val3.y, Mathf.Sqrt(val3.z));
			foreach (Transform componentInChild in val.GetComponentInChildren<Transform>())
			{
				Transform val4 = componentInChild;
				val4.localScale = val3;
			}
			SpinEffect = new EffectDef
			{
				prefab = val,
				prefabName = "CookSpinEffect",
				prefabEffectComponent = val2
			};
			GameObject val5 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Saw.OmniImpactVFXSawmerang_prefab).WaitForCompletion(), "CookSliceImpact");
			EffectComponent component2 = val5.GetComponent<EffectComponent>();
			Object.Destroy((Object)(object)((Component)val5.transform.Find("Scaled Hitspark 4, Directional (Random Color)")).gameObject);
			Object.Destroy((Object)(object)((Component)val5.transform.Find("Scaled Hitspark 3, Radial (Random Color)")).gameObject);
			Object.Destroy((Object)(object)((Component)val5.transform.Find("Dash, Bright")).gameObject);
			SliceEffect = new EffectDef
			{
				prefab = val5,
				prefabName = "CookSliceImpact",
				prefabEffectComponent = component2
			};
			ContentAddition.AddEffect(SpinEffect.prefab);
			ContentAddition.AddEffect(SliceEffect.prefab);
		}

		public override void OnEnter()
		{
			((GenericCharacterMain)this).OnEnter();
			chefControl = ((Component)((EntityState)this).characterBody).GetComponent<ChefController>();
			sliceImpact = SliceEffect.prefab.GetComponent<EffectComponent>();
			isCrit = Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master);
			chefControl.blockOtherSkills = true;
			setDuration = PluginConfig.Attack_Rate.Value / (float)PluginConfig.Attack_Instances.Value;
			attackCount = 0;
			Util.PlaySound("Play_chef_skill3_boosted_active_loop", ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("Body", "BoostedRolyPoly", "FireRolyPoly.playbackRate", PluginConfig.Attack_Rate.Value, 0f);
			((EntityState)this).GetModelAnimator().SetBool("isInBoostedRolyPoly", true);
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(CookingBuff.BuffDef);
			}
		}

		public override void FixedUpdate()
		{
			((GenericCharacterMain)this).FixedUpdate();
			if ((Object)(object)chefControl == (Object)null)
			{
				return;
			}
			SlashEffectSpawn();
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(MeatTimerBuff.BuffDef, 0.1f);
			}
			setDuration -= ((EntityState)this).GetDeltaTime();
			if (setDuration <= 0f)
			{
				setDuration = PluginConfig.Attack_Rate.Value / (float)PluginConfig.Attack_Instances.Value;
				attackCount++;
				AreaSlash();
			}
			if (attackCount > PluginConfig.Attack_Instances.Value && ((EntityState)this).isAuthority)
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory) && ((EntityState)this).characterBody.inventory.GetItemCountEffective(MonsterMeatItem.ItemDef) > 0 && NetworkServer.active)
				{
					((EntityState)this).characterBody.AddTimedBuff(MeatTimerBuff.BuffDef, 2f);
				}
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			chefControl.blockOtherSkills = false;
			Util.PlaySound("Stop_chef_skill3_boosted_active_loop", ((EntityState)this).gameObject);
			((EntityState)this).GetModelAnimator().SetBool("isInBoostedRolyPoly", false);
			((EntityState)this).PlayCrossfade("Body", "ExitRolyPoly", 0.1f);
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.RemoveBuff(CookingBuff.BuffDef);
			}
			((GenericCharacterMain)this).OnExit();
		}

		private void SlashEffectSpawn()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: 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_002f: 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_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			EffectManager.SpawnEffect(SpinEffect.prefab, new EffectData
			{
				rootObject = ((EntityState)this).gameObject,
				origin = ((EntityState)this).characterBody.corePosition,
				rotation = Quaternion.identity
			}, true);
		}

		private void AreaSlash()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: 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_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: 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_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: 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_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: 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_00d2: Expected O, but got Unknown
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).isAuthority)
			{
				BlastAttack val = new BlastAttack
				{
					inflictor = ((EntityState)this).gameObject,
					attacker = ((EntityState)this).gameObject,
					attackerFiltering = (AttackerFiltering)2,
					position = ((EntityState)this).characterBody.corePosition,
					teamIndex = ((BaseState)this).GetTeam(),
					radius = PluginConfig.Radius.Value,
					procCoefficient = PluginConfig.Proc_Coefficient.Value,
					baseDamage = ((BaseState)this).damageStat * (float)PluginConfig.Damage_Coefficient.Value / 100f,
					damageColorIndex = (DamageColorIndex)0,
					damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)32), (DamageTypeExtended)0, (DamageSource)8),
					crit = isCrit,
					falloffModel = (FalloffModel)0,
					impactEffect = sliceImpact.effectIndex
				};
				DamageAPI.AddModdedDamageType(val, CookDamageType.DamageType);
				val.Fire();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)7;
		}
	}
	public class ConsumedChefEquip : EquipmentBase
	{
		public static EquipmentDef EquipmentDef;

		protected override ExpansionDef RequiredExpansion => Addressables.LoadAssetAsync<ExpansionDef>((object)RoR2_DLC3.DLC3_asset).WaitForCompletion();

		protected override string Name => "ConsumedChefEquip";

		protected override float Cooldown => 70f;

		protected override bool CanDrop => false;

		protected override GameObject PickupModelPrefab => ChefOverCookedPlugin.Bundle.LoadAsset<GameObject>("summonChefModel");

		protected override Sprite PickupIconSprite => ChefOverCookedPlugin.Bundle.LoadAsset<Sprite>("texConsumedChefIcon");

		protected override string PickupText => "Seems like Wandering CHEF is done serving orders.";

		protected override string Description => "Seems like Wandering CHEF is done serving orders.";

		protected override string DisplayName => "À La Carte (Consumed)";

		protected override void Initialize()
		{
			EquipmentDef = Value;
		}

		protected override bool ActivateEquip(EquipmentSlot slot)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: 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_004c: Expected O, but got Unknown
			if (Object.op_Implicit((Object)(object)slot.characterBody) && Object.op_Implicit((Object)(object)((Component)slot.characterBody).gameObject))
			{
				Chat.SendBroadcastChat((ChatMessageBase)new BodyChatMessage
				{
					bodyObject = ((Component)slot.characterBody).gameObject,
					token = "Yes, CHEF!"
				});
			}
			return true;
		}

		protected override void LogDisplay()
		{
			ModelPanelParameters val = PickupModelPrefab.AddComponent<ModelPanelParameters>();
			Transform child = PickupModelPrefab.transform.GetChild(0);
			if (Object.op_Implicit((Object)(object)child))
			{
				val.focusPointTransform = child;
				val.cameraPositionTransform = child;
				val.minDistance = 3f;
				val.maxDistance = 12f;
			}
		}
	}
	public class SummonChefEquip : EquipmentBase
	{
		private class ChefDeployAdjuster : MonoBehaviour
		{
			public static GameObject currentChef;

			private static readonly float SPEED_COEFF = 10f;

			private float squashHeightVelocity = 0f;

			private float squashSideVelocity = 0f;

			private float squashTime = 0f;

			public void Awake()
			{
				if (Object.op_Implicit((Object)(object)currentChef))
				{
					Object.Destroy((Object)(object)currentChef);
				}
				currentChef = ((Component)((Component)this).transform.parent).gameObject;
			}

			public void FixedUpdate()
			{
				//IL_00ec: 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_0133: Unknown result type (might be due to invalid IL or missing references)
				float num = 1f;
				float num2 = 1f;
				squashTime += Time.deltaTime;
				if (squashTime <= MathF.PI / SPEED_COEFF)
				{
					num = -0.55f * Mathf.Pow(squashTime * SPEED_COEFF, 3f) + 2.5f * Mathf.Pow(squashTime * SPEED_COEFF, 2f) - 2.55f * (squashTime * SPEED_COEFF) + 1f;
					num2 = 0.5f * Mathf.Pow(squashTime * SPEED_COEFF, 3f) - 2.5f * Mathf.Pow(squashTime * SPEED_COEFF, 2f) + 3f * (squashTime * SPEED_COEFF) + 1f;
				}
				float num3 = Mathf.SmoothDamp(((Component)this).transform.localScale.y, num, ref squashHeightVelocity, 0.025f);
				float num4 = Mathf.SmoothDamp(((Component)this).transform.localScale.x, num2, ref squashSideVelocity, 0.025f);
				((Component)this).transform.localScale = new Vector3(num4, num3, num4);
				if (squashTime >= MathF.PI / SPEED_COEFF * 2f)
				{
					((Behaviour)this).enabled = false;
				}
			}
		}

		public static EquipmentDef EquipmentDef;

		public static GameObject ChefProjectile;

		protected override ExpansionDef RequiredExpansion => Addressables.LoadAssetAsync<ExpansionDef>((object)RoR2_DLC3.DLC3_asset).WaitForCompletion();

		protected override string Name => "SummonChefEquip";

		protected override float Cooldown => 60f;

		protected override GameObject PickupModelPrefab => ChefOverCookedPlugin.Bundle.LoadAsset<GameObject>("summonChefModel");

		protected override Sprite PickupIconSprite =