Decompiled source of VanillaItemTweaks v1.0.0

VanillaItemTweaks.dll

Decompiled a week 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 EntityStates.TeleporterHealNovaController;
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 On.EntityStates.TeleporterHealNovaController;
using On.RoR2;
using R2API;
using RoR2;
using RoR2.Orbs;
using RoR2.Projectile;
using UnityEngine;
using UnityEngine.Networking;
using VanillaItemTweaks.Boss;
using VanillaItemTweaks.Common;
using VanillaItemTweaks.Legendary;
using VanillaItemTweaks.Lunar;
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 = ".NET Standard 2.1")]
[assembly: AssemblyCompany("VanillaItemTweaks")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+22d4f578fc76e60c7121f497ea9502dbba6bfd19")]
[assembly: AssemblyProduct("VanillaItemTweaks")]
[assembly: AssemblyTitle("VanillaItemTweaks")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
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;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace 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);
		}

		internal static void LogInstrNotFound(ILContext il)
		{
			LogError("GoToNext instructions not found at method: " + (object)il.Method);
		}
	}
	[BepInPlugin("OakPrime.VanillaItemTweaks", "VanillaItemTweaks", "1.0.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 = "1.0.0";

		public static ManualLogSource logger;

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

		private void Init()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			ConfigFile configFile = new ConfigFile(Paths.ConfigPath + "\\OakPrime.VanillaItemTweaks.cfg", true);
			WarbannerBuff.TryInit(configFile);
			MochaRework.TryInit(configFile);
			StickyBombBuff.TryInit(configFile);
			DeathMarkChoice.TryInit(configFile);
			HuntersHarpoonChoice.TryInit(configFile);
			LeechingSeedBuff.TryInit(configFile);
			LeptonDaisyBuff.TryInit(configFile);
			RedWhipBuff.TryInit(configFile);
			OldGuillotineBuff.TryInit(configFile);
			RegeneratingScrapBuff.TryInit(configFile);
			SquidPolypBuff.TryInit(configFile);
			HappiestMaskRework.TryInit(configFile);
			LaserScopeBuff.TryInit(configFile);
			KnurlBuff.TryInit(configFile);
			PolyluteNerf.TryInit(configFile);
			GestureNerf.TryInit(configFile);
			TranscendenceNerf.TryInit(configFile);
		}
	}
}
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__1_1;

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

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

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

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

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

			public static Manipulator <>9__1_0;

			internal void <Init>b__1_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__1_1(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdloc(x, ref num);
			}

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

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

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

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

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

		public static void TryInit(ConfigFile configFile)
		{
			if (configFile.Bind<bool>("Polylute Nerf", "Enable Polylute Nerf", true, "Reduces Polylute strikes from 3 to 2.").Value)
			{
				Init();
			}
		}

		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__1_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__1_0 = val;
					obj = (object)val;
				}
				GlobalEventManager.ProcessHitEnemy += (Manipulator)obj;
				ReplaceText();
				Log.LogInfo("Added Polylute Nerf");
			}
			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
{
	internal class DeathMarkBehavior : MonoBehaviour
	{
		private float _timer = 0f;

		private float _slowBuildUpSeconds = 4f;

		private CharacterBody _victimBody;

		private int _deathMarkCount = 1;

		public void SetBuildUpSeconds(float buildupSeconds)
		{
			_slowBuildUpSeconds = buildupSeconds;
		}

		private void OnEnable()
		{
			Log.LogDebug("Death Mark Beh OnEnable entered");
			_victimBody = ((Component)this).GetComponent<CharacterBody>();
		}

		public void ApplyMark()
		{
			Log.LogDebug("AppliedMark");
			_victimBody.AddTimedBuff(Buffs.DeathMark, DeathMarkRework._duration * (float)_deathMarkCount);
			_timer = 0f;
		}

		public void TryUpdateCount(int count)
		{
			if (count > _deathMarkCount)
			{
				_deathMarkCount = count;
			}
		}

		private bool IsSlowed()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: 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)
			Log.LogDebug("Check slow");
			HashSet<BuffIndex> hashSet = new HashSet<BuffIndex>
			{
				Buffs.Slow80.buffIndex,
				Buffs.Slow50.buffIndex,
				Buffs.Slow60.buffIndex,
				Buffs.Cripple.buffIndex,
				Buffs.BeetleJuice.buffIndex,
				Buffs.ClayGoo.buffIndex,
				Buffs.Weak.buffIndex
			};
			foreach (TimedBuff timedBuff in _victimBody.timedBuffs)
			{
				if (hashSet.Contains(timedBuff.buffIndex))
				{
					return true;
				}
			}
			return false;
		}

		private void FixedUpdate()
		{
			if (_victimBody.HasBuff(Buffs.Entangle))
			{
				ApplyMark();
			}
			else if (!_victimBody.HasBuff(Buffs.DeathMark) && IsSlowed())
			{
				_timer += Time.deltaTime;
				if (_timer >= _slowBuildUpSeconds)
				{
					ApplyMark();
				}
			}
		}
	}
	internal class DeathMarkChoice
	{
		public static void TryInit(ConfigFile configFile)
		{
			bool value = configFile.Bind<bool>("Death Mark Rework", "Enable Death Mark Rework", true, "Death Mark applies on all hard CC.").Value;
			float value2 = configFile.Bind<float>("Death Mark Rework", "Death Mark Duration", 4f, "Death Mark lasts X (+X per stack) seconds.").Value;
			float value3 = configFile.Bind<float>("Death Mark Rework", "Death Mark Buildup Duration", 4f, "Death Mark can also be applied by slowing target for X seconds.").Value;
			float damageMultiplier = configFile.Bind<float>("Death Mark Rework", "Death Mark Damage Boost", 35f, "Death Mark increases damage to target by X%.").Value / 100f + 1f;
			bool value4 = configFile.Bind<bool>("Death Mark Buff", "Enable Death Mark Buff", false, "Reduces Death Mark debuffs required to 3 and reduces its damage multiplier to 1.35x.").Value;
			float damageMultiplier2 = configFile.Bind<float>("Death Mark Buff", "Death Mark Damage Boost", 35f, "Death Mark increases damage to target by X%.").Value / 100f + 1f;
			int value5 = configFile.Bind<int>("Death Mark Buff", "Death Mark Debuff Count", 3, "Death Mark requires X debuffs to activate.").Value;
			if (value)
			{
				DeathMarkRework.Init(value2, value3, damageMultiplier);
			}
			else if (value4)
			{
				DeathMarkFix.Init(damageMultiplier2, value5);
			}
		}
	}
	public static class DeathMarkFix
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

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

			public static Manipulator <>9__2_0;

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

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

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

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

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

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

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

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

			public static Manipulator <>9__2_1;

			internal void <Init>b__2_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);
				if (!val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 4)
				}))
				{
					Log.LogInstrNotFound(il);
					return;
				}
				int index = val.Index;
				val.Index = index + 1;
				val.EmitDelegate<Func<int, int>>((Func<int, int>)((int num) => _debuffCount));
			}

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

			internal int <Init>b__2_2(int num)
			{
				return _debuffCount;
			}

			internal void <Init>b__2_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 num4 = default(int);
				int num3 = default(int);
				if (!val.TryGotoNext(new Func<Instruction, bool>[4]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num4),
					(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f),
					(Instruction x) => ILPatternMatchingExt.MatchMul(x),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num3)
				}))
				{
					Log.LogInstrNotFound(il);
					return;
				}
				int num2 = default(int);
				int num = default(int);
				if (!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)
				}))
				{
					Log.LogInstrNotFound(il);
					return;
				}
				int index = val.Index;
				val.Index = index + 1;
				val.Next.Operand = _damageMultiplier;
			}

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

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

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

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

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

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

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

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

		public static float _damageMultiplier;

		public static int _debuffCount;

		public static void Init(float damageMultiplier, int debuffCount)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			_damageMultiplier = damageMultiplier;
			_debuffCount = debuffCount;
			try
			{
				object obj = <>c.<>9__2_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 val4 = new ILCursor(il);
						if (!val4.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 4)
						}))
						{
							Log.LogInstrNotFound(il);
						}
						else
						{
							int index2 = val4.Index;
							val4.Index = index2 + 1;
							val4.EmitDelegate<Func<int, int>>((Func<int, int>)((int num) => _debuffCount));
						}
					};
					<>c.<>9__2_0 = val;
					obj = (object)val;
				}
				GlobalEventManager.ProcDeathMark += (Manipulator)obj;
				object obj2 = <>c.<>9__2_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 num5 = default(int);
						int num4 = default(int);
						int num3 = default(int);
						int num2 = default(int);
						if (!val3.TryGotoNext(new Func<Instruction, bool>[4]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num5),
							(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f),
							(Instruction x) => ILPatternMatchingExt.MatchMul(x),
							(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num4)
						}))
						{
							Log.LogInstrNotFound(il);
						}
						else if (!val3.TryGotoNext(new Func<Instruction, bool>[4]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3),
							(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f),
							(Instruction x) => ILPatternMatchingExt.MatchMul(x),
							(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num2)
						}))
						{
							Log.LogInstrNotFound(il);
						}
						else
						{
							int index = val3.Index;
							val3.Index = index + 1;
							val3.Next.Operand = _damageMultiplier;
						}
					};
					<>c.<>9__2_1 = val2;
					obj2 = (object)val2;
				}
				HealthComponent.TakeDamageProcess += (Manipulator)obj2;
				ReplaceText();
				Log.LogInfo("Added Death Mark Buff");
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

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

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

			public static Action<DamageReport> <>9__3_4;

			public static Manipulator <>9__3_0;

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

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

			public static Func<CharacterMaster, DamageInfo, GameObject, CharacterMaster> <>9__3_6;

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

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

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

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

			public static Action<DamageInfo, GameObject> <>9__3_7;

			public static Manipulator <>9__3_1;

			public static Manipulator <>9__3_2;

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

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

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

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

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

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

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

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

			public static Manipulator <>9__3_3;

			internal void <Init>b__3_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_0048: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				string text = default(string);
				if (!val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, ref text)
				}))
				{
					Log.LogInstrNotFound(il);
					return;
				}
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<Action<DamageReport>>((Action<DamageReport>)delegate(DamageReport dmgRep)
				{
					if (dmgRep.attackerMaster.inventory.GetItemCountEffective(Items.DeathMark) > 0)
					{
						dmgRep.victimBody.AddTimedBuff(Buffs.DeathMark, _duration);
					}
				});
			}

			internal bool <Init>b__3_5(Instruction x)
			{
				string text = default(string);
				return ILPatternMatchingExt.MatchLdstr(x, ref text);
			}

			internal void <Init>b__3_4(DamageReport dmgRep)
			{
				if (dmgRep.attackerMaster.inventory.GetItemCountEffective(Items.DeathMark) > 0)
				{
					dmgRep.victimBody.AddTimedBuff(Buffs.DeathMark, _duration);
				}
			}

			internal void <Init>b__3_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_006d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0079: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				int num2 = default(int);
				if (!val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterMaster>(x, "get_inventory"),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num2)
				}))
				{
					Log.LogInstrNotFound(il);
					return;
				}
				val.Emit(OpCodes.Ldarg_1);
				val.Emit(OpCodes.Ldarg_2);
				val.EmitDelegate<Func<CharacterMaster, DamageInfo, GameObject, CharacterMaster>>((Func<CharacterMaster, DamageInfo, GameObject, CharacterMaster>)delegate(CharacterMaster master, DamageInfo dmgInfo, GameObject obj)
				{
					//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
					Log.LogDebug("Entered stungrenade delegate");
					Inventory inventory = master.inventory;
					int itemCountEffective2 = inventory.GetItemCountEffective(Items.StunChanceOnHit);
					Log.LogDebug("inventory: " + ((object)inventory)?.ToString() + "; stunGrenades: " + itemCountEffective2);
					if (inventory.GetItemCountEffective(Items.DeathMark) > 0 && itemCountEffective2 > 0 && (Object)(object)obj.GetComponent<SetStateOnHurt>() == (Object)null && Util.CheckRoll(Util.ConvertAmplificationPercentageIntoReductionPercentage(SetStateOnHurt.stunChanceOnHitBaseChancePercent * (float)itemCountEffective2 * dmgInfo.procCoefficient), master))
					{
						Log.LogDebug("Doing fake stun grenade");
						EffectManager.SimpleImpactEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/ImpactStunGrenade"), dmgInfo.position, -dmgInfo.force, true);
						obj.GetComponent<CharacterBody>().AddTimedBuff(Buffs.DeathMark, _duration);
					}
					return master;
				});
				int num = default(int);
				ILLabel val2 = default(ILLabel);
				if (!val.TryGotoNext(new Func<Instruction, bool>[4]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
					(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC2Content/Buffs", "EliteBeadCorruption"),
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.CharacterBody", "HasBuff"),
					(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val2)
				}))
				{
					Log.LogInstrNotFound(il);
					return;
				}
				int index = val.Index;
				val.Index = index + 1;
				Log.LogDebug("index: " + val.Index);
				Log.LogDebug("next instr: " + (object)val.Next);
				val.Emit(OpCodes.Ldarg_1);
				val.Emit(OpCodes.Ldarg_2);
				val.EmitDelegate<Action<DamageInfo, GameObject>>((Action<DamageInfo, GameObject>)delegate(DamageInfo dmgInfo, GameObject obj)
				{
					Log.LogDebug("Entered deathmark delegate");
					CharacterBody component = obj.GetComponent<CharacterBody>();
					int itemCountEffective = dmgInfo.attacker.GetComponent<CharacterBody>().inventory.GetItemCountEffective(Items.DeathMark);
					Log.LogDebug("count: " + itemCountEffective);
					if (itemCountEffective <= 0)
					{
						Log.LogDebug("no deathmarks");
					}
					else
					{
						DeathMarkBehavior deathMarkBehavior = obj.GetComponent<DeathMarkBehavior>();
						if ((Object)(object)deathMarkBehavior == (Object)null)
						{
							deathMarkBehavior = obj.AddComponent<DeathMarkBehavior>();
							deathMarkBehavior.SetBuildUpSeconds(_slowBuildUpDuration);
							Log.LogDebug("Added deathMarkBehavior");
							Log.LogDebug("Deathmark behavior parent disabled: " + obj.activeInHierarchy);
						}
						deathMarkBehavior.TryUpdateCount(itemCountEffective);
						if (IsHardCCDamageType(dmgInfo))
						{
							deathMarkBehavior.ApplyMark();
						}
					}
				});
			}

			internal bool <Init>b__3_8(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterMaster>(x, "get_inventory");
			}

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

			internal CharacterMaster <Init>b__3_6(CharacterMaster master, DamageInfo dmgInfo, GameObject obj)
			{
				//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
				Log.LogDebug("Entered stungrenade delegate");
				Inventory inventory = master.inventory;
				int itemCountEffective = inventory.GetItemCountEffective(Items.StunChanceOnHit);
				Log.LogDebug("inventory: " + ((object)inventory)?.ToString() + "; stunGrenades: " + itemCountEffective);
				if (inventory.GetItemCountEffective(Items.DeathMark) > 0 && itemCountEffective > 0 && (Object)(object)obj.GetComponent<SetStateOnHurt>() == (Object)null && Util.CheckRoll(Util.ConvertAmplificationPercentageIntoReductionPercentage(SetStateOnHurt.stunChanceOnHitBaseChancePercent * (float)itemCountEffective * dmgInfo.procCoefficient), master))
				{
					Log.LogDebug("Doing fake stun grenade");
					EffectManager.SimpleImpactEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/ImpactStunGrenade"), dmgInfo.position, -dmgInfo.force, true);
					obj.GetComponent<CharacterBody>().AddTimedBuff(Buffs.DeathMark, _duration);
				}
				return master;
			}

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

			internal bool <Init>b__3_11(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC2Content/Buffs", "EliteBeadCorruption");
			}

			internal bool <Init>b__3_12(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.CharacterBody", "HasBuff");
			}

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

			internal void <Init>b__3_7(DamageInfo dmgInfo, GameObject obj)
			{
				Log.LogDebug("Entered deathmark delegate");
				CharacterBody component = obj.GetComponent<CharacterBody>();
				int itemCountEffective = dmgInfo.attacker.GetComponent<CharacterBody>().inventory.GetItemCountEffective(Items.DeathMark);
				Log.LogDebug("count: " + itemCountEffective);
				if (itemCountEffective <= 0)
				{
					Log.LogDebug("no deathmarks");
					return;
				}
				DeathMarkBehavior deathMarkBehavior = obj.GetComponent<DeathMarkBehavior>();
				if ((Object)(object)deathMarkBehavior == (Object)null)
				{
					deathMarkBehavior = obj.AddComponent<DeathMarkBehavior>();
					deathMarkBehavior.SetBuildUpSeconds(_slowBuildUpDuration);
					Log.LogDebug("Added deathMarkBehavior");
					Log.LogDebug("Deathmark behavior parent disabled: " + obj.activeInHierarchy);
				}
				deathMarkBehavior.TryUpdateCount(itemCountEffective);
				if (IsHardCCDamageType(dmgInfo))
				{
					deathMarkBehavior.ApplyMark();
				}
			}

			internal void <Init>b__3_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_0009: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				val.Emit(OpCodes.Ret);
			}

			internal void <Init>b__3_3(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 num4 = default(int);
				int num3 = default(int);
				if (!val.TryGotoNext(new Func<Instruction, bool>[4]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num4),
					(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f),
					(Instruction x) => ILPatternMatchingExt.MatchMul(x),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num3)
				}))
				{
					Log.LogInstrNotFound(il);
					return;
				}
				int num2 = default(int);
				int num = default(int);
				if (!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)
				}))
				{
					Log.LogInstrNotFound(il);
					return;
				}
				int index = val.Index;
				val.Index = index + 1;
				Log.LogDebug("Dmark coeff: " + val.Next.Operand);
				val.Next.Operand = _damageMultiplier;
				Log.LogDebug("Dmark coeff updated: " + val.Next.Operand);
			}

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

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

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

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

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

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

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

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

		public static float _duration;

		public static float _slowBuildUpDuration;

		public static float _damageMultiplier;

		public static void Init(float duration, float slowBulidUpDuration, float damageMultiplier)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			_duration = duration;
			_slowBuildUpDuration = slowBulidUpDuration;
			_damageMultiplier = damageMultiplier;
			try
			{
				object obj2 = <>c.<>9__3_0;
				if (obj2 == 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_0048: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val9 = new ILCursor(il);
						string text = default(string);
						if (!val9.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, ref text)
						}))
						{
							Log.LogInstrNotFound(il);
						}
						else
						{
							val9.Emit(OpCodes.Ldarg_1);
							val9.EmitDelegate<Action<DamageReport>>((Action<DamageReport>)delegate(DamageReport dmgRep)
							{
								if (dmgRep.attackerMaster.inventory.GetItemCountEffective(Items.DeathMark) > 0)
								{
									dmgRep.victimBody.AddTimedBuff(Buffs.DeathMark, _duration);
								}
							});
						}
					};
					<>c.<>9__3_0 = val;
					obj2 = (object)val;
				}
				SetStateOnHurt.OnTakeDamageServer += (Manipulator)obj2;
				object obj3 = <>c.<>9__3_1;
				if (obj3 == 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_006d: Unknown result type (might be due to invalid IL or missing references)
						//IL_0079: Unknown result type (might be due to invalid IL or missing references)
						//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
						//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val7 = new ILCursor(il);
						int num6 = default(int);
						if (!val7.TryGotoNext(new Func<Instruction, bool>[2]
						{
							(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterMaster>(x, "get_inventory"),
							(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num6)
						}))
						{
							Log.LogInstrNotFound(il);
						}
						else
						{
							val7.Emit(OpCodes.Ldarg_1);
							val7.Emit(OpCodes.Ldarg_2);
							val7.EmitDelegate<Func<CharacterMaster, DamageInfo, GameObject, CharacterMaster>>((Func<CharacterMaster, DamageInfo, GameObject, CharacterMaster>)delegate(CharacterMaster master, DamageInfo dmgInfo, GameObject obj)
							{
								//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
								//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
								//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
								Log.LogDebug("Entered stungrenade delegate");
								Inventory inventory = master.inventory;
								int itemCountEffective2 = inventory.GetItemCountEffective(Items.StunChanceOnHit);
								Log.LogDebug("inventory: " + ((object)inventory)?.ToString() + "; stunGrenades: " + itemCountEffective2);
								if (inventory.GetItemCountEffective(Items.DeathMark) > 0 && itemCountEffective2 > 0 && (Object)(object)obj.GetComponent<SetStateOnHurt>() == (Object)null && Util.CheckRoll(Util.ConvertAmplificationPercentageIntoReductionPercentage(SetStateOnHurt.stunChanceOnHitBaseChancePercent * (float)itemCountEffective2 * dmgInfo.procCoefficient), master))
								{
									Log.LogDebug("Doing fake stun grenade");
									EffectManager.SimpleImpactEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/ImpactStunGrenade"), dmgInfo.position, -dmgInfo.force, true);
									obj.GetComponent<CharacterBody>().AddTimedBuff(Buffs.DeathMark, _duration);
								}
								return master;
							});
							int num5 = default(int);
							ILLabel val8 = default(ILLabel);
							if (!val7.TryGotoNext(new Func<Instruction, bool>[4]
							{
								(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num5),
								(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC2Content/Buffs", "EliteBeadCorruption"),
								(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.CharacterBody", "HasBuff"),
								(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val8)
							}))
							{
								Log.LogInstrNotFound(il);
							}
							else
							{
								int index2 = val7.Index;
								val7.Index = index2 + 1;
								Log.LogDebug("index: " + val7.Index);
								Log.LogDebug("next instr: " + (object)val7.Next);
								val7.Emit(OpCodes.Ldarg_1);
								val7.Emit(OpCodes.Ldarg_2);
								val7.EmitDelegate<Action<DamageInfo, GameObject>>((Action<DamageInfo, GameObject>)delegate(DamageInfo dmgInfo, GameObject obj)
								{
									Log.LogDebug("Entered deathmark delegate");
									CharacterBody component = obj.GetComponent<CharacterBody>();
									int itemCountEffective = dmgInfo.attacker.GetComponent<CharacterBody>().inventory.GetItemCountEffective(Items.DeathMark);
									Log.LogDebug("count: " + itemCountEffective);
									if (itemCountEffective <= 0)
									{
										Log.LogDebug("no deathmarks");
									}
									else
									{
										DeathMarkBehavior deathMarkBehavior = obj.GetComponent<DeathMarkBehavior>();
										if ((Object)(object)deathMarkBehavior == (Object)null)
										{
											deathMarkBehavior = obj.AddComponent<DeathMarkBehavior>();
											deathMarkBehavior.SetBuildUpSeconds(_slowBuildUpDuration);
											Log.LogDebug("Added deathMarkBehavior");
											Log.LogDebug("Deathmark behavior parent disabled: " + obj.activeInHierarchy);
										}
										deathMarkBehavior.TryUpdateCount(itemCountEffective);
										if (IsHardCCDamageType(dmgInfo))
										{
											deathMarkBehavior.ApplyMark();
										}
									}
								});
							}
						}
					};
					<>c.<>9__3_1 = val2;
					obj3 = (object)val2;
				}
				GlobalEventManager.ProcessHitEnemy += (Manipulator)obj3;
				object obj4 = <>c.<>9__3_2;
				if (obj4 == 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_0009: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val6 = new ILCursor(il);
						val6.Emit(OpCodes.Ret);
					};
					<>c.<>9__3_2 = val3;
					obj4 = (object)val3;
				}
				GlobalEventManager.ProcDeathMark += (Manipulator)obj4;
				object obj5 = <>c.<>9__3_3;
				if (obj5 == null)
				{
					Manipulator val4 = 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);
						int num4 = default(int);
						int num3 = default(int);
						int num2 = default(int);
						int num = default(int);
						if (!val5.TryGotoNext(new Func<Instruction, bool>[4]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num4),
							(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f),
							(Instruction x) => ILPatternMatchingExt.MatchMul(x),
							(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num3)
						}))
						{
							Log.LogInstrNotFound(il);
						}
						else if (!val5.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)
						}))
						{
							Log.LogInstrNotFound(il);
						}
						else
						{
							int index = val5.Index;
							val5.Index = index + 1;
							Log.LogDebug("Dmark coeff: " + val5.Next.Operand);
							val5.Next.Operand = _damageMultiplier;
							Log.LogDebug("Dmark coeff updated: " + val5.Next.Operand);
						}
					};
					<>c.<>9__3_3 = val4;
					obj5 = (object)val4;
				}
				HealthComponent.TakeDamageProcess += (Manipulator)obj5;
				ReplaceText();
				Log.LogInfo("Added Death Mark Rework");
			}
			catch (Exception ex)
			{
				VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		private static bool IsHardCCDamageType(DamageInfo dmgInfo)
		{
			//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_0011: 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)
			return DamageTypeCombo.op_Implicit(dmgInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)50364704)) > DamageTypeCombo.op_Implicit(DamageTypeCombo.Generic);
		}

		private static void ReplaceText()
		{
			LanguageAPI.Add("ITEM_DEATHMARK_PICKUP", "Movement-impaired enemies are <style=cIsDamage>marked for death</style>.");
			LanguageAPI.Add("ITEM_DEATHMARK_DESC", "Slowing enemies for " + _slowBuildUpDuration + " seconds <style=cIsDamage>applies Death Mark</style>, increasing damage taken by <style=cIsDamage>" + (_damageMultiplier - 1f) * 100f + "%</style> from all sources for <style=cIsUtility>" + _duration + "</style> <style=cStack>(+" + _duration + " per stack)</style> seconds. Stuns apply Death Mark instantly.");
		}
	}
	internal class HuntersHarpoonBehavior : ItemBehavior
	{
		private const int HUNTERS_HARPOON_COOLDOWN = 3;

		private const float HUNTERS_HARPOON_DURATION = 3f;

		private float _timer = 0f;

		private void OnDisable()
		{
			base.body.ClearTimedBuffs(Buffs.KillMoveSpeed);
		}

		public void TryApplyMovespeed()
		{
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Expected O, but got Unknown
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			int num = Math.Clamp((int)Math.Truncate(_timer), 1, 3);
			Log.LogDebug("BuffCount: " + num);
			_timer = 0f;
			if (num <= 0)
			{
				return;
			}
			int buffCount = base.body.GetBuffCount(Buffs.KillMoveSpeed);
			if (num == buffCount)
			{
				for (int i = 0; i < base.body.timedBuffs.Count; i++)
				{
					TimedBuff val = base.body.timedBuffs[i];
					if (val.buffIndex == Buffs.KillMoveSpeed.buffIndex)
					{
						val.timer = val.totalDuration;
					}
				}
			}
			else
			{
				if (num < buffCount)
				{
					return;
				}
				base.body.ClearTimedBuffs(Buffs.KillMoveSpeed);
				for (int j = 0; j < num; j++)
				{
					CharacterBody body = base.body;
					if (body != null)
					{
						body.AddTimedBuff(Buffs.KillMoveSpeed, 2f * (float)base.stack * (float)Math.Pow(0.75, j));
					}
				}
				EffectData val2 = new EffectData();
				val2.origin = base.body.corePosition;
				CharacterMotor characterMotor = base.body.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 = base.body.transform.rotation;
				}
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/MoveSpeedOnKillActivate"), val2, true);
			}
		}

		private void FixedUpdate()
		{
			if (_timer < 3f)
			{
				_timer += Time.deltaTime;
			}
		}
	}
	public static class HuntersHarpoonBuff
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

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

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

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

			public static Action<DamageReport> <>9__2_2;

			public static Manipulator <>9__2_0;

			internal void <Init>b__2_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_00f0: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				if (!val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill")
				}))
				{
					Log.LogInstrNotFound(il);
					return;
				}
				val.Index += 4;
				val.EmitDelegate<Func<int, int>>((Func<int, int>)((int itemCount) => 0));
				MethodReference val3 = default(MethodReference);
				if (!val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1),
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val3)
				}))
				{
					Log.LogInstrNotFound(il);
					return;
				}
				val.Index += 3;
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<Action<DamageReport>>((Action<DamageReport>)delegate(DamageReport damageReport)
				{
					//IL_0099: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a0: Expected O, but got Unknown
					//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c9: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
					//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
					//IL_0109: Unknown result type (might be due to invalid IL or missing references)
					//IL_010e: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
					CharacterBody attackerBody = damageReport.attackerBody;
					int itemCountEffective = attackerBody.inventory.GetItemCountEffective(Items.MoveSpeedOnKill);
					if (itemCountEffective > 0)
					{
						int num = itemCountEffective - 1;
						int num2 = 5;
						float num3 = (float)(1.0 + (double)num * 0.5);
						attackerBody.ClearTimedBuffs(Buffs.KillMoveSpeed);
						for (int i = 0; i < _harpoonStacks; i++)
						{
							if (attackerBody != null)
							{
								attackerBody.AddTimedBuff(Buffs.KillMoveSpeed, _buffDuration * (float)itemCountEffective * (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__2_3(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill");
			}

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

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

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

			internal void <Init>b__2_2(DamageReport damageReport)
			{
				//IL_0099: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a0: Expected O, but got Unknown
				//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c9: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0109: Unknown result type (might be due to invalid IL or missing references)
				//IL_010e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
				CharacterBody attackerBody = damageReport.attackerBody;
				int itemCountEffective = attackerBody.inventory.GetItemCountEffective(Items.MoveSpeedOnKill);
				if (itemCountEffective <= 0)
				{
					return;
				}
				int num = itemCountEffective - 1;
				int num2 = 5;
				float num3 = (float)(1.0 + (double)num * 0.5);
				attackerBody.ClearTimedBuffs(Buffs.KillMoveSpeed);
				for (int i = 0; i < _harpoonStacks; i++)
				{
					if (attackerBody != null)
					{
						attackerBody.AddTimedBuff(Buffs.KillMoveSpeed, _buffDuration * (float)itemCountEffective * (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 int _harpoonStacks;

		public static float _buffDuration;

		public static void Init(int harpoonStacks, float buffDuration)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			_harpoonStacks = harpoonStacks;
			_buffDuration = buffDuration;
			try
			{
				object obj = <>c.<>9__2_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_00f0: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val2 = new ILCursor(il);
						if (!val2.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill")
						}))
						{
							Log.LogInstrNotFound(il);
						}
						else
						{
							val2.Index += 4;
							val2.EmitDelegate<Func<int, int>>((Func<int, int>)((int itemCount) => 0));
							MethodReference val4 = default(MethodReference);
							if (!val2.TryGotoNext(new Func<Instruction, bool>[2]
							{
								(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1),
								(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val4)
							}))
							{
								Log.LogInstrNotFound(il);
							}
							else
							{
								val2.Index += 3;
								val2.Emit(OpCodes.Ldarg_1);
								val2.EmitDelegate<Action<DamageReport>>((Action<DamageReport>)delegate(DamageReport damageReport)
								{
									//IL_0099: Unknown result type (might be due to invalid IL or missing references)
									//IL_00a0: Expected O, but got Unknown
									//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
									//IL_00c9: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
									//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
									//IL_0109: Unknown result type (might be due to invalid IL or missing references)
									//IL_010e: Unknown result type (might be due to invalid IL or missing references)
									//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
									//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
									//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
									CharacterBody attackerBody = damageReport.attackerBody;
									int itemCountEffective = attackerBody.inventory.GetItemCountEffective(Items.MoveSpeedOnKill);
									if (itemCountEffective > 0)
									{
										int num = itemCountEffective - 1;
										int num2 = 5;
										float num3 = (float)(1.0 + (double)num * 0.5);
										attackerBody.ClearTimedBuffs(Buffs.KillMoveSpeed);
										for (int i = 0; i < _harpoonStacks; i++)
										{
											if (attackerBody != null)
											{
												attackerBody.AddTimedBuff(Buffs.KillMoveSpeed, _buffDuration * (float)itemCountEffective * (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__2_0 = val;
					obj = (object)val;
				}
				GlobalEventManager.OnCharacterDeath += (Manipulator)obj;
				UpdateText();
				Log.LogInfo("Added Hunters Harpoon Buff");
			}
			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>" + _harpoonStacks * 25 + "%</style> fading over <style=cIsUtility>" + _buffDuration + "</style> <style=cStack>(+" + _buffDuration + " per stack)</style> seconds.");
		}
	}
	internal class HuntersHarpoonChoice
	{
		private bool _enableHuntersHarpoonRework;

		private bool _enableHuntersHarpoonBuff;

		public static void TryInit(ConfigFile configFile)
		{
			bool value = configFile.Bind<bool>("Hunters Harpoon Buff", "Enable Hunters Harpoon Buff", false, "Harpoon speed is less intense, but lasts longer.").Value;
			float value2 = configFile.Bind<float>("Hunters Harpoon Buff", "Hunters Harpoon Duration", 2f, "Hunters Harpoon buff lasts X seconds.").Value;
			int value3 = configFile.Bind<int>("Hunters Harpoon Buff", "Hunters Harpoon Stacks Per Kill", 4, "Hunteres Harpoon refreshes to X stacks of the buff upon kill.").Value;
			if (value)
			{
				HuntersHarpoonBuff.Init(value3, value2);
			}
		}
	}
	public static class HuntersHarpoonRework
	{
		[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<Instruction, bool> <>9__0_5;

			public static Action<CharacterBody> <>9__0_6;

			public static Manipulator <>9__0_0;

			public static Func<Instruction, bool> <>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<CharacterMaster, DamageInfo, CharacterMaster> <>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_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)
				{
					Log.LogDebug("Attempting to add behavior for hunter: " + (object)body);
					body.AddItemBehavior<HuntersHarpoonBehavior>(body.inventory.GetItemCountEffective(Items.MoveSpeedOnKill));
					Log.LogDebug("Behavior: " + (object)((Component)body).gameObject.GetComponent<HuntersHarpoonBehavior>());
					Log.LogDebug("Behaviormasterbodypath: " + (object)((Component)body.master.GetBody()).GetComponent<HuntersHarpoonBehavior>());
				});
			}

			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)
			{
				Log.LogDebug("Attempting to add behavior for hunter: " + (object)body);
				body.AddItemBehavior<HuntersHarpoonBehavior>(body.inventory.GetItemCountEffective(Items.MoveSpeedOnKill));
				Log.LogDebug("Behavior: " + (object)((Component)body).gameObject.GetComponent<HuntersHarpoonBehavior>());
				Log.LogDebug("Behaviormasterbodypath: " + (object)((Component)body.master.GetBody()).GetComponent<HuntersHarpoonBehavior>());
			}

			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_0057: Unknown result type (might be due to invalid IL or missing references)
				//IL_0063: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				if (!val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill")
				}))
				{
					Log.LogInstrNotFound(il);
					return;
				}
				val.Index += 2;
				val.Emit(OpCodes.Ldc_I4_0);
				val.Emit(OpCodes.Mul);
			}

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

			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)
				ILCursor val = new ILCursor(il);
				int num = default(int);
				val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterMaster>(x, "get_inventory"),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num)
				});
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<Func<CharacterMaster, DamageInfo, CharacterMaster>>((Func<CharacterMaster, DamageInfo, CharacterMaster>)delegate(CharacterMaster master, DamageInfo dmgInfo)
				{
					Log.LogDebug("Entering Hunter Harp delegate");
					HuntersHarpoonBehavior component = ((Component)master.GetBody()).GetComponent<HuntersHarpoonBehavior>();
					Log.LogDebug("Hunter harp behavior: " + (object)component);
					if ((Object)(object)component != (Object)null && ((DamageTypeCombo)(ref dmgInfo.damageType)).IsDamageSourceSkillBased)
					{
						component.TryApplyMovespeed();
					}
					return master;
				});
			}

			internal bool <Init>b__0_8(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterMaster>(x, "get_inventory");
			}

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

			internal CharacterMaster <Init>b__0_10(CharacterMaster master, DamageInfo dmgInfo)
			{
				Log.LogDebug("Entering Hunter Harp delegate");
				HuntersHarpoonBehavior component = ((Component)master.GetBody()).GetComponent<HuntersHarpoonBehavior>();
				Log.LogDebug("Hunter harp behavior: " + (object)component);
				if ((Object)(object)component != (Object)null && ((DamageTypeCombo)(ref dmgInfo.damageType)).IsDamageSourceSkillBased)
				{
					component.TryApplyMovespeed();
				}
				return master;
			}
		}

		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_007c: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val6 = new ILCursor(il);
						int num3 = default(int);
						int num2 = default(int);
						val6.TryGotoNext(new Func<Instruction, bool>[3]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num3),
							(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num2),
							(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "inventory")
						});
						val6.Emit(OpCodes.Ldarg_0);
						val6.EmitDelegate<Action<CharacterBody>>((Action<CharacterBody>)delegate(CharacterBody body)
						{
							Log.LogDebug("Attempting to add behavior for hunter: " + (object)body);
							body.AddItemBehavior<HuntersHarpoonBehavior>(body.inventory.GetItemCountEffective(Items.MoveSpeedOnKill));
							Log.LogDebug("Behavior: " + (object)((Component)body).gameObject.GetComponent<HuntersHarpoonBehavior>());
							Log.LogDebug("Behaviormasterbodypath: " + (object)((Component)body.master.GetBody()).GetComponent<HuntersHarpoonBehavior>());
						});
					};
					<>c.<>9__0_0 = val;
					obj = (object)val;
				}
				CharacterBody.OnInventoryChanged += (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_0057: Unknown result type (might be due to invalid IL or missing references)
						//IL_0063: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val5 = new ILCursor(il);
						if (!val5.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill")
						}))
						{
							Log.LogInstrNotFound(il);
						}
						else
						{
							val5.Index += 2;
							val5.Emit(OpCodes.Ldc_I4_0);
							val5.Emit(OpCodes.Mul);
						}
					};
					<>c.<>9__0_1 = val2;
					obj2 = (object)val2;
				}
				GlobalEventManager.OnCharacterDeath += (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)
						ILCursor val4 = new ILCursor(il);
						int num = default(int);
						val4.TryGotoNext(new Func<Instruction, bool>[2]
						{
							(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterMaster>(x, "get_inventory"),
							(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num)
						});
						val4.Emit(OpCodes.Ldarg_1);
						val4.EmitDelegate<Func<CharacterMaster, DamageInfo, CharacterMaster>>((Func<CharacterMaster, DamageInfo, CharacterMaster>)delegate(CharacterMaster master, DamageInfo dmgInfo)
						{
							Log.LogDebug("Entering Hunter Harp delegate");
							HuntersHarpoonBehavior component = ((Component)master.GetBody()).GetComponent<HuntersHarpoonBehavior>();
							Log.LogDebug("Hunter harp behavior: " + (object)component);
							if ((Object)(object)component != (Object)null && ((DamageTypeCombo)(ref dmgInfo.damageType)).IsDamageSourceSkillBased)
							{
								component.TryApplyMovespeed();
							}
							return master;
						});
					};
					<>c.<>9__0_2 = val3;
					obj3 = (object)val3;
				}
				GlobalEventManager.ProcessHitEnemy += (Manipulator)obj3;
				UpdateText();
				Log.LogInfo("Added Hunters Harpoon Rework");
			}
			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 Func<Instruction, bool> <>9__0_5;

			public static Action<GenericCharacterMain> <>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_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_0069: 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>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchAnd(x),
					(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val2)
				});
				val.Index += 2;
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Action<GenericCharacterMain>>((Action<GenericCharacterMain>)delegate(GenericCharacterMain gcm)
				{
					int itemCountEffective = ((EntityState)gcm).characterBody.inventory.GetItemCountEffective(Items.StrengthenBurn);
					if (itemCountEffective > 0)
					{
						ProcIgniteOnJump(((EntityState)gcm).characterBody, itemCountEffective);
					}
				});
			}

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

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

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

		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 index = val5.Index;
						val5.Index = index + 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_0069: 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>[2]
						{
							(Instruction x) => ILPatternMatchingExt.MatchAnd(x),
							(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val4)
						});
						val3.Index += 2;
						val3.Emit(OpCodes.Ldarg_0);
						val3.EmitDelegate<Action<GenericCharacterMain>>((Action<GenericCharacterMain>)delegate(GenericCharacterMain gcm)
						{
							int itemCountEffective = ((EntityState)gcm).characterBody.inventory.GetItemCountEffective(Items.StrengthenBurn);
							if (itemCountEffective > 0)
							{
								ProcIgniteOnJump(((EntityState)gcm).characterBody, itemCountEffective);
							}
						});
					};
					<>c.<>9__0_1 = val2;
					obj2 = (object)val2;
				}
				GenericCharacterMain.ProcessJump_bool += (Manipulator)obj2;
				UpdateText();
				Log.LogInfo("Added Ignition Tank Rework");
			}
			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 = 0.75f * 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 itemCountEffective = attacker.inventory.GetItemCountEffective(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 * itemCountEffective;
					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__2_1;

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

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

			public static Action<DamageInfo> <>9__2_4;

			public static Manipulator <>9__2_0;

			internal void <Init>b__2_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 itemCountEffective = val3.GetItemCountEffective(Items.Seed);
							if (itemCountEffective > 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)itemCountEffective * _extraHeal, procChainMask, true);
								}
							}
						}
					}
				});
			}

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

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

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

			internal void <Init>b__2_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 itemCountEffective = val2.GetItemCountEffective(Items.Seed);
				if (itemCountEffective > 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)itemCountEffective * _extraHeal, procChainMask, true);
					}
				}
			}
		}

		public static float _extraHeal;

		public static void TryInit(ConfigFile configFile)
		{
			bool value = configFile.Bind<bool>("Leeching Seed Buff", "Enable Leeching Seed Buff", true, "Leeching seed also heals for additional health regardless of proc coefficient.").Value;
			_extraHeal = configFile.Bind<float>("Leeching Seed Buff", "Leeching Seed Extra Heal", 0.2f, "Leeching seed heals X extra health regardless of proc coefficient.\nDefault:0.2\nVanilla:0.0").Value;
			if (value)
			{
				Init();
			}
		}

		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__2_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 itemCountEffective = val4.GetItemCountEffective(Items.Seed);
									if (itemCountEffective > 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)itemCountEffective * _extraHeal, procChainMask, true);
										}
									}
								}
							}
						});
					};
					<>c.<>9__2_0 = val;
					obj = (object)val;
				}
				HealthComponent.TakeDamageProcess += (Manipulator)obj;
				UpdateText();
				Log.LogInfo("Added Leeching Seed Buff");
			}
			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>" + _extraHeal + "</style> <style=cStack>(+" + _extraHeal + " per stack)</style>on all damage instances.");
		}
	}
	internal class LeptonDaisyBehavior : MonoBehaviour
	{
		private float _timer = 0f;

		private GameObject _obj;

		private void OnDisable()
		{
			Log.LogDebug("Daisy Behavior disabled!");
			Object.Destroy((Object)(object)_obj);
		}

		private void OnEnable()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			_obj = new GameObject();
			NetworkServer.Spawn(_obj);
			Log.LogDebug("Daisy Behavior enabled!, " + _timer);
		}

		private void Pulse()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active)
			{
				return;
			}
			int itemCountForTeam = Util.GetItemCountForTeam((TeamIndex)1, Items.TPHealingNova.itemIndex, false, false);
			Log.LogDebug("Daisies: " + itemCountForTeam);
			if (itemCountForTeam >= 1)
			{
				if ((Object)(object)_obj.transform == (Object)null)
				{
					Log.LogDebug("parentTransform is NULL");
				}
				GameObject val = Object.Instantiate<GameObject>(TeleporterHealNovaGeneratorMain.pulsePrefab, new Vector3(-89f, 492f, 0f), _obj.transform.rotation, _obj.transform);
				TeleporterHealNovaPulse component = val.GetComponent<TeleporterHealNovaPulse>();
				val.GetComponent<TeamFilter>().teamIndex = (TeamIndex)1;
				NetworkServer.Spawn(val);
			}
		}

		private void FixedUpdate()
		{
			_timer += Time.deltaTime;
			if (_timer > LeptonDaisyRework.LEPTON_DAISY_COOLDOWN)
			{
				_timer = 0f;
				Pulse();
			}
		}
	}
	public static class LeptonDaisyBuff
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

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

			public static Action<HealthComponent> <>9__6_6;

			public static Manipulator <>9__6_0;

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

			public static Manipulator <>9__6_1;

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

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

			public static Manipulator <>9__6_2;

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

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

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

			public static Manipulator <>9__6_3;

			internal void <Init>b__6_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)
				{
					CleanseSystem.CleanseBodyServer(healthComponent.body, _cleanseDebuff, false, _cleanseCooldown, _cleanseDebuff, _cleanseDebuff, _cleanseProjecties);
				});
			}

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

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

			internal void <Init>b__6_6(HealthComponent healthComponent)
			{
				CleanseSystem.CleanseBodyServer(healthComponent.body, _cleanseDebuff, false, _cleanseCooldown, _cleanseDebuff, _cleanseDebuff, _cleanseProjecties);
			}

			internal void <Init>b__6_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 = _healVal;
			}

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

			internal void <Init>b__6_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_0059: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				if (!val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchMul(x)
				}))
				{
					Log.LogInstrNotFound(il);
					return;
				}
				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));
			}

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

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

			internal void <Init>b__6_3(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 num = default(int);
				if (!val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchAdd(x),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num)
				}))
				{
					Log.LogInstrNotFound(il);
					return;
				}
				val.EmitDelegate<Func<int, int>>((Func<int, int>)((int defaultPulseCount) => defaultPulseCount * _pulseCount));
			}

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

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

			internal int <Init>b__6_10(int defaultPulseCount)
			{
				return defaultPulseCount * _pulseCount;
			}
		}

		public static int _pulseCount;

		public static float _healVal;

		public static bool _cleanseDebuff;

		public static bool _cleanseProjecties;

		public static bool _cleanseCooldown;

		public static void TryInit(ConfigFile configFile)
		{
			bool value = configFile.Bind<bool>("Lepton Daisy Buff", "Enable Lepton Daisy Buff", true, "Lepton Daisy now pulses more often at a lower value, cleansing debuffs. Also heals once on holdout start.").Value;
			_pulseCount = configFile.Bind<int>("Lepton Daisy Buff", "Lepton Daisy Pulse Count", 3, "Lepton Daisy now pulses X times (+ X-1 times per stack).").Value - 1;
			_healVal = configFile.Bind<float>("Lepton Daisy Buff", "Lepton Daisy Heal", 35f, "Lepton Daisy heals X% health per pulse.").Value / 100f;
			_cleanseDebuff = configFile.Bind<bool>("Lepton Daisy Buff", "Lepton Daisy Cleanses Debuffs", true, "").Value;
			_cleanseProjecties = configFile.Bind<bool>("Lepton Daisy Buff", "Lepton Daisy Cleanses Projectiles Near Allies", true, "").Value;
			_cleanseCooldown = configFile.Bind<bool>("Lepton Daisy Buff", "Lepton Daisy Cleanses Item Cooldowns", false, "").Value;
			if (value)
			{
				if (_pulseCount < 0)
				{
					_pulseCount = 0;
				}
				Init();
			}
		}

		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
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Expected O, but got Unknown
			try
			{
				object obj = <>c.<>9__6_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 val8 = new ILCursor(il);
						int num4 = default(int);
						int num3 = default(int);
						val8.TryGotoNext(new Func<Instruction, bool>[2]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num4),
							(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3)
						});
						val8.Index += 3;
						val8.Emit(OpCodes.Ldloc_2);
						val8.EmitDelegate<Action<HealthComponent>>((Action<HealthComponent>)delegate(HealthComponent healthComponent)
						{
							CleanseSystem.CleanseBodyServer(healthComponent.body, _cleanseDebuff, false, _cleanseCooldown, _cleanseDebuff, _cleanseDebuff, _cleanseProjecties);
						});
					};
					<>c.<>9__6_0 = val;
					obj = (object)val;
				}
				HealPulse.Update += (Manipulator)obj;
				object obj2 = <>c.<>9__6_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 val7 = new ILCursor(il);
						float num2 = default(float);
						val7.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num2)
						});
						val7.Next.Operand = _healVal;
					};
					<>c.<>9__6_1 = val2;
					obj2 = (object)val2;
				}
				TeleporterHealNovaPulse.OnEnter += (Manipulator)obj2;
				object obj3 = <>c.<>9__6_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_0059: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val6 = new ILCursor(il);
						if (!val6.TryGotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchMul(x)
						}))
						{
							Log.LogInstrNotFound(il);
						}
						else
						{
							int index = val6.Index;
							val6.Index = index + 1;
							val6.Emit(OpCodes.Ldarg_1);
							val6.EmitDelegate<Func<float, float, float>>((Func<float, float, float>)((float nextPulseFraction, float prevPulseFraction) => (prevPulseFraction < 0.01f) ? 0.01f : nextPulseFraction));
						}
					};
					<>c.<>9__6_2 = val3;
					obj3 = (object)val3;
				}
				TeleporterHealNovaGeneratorMain.CalculateNextPulseFraction += (Manipulator)obj3;
				object obj4 = <>c.<>9__6_3;
				if (obj4 == null)
				{
					Manipulator val4 = delegate(ILContext il)
					{
						//IL_0002: U