Decompiled source of VanillaItemTweaks v0.2.0

VanillaItemTweaks.dll

Decompiled 2 days ago
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Missions.BrotherEncounter;
using IL.EntityStates;
using IL.EntityStates.TeleporterHealNovaController;
using IL.RoR2;
using IL.RoR2.Orbs;
using Microsoft.CodeAnalysis;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.Missions.BrotherEncounter;
using R2API;
using RoR2;
using RoR2.Orbs;
using UnityEngine;
using UnityEngine.Networking;
using VanillaItemTweaks.Boss;
using VanillaItemTweaks.Common;
using VanillaItemTweaks.Legendary;
using VanillaItemTweaks.Uncommon;
using VanillaItemTweaks.Void;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("VanillaItemTweaks")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("VanillaItemTweaks")]
[assembly: AssemblyTitle("VanillaItemTweaks")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace VanillaItemTweaks
{
	internal static class Log
	{
		internal static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void LogDebug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void LogError(object data)
		{
			_logSource.LogError(data);
		}

		internal static void LogFatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void LogInfo(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void LogMessage(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void LogWarning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	[BepInPlugin("OakPrime.VanillaItemTweaks", "VanillaItemTweaks", "0.2.0")]
	public class VanillaItemTweaks : BaseUnityPlugin
	{
		public const string PluginGUID = "OakPrime.VanillaItemTweaks";

		public const string PluginAuthor = "OakPrime";

		public const string PluginName = "VanillaItemTweaks";

		public const string PluginVersion = "0.2.0";

		public static ManualLogSource logger;

		public void Awake()
		{
			logger = ((BaseUnityPlugin)this).Logger;
			Log.Init(logger);
			try
			{
				VITConfig.InitializeConfig();
				Init();
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		private void Init()
		{
			if (VITConfig.enableKnurlBuff.Value)
			{
				KnurlBuff.Init();
			}
			if (VITConfig.enablePolyluteNerf.Value)
			{
				PolyluteNerf.Init();
			}
			if (VITConfig.enableHappiestMaskRework.Value)
			{
				HappiestMaskRework.Init();
			}
			if (VITConfig.enableLaserScopeBuff.Value)
			{
				LaserScopeBuff.Init();
			}
			if (VITConfig.enableDeathMarkFix.Value)
			{
				DeathMarkFix.Init();
			}
			if (VITConfig.enableHuntersHarpoonRework.Value)
			{
				HuntersHarpoonRework.Init();
			}
			if (VITConfig.enableLeechingSeedBuff.Value)
			{
				LeechingSeedBuff.Init();
			}
			if (VITConfig.enableLeptonDaisyBuff.Value)
			{
				LeptonDaisyBuff.Init();
			}
			if (VITConfig.enableRedWhipBuff.Value)
			{
				RedWhipBuff.Init();
			}
			if (VITConfig.enableOldGuillotineBuff.Value)
			{
				OldGuillotineBuff.Init();
			}
			if (VITConfig.enableRegeneratingScrapBuff.Value)
			{
				RegeneratingScrapBuff.Init();
			}
			if (VITConfig.enableSquidPolypBuff.Value)
			{
				SquidPolypBuff.Init();
			}
			if (VITConfig.enableIgnitionTankRework.Value)
			{
				IgnitionTankRework.Init();
			}
			if (VITConfig.enableGestureNerf.Value)
			{
				GestureNerf.Init();
			}
			if (VITConfig.enableTranscendenceNerf.Value)
			{
				TranscendenceNerf.Init();
			}
			if (VITConfig.enableWarbannerBuff.Value)
			{
				WarbannerBuff.Init();
			}
		}
	}
	internal static class VITConfig
	{
		public static ConfigEntry<bool> enableKnurlBuff;

		public static ConfigEntry<bool> enableHappiestMaskRework;

		public static ConfigEntry<bool> enableDeathMarkFix;

		public static ConfigEntry<bool> enableHuntersHarpoonRework;

		public static ConfigEntry<bool> enableLeechingSeedBuff;

		public static ConfigEntry<bool> enableLeptonDaisyBuff;

		public static ConfigEntry<bool> enablePolyluteNerf;

		public static ConfigEntry<bool> enableRedWhipBuff;

		public static ConfigEntry<bool> enableLaserScopeBuff;

		public static ConfigEntry<bool> enableWarbannerBuff;

		public static ConfigEntry<bool> enableOldGuillotineBuff;

		public static ConfigEntry<bool> enableRegeneratingScrapBuff;

		public static ConfigEntry<bool> enableSquidPolypBuff;

		public static ConfigEntry<bool> enableIgnitionTankRework;

		public static ConfigEntry<bool> enableTranscendenceNerf;

		public static ConfigEntry<bool> enableGestureNerf;

		public static void InitializeConfig()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			ConfigFile val = new ConfigFile(Paths.ConfigPath + "\\OakPrime.VanillaItemTweaks.cfg", true);
			enableKnurlBuff = val.Bind<bool>("Main", "Enable Knurl Buff", true, "Gives Titanic Knurl additional +10 armor per stack.");
			enableLeechingSeedBuff = val.Bind<bool>("Main", "Enable Leeching Seed Buff", true, "Leeching seed also heals for an additional 0.2 health regardless of proc coefficient.");
			enablePolyluteNerf = val.Bind<bool>("Main", "Enable Polylute Nerf", true, "Reduces Polylute strikes from 3 to 2.");
			enableLeptonDaisyBuff = val.Bind<bool>("Main", "Enable Lepton Daisy Buff", true, "Lepton Daisy now pulses twice per item at a lower value, cleansing debuffs (including band/bear cooldown). Also heals once on holdout start.");
			enableHuntersHarpoonRework = val.Bind<bool>("Main", "Enable Hunters Harpoon Rework", true, "Harpoon speed is less intense but lasts longer.");
			enableHappiestMaskRework = val.Bind<bool>("Main", "Enable Happiest Mask Rework", true, "Happiest Mask now spawns a ghost for 30 seconds if you don't have one on enemy kill.");
			enableDeathMarkFix = val.Bind<bool>("Main", "Enable Death Mark Fix", true, "Reduces Death Mark debuffs required to 3 and reduces its damage multiplier to 1.35x.");
			enableRedWhipBuff = val.Bind<bool>("Main", "Enable Red Whip Buff", true, "Raises Red Whip speed to 40%.");
			enableLaserScopeBuff = val.Bind<bool>("Main", "Enable Laser Scope Buff", true, "Gives Laser Scope 15% non-stacking crit chance.");
			enableWarbannerBuff = val.Bind<bool>("Main", "Enable Warbanner Buff", true, "Warbanner activates when starting Mithrix fight.");
			enableOldGuillotineBuff = val.Bind<bool>("Main", "Enable Old Guillotine Buff", true, "Guillotine executes enemies at 20% health instead of 11%.");
			enableRegeneratingScrapBuff = val.Bind<bool>("Main", "Enable Regenerating Scrap Buff", true, "Regenerating Scrap returns after being scrapped.");
			enableSquidPolypBuff = val.Bind<bool>("Main", "Enable Squid Polyp Buff", true, "Squid Polyp inflicts beetlejuice debuff.");
			enableIgnitionTankRework = val.Bind<bool>("Main", "Enable Ignition Tank Rework", true, "Ignition Tank ignites enemies on jump, inflicting stronger burn.");
			enableTranscendenceNerf = val.Bind<bool>("Main", "Enable TranscendenceNerf", true, "Transcendence shields regen slower with each stack.");
			enableGestureNerf = val.Bind<bool>("Main", "Enable Gesture Nerf", true, "Gesture has a +10% chance not to fire.");
		}
	}
}
namespace VanillaItemTweaks.Void
{
	public static class PolyluteNerf
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

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

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

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

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

			public static Func<int, int> <>9__0_6;

			public static Manipulator <>9__0_0;

			internal void <Init>b__0_0(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val = new ILCursor(il);
				int num3 = default(int);
				int num2 = default(int);
				int num = default(int);
				val.TryGotoNext(new Func<Instruction, bool>[5]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3),
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num2),
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
					(Instruction x) => ILPatternMatchingExt.MatchMul(x),
					(Instruction x) => ILPatternMatchingExt.MatchStfld<VoidLightningOrb>(x, "totalStrikes")
				});
				val.Index += 4;
				val.EmitDelegate<Func<int, int>>((Func<int, int>)((int totalStrikes) => totalStrikes * 2 / 3));
			}

			internal bool <Init>b__0_1(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdloc(x, ref num);
			}

			internal bool <Init>b__0_2(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdcI4(x, ref num);
			}

			internal bool <Init>b__0_3(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdloc(x, ref num);
			}

			internal bool <Init>b__0_4(Instruction x)
			{
				return ILPatternMatchingExt.MatchMul(x);
			}

			internal bool <Init>b__0_5(Instruction x)
			{
				return ILPatternMatchingExt.MatchStfld<VoidLightningOrb>(x, "totalStrikes");
			}

			internal int <Init>b__0_6(int totalStrikes)
			{
				return totalStrikes * 2 / 3;
			}
		}

		public static void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			try
			{
				object obj = <>c.<>9__0_0;
				if (obj == null)
				{
					Manipulator val = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						ILCursor val2 = new ILCursor(il);
						int num3 = default(int);
						int num2 = default(int);
						int num = default(int);
						val2.TryGotoNext(new Func<Instruction, bool>[5]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3),
							(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num2),
							(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
							(Instruction x) => ILPatternMatchingExt.MatchMul(x),
							(Instruction x) => ILPatternMatchingExt.MatchStfld<VoidLightningOrb>(x, "totalStrikes")
						});
						val2.Index += 4;
						val2.EmitDelegate<Func<int, int>>((Func<int, int>)((int totalStrikes) => totalStrikes * 2 / 3));
					};
					<>c.<>9__0_0 = val;
					obj = (object)val;
				}
				GlobalEventManager.ProcessHitEnemy += (Manipulator)obj;
				ReplaceText();
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		private static void ReplaceText()
		{
			LanguageAPI.Add("ITEM_CHAINLIGHTNINGVOID_DESC", "<style=cIsDamage>25%</style> chance to fire <style=cIsDamage>lightning</style> for <style=cIsDamage>60%</style> TOTAL damage up to <style=cIsDamage>2</style> <style=cStack>(+2 per stack)</style> times. <style=cIsVoid>Corrupts all Ukeleles</style>.");
		}
	}
}
namespace VanillaItemTweaks.Uncommon
{
	public static class GestureNerf
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

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

			public static Func<Func<bool>, EquipmentSlot, EquipmentDef, bool> <>9__0_5;

			public static Manipulator <>9__0_0;

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

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

			public static Func<EquipmentSlot, bool> <>9__0_8;

			public static Manipulator <>9__0_1;

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

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

			public static Func<EquipmentSlot, bool> <>9__0_11;

			public static Manipulator <>9__0_2;

			internal void <Init>b__0_0(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0069: Unknown result type (might be due to invalid IL or missing references)
				//IL_0075: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				int num = default(int);
				val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchRet(x),
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num)
				});
				val.Index -= 2;
				val.Emit(OpCodes.Ldarg_0);
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<Func<Func<bool>, EquipmentSlot, EquipmentDef, bool>>((Func<Func<bool>, EquipmentSlot, EquipmentDef, bool>)delegate(Func<bool> func, EquipmentSlot equipSlot, EquipmentDef equipDef)
				{
					List<EquipmentDef> list = new List<EquipmentDef>
					{
						Equipment.Lightning,
						Equipment.Recycle,
						Equipment.BossHunter,
						Equipment.HealAndRevive
					};
					if (func == null)
					{
						return false;
					}
					foreach (EquipmentDef item in list)
					{
					}
					return list.Contains(equipDef) || GestureFailureCheck(equipSlot);
				});
			}

			internal bool <Init>b__0_3(Instruction x)
			{
				return ILPatternMatchingExt.MatchRet(x);
			}

			internal bool <Init>b__0_4(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdloc(x, ref num);
			}

			internal bool <Init>b__0_5(Func<bool> func, EquipmentSlot equipSlot, EquipmentDef equipDef)
			{
				List<EquipmentDef> list = new List<EquipmentDef>
				{
					Equipment.Lightning,
					Equipment.Recycle,
					Equipment.BossHunter,
					Equipment.HealAndRevive
				};
				if (func == null)
				{
					return false;
				}
				foreach (EquipmentDef item in list)
				{
				}
				if (list.Contains(equipDef))
				{
					return true;
				}
				return GestureFailureCheck(equipSlot);
			}

			internal void <Init>b__0_1(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_005a: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				int num2 = default(int);
				float num = default(float);
				val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num2),
					(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num)
				});
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<EquipmentSlot, bool>>((Func<EquipmentSlot, bool>)((EquipmentSlot equipSlot) => GestureFailureCheck(equipSlot)));
				ILLabel val2 = val.DefineLabel();
				val2.Target = val.Next;
				val.Emit(OpCodes.Brtrue_S, (object)val2);
				val.Emit(OpCodes.Ldc_I4_0);
				val.Emit(OpCodes.Ret);
			}

			internal bool <Init>b__0_6(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdarg(x, ref num);
			}

			internal bool <Init>b__0_7(Instruction x)
			{
				float num = default(float);
				return ILPatternMatchingExt.MatchLdcR4(x, ref num);
			}

			internal bool <Init>b__0_8(EquipmentSlot equipSlot)
			{
				return GestureFailureCheck(equipSlot);
			}

			internal void <Init>b__0_2(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_005a: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				int num2 = default(int);
				int num = default(int);
				val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2),
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num)
				});
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<EquipmentSlot, bool>>((Func<EquipmentSlot, bool>)((EquipmentSlot equipSlot) => GestureFailureCheck(equipSlot)));
				ILLabel val2 = val.DefineLabel();
				val2.Target = val.Next;
				val.Emit(OpCodes.Brtrue_S, (object)val2);
				val.Emit(OpCodes.Ldc_I4_0);
				val.Emit(OpCodes.Ret);
			}

			internal bool <Init>b__0_9(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdloc(x, ref num);
			}

			internal bool <Init>b__0_10(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdloc(x, ref num);
			}

			internal bool <Init>b__0_11(EquipmentSlot equipSlot)
			{
				return GestureFailureCheck(equipSlot);
			}
		}

		public static void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//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_0046: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			try
			{
				object obj = <>c.<>9__0_0;
				if (obj == null)
				{
					Manipulator val = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_0069: Unknown result type (might be due to invalid IL or missing references)
						//IL_0075: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val8 = new ILCursor(il);
						int num5 = default(int);
						val8.TryGotoNext(new Func<Instruction, bool>[2]
						{
							(Instruction x) => ILPatternMatchingExt.MatchRet(x),
							(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num5)
						});
						val8.Index -= 2;
						val8.Emit(OpCodes.Ldarg_0);
						val8.Emit(OpCodes.Ldarg_1);
						val8.EmitDelegate<Func<Func<bool>, EquipmentSlot, EquipmentDef, bool>>((Func<Func<bool>, EquipmentSlot, EquipmentDef, bool>)delegate(Func<bool> func, EquipmentSlot equipSlot, EquipmentDef equipDef)
						{
							List<EquipmentDef> list = new List<EquipmentDef>
							{
								Equipment.Lightning,
								Equipment.Recycle,
								Equipment.BossHunter,
								Equipment.HealAndRevive
							};
							if (func == null)
							{
								return false;
							}
							foreach (EquipmentDef item in list)
							{
							}
							return list.Contains(equipDef) || GestureFailureCheck(equipSlot);
						});
					};
					<>c.<>9__0_0 = val;
					obj = (object)val;
				}
				EquipmentSlot.PerformEquipmentAction += (Manipulator)obj;
				object obj2 = <>c.<>9__0_1;
				if (obj2 == null)
				{
					Manipulator val2 = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_005a: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
						//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val6 = new ILCursor(il);
						int num4 = default(int);
						float num3 = default(float);
						val6.TryGotoNext(new Func<Instruction, bool>[2]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num4),
							(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num3)
						});
						val6.Emit(OpCodes.Ldarg_0);
						val6.EmitDelegate<Func<EquipmentSlot, bool>>((Func<EquipmentSlot, bool>)((EquipmentSlot equipSlot) => GestureFailureCheck(equipSlot)));
						ILLabel val7 = val6.DefineLabel();
						val7.Target = val6.Next;
						val6.Emit(OpCodes.Brtrue_S, (object)val7);
						val6.Emit(OpCodes.Ldc_I4_0);
						val6.Emit(OpCodes.Ret);
					};
					<>c.<>9__0_1 = val2;
					obj2 = (object)val2;
				}
				EquipmentSlot.FireLightning += (Manipulator)obj2;
				object obj3 = <>c.<>9__0_2;
				if (obj3 == null)
				{
					Manipulator val3 = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_005a: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
						//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val4 = new ILCursor(il);
						int num2 = default(int);
						int num = default(int);
						val4.TryGotoNext(new Func<Instruction, bool>[2]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2),
							(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num)
						});
						val4.Emit(OpCodes.Ldarg_0);
						val4.EmitDelegate<Func<EquipmentSlot, bool>>((Func<EquipmentSlot, bool>)((EquipmentSlot equipSlot) => GestureFailureCheck(equipSlot)));
						ILLabel val5 = val4.DefineLabel();
						val5.Target = val4.Next;
						val4.Emit(OpCodes.Brtrue_S, (object)val5);
						val4.Emit(OpCodes.Ldc_I4_0);
						val4.Emit(OpCodes.Ret);
					};
					<>c.<>9__0_2 = val3;
					obj3 = (object)val3;
				}
				EquipmentSlot.FireRecycle += (Manipulator)obj3;
				UpdateText();
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		private static bool GestureFailureCheck(EquipmentSlot equipSlot)
		{
			Inventory inventory = equipSlot.inventory;
			int num = (((Object)(object)inventory != (Object)null) ? inventory.GetItemCount(Items.AutoCastEquipment) : 0);
			if (num >= 1 && !Util.CheckRoll(90f, (float)(1 - num), (CharacterMaster)null))
			{
				equipSlot.inventory.DeductEquipmentCharges(equipSlot.activeEquipmentSlot, 1);
				equipSlot.UpdateInventory();
				Util.PlaySound("Play_drone_deathpt1", ((Component)equipSlot.characterBody).gameObject);
				return false;
			}
			return true;
		}

		private static void UpdateText()
		{
			LanguageAPI.Add("ITEM_AUTOCASTEQUIPMENT_DESC", "<style=cIsUtility>Reduce Equipment cooldown</style> by <style=cIsUtility>50%</style> <style=cStack>(+50% per stack)</style>. Forces your Equipment to <style=cIsUtility>activate</style> whenever it is off <style=cIsUtility>cooldown</style> with a <style=cIsUtility>10%</style> <style=cStack>(+10% per stack)</style> chance to fail.");
			LanguageAPI.Add("ITEM_AUTOCASTEQUIPMENT_PICKUP", "Halve Equipment cooldown... <style=cDeath>BUT it automatically activates with a chance to fail</style>.");
		}
	}
	public static class TranscendenceNerf
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

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

			public static Func<HealthComponent, float> <>9__0_5;

			public static Manipulator <>9__0_0;

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

			public static Func<float, CharacterBody, float> <>9__0_7;

			public static Manipulator <>9__0_1;

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

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

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

			public static Manipulator <>9__0_2;

			internal void <Init>b__0_0(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val = new ILCursor(il);
				float num2 = default(float);
				val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num2),
					(Instruction x) => ILPatternMatchingExt.MatchMul(x)
				});
				val.Index -= 2;
				val.RemoveRange(4);
				val.EmitDelegate<Func<HealthComponent, float>>((Func<HealthComponent, float>)delegate(HealthComponent healthComp)
				{
					CharacterBody body = healthComp.body;
					Inventory inventory = healthComp.body.inventory;
					int num = (((Object)(object)inventory != (Object)null) ? inventory.GetItemCount(Items.ShieldOnly) : 0);
					return body.maxShield * 0.5f * Mathf.Pow(0.25f, (float)num);
				});
			}

			internal bool <Init>b__0_3(Instruction x)
			{
				float num = default(float);
				return ILPatternMatchingExt.MatchLdcR4(x, ref num);
			}

			internal bool <Init>b__0_4(Instruction x)
			{
				return ILPatternMatchingExt.MatchMul(x);
			}

			internal float <Init>b__0_5(HealthComponent healthComp)
			{
				CharacterBody body = healthComp.body;
				Inventory inventory = healthComp.body.inventory;
				int num = (((Object)(object)inventory != (Object)null) ? inventory.GetItemCount(Items.ShieldOnly) : 0);
				return body.maxShield * 0.5f * Mathf.Pow(0.25f, (float)num);
			}

			internal void <Init>b__0_1(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchMul(x)
				});
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<Func<float, CharacterBody, float>>((Func<float, CharacterBody, float>)((float num, CharacterBody cb) => num + cb.maxShield));
			}

			internal bool <Init>b__0_6(Instruction x)
			{
				return ILPatternMatchingExt.MatchMul(x);
			}

			internal float <Init>b__0_7(float num, CharacterBody cb)
			{
				return num + cb.maxShield;
			}

			internal void <Init>b__0_2(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val = new ILCursor(il);
				float num = default(float);
				val.TryGotoNext(new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchSub(x),
					(Instruction x) => ILPatternMatchingExt.MatchConvR4(x),
					(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num)
				});
				val.Index += 2;
				val.Next.Operand = 0.5f;
			}

			internal bool <Init>b__0_8(Instruction x)
			{
				return ILPatternMatchingExt.MatchSub(x);
			}

			internal bool <Init>b__0_9(Instruction x)
			{
				return ILPatternMatchingExt.MatchConvR4(x);
			}

			internal bool <Init>b__0_10(Instruction x)
			{
				float num = default(float);
				return ILPatternMatchingExt.MatchLdcR4(x, ref num);
			}
		}

		public static void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//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_0046: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			try
			{
				object obj = <>c.<>9__0_0;
				if (obj == null)
				{
					Manipulator val = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						ILCursor val6 = new ILCursor(il);
						float num4 = default(float);
						val6.TryGotoNext(new Func<Instruction, bool>[2]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num4),
							(Instruction x) => ILPatternMatchingExt.MatchMul(x)
						});
						val6.Index -= 2;
						val6.RemoveRange(4);
						val6.EmitDelegate<Func<HealthComponent, float>>((Func<HealthComponent, float>)delegate(HealthComponent healthComp)
						{
							CharacterBody body = healthComp.body;
							Inventory inventory = healthComp.body.inventory;
							int num3 = (((Object)(object)inventory != (Object)null) ? inventory.GetItemCount(Items.ShieldOnly) : 0);
							return body.maxShield * 0.5f * Mathf.Pow(0.25f, (float)num3);
						});
					};
					<>c.<>9__0_0 = val;
					obj = (object)val;
				}
				HealthComponent.ServerFixedUpdate += (Manipulator)obj;
				object obj2 = <>c.<>9__0_1;
				if (obj2 == null)
				{
					Manipulator val2 = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_0038: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val5 = new ILCursor(il);
						val5.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchMul(x)
						});
						val5.Emit(OpCodes.Ldarg_1);
						val5.EmitDelegate<Func<float, CharacterBody, float>>((Func<float, CharacterBody, float>)((float num, CharacterBody cb) => num + cb.maxShield));
					};
					<>c.<>9__0_1 = val2;
					obj2 = (object)val2;
				}
				GlobalEventManager.OnCharacterHitGroundServer += (Manipulator)obj2;
				object obj3 = <>c.<>9__0_2;
				if (obj3 == null)
				{
					Manipulator val3 = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						ILCursor val4 = new ILCursor(il);
						float num2 = default(float);
						val4.TryGotoNext(new Func<Instruction, bool>[3]
						{
							(Instruction x) => ILPatternMatchingExt.MatchSub(x),
							(Instruction x) => ILPatternMatchingExt.MatchConvR4(x),
							(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num2)
						});
						val4.Index += 2;
						val4.Next.Operand = 0.5f;
					};
					<>c.<>9__0_2 = val3;
					obj3 = (object)val3;
				}
				CharacterBody.RecalculateStats += (Manipulator)obj3;
				UpdateText();
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		private static void UpdateText()
		{
			LanguageAPI.Add("ITEM_SHIELDONLY_DESC", "<style=cIsHealing>Convert</style> all but <style=cIsHealing>1 health</style> into <style=cIsHealing>regenerating shields</style>. <style=cIsHealing>Gain 50%</style> <style=cStack>(+25% per stack)</style> <style=cIsHealing>maximum health</style>. Shields regenerate <style=cIsHealing>75%</style> <style=cStack>(+75% per stack)</style> slower.");
			LanguageAPI.Add("Item_SHIELDONLY_PICKUP", "Increases health and converts it all into shields, <style=cDeath>BUT shields regen slower.</stack>");
		}
	}
	public static class DeathMarkFix
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

			public static Manipulator <>9__0_0;

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

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

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

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

			public static Manipulator <>9__0_1;

			internal void <Init>b__0_0(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 4)
				});
				val.Next.OpCode = OpCodes.Ldc_I4_3;
			}

			internal bool <Init>b__0_2(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdcI4(x, 4);
			}

			internal void <Init>b__0_1(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val = new ILCursor(il);
				int num2 = default(int);
				int num = default(int);
				val.TryGotoNext(new Func<Instruction, bool>[4]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2),
					(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f),
					(Instruction x) => ILPatternMatchingExt.MatchMul(x),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num)
				});
				int index = val.Index;
				val.Index = index + 1;
				val.Next.Operand = 1.35f;
			}

			internal bool <Init>b__0_3(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdloc(x, ref num);
			}

			internal bool <Init>b__0_4(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdcR4(x, 1.5f);
			}

			internal bool <Init>b__0_5(Instruction x)
			{
				return ILPatternMatchingExt.MatchMul(x);
			}

			internal bool <Init>b__0_6(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchStloc(x, ref num);
			}
		}

		public static void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//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_0046: Expected O, but got Unknown
			try
			{
				object obj = <>c.<>9__0_0;
				if (obj == null)
				{
					Manipulator val = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_003d: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val4 = new ILCursor(il);
						val4.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 4)
						});
						val4.Next.OpCode = OpCodes.Ldc_I4_3;
					};
					<>c.<>9__0_0 = val;
					obj = (object)val;
				}
				GlobalEventManager.ProcDeathMark += (Manipulator)obj;
				object obj2 = <>c.<>9__0_1;
				if (obj2 == null)
				{
					Manipulator val2 = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						ILCursor val3 = new ILCursor(il);
						int num2 = default(int);
						int num = default(int);
						val3.TryGotoNext(new Func<Instruction, bool>[4]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2),
							(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f),
							(Instruction x) => ILPatternMatchingExt.MatchMul(x),
							(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num)
						});
						int index = val3.Index;
						val3.Index = index + 1;
						val3.Next.Operand = 1.35f;
					};
					<>c.<>9__0_1 = val2;
					obj2 = (object)val2;
				}
				HealthComponent.TakeDamageProcess += (Manipulator)obj2;
				ReplaceText();
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		private static void ReplaceText()
		{
			LanguageAPI.Add("ITEM_DEATHMARK_PICKUP", "Enemies with 3 or more debuffs are marked for death, taking bonus damage.");
			LanguageAPI.Add("ITEM_DEATHMARK_DESC", "Enemies with <style=cIsDamage>3</style> or more debuffs are <style=cIsDamage>marked for death</style>, increasing damage taken by <style=cIsDamage>35%</style> from all sources for <style=cIsUtility>7</style> <style=cStack>(+7 per stack)</style> seconds.");
		}
	}
	public static class HuntersHarpoonRework
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

			public static Func<int, int> <>9__0_2;

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

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

			public static Action<DamageReport> <>9__0_5;

			public static Manipulator <>9__0_0;

			internal void <Init>b__0_0(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill")
				});
				val.Index += 4;
				val.EmitDelegate<Func<int, int>>((Func<int, int>)((int itemCount) => 0));
				MethodReference val3 = default(MethodReference);
				val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1),
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val3)
				});
				val.Index += 3;
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<Action<DamageReport>>((Action<DamageReport>)delegate(DamageReport damageReport)
				{
					//IL_0095: Unknown result type (might be due to invalid IL or missing references)
					//IL_009c: Expected O, but got Unknown
					//IL_009f: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ca: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
					//IL_0105: Unknown result type (might be due to invalid IL or missing references)
					//IL_010a: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
					CharacterBody attackerBody = damageReport.attackerBody;
					int itemCount2 = attackerBody.inventory.GetItemCount(Items.MoveSpeedOnKill);
					if (itemCount2 > 0)
					{
						int num = itemCount2 - 1;
						int num2 = 5;
						float num3 = (float)(1.0 + (double)num * 0.5);
						attackerBody.ClearTimedBuffs(Buffs.KillMoveSpeed);
						for (int i = 0; i < 4; i++)
						{
							if (attackerBody != null)
							{
								attackerBody.AddTimedBuff(Buffs.KillMoveSpeed, 2f * (float)itemCount2 * (float)Math.Pow(0.75, i));
							}
						}
						EffectData val2 = new EffectData();
						val2.origin = attackerBody.corePosition;
						CharacterMotor characterMotor = attackerBody.characterMotor;
						bool flag = false;
						if (Object.op_Implicit((Object)(object)characterMotor))
						{
							Vector3 moveDirection = characterMotor.moveDirection;
							if (moveDirection != Vector3.zero)
							{
								val2.rotation = Util.QuaternionSafeLookRotation(moveDirection);
								flag = true;
							}
						}
						if (!flag)
						{
							val2.rotation = attackerBody.transform.rotation;
						}
						EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/MoveSpeedOnKillActivate"), val2, true);
					}
				});
			}

			internal bool <Init>b__0_1(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill");
			}

			internal int <Init>b__0_2(int itemCount)
			{
				return 0;
			}

			internal bool <Init>b__0_3(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdcI4(x, 1);
			}

			internal bool <Init>b__0_4(Instruction x)
			{
				MethodReference val = default(MethodReference);
				return ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val);
			}

			internal void <Init>b__0_5(DamageReport damageReport)
			{
				//IL_0095: Unknown result type (might be due to invalid IL or missing references)
				//IL_009c: Expected O, but got Unknown
				//IL_009f: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ca: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_0105: Unknown result type (might be due to invalid IL or missing references)
				//IL_010a: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
				CharacterBody attackerBody = damageReport.attackerBody;
				int itemCount = attackerBody.inventory.GetItemCount(Items.MoveSpeedOnKill);
				if (itemCount <= 0)
				{
					return;
				}
				int num = itemCount - 1;
				int num2 = 5;
				float num3 = (float)(1.0 + (double)num * 0.5);
				attackerBody.ClearTimedBuffs(Buffs.KillMoveSpeed);
				for (int i = 0; i < 4; i++)
				{
					if (attackerBody != null)
					{
						attackerBody.AddTimedBuff(Buffs.KillMoveSpeed, 2f * (float)itemCount * (float)Math.Pow(0.75, i));
					}
				}
				EffectData val = new EffectData();
				val.origin = attackerBody.corePosition;
				CharacterMotor characterMotor = attackerBody.characterMotor;
				bool flag = false;
				if (Object.op_Implicit((Object)(object)characterMotor))
				{
					Vector3 moveDirection = characterMotor.moveDirection;
					if (moveDirection != Vector3.zero)
					{
						val.rotation = Util.QuaternionSafeLookRotation(moveDirection);
						flag = true;
					}
				}
				if (!flag)
				{
					val.rotation = attackerBody.transform.rotation;
				}
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/MoveSpeedOnKillActivate"), val, true);
			}
		}

		public static void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			try
			{
				object obj = <>c.<>9__0_0;
				if (obj == null)
				{
					Manipulator val = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val2 = new ILCursor(il);
						val2.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill")
						});
						val2.Index += 4;
						val2.EmitDelegate<Func<int, int>>((Func<int, int>)((int itemCount) => 0));
						MethodReference val4 = default(MethodReference);
						val2.TryGotoNext(new Func<Instruction, bool>[2]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1),
							(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val4)
						});
						val2.Index += 3;
						val2.Emit(OpCodes.Ldarg_1);
						val2.EmitDelegate<Action<DamageReport>>((Action<DamageReport>)delegate(DamageReport damageReport)
						{
							//IL_0095: Unknown result type (might be due to invalid IL or missing references)
							//IL_009c: Expected O, but got Unknown
							//IL_009f: Unknown result type (might be due to invalid IL or missing references)
							//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
							//IL_00ca: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
							//IL_0105: Unknown result type (might be due to invalid IL or missing references)
							//IL_010a: Unknown result type (might be due to invalid IL or missing references)
							//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
							//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
							//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
							CharacterBody attackerBody = damageReport.attackerBody;
							int itemCount2 = attackerBody.inventory.GetItemCount(Items.MoveSpeedOnKill);
							if (itemCount2 > 0)
							{
								int num = itemCount2 - 1;
								int num2 = 5;
								float num3 = (float)(1.0 + (double)num * 0.5);
								attackerBody.ClearTimedBuffs(Buffs.KillMoveSpeed);
								for (int i = 0; i < 4; i++)
								{
									if (attackerBody != null)
									{
										attackerBody.AddTimedBuff(Buffs.KillMoveSpeed, 2f * (float)itemCount2 * (float)Math.Pow(0.75, i));
									}
								}
								EffectData val3 = new EffectData();
								val3.origin = attackerBody.corePosition;
								CharacterMotor characterMotor = attackerBody.characterMotor;
								bool flag = false;
								if (Object.op_Implicit((Object)(object)characterMotor))
								{
									Vector3 moveDirection = characterMotor.moveDirection;
									if (moveDirection != Vector3.zero)
									{
										val3.rotation = Util.QuaternionSafeLookRotation(moveDirection);
										flag = true;
									}
								}
								if (!flag)
								{
									val3.rotation = attackerBody.transform.rotation;
								}
								EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/MoveSpeedOnKillActivate"), val3, true);
							}
						});
					};
					<>c.<>9__0_0 = val;
					obj = (object)val;
				}
				GlobalEventManager.OnCharacterDeath += (Manipulator)obj;
				UpdateText();
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		private static void UpdateText()
		{
			LanguageAPI.Add("ITEM_MOVESPEEDONKILL_DESC", "Killing an enemy increases <style=cIsUtility>movement speed</style> by <style=cIsUtility>100%</style> fading over <style=cIsUtility>2</style> <style=cStack>(+2 per stack)</style> seconds.");
		}
	}
	internal class IgnitionTankRework
	{
		private delegate int ItemCountIfBurningDel(int itemCount, ref InflictDotInfo dotInfo);

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

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

			public static Manipulator <>9__0_0;

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

			public static Action<GenericCharacterMain> <>9__0_5;

			public static Manipulator <>9__0_1;

			internal void <Init>b__0_0(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				int num = default(int);
				val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0)
				});
				int index = val.Index;
				val.Index = index + 1;
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<ItemCountIfBurningDel>((ItemCountIfBurningDel)ItemCountIfBurning);
			}

			internal bool <Init>b__0_2(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdloc(x, ref num);
			}

			internal bool <Init>b__0_3(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdcI4(x, 0);
			}

			internal void <Init>b__0_1(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				ILLabel val2 = default(ILLabel);
				val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchBge(x, ref val2)
				});
				int index = val.Index;
				val.Index = index + 1;
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Action<GenericCharacterMain>>((Action<GenericCharacterMain>)delegate(GenericCharacterMain gcm)
				{
					int itemCount = ((EntityState)gcm).characterBody.inventory.GetItemCount(Items.StrengthenBurn);
					if (itemCount > 0)
					{
						ProcIgniteOnJump(((EntityState)gcm).characterBody, itemCount);
					}
				});
			}

			internal bool <Init>b__0_4(Instruction x)
			{
				ILLabel val = default(ILLabel);
				return ILPatternMatchingExt.MatchBge(x, ref val);
			}

			internal void <Init>b__0_5(GenericCharacterMain gcm)
			{
				int itemCount = ((EntityState)gcm).characterBody.inventory.GetItemCount(Items.StrengthenBurn);
				if (itemCount > 0)
				{
					ProcIgniteOnJump(((EntityState)gcm).characterBody, itemCount);
				}
			}
		}

		public static void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//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_0046: Expected O, but got Unknown
			try
			{
				object obj = <>c.<>9__0_0;
				if (obj == null)
				{
					Manipulator val = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_006b: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val5 = new ILCursor(il);
						int num = default(int);
						val5.TryGotoNext(new Func<Instruction, bool>[2]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
							(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0)
						});
						int index2 = val5.Index;
						val5.Index = index2 + 1;
						val5.Emit(OpCodes.Ldarg_1);
						val5.EmitDelegate<ItemCountIfBurningDel>((ItemCountIfBurningDel)ItemCountIfBurning);
					};
					<>c.<>9__0_0 = val;
					obj = (object)val;
				}
				StrengthenBurnUtils.CheckDotForUpgrade += (Manipulator)obj;
				object obj2 = <>c.<>9__0_1;
				if (obj2 == null)
				{
					Manipulator val2 = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_0049: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val3 = new ILCursor(il);
						ILLabel val4 = default(ILLabel);
						val3.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchBge(x, ref val4)
						});
						int index = val3.Index;
						val3.Index = index + 1;
						val3.Emit(OpCodes.Ldarg_0);
						val3.EmitDelegate<Action<GenericCharacterMain>>((Action<GenericCharacterMain>)delegate(GenericCharacterMain gcm)
						{
							int itemCount = ((EntityState)gcm).characterBody.inventory.GetItemCount(Items.StrengthenBurn);
							if (itemCount > 0)
							{
								ProcIgniteOnJump(((EntityState)gcm).characterBody, itemCount);
							}
						});
					};
					<>c.<>9__0_1 = val2;
					obj2 = (object)val2;
				}
				GenericCharacterMain.ProcessJump += (Manipulator)obj2;
				UpdateText();
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		private static int ItemCountIfBurning(int itemCount, ref InflictDotInfo dotInfo)
		{
			return dotInfo.victimObject.GetComponent<CharacterBody>().HasBuff(Buffs.StrongerBurn) ? itemCount : 0;
		}

		private static void ProcIgniteOnJump(CharacterBody attackerBody, int ignitionTankCount)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: 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_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: 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_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			float num = 12f + attackerBody.radius;
			Vector3 corePosition = attackerBody.corePosition;
			GlobalEventManager.igniteOnKillSphereSearch.origin = corePosition;
			GlobalEventManager.igniteOnKillSphereSearch.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask;
			GlobalEventManager.igniteOnKillSphereSearch.radius = num;
			GlobalEventManager.igniteOnKillSphereSearch.RefreshCandidates();
			GlobalEventManager.igniteOnKillSphereSearch.FilterCandidatesByHurtBoxTeam(TeamMask.GetUnprotectedTeams(attackerBody.teamComponent.teamIndex));
			GlobalEventManager.igniteOnKillSphereSearch.FilterCandidatesByDistinctHurtBoxEntities();
			GlobalEventManager.igniteOnKillSphereSearch.OrderCandidatesByDistance();
			GlobalEventManager.igniteOnKillSphereSearch.GetHurtBoxes(GlobalEventManager.igniteOnKillHurtBoxBuffer);
			GlobalEventManager.igniteOnKillSphereSearch.ClearCandidates();
			float num2 = 1.5f * attackerBody.damage;
			EffectManager.SpawnEffect(CommonAssets.igniteOnKillExplosionEffectPrefab, new EffectData
			{
				origin = corePosition,
				scale = num,
				rotation = new Quaternion(0f, 0f, 0f, 1f)
			}, true);
			for (int i = 0; i < GlobalEventManager.igniteOnKillHurtBoxBuffer.Count; i++)
			{
				HurtBox val = GlobalEventManager.igniteOnKillHurtBoxBuffer[i];
				if (Object.op_Implicit((Object)(object)val.healthComponent))
				{
					GameObject gameObject = ((Component)val.healthComponent).gameObject;
					UpgradeExistingBurns(gameObject, attackerBody);
					float num3 = 1 + ignitionTankCount * 3;
					InflictDotInfo val2 = default(InflictDotInfo);
					val2.victimObject = gameObject;
					val2.attackerObject = ((Component)attackerBody).gameObject;
					val2.totalDamage = num2 * num3;
					val2.dotIndex = (DotIndex)7;
					val2.damageMultiplier = num3;
					InflictDotInfo val3 = val2;
					DotController.InflictDot(ref val3);
				}
			}
			GlobalEventManager.igniteOnKillHurtBoxBuffer.Clear();
		}

		private static void UpgradeExistingBurns(GameObject victim, CharacterBody attacker)
		{
			//IL_0069: 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_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			DotController val = DotController.FindDotController(victim);
			int itemCount = attacker.inventory.GetItemCount(Items.StrengthenBurn);
			if (!Object.op_Implicit((Object)(object)val))
			{
				return;
			}
			DotIndex[] source = (DotIndex[])(object)new DotIndex[2]
			{
				(DotIndex)1,
				(DotIndex)2
			};
			Log.LogInfo("Pre inflict info: ");
			for (int num = val.dotStackList.Count - 1; num >= 0; num--)
			{
				if (source.Contains(val.dotStackList[num].dotIndex))
				{
					DotStack val2 = val.dotStackList[num];
					float num2 = 1 + 3 * itemCount;
					InflictDotInfo val3 = default(InflictDotInfo);
					val3.victimObject = victim;
					val3.attackerObject = ((Component)attacker).gameObject;
					val3.totalDamage = val2.damage / val2.dotDef.interval * val2.timer * num2;
					val3.dotIndex = (DotIndex)7;
					val3.damageMultiplier = num2;
					InflictDotInfo val4 = val3;
					string text = val2.damage.ToString();
					float? totalDamage = val4.totalDamage;
					Log.LogInfo("Stack damage: " + text + ", totalDamage: " + totalDamage);
					Log.LogInfo("Burn upgraded at i = " + num + "with timer: " + val2.timer + " and duration: " + val2.totalDuration + " and new duration: " + val4.duration);
					DotController.InflictDot(ref val4);
					val.RemoveDotStackAtServer(num);
				}
			}
			Log.LogInfo("Total DOT recap: ");
			for (int num3 = val.dotStackList.Count - 1; num3 >= 0; num3--)
			{
				DotStack val5 = val.dotStackList[num3];
				Log.LogInfo(((object)(DotIndex)(ref val5.dotIndex)).ToString() + " exists at i = " + num3 + "with timer: " + val5.timer + " and duration: " + val5.totalDuration);
				Log.LogInfo("Damage: " + val5.damage + "Total damage?: " + val5.damage / val5.dotDef.interval * val5.timer);
			}
		}

		private static void UpdateText()
		{
			LanguageAPI.Add("ITEM_STRENGTHENBURN_DESC", "Jumping near an enemy burns them for <style=cIsDamage>150%</style> damage. Victims take an additional <style=cIsDamage>300%</style> <style=cStack>(+300% per stack)</style> damage from burn effects. ");
			LanguageAPI.Add("ITEM_STRENGTHENBURN_PICKUP", "Jumping near an enemy burns them and causes them to take quadruple burn damage.");
		}
	}
	public class LeechingSeedBuff
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

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

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

			public static Action<DamageInfo> <>9__0_4;

			public static Manipulator <>9__0_0;

			internal void <Init>b__0_0(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_007c: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				int num3 = default(int);
				int num2 = default(int);
				val.TryGotoNext(new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num3),
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<HealthComponent>(x, "combinedHealth"),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num2)
				});
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<Action<DamageInfo>>((Action<DamageInfo>)delegate(DamageInfo damageInfo)
				{
					//IL_00b2: 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_00cd: Unknown result type (might be due to invalid IL or missing references)
					if (damageInfo != null && !((Object)(object)damageInfo.attacker == (Object)null))
					{
						CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
						CharacterMaster val2 = ((component != null) ? component.master : null);
						Inventory val3 = ((val2 != null) ? val2.inventory : null);
						if ((Object)(object)val3 != (Object)null && !((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)6))
						{
							int itemCount = val3.GetItemCount(Items.Seed);
							if (itemCount > 0)
							{
								HealthComponent val4 = ((component != null) ? ((Component)component).GetComponent<HealthComponent>() : null);
								if ((Object)(object)val4 != (Object)null && Object.op_Implicit((Object)(object)val4))
								{
									ProcChainMask procChainMask = damageInfo.procChainMask;
									((ProcChainMask)(ref procChainMask)).AddProc((ProcType)6);
									double num = val4.Heal((float)itemCount * 0.2f, procChainMask, true);
								}
							}
						}
					}
				});
			}

			internal bool <Init>b__0_1(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdarg(x, ref num);
			}

			internal bool <Init>b__0_2(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<HealthComponent>(x, "combinedHealth");
			}

			internal bool <Init>b__0_3(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchStloc(x, ref num);
			}

			internal void <Init>b__0_4(DamageInfo damageInfo)
			{
				//IL_00b2: 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_00cd: Unknown result type (might be due to invalid IL or missing references)
				if (damageInfo == null || (Object)(object)damageInfo.attacker == (Object)null)
				{
					return;
				}
				CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
				CharacterMaster val = ((component != null) ? component.master : null);
				Inventory val2 = ((val != null) ? val.inventory : null);
				if (!((Object)(object)val2 != (Object)null) || ((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)6))
				{
					return;
				}
				int itemCount = val2.GetItemCount(Items.Seed);
				if (itemCount > 0)
				{
					HealthComponent val3 = ((component != null) ? ((Component)component).GetComponent<HealthComponent>() : null);
					if ((Object)(object)val3 != (Object)null && Object.op_Implicit((Object)(object)val3))
					{
						ProcChainMask procChainMask = damageInfo.procChainMask;
						((ProcChainMask)(ref procChainMask)).AddProc((ProcType)6);
						double num = val3.Heal((float)itemCount * 0.2f, procChainMask, true);
					}
				}
			}
		}

		public static void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			try
			{
				object obj = <>c.<>9__0_0;
				if (obj == null)
				{
					Manipulator val = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_007c: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val2 = new ILCursor(il);
						int num3 = default(int);
						int num2 = default(int);
						val2.TryGotoNext(new Func<Instruction, bool>[3]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num3),
							(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<HealthComponent>(x, "combinedHealth"),
							(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num2)
						});
						val2.Emit(OpCodes.Ldarg_1);
						val2.EmitDelegate<Action<DamageInfo>>((Action<DamageInfo>)delegate(DamageInfo damageInfo)
						{
							//IL_00b2: 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_00cd: Unknown result type (might be due to invalid IL or missing references)
							if (damageInfo != null && !((Object)(object)damageInfo.attacker == (Object)null))
							{
								CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
								CharacterMaster val3 = ((component != null) ? component.master : null);
								Inventory val4 = ((val3 != null) ? val3.inventory : null);
								if ((Object)(object)val4 != (Object)null && !((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)6))
								{
									int itemCount = val4.GetItemCount(Items.Seed);
									if (itemCount > 0)
									{
										HealthComponent val5 = ((component != null) ? ((Component)component).GetComponent<HealthComponent>() : null);
										if ((Object)(object)val5 != (Object)null && Object.op_Implicit((Object)(object)val5))
										{
											ProcChainMask procChainMask = damageInfo.procChainMask;
											((ProcChainMask)(ref procChainMask)).AddProc((ProcType)6);
											double num = val5.Heal((float)itemCount * 0.2f, procChainMask, true);
										}
									}
								}
							}
						});
					};
					<>c.<>9__0_0 = val;
					obj = (object)val;
				}
				HealthComponent.TakeDamageProcess += (Manipulator)obj;
				UpdateText();
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		private static void UpdateText()
		{
			LanguageAPI.Add("ITEM_SEED_DESC", "Proc damage <style=cIsHealing>heals</style> you for  <style=cIsHealing>1</style> <style=cStack>(+1 per stack)</style>, <style=cIsHealing>health</style>. Also heals for <style=cIsHealing>0.2</style> <style=cStack>(+0.2 per stack)</style>on all damage instances.");
		}
	}
	public static class LeptonDaisyBuff
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

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

			public static Action<HealthComponent> <>9__0_5;

			public static Manipulator <>9__0_0;

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

			public static Manipulator <>9__0_1;

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

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

			public static Func<float, float, float> <>9__0_9;

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

			public static Manipulator <>9__0_2;

			internal void <Init>b__0_0(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0069: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				int num2 = default(int);
				int num = default(int);
				val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num2),
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num)
				});
				val.Index += 3;
				val.Emit(OpCodes.Ldloc_2);
				val.EmitDelegate<Action<HealthComponent>>((Action<HealthComponent>)delegate(HealthComponent healthComponent)
				{
					Util.CleanseBody(healthComponent.body, true, false, true, true, true, true);
				});
			}

			internal bool <Init>b__0_3(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdarg(x, ref num);
			}

			internal bool <Init>b__0_4(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdloc(x, ref num);
			}

			internal void <Init>b__0_5(HealthComponent healthComponent)
			{
				Util.CleanseBody(healthComponent.body, true, false, true, true, true, true);
			}

			internal void <Init>b__0_1(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val = new ILCursor(il);
				float num = default(float);
				val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num)
				});
				val.Next.Operand = 0.35f;
			}

			internal bool <Init>b__0_6(Instruction x)
			{
				float num = default(float);
				return ILPatternMatchingExt.MatchLdcR4(x, ref num);
			}

			internal void <Init>b__0_2(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_0102: 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)
				ILCursor val = new ILCursor(il);
				int num = default(int);
				val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num)
				});
				val.Emit(OpCodes.Ldc_I4_2);
				val.Emit(OpCodes.Mul);
				val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchMul(x)
				});
				int index = val.Index;
				val.Index = index + 1;
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<Func<float, float, float>>((Func<float, float, float>)((float nextPulseFraction, float prevPulseFraction) => (prevPulseFraction < 0.01f) ? 0.01f : nextPulseFraction));
				val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0)
				});
				index = val.Index;
				val.Index = index + 1;
				val.Emit(OpCodes.Ldc_I4_2);
				val.Emit(OpCodes.Mul);
			}

			internal bool <Init>b__0_7(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdcI4(x, ref num);
			}

			internal bool <Init>b__0_8(Instruction x)
			{
				return ILPatternMatchingExt.MatchMul(x);
			}

			internal float <Init>b__0_9(float nextPulseFraction, float prevPulseFraction)
			{
				if (prevPulseFraction < 0.01f)
				{
					return 0.01f;
				}
				return nextPulseFraction;
			}

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

		public static void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//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_0046: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			try
			{
				object obj = <>c.<>9__0_0;
				if (obj == null)
				{
					Manipulator val = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_0069: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val6 = new ILCursor(il);
						int num4 = default(int);
						int num3 = default(int);
						val6.TryGotoNext(new Func<Instruction, bool>[2]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num4),
							(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3)
						});
						val6.Index += 3;
						val6.Emit(OpCodes.Ldloc_2);
						val6.EmitDelegate<Action<HealthComponent>>((Action<HealthComponent>)delegate(HealthComponent healthComponent)
						{
							Util.CleanseBody(healthComponent.body, true, false, true, true, true, true);
						});
					};
					<>c.<>9__0_0 = val;
					obj = (object)val;
				}
				HealPulse.Update += (Manipulator)obj;
				object obj2 = <>c.<>9__0_1;
				if (obj2 == null)
				{
					Manipulator val2 = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						ILCursor val5 = new ILCursor(il);
						float num2 = default(float);
						val5.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num2)
						});
						val5.Next.Operand = 0.35f;
					};
					<>c.<>9__0_1 = val2;
					obj2 = (object)val2;
				}
				TeleporterHealNovaPulse.OnEnter += (Manipulator)obj2;
				object obj3 = <>c.<>9__0_2;
				if (obj3 == null)
				{
					Manipulator val3 = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_0038: Unknown result type (might be due to invalid IL or missing references)
						//IL_0044: Unknown result type (might be due to invalid IL or missing references)
						//IL_0090: Unknown result type (might be due to invalid IL or missing references)
						//IL_0102: 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)
						ILCursor val4 = new ILCursor(il);
						int num = default(int);
						val4.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num)
						});
						val4.Emit(OpCodes.Ldc_I4_2);
						val4.Emit(OpCodes.Mul);
						val4.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchMul(x)
						});
						int index = val4.Index;
						val4.Index = index + 1;
						val4.Emit(OpCodes.Ldarg_1);
						val4.EmitDelegate<Func<float, float, float>>((Func<float, float, float>)((float nextPulseFraction, float prevPulseFraction) => (prevPulseFraction < 0.01f) ? 0.01f : nextPulseFraction));
						val4.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0)
						});
						index = val4.Index;
						val4.Index = index + 1;
						val4.Emit(OpCodes.Ldc_I4_2);
						val4.Emit(OpCodes.Mul);
					};
					<>c.<>9__0_2 = val3;
					obj3 = (object)val3;
				}
				TeleporterHealNovaGeneratorMain.CalculateNextPulseFraction += (Manipulator)obj3;
				UpdateText();
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		private static void UpdateText()
		{
			LanguageAPI.Add("ITEM_TPHEALINGNOVA_DESC", "Release a <style=cIsHealing>healing nova</style> during the Teleporter event, <style=cIsHealing>cleansing</style> and <style=cIsHealing>healing</style> all nearby allies for <style=cIsHealing>35%</style> of their maximum health. Occurs <style=cIsHealing>3</style> <style=cStack>(+2 per stack)</style> times.");
		}
	}
	internal class OldGuillotineBuff
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

			public static Manipulator <>9__0_0;

			internal void <Init>b__0_0(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val = new ILCursor(il);
				val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 13f)
				});
				val.Next.Operand = 25f;
			}

			internal bool <Init>b__0_1(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdcR4(x, 13f);
			}
		}

		public static void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			try
			{
				object obj = <>c.<>9__0_0;
				if (obj == null)
				{
					Manipulator val = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						ILCursor val2 = new ILCursor(il);
						val2.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 13f)
						});
						val2.Next.Operand = 25f;
					};
					<>c.<>9__0_0 = val;
					obj = (object)val;
				}
				CharacterBody.OnInventoryChanged += (Manipulator)obj;
				UpdateText();
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		private static void UpdateText()
		{
			LanguageAPI.Add("ITEM_EXECUTELOWHEALTHELITE_DESC", "Instantly kill Elite monsters below <style=cIsDamage>20%</style> <style=cStack>(+20% hyperbolically per stack)</style> <style=cIsDamage>health</style>. In other words, a <style=cIsDamage>25%</style> <style=cStack>(+25% per stack)</style> damage increase to elites.");
		}
	}
	public static class RedWhipBuff
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

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

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

			public static Manipulator <>9__0_0;

			internal void <Init>b__0_0(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val = new ILCursor(il);
				val.TryGotoNext(new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchConvR4(x),
					(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.3f),
					(Instruction x) => ILPatternMatchingExt.MatchMul(x)
				});
				int index = val.Index;
				val.Index = index + 1;
				val.Next.Operand = 0.4f;
			}

			internal bool <Init>b__0_1(Instruction x)
			{
				return ILPatternMatchingExt.MatchConvR4(x);
			}

			internal bool <Init>b__0_2(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdcR4(x, 0.3f);
			}

			internal bool <Init>b__0_3(Instruction x)
			{
				return ILPatternMatchingExt.MatchMul(x);
			}
		}

		public static void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			try
			{
				object obj = <>c.<>9__0_0;
				if (obj == null)
				{
					Manipulator val = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						ILCursor val2 = new ILCursor(il);
						val2.TryGotoNext(new Func<Instruction, bool>[3]
						{
							(Instruction x) => ILPatternMatchingExt.MatchConvR4(x),
							(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.3f),
							(Instruction x) => ILPatternMatchingExt.MatchMul(x)
						});
						int index = val2.Index;
						val2.Index = index + 1;
						val2.Next.Operand = 0.4f;
					};
					<>c.<>9__0_0 = val;
					obj = (object)val;
				}
				CharacterBody.RecalculateStats += (Manipulator)obj;
				UpdateText();
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		public static void UpdateText()
		{
			LanguageAPI.Add("ITEM_SPRINTOUTOFCOMBAT_DESC", "Leaving combat boosts your <style=cIsUtility>movement speed</style> by <style=cIsUtility>40%</style> <style=cStack>(+40% per stack)</style>.");
		}
	}
	internal class RegeneratingScrapBuff
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

			public static Action<ScrapperController> <>9__0_2;

			public static Manipulator <>9__0_0;

			internal void <Init>b__0_0(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0047: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchAdd(x)
				});
				val.Index += 2;
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Action<ScrapperController>>((Action<ScrapperController>)delegate(ScrapperController scrapper)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_000c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0058: 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)
					if (scrapper.lastScrappedItemIndex == Items.RegeneratingScrap.itemIndex)
					{
						CharacterBody component = ((Component)scrapper.interactor).GetComponent<CharacterBody>();
						for (int i = 0; i < scrapper.itemsEaten; i++)
						{
							component.inventory.GiveItem(Items.RegeneratingScrapConsumed, 1);
						}
						CharacterMasterNotificationQueue.SendTransformNotification(component.master, Items.RegeneratingScrap.itemIndex, Items.RegeneratingScrapConsumed.itemIndex, (TransformationType)5);
					}
				});
			}

			internal bool <Init>b__0_1(Instruction x)
			{
				return ILPatternMatchingExt.MatchAdd(x);
			}

			internal void <Init>b__0_2(ScrapperController scrapper)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: 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)
				if (scrapper.lastScrappedItemIndex == Items.RegeneratingScrap.itemIndex)
				{
					CharacterBody component = ((Component)scrapper.interactor).GetComponent<CharacterBody>();
					for (int i = 0; i < scrapper.itemsEaten; i++)
					{
						component.inventory.GiveItem(Items.RegeneratingScrapConsumed, 1);
					}
					CharacterMasterNotificationQueue.SendTransformNotification(component.master, Items.RegeneratingScrap.itemIndex, Items.RegeneratingScrapConsumed.itemIndex, (TransformationType)5);
				}
			}
		}

		public static void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			try
			{
				object obj = <>c.<>9__0_0;
				if (obj == null)
				{
					Manipulator val = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_0047: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val2 = new ILCursor(il);
						val2.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchAdd(x)
						});
						val2.Index += 2;
						val2.Emit(OpCodes.Ldarg_0);
						val2.EmitDelegate<Action<ScrapperController>>((Action<ScrapperController>)delegate(ScrapperController scrapper)
						{
							//IL_0002: Unknown result type (might be due to invalid IL or missing references)
							//IL_000c: Unknown result type (might be due to invalid IL or missing references)
							//IL_0058: 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)
							if (scrapper.lastScrappedItemIndex == Items.RegeneratingScrap.itemIndex)
							{
								CharacterBody component = ((Component)scrapper.interactor).GetComponent<CharacterBody>();
								for (int i = 0; i < scrapper.itemsEaten; i++)
								{
									component.inventory.GiveItem(Items.RegeneratingScrapConsumed, 1);
								}
								CharacterMasterNotificationQueue.SendTransformNotification(component.master, Items.RegeneratingScrap.itemIndex, Items.RegeneratingScrapConsumed.itemIndex, (TransformationType)5);
							}
						});
					};
					<>c.<>9__0_0 = val;
					obj = (object)val;
				}
				ScrapperController.BeginScrapping += (Manipulator)obj;
				UpdateText();
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		private static void UpdateText()
		{
		}
	}
	public class SquidPolypBuff
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

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

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

			public static Action<HealthComponent> <>9__0_4;

			public static Manipulator <>9__0_0;

			internal void <Init>b__0_0(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_008b: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				int num2 = default(int);
				int num = default(int);
				MethodReference val2 = default(MethodReference);
				val.TryGotoNext(new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2),
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val2)
				});
				val.Index += 3;
				val.Emit(OpCodes.Ldloc_0);
				val.EmitDelegate<Action<HealthComponent>>((Action<HealthComponent>)delegate(HealthComponent healthComponent)
				{
					CharacterBody body = healthComponent.body;
					if (body != null)
					{
						body.AddTimedBuff(Buffs.BeetleJuice, 2f);
					}
				});
			}

			internal bool <Init>b__0_1(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdloc(x, ref num);
			}

			internal bool <Init>b__0_2(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdloc(x, ref num);
			}

			internal bool <Init>b__0_3(Instruction x)
			{
				MethodReference val = default(MethodReference);
				return ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val);
			}

			internal void <Init>b__0_4(HealthComponent healthComponent)
			{
				CharacterBody body = healthComponent.body;
				if (body != null)
				{
					body.AddTimedBuff(Buffs.BeetleJuice, 2f);
				}
			}
		}

		public static void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			try
			{
				object obj = <>c.<>9__0_0;
				if (obj == null)
				{
					Manipulator val = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_008b: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val2 = new ILCursor(il);
						int num2 = default(int);
						int num = default(int);
						MethodReference val3 = default(MethodReference);
						val2.TryGotoNext(new Func<Instruction, bool>[3]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2),
							(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
							(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val3)
						});
						val2.Index += 3;
						val2.Emit(OpCodes.Ldloc_0);
						val2.EmitDelegate<Action<HealthComponent>>((Action<HealthComponent>)delegate(HealthComponent healthComponent)
						{
							CharacterBody body = healthComponent.body;
							if (body != null)
							{
								body.AddTimedBuff(Buffs.BeetleJuice, 2f);
							}
						});
					};
					<>c.<>9__0_0 = val;
					obj = (object)val;
				}
				SquidOrb.OnArrival += (Manipulator)obj;
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}
	}
}
namespace VanillaItemTweaks.Legendary
{
	internal class HappiestMaskBehavior : ItemBehavior
	{
		private CharacterBody _ghost;

		private void OnDisable()
		{
			if (Object.op_Implicit((Object)(object)_ghost) && (Object)(object)_ghost.healthComponent != (Object)null)
			{
				_ghost.healthComponent.health = 0f;
			}
		}

		public bool HasGhost()
		{
			return Object.op_Implicit((Object)(object)_ghost);
		}

		public void SetGhost(CharacterBody newGhost)
		{
			_ghost = newGhost;
		}
	}
	public static class HappiestMaskRework
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Action <>9__0_0;

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

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

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

			public static Action<CharacterBody> <>9__0_6;

			public static Manipulator <>9__0_1;

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

			public static Func<DamageReport, bool> <>9__0_8;

			public static Action<CharacterBody, DamageReport> <>9__0_9;

			public static Manipulator <>9__0_2;

			internal void <Init>b__0_0()
			{
				List<ItemTag> list = Items.GhostOnKill.tags.ToList();
				list.Add((ItemTag)13);
				Items.GhostOnKill.tags = list.ToArray();
			}

			internal void <Init>b__0_1(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_007c: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				int num2 = default(int);
				int num = default(int);
				val.TryGotoNext(new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num2),
					(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num),
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "inventory")
				});
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Action<CharacterBody>>((Action<CharacterBody>)delegate(CharacterBody body)
				{
					body.AddItemBehavior<HappiestMaskBehavior>(body.inventory.GetItemCount(Items.GhostOnKill));
				});
			}

			internal bool <Init>b__0_3(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdarg(x, ref num);
			}

			internal bool <Init>b__0_4(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdarg(x, ref num);
			}

			internal bool <Init>b__0_5(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "inventory");
			}

			internal void <Init>b__0_6(CharacterBody body)
			{
				body.AddItemBehavior<HappiestMaskBehavior>(body.inventory.GetItemCount(Items.GhostOnKill));
			}

			internal void <Init>b__0_2(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 7f)
				});
				val.RemoveRange(3);
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<Func<DamageReport, bool>>((Func<DamageReport, bool>)delegate(DamageReport damageReport)
				{
					HappiestMaskBehavior component = damageReport.attacker.GetComponent<HappiestMaskBehavior>();
					Log.LogDebug("Behavior null?: " + (object)component == ". Has ghost?: " + component.HasGhost());
					return (Object)(object)component != (Object)null && !component.HasGhost();
				});
				val.Index += 3;
				val.Remove();
				int index = val.Index;
				val.Index = index + 1;
				val.Remove();
				index = val.Index;
				val.Index = index + 1;
				val.Remove();
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<Action<CharacterBody, DamageReport>>((Action<CharacterBody, DamageReport>)delegate(CharacterBody ghostBody, DamageReport damageReport)
				{
					if ((Object)(object)ghostBody != (Object)null)
					{
						damageReport.attacker.GetComponent<HappiestMaskBehavior>().SetGhost(ghostBody);
						ghostBody.master.inventory.GiveItem(Items.BoostDamage, 75 * damageReport.attackerBody.inventory.GetItemCount(Items.GhostOnKill) - 150);
					}
				});
			}

			internal bool <Init>b__0_7(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdcR4(x, 7f);
			}

			internal bool <Init>b__0_8(DamageReport damageReport)
			{
				HappiestMaskBehavior component = damageReport.attacker.GetComponent<HappiestMaskBehavior>();
				Log.LogDebug("Behavior null?: " + (object)component == ". Has ghost?: " + component.HasGhost());
				return (Object)(object)component != (Object)null && !component.HasGhost();
			}

			internal void <Init>b__0_9(CharacterBody ghostBody, DamageReport damageReport)
			{
				if ((Object)(object)ghostBody != (Object)null)
				{
					damageReport.attacker.GetComponent<HappiestMaskBehavior>().SetGhost(ghostBody);
					ghostBody.master.inventory.GiveItem(Items.BoostDamage, 75 * damageReport.attackerBody.inventory.GetItemCount(Items.GhostOnKill) - 150);
				}
			}
		}

		public static void Init()
		{
			//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_0054: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Expected O, but got Unknown
			try
			{
				RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate
				{
					List<ItemTag> list = Items.GhostOnKill.tags.ToList();
					list.Add((ItemTag)13);
					Items.GhostOnKill.tags = list.ToArray();
				});
				object obj = <>c.<>9__0_1;
				if (obj == null)
				{
					Manipulator val = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_007c: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val4 = new ILCursor(il);
						int num2 = default(int);
						int num = default(int);
						val4.TryGotoNext(new Func<Instruction, bool>[3]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num2),
							(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num),
							(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "inventory")
						});
						val4.Emit(OpCodes.Ldarg_0);
						val4.EmitDelegate<Action<CharacterBody>>((Action<CharacterBody>)delegate(CharacterBody body)
						{
							body.AddItemBehavior<HappiestMaskBehavior>(body.inventory.GetItemCount(Items.GhostOnKill));
						});
					};
					<>c.<>9__0_1 = val;
					obj = (object)val;
				}
				CharacterBody.OnInventoryChanged += (Manipulator)obj;
				object obj2 = <>c.<>9__0_2;
				if (obj2 == null)
				{
					Manipulator val2 = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_0040: Unknown result type (might be due to invalid IL or missing references)
						//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val3 = new ILCursor(il);
						val3.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 7f)
						});
						val3.RemoveRange(3);
						val3.Emit(OpCodes.Ldarg_1);
						val3.EmitDelegate<Func<DamageReport, bool>>((Func<DamageReport, bool>)delegate(DamageReport damageReport)
						{
							HappiestMaskBehavior component = damageReport.attacker.GetComponent<HappiestMaskBehavior>();
							Log.LogDebug("Behavior null?: " + (object)component == ". Has ghost?: " + component.HasGhost());
							return (Object)(object)component != (Object)null && !component.HasGhost();
						});
						val3.Index += 3;
						val3.Remove();
						int index = val3.Index;
						val3.Index = index + 1;
						val3.Remove();
						index = val3.Index;
						val3.Index = index + 1;
						val3.Remove();
						val3.Emit(OpCodes.Ldarg_1);
						val3.EmitDelegate<Action<CharacterBody, DamageReport>>((Action<CharacterBody, DamageReport>)delegate(CharacterBody ghostBody, DamageReport damageReport)
						{
							if ((Object)(object)ghostBody != (Object)null)
							{
								damageReport.attacker.GetComponent<HappiestMaskBehavior>().SetGhost(ghostBody);
								ghostBody.master.inventory.GiveItem(Items.BoostDamage, 75 * damageReport.attackerBody.inventory.GetItemCount(Items.GhostOnKill) - 150);
							}
						});
					};
					<>c.<>9__0_2 = val2;
					obj2 = (object)val2;
				}
				GlobalEventManager.OnCharacterDeath += (Manipulator)obj2;
				UpdateText();
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		private static void UpdateText()
		{
			LanguageAPI.Add("ITEM_GHOSTONKILL_DESC", "Killing an enemy will spawn a ghost of the killed enemy with <style=cIsDamage>750%</style><style=cStack>(+750% per stack)</style> damage for <style=cIsDamage>30s</style>. ");
			LanguageAPI.Add("ITEM_GHOSTONKILL_PICKUP", "Killing an enemy spawns a ghost of them.");
		}
	}
	public static class LaserScopeBuff
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static StatHookEventHandler <>9__0_0;

			internal void <Init>b__0_0(CharacterBody sender, StatHookEventArgs args)
			{
				if ((Object)(object)sender.inventory != (Object)null && sender.inventory.GetItemCount(Items.CritDamage) > 0)
				{
					args.critAdd += 15f;
				}
			}
		}

		public static void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			try
			{
				object obj = <>c.<>9__0_0;
				if (obj == null)
				{
					StatHookEventHandler val = delegate(CharacterBody sender, StatHookEventArgs args)
					{
						if ((Object)(object)sender.inventory != (Object)null && sender.inventory.GetItemCount(Items.CritDamage) > 0)
						{
							args.critAdd += 15f;
						}
					};
					<>c.<>9__0_0 = val;
					obj = (object)val;
				}
				RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj;
				UpdateText();
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		private static void UpdateText()
		{
			LanguageAPI.Add("ITEM_CRITDAMAGE_DESC", "Gain <style=cIsDamage>15% critical chance</style>. <style=cIsDamage>Critical Strikes</style> deal an additional <style=cIsDamage>100% damage</style> <style=cStack>(+100% per stack)</style>.");
		}
	}
}
namespace VanillaItemTweaks.Common
{
	public static class WarbannerBuff
	{
		[Serializable]
		[CompilerGenerat