Decompiled source of Hypercrit2 v2.0.0

NotHypercrit.dll

Decompiled 5 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Huntress.HuntressWeapon;
using IL.EntityStates.Huntress.HuntressWeapon;
using IL.RoR2;
using IL.RoR2.Orbs;
using LookingGlass.StatsDisplay;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MysticsItems;
using MysticsItems.Items;
using On.EntityStates.Huntress.HuntressWeapon;
using On.RoR2;
using R2API;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RoR2;
using RoR2.Orbs;
using UnityEngine;
using UnityEngine.Networking;

[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("NotHypercrit")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+f8545cdee0be2ae6c4e6dc27416bf1787175185f")]
[assembly: AssemblyProduct("NotHypercrit")]
[assembly: AssemblyTitle("NotHypercrit")]
[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 NotHypercrit
{
	public static class BleedExtension
	{
		public static float GetBleedDamage(this CharacterBody body)
		{
			if (!Bleed.bleedDamage.ContainsKey(body))
			{
				Bleed.bleedDamage.Add(body, 1f);
			}
			return Bleed.bleedDamage[body];
		}

		public static CharacterBody SetBleedDamage(this CharacterBody body, float value)
		{
			if (!Bleed.bleedDamage.ContainsKey(body))
			{
				Bleed.bleedDamage.Add(body, value);
			}
			else
			{
				Bleed.bleedDamage[body] = value;
			}
			return body;
		}

		public static float GetCollapseDamage(this CharacterBody body)
		{
			if (!Bleed.collapseDamage.ContainsKey(body))
			{
				Bleed.collapseDamage.Add(body, 1f);
			}
			return Bleed.collapseDamage[body];
		}

		public static CharacterBody SetCollapseDamage(this CharacterBody body, float value)
		{
			if (!Bleed.collapseDamage.ContainsKey(body))
			{
				Bleed.collapseDamage.Add(body, value);
			}
			else
			{
				Bleed.collapseDamage[body] = value;
			}
			return body;
		}
	}
	public class Bleed
	{
		public class InflictHyperbleedInfo : Main.AdditionalProcInfo
		{
			public GameObject attacker;

			public DotIndex dotIndex;

			public new void Deserialize(NetworkReader reader)
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				base.Deserialize(reader);
				dotIndex = (DotIndex)reader.ReadInt32();
			}

			public new void Serialize(NetworkWriter writer)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: Expected I4, but got Unknown
				base.Serialize(writer);
				writer.Write((int)dotIndex);
			}
		}

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

			public static Action<Run> <>9__6_0;

			public static hook_Start <>9__6_1;

			public static StatHookEventHandler <>9__6_2;

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

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

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

			public static Action<DamageInfo> <>9__6_9;

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

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

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

			public static Action<DamageInfo> <>9__6_13;

			public static Manipulator <>9__6_3;

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

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

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

			public static Action<OnDotInflictedServerGlobalDelegate, DotController> <>9__6_17;

			public static Manipulator <>9__6_4;

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

			public static Action<DamageDealtMessage, TeamComponent> <>9__6_20;

			public static Manipulator <>9__6_5;

			public static hook_InflictDot_refInflictDotInfo <>9__7_0;

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

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

			public static Manipulator <>9__7_1;

			public static hook_GetLocalizedStringByToken <>9__7_2;

			public static hook_RecalculateStats <>9__7_6;

			public static Action <>9__7_3;

			internal void <Patch>b__6_0(Run run)
			{
				bleedDamage.Clear();
			}

			internal void <Patch>b__6_1(orig_Start orig, CharacterBody self)
			{
				self.GetBleedDamage();
				self.GetCollapseDamage();
				orig.Invoke(self);
			}

			internal void <Patch>b__6_2(CharacterBody self, StatHookEventArgs args)
			{
				bleedDamage[self] = 1f;
				collapseDamage[self] = 1f;
			}

			internal void <Patch>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
				//IL_0099: Unknown result type (might be due to invalid IL or missing references)
				//IL_0159: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				int num = -1;
				val.GotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_bleedChance")
				});
				val.GotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 5)
				});
				val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<ProcChainMask>(x, "AddProc")
				});
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<Action<DamageInfo>>((Action<DamageInfo>)delegate(DamageInfo info)
				{
					if (Object.op_Implicit((Object)(object)info.attacker))
					{
						CharacterBody component2 = info.attacker.GetComponent<CharacterBody>();
						if (Object.op_Implicit((Object)(object)component2))
						{
							InflictHyperbleedInfo item2 = RollHyperbleed((DotIndex)0, component2.GetBleedDamage() - 1f, component2);
							inflictHyperBleedInfos.Add(item2);
						}
					}
				});
				val.GotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Items), "BleedOnHitVoid")
				});
				val.GotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 19)
				});
				val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<ProcChainMask>(x, "AddProc")
				});
				val.Emit(OpCodes.Ldarg, 1);
				val.EmitDelegate<Action<DamageInfo>>((Action<DamageInfo>)delegate(DamageInfo info)
				{
					if (Object.op_Implicit((Object)(object)info.attacker))
					{
						CharacterBody component = info.attacker.GetComponent<CharacterBody>();
						if (Object.op_Implicit((Object)(object)component))
						{
							InflictHyperbleedInfo item = RollHyperbleed((DotIndex)8, component.GetCollapseDamage() - 1f, component);
							inflictHyperBleedInfos.Add(item);
						}
					}
				});
			}

			internal bool <Patch>b__6_6(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_bleedChance");
			}

			internal bool <Patch>b__6_7(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdcI4(x, 5);
			}

			internal bool <Patch>b__6_8(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<ProcChainMask>(x, "AddProc");
			}

			internal void <Patch>b__6_9(DamageInfo info)
			{
				if (Object.op_Implicit((Object)(object)info.attacker))
				{
					CharacterBody component = info.attacker.GetComponent<CharacterBody>();
					if (Object.op_Implicit((Object)(object)component))
					{
						InflictHyperbleedInfo item = RollHyperbleed((DotIndex)0, component.GetBleedDamage() - 1f, component);
						inflictHyperBleedInfos.Add(item);
					}
				}
			}

			internal bool <Patch>b__6_10(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdsfld(x, typeof(Items), "BleedOnHitVoid");
			}

			internal bool <Patch>b__6_11(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdcI4(x, 19);
			}

			internal bool <Patch>b__6_12(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<ProcChainMask>(x, "AddProc");
			}

			internal void <Patch>b__6_13(DamageInfo info)
			{
				if (Object.op_Implicit((Object)(object)info.attacker))
				{
					CharacterBody component = info.attacker.GetComponent<CharacterBody>();
					if (Object.op_Implicit((Object)(object)component))
					{
						InflictHyperbleedInfo item = RollHyperbleed((DotIndex)8, component.GetCollapseDamage() - 1f, component);
						inflictHyperBleedInfos.Add(item);
					}
				}
			}

			internal void <Patch>b__6_4(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val = new ILCursor(il);
				val.GotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<OnDotInflictedServerGlobalDelegate>(x, "Invoke")
				});
				val.GotoPrev(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0)
				});
				val.Remove();
				val.GotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<OnDotInflictedServerGlobalDelegate>(x, "Invoke")
				});
				val.Remove();
				val.EmitDelegate<Action<OnDotInflictedServerGlobalDelegate, DotController>>((Action<OnDotInflictedServerGlobalDelegate, DotController>)delegate(OnDotInflictedServerGlobalDelegate inflictedServerGlobal, DotController self)
				{
					//IL_001d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0022: Unknown result type (might be due to invalid IL or missing references)
					//IL_0035: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0043: Invalid comparison between Unknown and I4
					<>c__DisplayClass6_0 CS$<>8__locals0 = new <>c__DisplayClass6_0
					{
						attacker = lastInfo.attackerObject,
						dotIndex = lastInfo.dotIndex
					};
					if (Object.op_Implicit((Object)(object)CS$<>8__locals0.attacker) && ((int)CS$<>8__locals0.dotIndex == 0 || (int)CS$<>8__locals0.dotIndex == 8))
					{
						InflictHyperbleedInfo inflictHyperbleedInfo = inflictHyperBleedInfos.Find((InflictHyperbleedInfo x) => (Object)(object)x.attacker == (Object)(object)CS$<>8__locals0.attacker && x.dotIndex == CS$<>8__locals0.dotIndex);
						if (inflictHyperbleedInfo != null)
						{
							if (inflictedServerGlobal != null)
							{
								for (int i = 0; i < inflictHyperbleedInfo.numProcs; i++)
								{
									inflictedServerGlobal.Invoke(self, ref lastInfo);
								}
							}
							inflictHyperBleedInfos.Remove(inflictHyperbleedInfo);
						}
					}
				});
			}

			internal bool <Patch>b__6_14(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<OnDotInflictedServerGlobalDelegate>(x, "Invoke");
			}

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

			internal bool <Patch>b__6_16(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<OnDotInflictedServerGlobalDelegate>(x, "Invoke");
			}

			internal void <Patch>b__6_17(OnDotInflictedServerGlobalDelegate inflictedServerGlobal, DotController self)
			{
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Invalid comparison between Unknown and I4
				<>c__DisplayClass6_0 CS$<>8__locals0 = new <>c__DisplayClass6_0
				{
					attacker = lastInfo.attackerObject,
					dotIndex = lastInfo.dotIndex
				};
				if (!Object.op_Implicit((Object)(object)CS$<>8__locals0.attacker) || ((int)CS$<>8__locals0.dotIndex != 0 && (int)CS$<>8__locals0.dotIndex != 8))
				{
					return;
				}
				InflictHyperbleedInfo inflictHyperbleedInfo = inflictHyperBleedInfos.Find((InflictHyperbleedInfo x) => (Object)(object)x.attacker == (Object)(object)CS$<>8__locals0.attacker && x.dotIndex == CS$<>8__locals0.dotIndex);
				if (inflictHyperbleedInfo == null)
				{
					return;
				}
				if (inflictedServerGlobal != null)
				{
					for (int i = 0; i < inflictHyperbleedInfo.numProcs; i++)
					{
						inflictedServerGlobal.Invoke(self, ref lastInfo);
					}
				}
				inflictHyperBleedInfos.Remove(inflictHyperbleedInfo);
			}

			internal void <Patch>b__6_5(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0068: Unknown result type (might be due to invalid IL or missing references)
				//IL_0074: Unknown result type (might be due to invalid IL or missing references)
				//IL_0087: Unknown result type (might be due to invalid IL or missing references)
				//IL_0093: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				val.GotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<DamageNumberManager>(x, "SpawnDamageNumber")
				});
				val.Emit(OpCodes.Pop);
				val.Emit(OpCodes.Pop);
				val.Emit(OpCodes.Pop);
				val.Emit(OpCodes.Pop);
				val.Emit(OpCodes.Pop);
				val.Emit(OpCodes.Pop);
				val.Remove();
				val.Emit(OpCodes.Ldloc_0);
				val.Emit(OpCodes.Ldloc_2);
				val.EmitDelegate<Action<DamageDealtMessage, TeamComponent>>((Action<DamageDealtMessage, TeamComponent>)delegate(DamageDealtMessage msg, TeamComponent team)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Invalid comparison between Unknown and I4
					//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
					//IL_0211: Unknown result type (might be due to invalid IL or missing references)
					//IL_0217: Unknown result type (might be due to invalid IL or missing references)
					//IL_0221: Expected I4, but got F4
					//IL_0221: Expected F4, but got I4
					//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
					//IL_00de: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e7: Invalid comparison between Unknown and I4
					//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
					//IL_0104: Invalid comparison between Unknown and I4
					//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
					//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
					//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
					//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
					//IL_0135: Unknown result type (might be due to invalid IL or missing references)
					//IL_013e: Unknown result type (might be due to invalid IL or missing references)
					//IL_014b: Unknown result type (might be due to invalid IL or missing references)
					//IL_014d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0161: Unknown result type (might be due to invalid IL or missing references)
					//IL_010c: Unknown result type (might be due to invalid IL or missing references)
					//IL_011d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0122: Unknown result type (might be due to invalid IL or missing references)
					//IL_0127: Unknown result type (might be due to invalid IL or missing references)
					//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
					//IL_0216->IL0216: Incompatible stack types: I4 vs F4
					//IL_0216->IL0216: Incompatible stack types: F4 vs I4
					//IL_0216->IL0216: Incompatible stack types: O vs I4
					//IL_0210->IL0216: Incompatible stack types: I4 vs O
					//IL_0210->IL0216: Incompatible stack types: I4 vs F4
					//IL_0210->IL0216: Incompatible stack types: F4 vs I4
					//IL_0210->IL0216: Incompatible stack types: O vs I4
					if ((int)msg.damageColorIndex == 2 && Object.op_Implicit((Object)(object)msg.victim) && Object.op_Implicit((Object)(object)msg.attacker))
					{
						CharacterBody component = msg.attacker.GetComponent<CharacterBody>();
						CharacterBody component2 = msg.victim.GetComponent<CharacterBody>();
						if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2))
						{
							float num = msg.damage / ((float)component2.GetBuffCount(Buffs.Bleeding) * 0.2f * component.baseDamage);
							int num2 = component2.GetBuffCount(Buffs.Bleeding) + 1;
							if (num > 0f)
							{
								float num3 = (num2 - 1) % Main.BleedColor.Value / (Main.BleedColor.Value - 1);
								Color val2 = Color.HSVToRGB(0f, 71f / 120f, 0.75f - 0.5f * num3);
								if ((int)team.teamIndex == -1)
								{
									val2 *= Color.gray;
								}
								if ((int)team.teamIndex == 2)
								{
									val2 *= new Color(0.5568628f, 0.2941177f, 0.6039216f);
								}
								ParticleSystem ps = DamageNumberManager.instance.ps;
								EmitParams val3 = default(EmitParams);
								((EmitParams)(ref val3)).position = msg.position;
								((EmitParams)(ref val3)).startColor = Color32.op_Implicit(val2);
								((EmitParams)(ref val3)).applyShapeToPosition = true;
								ps.Emit(val3, 1);
								DamageNumberManager.instance.ps.GetCustomParticleData(DamageNumberManager.instance.customData, (ParticleSystemCustomData)0);
								DamageNumberManager.instance.customData[DamageNumberManager.instance.customData.Count - 1] = new Vector4(1f, 0f, msg.damage, msg.crit ? 1f : 0f);
								DamageNumberManager.instance.ps.SetCustomParticleData(DamageNumberManager.instance.customData, (ParticleSystemCustomData)0);
								return;
							}
						}
					}
					object obj = DamageNumberManager.instance;
					float num4 = msg.damage;
					Vector3 position = msg.position;
					int num5 = (msg.crit ? 1 : 0);
					int num6;
					if (Object.op_Implicit((Object)(object)team))
					{
						obj = team.teamIndex;
						num4 = num5;
						num5 = (int)num4;
						num6 = (int)obj;
					}
					else
					{
						num6 = -1;
						obj = num6;
						num4 = num5;
						num5 = (int)num4;
						num6 = (int)obj;
					}
					((DamageNumberManager)num6).SpawnDamageNumber((float)num5, position, (byte)(int)num4 != 0, (TeamIndex)obj, msg.damageColorIndex);
				});
			}

			internal bool <Patch>b__6_19(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<DamageNumberManager>(x, "SpawnDamageNumber");
			}

			internal void <Patch>b__6_20(DamageDealtMessage msg, TeamComponent team)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Invalid comparison between Unknown and I4
				//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_0211: Unknown result type (might be due to invalid IL or missing references)
				//IL_0217: Unknown result type (might be due to invalid IL or missing references)
				//IL_0221: Expected I4, but got F4
				//IL_0221: Expected F4, but got I4
				//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00de: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e7: Invalid comparison between Unknown and I4
				//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0104: Invalid comparison between Unknown and I4
				//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0135: Unknown result type (might be due to invalid IL or missing references)
				//IL_013e: Unknown result type (might be due to invalid IL or missing references)
				//IL_014b: Unknown result type (might be due to invalid IL or missing references)
				//IL_014d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0161: Unknown result type (might be due to invalid IL or missing references)
				//IL_010c: Unknown result type (might be due to invalid IL or missing references)
				//IL_011d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0122: Unknown result type (might be due to invalid IL or missing references)
				//IL_0127: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_0216->IL0216: Incompatible stack types: I4 vs F4
				//IL_0216->IL0216: Incompatible stack types: F4 vs I4
				//IL_0216->IL0216: Incompatible stack types: O vs I4
				//IL_0210->IL0216: Incompatible stack types: I4 vs O
				//IL_0210->IL0216: Incompatible stack types: I4 vs F4
				//IL_0210->IL0216: Incompatible stack types: F4 vs I4
				//IL_0210->IL0216: Incompatible stack types: O vs I4
				if ((int)msg.damageColorIndex == 2 && Object.op_Implicit((Object)(object)msg.victim) && Object.op_Implicit((Object)(object)msg.attacker))
				{
					CharacterBody component = msg.attacker.GetComponent<CharacterBody>();
					CharacterBody component2 = msg.victim.GetComponent<CharacterBody>();
					if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2))
					{
						float num = msg.damage / ((float)component2.GetBuffCount(Buffs.Bleeding) * 0.2f * component.baseDamage);
						int num2 = component2.GetBuffCount(Buffs.Bleeding) + 1;
						if (num > 0f)
						{
							float num3 = (num2 - 1) % Main.BleedColor.Value / (Main.BleedColor.Value - 1);
							Color val = Color.HSVToRGB(0f, 71f / 120f, 0.75f - 0.5f * num3);
							if ((int)team.teamIndex == -1)
							{
								val *= Color.gray;
							}
							if ((int)team.teamIndex == 2)
							{
								val *= new Color(0.5568628f, 0.2941177f, 0.6039216f);
							}
							ParticleSystem ps = DamageNumberManager.instance.ps;
							EmitParams val2 = default(EmitParams);
							((EmitParams)(ref val2)).position = msg.position;
							((EmitParams)(ref val2)).startColor = Color32.op_Implicit(val);
							((EmitParams)(ref val2)).applyShapeToPosition = true;
							ps.Emit(val2, 1);
							DamageNumberManager.instance.ps.GetCustomParticleData(DamageNumberManager.instance.customData, (ParticleSystemCustomData)0);
							DamageNumberManager.instance.customData[DamageNumberManager.instance.customData.Count - 1] = new Vector4(1f, 0f, msg.damage, msg.crit ? 1f : 0f);
							DamageNumberManager.instance.ps.SetCustomParticleData(DamageNumberManager.instance.customData, (ParticleSystemCustomData)0);
							return;
						}
					}
				}
				object obj = DamageNumberManager.instance;
				float num4 = msg.damage;
				Vector3 position = msg.position;
				int num5 = (msg.crit ? 1 : 0);
				int num6;
				if (Object.op_Implicit((Object)(object)team))
				{
					obj = team.teamIndex;
					num4 = num5;
					num5 = (int)num4;
					num6 = (int)obj;
				}
				else
				{
					num6 = -1;
					obj = num6;
					num4 = num5;
					num5 = (int)num4;
					num6 = (int)obj;
				}
				((DamageNumberManager)num6).SpawnDamageNumber((float)num5, position, (byte)(int)num4 != 0, (TeamIndex)obj, msg.damageColorIndex);
			}

			internal void <PatchStack>b__7_0(orig_InflictDot_refInflictDotInfo orig, ref InflictDotInfo info)
			{
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_004d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_0029: Invalid comparison between Unknown and I4
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				if (NetworkServer.active)
				{
					GameObject attackerObject = info.attackerObject;
					DotIndex dotIndex = info.dotIndex;
					if (Object.op_Implicit((Object)(object)attackerObject) && ((int)dotIndex == 0 || (int)dotIndex == 8))
					{
						info.damageMultiplier *= HyperbleedMultiplier(attackerObject, dotIndex);
					}
				}
				lastInfo = info;
				orig.Invoke(ref info);
			}

			internal void <PatchStack>b__7_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_0071: 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)
				ILCursor val = new ILCursor(il);
				if (val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Items), "BleedOnHitAndExplode"),
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount")
				}))
				{
					val.Index += 2;
					val.Emit(OpCodes.Pop);
					val.Emit(OpCodes.Ldc_I4, 0);
				}
			}

			internal bool <PatchStack>b__7_4(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdsfld(x, typeof(Items), "BleedOnHitAndExplode");
			}

			internal bool <PatchStack>b__7_5(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount");
			}

			internal string <PatchStack>b__7_2(orig_GetLocalizedStringByToken orig, Language self, string token)
			{
				if (token == "ITEM_BLEEDONHITANDEXPLODE_DESC")
				{
					string text = "Gain <style=cIsDamage>5%</style> critical chance. Gain <style=cIsDamage>Bleed chance</style> equal to your <style=cIsDamage>Critical chance</style>. <style=cIsDamage>Bleeding</style> enemies <style=cIsDamage>explode</style> on death for <style=cIsDamage>400%</style> <style=cStack>(+400% per stack)</style> damage";
					if (!Main.Mods("Hayaku.VanillaRebalance"))
					{
						text += ", plus an additional <style=cIsDamage>15%</style> <style=cStack>(+15% per stack)</style> of their maximum health";
					}
					return text + ".";
				}
				return orig.Invoke(self, token);
			}

			internal void <PatchStack>b__7_3()
			{
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Expected O, but got Unknown
				object obj = <>9__7_6;
				if (obj == null)
				{
					hook_RecalculateStats val = delegate(orig_RecalculateStats orig, CharacterBody self)
					{
						orig.Invoke(self);
						if (!((Object)(object)self == (Object)null) && !((Object)(object)self.inventory == (Object)null) && Main.LamerShatterspleen.Value && self.inventory.GetItemCountEffective(Items.BleedOnHitAndExplode) > 0)
						{
							self.bleedChance += self.crit;
						}
					};
					<>9__7_6 = val;
					obj = (object)val;
				}
				CharacterBody.RecalculateStats += (hook_RecalculateStats)obj;
			}

			internal void <PatchStack>b__7_6(orig_RecalculateStats orig, CharacterBody self)
			{
				orig.Invoke(self);
				if (!((Object)(object)self == (Object)null) && !((Object)(object)self.inventory == (Object)null) && Main.LamerShatterspleen.Value && self.inventory.GetItemCountEffective(Items.BleedOnHitAndExplode) > 0)
				{
					self.bleedChance += self.crit;
				}
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass6_0
		{
			public GameObject attacker;

			public DotIndex dotIndex;

			internal bool <Patch>b__18(InflictHyperbleedInfo x)
			{
				//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)
				return (Object)(object)x.attacker == (Object)(object)attacker && x.dotIndex == dotIndex;
			}
		}

		public static List<InflictHyperbleedInfo> inflictHyperBleedInfos = new List<InflictHyperbleedInfo>();

		public static InflictHyperbleedInfo lastNetworkedBleedInfo = null;

		public static Dictionary<CharacterBody, float> bleedDamage = new Dictionary<CharacterBody, float>();

		public static Dictionary<CharacterBody, float> collapseDamage = new Dictionary<CharacterBody, float>();

		public static InflictDotInfo lastInfo;

		public static void Patch()
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Expected O, but got Unknown
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Expected O, but got Unknown
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Expected O, but got Unknown
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Expected O, but got Unknown
			Main.Log.LogDebug((object)"The Spirit of TheMysticSword Burns Alight...");
			Run.onRunStartGlobal += delegate
			{
				bleedDamage.Clear();
			};
			object obj = <>c.<>9__6_1;
			if (obj == null)
			{
				hook_Start val = delegate(orig_Start orig, CharacterBody self)
				{
					self.GetBleedDamage();
					self.GetCollapseDamage();
					orig.Invoke(self);
				};
				<>c.<>9__6_1 = val;
				obj = (object)val;
			}
			CharacterBody.Start += (hook_Start)obj;
			object obj2 = <>c.<>9__6_2;
			if (obj2 == null)
			{
				StatHookEventHandler val2 = delegate(CharacterBody self, StatHookEventArgs args)
				{
					bleedDamage[self] = 1f;
					collapseDamage[self] = 1f;
				};
				<>c.<>9__6_2 = val2;
				obj2 = (object)val2;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj2;
			object obj3 = <>c.<>9__6_3;
			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_0099: Unknown result type (might be due to invalid IL or missing references)
					//IL_0159: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val10 = new ILCursor(il);
					int num7 = -1;
					val10.GotoNext(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_bleedChance")
					});
					val10.GotoNext(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 5)
					});
					val10.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<ProcChainMask>(x, "AddProc")
					});
					val10.Emit(OpCodes.Ldarg_1);
					val10.EmitDelegate<Action<DamageInfo>>((Action<DamageInfo>)delegate(DamageInfo info)
					{
						if (Object.op_Implicit((Object)(object)info.attacker))
						{
							CharacterBody component4 = info.attacker.GetComponent<CharacterBody>();
							if (Object.op_Implicit((Object)(object)component4))
							{
								InflictHyperbleedInfo item2 = RollHyperbleed((DotIndex)0, component4.GetBleedDamage() - 1f, component4);
								inflictHyperBleedInfos.Add(item2);
							}
						}
					});
					val10.GotoNext(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Items), "BleedOnHitVoid")
					});
					val10.GotoNext(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 19)
					});
					val10.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<ProcChainMask>(x, "AddProc")
					});
					val10.Emit(OpCodes.Ldarg, 1);
					val10.EmitDelegate<Action<DamageInfo>>((Action<DamageInfo>)delegate(DamageInfo info)
					{
						if (Object.op_Implicit((Object)(object)info.attacker))
						{
							CharacterBody component3 = info.attacker.GetComponent<CharacterBody>();
							if (Object.op_Implicit((Object)(object)component3))
							{
								InflictHyperbleedInfo item = RollHyperbleed((DotIndex)8, component3.GetCollapseDamage() - 1f, component3);
								inflictHyperBleedInfos.Add(item);
							}
						}
					});
				};
				<>c.<>9__6_3 = val3;
				obj3 = (object)val3;
			}
			GlobalEventManager.ProcessHitEnemy += (Manipulator)obj3;
			object obj4 = <>c.<>9__6_4;
			if (obj4 == 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 val9 = new ILCursor(il);
					val9.GotoNext(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<OnDotInflictedServerGlobalDelegate>(x, "Invoke")
					});
					val9.GotoPrev(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0)
					});
					val9.Remove();
					val9.GotoNext(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<OnDotInflictedServerGlobalDelegate>(x, "Invoke")
					});
					val9.Remove();
					val9.EmitDelegate<Action<OnDotInflictedServerGlobalDelegate, DotController>>((Action<OnDotInflictedServerGlobalDelegate, DotController>)delegate(OnDotInflictedServerGlobalDelegate inflictedServerGlobal, DotController self)
					{
						//IL_001d: Unknown result type (might be due to invalid IL or missing references)
						//IL_0022: Unknown result type (might be due to invalid IL or missing references)
						//IL_0035: Unknown result type (might be due to invalid IL or missing references)
						//IL_003d: Unknown result type (might be due to invalid IL or missing references)
						//IL_0043: Invalid comparison between Unknown and I4
						GameObject attacker = lastInfo.attackerObject;
						DotIndex dotIndex = lastInfo.dotIndex;
						if (Object.op_Implicit((Object)(object)attacker) && ((int)dotIndex == 0 || (int)dotIndex == 8))
						{
							InflictHyperbleedInfo inflictHyperbleedInfo = inflictHyperBleedInfos.Find((InflictHyperbleedInfo x) => (Object)(object)x.attacker == (Object)(object)attacker && x.dotIndex == dotIndex);
							if (inflictHyperbleedInfo != null)
							{
								if (inflictedServerGlobal != null)
								{
									for (int i = 0; i < inflictHyperbleedInfo.numProcs; i++)
									{
										inflictedServerGlobal.Invoke(self, ref lastInfo);
									}
								}
								inflictHyperBleedInfos.Remove(inflictHyperbleedInfo);
							}
						}
					});
				};
				<>c.<>9__6_4 = val4;
				obj4 = (object)val4;
			}
			DotController.InflictDot_refInflictDotInfo += (Manipulator)obj4;
			if (Main.BleedColor.Value <= 1)
			{
				return;
			}
			object obj5 = <>c.<>9__6_5;
			if (obj5 == null)
			{
				Manipulator val5 = delegate(ILContext il)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Expected O, but got Unknown
					//IL_0038: Unknown result type (might be due to invalid IL or missing references)
					//IL_0044: Unknown result type (might be due to invalid IL or missing references)
					//IL_0050: Unknown result type (might be due to invalid IL or missing references)
					//IL_005c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0068: Unknown result type (might be due to invalid IL or missing references)
					//IL_0074: Unknown result type (might be due to invalid IL or missing references)
					//IL_0087: Unknown result type (might be due to invalid IL or missing references)
					//IL_0093: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val6 = new ILCursor(il);
					val6.GotoNext(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<DamageNumberManager>(x, "SpawnDamageNumber")
					});
					val6.Emit(OpCodes.Pop);
					val6.Emit(OpCodes.Pop);
					val6.Emit(OpCodes.Pop);
					val6.Emit(OpCodes.Pop);
					val6.Emit(OpCodes.Pop);
					val6.Emit(OpCodes.Pop);
					val6.Remove();
					val6.Emit(OpCodes.Ldloc_0);
					val6.Emit(OpCodes.Ldloc_2);
					val6.EmitDelegate<Action<DamageDealtMessage, TeamComponent>>((Action<DamageDealtMessage, TeamComponent>)delegate(DamageDealtMessage msg, TeamComponent team)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Invalid comparison between Unknown and I4
						//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
						//IL_0211: Unknown result type (might be due to invalid IL or missing references)
						//IL_0217: Unknown result type (might be due to invalid IL or missing references)
						//IL_0221: Expected I4, but got F4
						//IL_0221: Expected F4, but got I4
						//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
						//IL_00de: Unknown result type (might be due to invalid IL or missing references)
						//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
						//IL_00e7: Invalid comparison between Unknown and I4
						//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
						//IL_0104: Invalid comparison between Unknown and I4
						//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
						//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
						//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
						//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
						//IL_0135: Unknown result type (might be due to invalid IL or missing references)
						//IL_013e: Unknown result type (might be due to invalid IL or missing references)
						//IL_014b: Unknown result type (might be due to invalid IL or missing references)
						//IL_014d: Unknown result type (might be due to invalid IL or missing references)
						//IL_0161: Unknown result type (might be due to invalid IL or missing references)
						//IL_010c: Unknown result type (might be due to invalid IL or missing references)
						//IL_011d: Unknown result type (might be due to invalid IL or missing references)
						//IL_0122: Unknown result type (might be due to invalid IL or missing references)
						//IL_0127: Unknown result type (might be due to invalid IL or missing references)
						//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
						//IL_0216->IL0216: Incompatible stack types: I4 vs F4
						//IL_0216->IL0216: Incompatible stack types: F4 vs I4
						//IL_0216->IL0216: Incompatible stack types: O vs I4
						//IL_0210->IL0216: Incompatible stack types: I4 vs O
						//IL_0210->IL0216: Incompatible stack types: I4 vs F4
						//IL_0210->IL0216: Incompatible stack types: F4 vs I4
						//IL_0210->IL0216: Incompatible stack types: O vs I4
						if ((int)msg.damageColorIndex == 2 && Object.op_Implicit((Object)(object)msg.victim) && Object.op_Implicit((Object)(object)msg.attacker))
						{
							CharacterBody component = msg.attacker.GetComponent<CharacterBody>();
							CharacterBody component2 = msg.victim.GetComponent<CharacterBody>();
							if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2))
							{
								float num = msg.damage / ((float)component2.GetBuffCount(Buffs.Bleeding) * 0.2f * component.baseDamage);
								int num2 = component2.GetBuffCount(Buffs.Bleeding) + 1;
								if (num > 0f)
								{
									float num3 = (num2 - 1) % Main.BleedColor.Value / (Main.BleedColor.Value - 1);
									Color val7 = Color.HSVToRGB(0f, 71f / 120f, 0.75f - 0.5f * num3);
									if ((int)team.teamIndex == -1)
									{
										val7 *= Color.gray;
									}
									if ((int)team.teamIndex == 2)
									{
										val7 *= new Color(0.5568628f, 0.2941177f, 0.6039216f);
									}
									ParticleSystem ps = DamageNumberManager.instance.ps;
									EmitParams val8 = default(EmitParams);
									((EmitParams)(ref val8)).position = msg.position;
									((EmitParams)(ref val8)).startColor = Color32.op_Implicit(val7);
									((EmitParams)(ref val8)).applyShapeToPosition = true;
									ps.Emit(val8, 1);
									DamageNumberManager.instance.ps.GetCustomParticleData(DamageNumberManager.instance.customData, (ParticleSystemCustomData)0);
									DamageNumberManager.instance.customData[DamageNumberManager.instance.customData.Count - 1] = new Vector4(1f, 0f, msg.damage, msg.crit ? 1f : 0f);
									DamageNumberManager.instance.ps.SetCustomParticleData(DamageNumberManager.instance.customData, (ParticleSystemCustomData)0);
									return;
								}
							}
						}
						object obj6 = DamageNumberManager.instance;
						float num4 = msg.damage;
						Vector3 position = msg.position;
						int num5 = (msg.crit ? 1 : 0);
						int num6;
						if (Object.op_Implicit((Object)(object)team))
						{
							obj6 = team.teamIndex;
							num4 = num5;
							num5 = (int)num4;
							num6 = (int)obj6;
						}
						else
						{
							num6 = -1;
							obj6 = num6;
							num4 = num5;
							num5 = (int)num4;
							num6 = (int)obj6;
						}
						((DamageNumberManager)num6).SpawnDamageNumber((float)num5, position, (byte)(int)num4 != 0, (TeamIndex)obj6, msg.damageColorIndex);
					});
				};
				<>c.<>9__6_5 = val5;
				obj5 = (object)val5;
			}
			HealthComponent.HandleDamageDealt += (Manipulator)obj5;
		}

		public static void PatchStack()
		{
			//IL_0015: 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_0020: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Expected O, but got Unknown
			object obj = <>c.<>9__7_0;
			if (obj == null)
			{
				hook_InflictDot_refInflictDotInfo val = delegate(orig_InflictDot_refInflictDotInfo orig, ref InflictDotInfo info)
				{
					//IL_0048: Unknown result type (might be due to invalid IL or missing references)
					//IL_004d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0013: Unknown result type (might be due to invalid IL or missing references)
					//IL_0018: Unknown result type (might be due to invalid IL or missing references)
					//IL_0024: Unknown result type (might be due to invalid IL or missing references)
					//IL_0027: Unknown result type (might be due to invalid IL or missing references)
					//IL_0029: Invalid comparison between Unknown and I4
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					if (NetworkServer.active)
					{
						GameObject attackerObject = info.attackerObject;
						DotIndex dotIndex = info.dotIndex;
						if (Object.op_Implicit((Object)(object)attackerObject) && ((int)dotIndex == 0 || (int)dotIndex == 8))
						{
							info.damageMultiplier *= HyperbleedMultiplier(attackerObject, dotIndex);
						}
					}
					lastInfo = info;
					orig.Invoke(ref info);
				};
				<>c.<>9__7_0 = val;
				obj = (object)val;
			}
			DotController.InflictDot_refInflictDotInfo += (hook_InflictDot_refInflictDotInfo)obj;
			if (Main.LamerShatterspleen.Value)
			{
				object obj2 = <>c.<>9__7_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_0071: 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)
						ILCursor val5 = new ILCursor(il);
						if (val5.TryGotoNext(new Func<Instruction, bool>[2]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Items), "BleedOnHitAndExplode"),
							(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount")
						}))
						{
							val5.Index += 2;
							val5.Emit(OpCodes.Pop);
							val5.Emit(OpCodes.Ldc_I4, 0);
						}
					};
					<>c.<>9__7_1 = val2;
					obj2 = (object)val2;
				}
				GlobalEventManager.ProcessHitEnemy += (Manipulator)obj2;
				object obj3 = <>c.<>9__7_2;
				if (obj3 == null)
				{
					hook_GetLocalizedStringByToken val3 = delegate(orig_GetLocalizedStringByToken orig, Language self, string token)
					{
						if (token == "ITEM_BLEEDONHITANDEXPLODE_DESC")
						{
							string text = "Gain <style=cIsDamage>5%</style> critical chance. Gain <style=cIsDamage>Bleed chance</style> equal to your <style=cIsDamage>Critical chance</style>. <style=cIsDamage>Bleeding</style> enemies <style=cIsDamage>explode</style> on death for <style=cIsDamage>400%</style> <style=cStack>(+400% per stack)</style> damage";
							if (!Main.Mods("Hayaku.VanillaRebalance"))
							{
								text += ", plus an additional <style=cIsDamage>15%</style> <style=cStack>(+15% per stack)</style> of their maximum health";
							}
							return text + ".";
						}
						return orig.Invoke(self, token);
					};
					<>c.<>9__7_2 = val3;
					obj3 = (object)val3;
				}
				Language.GetLocalizedStringByToken += (hook_GetLocalizedStringByToken)obj3;
			}
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate
			{
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Expected O, but got Unknown
				object obj4 = <>c.<>9__7_6;
				if (obj4 == null)
				{
					hook_RecalculateStats val4 = delegate(orig_RecalculateStats orig, CharacterBody self)
					{
						orig.Invoke(self);
						if (!((Object)(object)self == (Object)null) && !((Object)(object)self.inventory == (Object)null) && Main.LamerShatterspleen.Value && self.inventory.GetItemCountEffective(Items.BleedOnHitAndExplode) > 0)
						{
							self.bleedChance += self.crit;
						}
					};
					<>c.<>9__7_6 = val4;
					obj4 = (object)val4;
				}
				CharacterBody.RecalculateStats += (hook_RecalculateStats)obj4;
			});
		}

		public static float HyperbleedMultiplier(GameObject attacker, DotIndex dotIndex)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			InflictHyperbleedInfo inflictHyperbleedInfo = inflictHyperBleedInfos.FirstOrDefault((InflictHyperbleedInfo x) => (Object)(object)x.attacker == (Object)(object)attacker && x.dotIndex == dotIndex);
			if (inflictHyperbleedInfo != null && inflictHyperbleedInfo != null)
			{
				return inflictHyperbleedInfo.damageMult;
			}
			return 1f;
		}

		public static InflictHyperbleedInfo RollHyperbleed(DotIndex dotIndex, float damage, CharacterBody body, bool forceSingleBleed = false)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Invalid comparison between Unknown and I4
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Invalid comparison between Unknown and I4
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Invalid comparison between Unknown and I4
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Invalid comparison between Unknown and I4
			InflictHyperbleedInfo inflictHyperbleedInfo = new InflictHyperbleedInfo();
			if (Object.op_Implicit((Object)(object)body))
			{
				inflictHyperbleedInfo.attacker = ((Component)body).gameObject;
				inflictHyperbleedInfo.dotIndex = dotIndex;
				inflictHyperbleedInfo.totalChance = body.bleedChance;
				float effectiveCount = GetEffectiveCount(body.bleedChance, body, (int)dotIndex == 8, forceSingleBleed);
				inflictHyperbleedInfo.num = Main.CalcChance(Main.BleedChance.Value, effectiveCount, body.master.luck);
				if (inflictHyperbleedInfo.num == 0)
				{
					inflictHyperbleedInfo.damageMult = 1f;
				}
				else if ((int)dotIndex == 0)
				{
					inflictHyperbleedInfo.damageMult = (1f + damage) * Main.Calc(Main.BleedMode.Value, Main.BleedA.Value, Main.BleedB.Value, effectiveCount);
				}
				else if ((int)dotIndex == 8)
				{
					inflictHyperbleedInfo.damageMult = (1f + damage) * Main.Calc(Main.CollapseMode.Value, Main.CollapseA.Value, Main.CollapseB.Value, effectiveCount);
				}
				float num = 0f;
				if (inflictHyperbleedInfo.num != 0)
				{
					if ((int)dotIndex == 0)
					{
						num = Main.Calc(Main.BleedProcMode.Value, Main.BleedProcA.Value, Main.BleedProcB.Value, effectiveCount);
					}
					else if ((int)dotIndex == 8)
					{
						num = Main.Calc(Main.CollapseProcMode.Value, Main.CollapseProcA.Value, Main.CollapseProcB.Value, effectiveCount);
					}
				}
				inflictHyperbleedInfo.numProcs = (int)num + (Util.CheckRoll(num % 1f * 100f, 0f, (CharacterMaster)null) ? 1 : 0);
			}
			return inflictHyperbleedInfo;
		}

		public static float GetDamage(float chance, float damage, CharacterBody body, bool collapse = false)
		{
			if (!collapse)
			{
				return (1f + damage) * Main.Calc(Main.BleedMode.Value, Main.BleedA.Value, Main.BleedB.Value, Mathf.Max(1f, GetEffectiveCount(chance + (100f - chance % 100f), body)));
			}
			return (1f + damage) * Main.Calc(Main.CollapseMode.Value, Main.CollapseA.Value, Main.CollapseB.Value, Mathf.Max(1f, GetEffectiveCount(chance + (100f - chance % 100f), body, collapse: true)));
		}

		public static float GetEffectiveCount(InflictHyperbleedInfo aci)
		{
			return aci.num;
		}

		public static float GetEffectiveCount(float chance, CharacterBody body, bool collapse = false, bool forceSingleBleed = false)
		{
			float num = Mathf.Max(0f, (chance - (float)(forceSingleBleed ? 100 : 0)) / 100f);
			if ((collapse ? Main.CollapseCap.Value : Main.BleedCap.Value) >= 0f)
			{
				num = Mathf.Min(num, collapse ? Main.CollapseCap.Value : Main.BleedCap.Value);
			}
			if (num <= 0f)
			{
				return 0f;
			}
			return Main.CalcChance(collapse ? Main.CollapseChance.Value : Main.BleedChance.Value, num, body.master.luck);
		}
	}
	public class Crit
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

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

			public static Func<DamageInfo, DamageInfo> <>9__3_11;

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

			public static Func<float, HealthComponent, DamageInfo, float> <>9__3_13;

			public static Manipulator <>9__3_0;

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

			public static Action<DamageDealtMessage, DamageReport> <>9__3_16;

			public static Manipulator <>9__3_1;

			public static hook_Serialize <>9__3_2;

			public static hook_Deserialize <>9__3_3;

			public static hook_OnCrit <>9__3_4;

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

			public static Func<Color, Color> <>9__3_18;

			public static Manipulator <>9__3_5;

			public static hook_OnEnter <>9__3_6;

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

			public static Action<GenericDamageOrb, FireSeekingArrow> <>9__3_20;

			public static Manipulator <>9__3_7;

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

			public static Action<DamageInfo, GenericDamageOrb> <>9__3_22;

			public static Manipulator <>9__3_8;

			public static StatHookEventHandler <>9__4_0;

			public static Func<float, string> <>9__4_3;

			public static Func<float, string> <>9__4_4;

			public static hook_GetLocalizedStringByToken <>9__4_1;

			public static Func<ItemIndex, bool> <>9__5_2;

			public static hook_RecalculateStats <>9__5_0;

			public static hook_GetLocalizedStringByToken <>9__5_1;

			internal void <Patch>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_00b0: 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)
				ILCursor val = new ILCursor(il);
				ILLabel val2 = default(ILLabel);
				val.GotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "crit"),
					(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val2)
				});
				val.EmitDelegate<Func<DamageInfo, DamageInfo>>((Func<DamageInfo, DamageInfo>)delegate(DamageInfo x)
				{
					info = x;
					return x;
				});
				val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_critMultiplier")
				});
				val.Emit(OpCodes.Ldarg_0);
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<Func<float, HealthComponent, DamageInfo, float>>((Func<float, HealthComponent, DamageInfo, float>)delegate(float orig, HealthComponent self, DamageInfo info)
				{
					if (!Object.op_Implicit((Object)(object)self))
					{
						return orig;
					}
					CharacterBody component = info.attacker.GetComponent<CharacterBody>();
					if (!Object.op_Implicit((Object)(object)component))
					{
						return orig;
					}
					Main.AdditionalProcInfo value = null;
					if (!critInfoAttachments.TryGetValue(info, out value))
					{
						value = RollHypercrit(orig - 2f, component);
						critInfoAttachments.Add(info, value);
					}
					return Mathf.Max(orig, value.damageMult);
				});
			}

			internal bool <Patch>b__3_9(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "crit");
			}

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

			internal DamageInfo <Patch>b__3_11(DamageInfo x)
			{
				info = x;
				return x;
			}

			internal bool <Patch>b__3_12(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_critMultiplier");
			}

			internal float <Patch>b__3_13(float orig, HealthComponent self, DamageInfo info)
			{
				if (!Object.op_Implicit((Object)(object)self))
				{
					return orig;
				}
				CharacterBody component = info.attacker.GetComponent<CharacterBody>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					return orig;
				}
				Main.AdditionalProcInfo value = null;
				if (!critInfoAttachments.TryGetValue(info, out value))
				{
					value = RollHypercrit(orig - 2f, component);
					critInfoAttachments.Add(info, value);
				}
				return Mathf.Max(orig, value.damageMult);
			}

			internal void <Patch>b__3_1(ILContext il)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Expected O, but got Unknown
				//IL_0065: 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)
				<>c__DisplayClass3_0 CS$<>8__locals0 = new <>c__DisplayClass3_0();
				ILCursor val = new ILCursor(il);
				CS$<>8__locals0.message = -1;
				val.GotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref CS$<>8__locals0.message),
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<NetworkServer>(x, "SendToAll")
				});
				int index = val.Index;
				val.Index = index + 1;
				val.Emit(OpCodes.Ldloc, CS$<>8__locals0.message);
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Action<DamageDealtMessage, DamageReport>>((Action<DamageDealtMessage, DamageReport>)delegate(DamageDealtMessage msg, DamageReport report)
				{
					TryPassHypercrit(report.damageInfo, msg);
				});
			}

			internal bool <Patch>b__3_15(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<NetworkServer>(x, "SendToAll");
			}

			internal void <Patch>b__3_16(DamageDealtMessage msg, DamageReport report)
			{
				TryPassHypercrit(report.damageInfo, msg);
			}

			internal void <Patch>b__3_2(orig_Serialize orig, DamageDealtMessage self, NetworkWriter writer)
			{
				orig.Invoke(self, writer);
				if (!critInfoAttachments.TryGetValue(self, out var value))
				{
					value = new Main.AdditionalProcInfo();
				}
				value.Serialize(writer);
			}

			internal void <Patch>b__3_3(orig_Deserialize orig, DamageDealtMessage self, NetworkReader reader)
			{
				orig.Invoke(self, reader);
				Main.AdditionalProcInfo additionalProcInfo = new Main.AdditionalProcInfo();
				additionalProcInfo.Deserialize(reader);
				critInfoAttachments.Add(self, additionalProcInfo);
				lastNetworkedCritInfo = additionalProcInfo;
			}

			internal void <Patch>b__3_4(orig_OnCrit orig, GlobalEventManager self, CharacterBody body, DamageInfo damageInfo, CharacterMaster master, float procCoefficient, ProcChainMask procChainMask)
			{
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				critInfoAttachments.TryGetValue(damageInfo, out var value);
				if (value != null && value.numProcs > 1)
				{
					int numProcs = value.numProcs;
					value.numProcs = 0;
					for (int i = 0; i < numProcs; i++)
					{
						orig.Invoke(self, body, damageInfo, master, procCoefficient, procChainMask);
					}
				}
				else
				{
					orig.Invoke(self, body, damageInfo, master, procCoefficient, procChainMask);
				}
			}

			internal void <Patch>b__3_5(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val = new ILCursor(il);
				val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, typeof(DamageColor), "FindColor")
				});
				val.EmitDelegate<Func<Color, Color>>((Func<Color, Color>)delegate(Color origColor)
				{
					//IL_000d: Unknown result type (might be due to invalid IL or missing references)
					//IL_000e: Unknown result type (might be due to invalid IL or missing references)
					//IL_006f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0074: Unknown result type (might be due to invalid IL or missing references)
					//IL_0033: Unknown result type (might be due to invalid IL or missing references)
					//IL_0034: Unknown result type (might be due to invalid IL or missing references)
					//IL_0078: Unknown result type (might be due to invalid IL or missing references)
					if (Crit.lastNetworkedCritInfo == null)
					{
						return origColor;
					}
					Main.AdditionalProcInfo lastNetworkedCritInfo = Crit.lastNetworkedCritInfo;
					Crit.lastNetworkedCritInfo = null;
					float effectiveCount = GetEffectiveCount(lastNetworkedCritInfo);
					if (effectiveCount == 0f)
					{
						return origColor;
					}
					float num = 1f / 6f - (effectiveCount - 1f) / (float)Main.CritColor.Value;
					return Color.HSVToRGB((num % 1f + 1f) % 1f, 1f, 1f);
				});
			}

			internal bool <Patch>b__3_17(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt(x, typeof(DamageColor), "FindColor");
			}

			internal Color <Patch>b__3_18(Color origColor)
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0074: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				//IL_0078: Unknown result type (might be due to invalid IL or missing references)
				if (Crit.lastNetworkedCritInfo == null)
				{
					return origColor;
				}
				Main.AdditionalProcInfo lastNetworkedCritInfo = Crit.lastNetworkedCritInfo;
				Crit.lastNetworkedCritInfo = null;
				float effectiveCount = GetEffectiveCount(lastNetworkedCritInfo);
				if (effectiveCount == 0f)
				{
					return origColor;
				}
				float num = 1f / 6f - (effectiveCount - 1f) / (float)Main.CritColor.Value;
				return Color.HSVToRGB((num % 1f + 1f) % 1f, 1f, 1f);
			}

			internal void <Patch>b__3_6(orig_OnEnter orig, FireFlurrySeekingArrow self)
			{
				orig.Invoke(self);
				Main.AdditionalProcInfo additionalProcInfo = RollHypercrit(((EntityState)self).characterBody.critMultiplier - 2f, ((EntityState)self).characterBody);
				if (additionalProcInfo.num > 1)
				{
					additionalProcInfo.damageMult *= 6f / (float)(3 + 3 * additionalProcInfo.num);
				}
				critInfoAttachments.Add(self, additionalProcInfo);
				((FireSeekingArrow)self).isCrit = additionalProcInfo.num > 0;
				((FireSeekingArrow)self).maxArrowCount = 3 + additionalProcInfo.num * 3;
				((FireSeekingArrow)self).arrowReloadDuration = ((FireSeekingArrow)self).baseArrowReloadDuration * (3f / (float)((FireSeekingArrow)self).maxArrowCount) / ((BaseState)self).attackSpeedStat;
			}

			internal void <Patch>b__3_7(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				val.GotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 0)
				});
				val.Emit(OpCodes.Dup);
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Action<GenericDamageOrb, FireSeekingArrow>>((Action<GenericDamageOrb, FireSeekingArrow>)delegate(GenericDamageOrb orb, FireSeekingArrow self)
				{
					TryPassHypercrit(self, orb);
				});
			}

			internal bool <Patch>b__3_19(Instruction x)
			{
				return ILPatternMatchingExt.MatchStloc(x, 0);
			}

			internal void <Patch>b__3_20(GenericDamageOrb orb, FireSeekingArrow self)
			{
				TryPassHypercrit(self, orb);
			}

			internal void <Patch>b__3_8(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchNewobj<DamageInfo>(x)
				});
				val.Emit(OpCodes.Dup);
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Action<DamageInfo, GenericDamageOrb>>((Action<DamageInfo, GenericDamageOrb>)delegate(DamageInfo di, GenericDamageOrb orb)
				{
					TryPassHypercrit(orb, di);
				});
			}

			internal bool <Patch>b__3_21(Instruction x)
			{
				return ILPatternMatchingExt.MatchNewobj<DamageInfo>(x);
			}

			internal void <Patch>b__3_22(DamageInfo di, GenericDamageOrb orb)
			{
				TryPassHypercrit(orb, di);
			}

			internal void <LaserScopeRework>b__4_0(CharacterBody self, StatHookEventArgs args)
			{
				if (!((Object)(object)self == (Object)null) && !((Object)(object)self.inventory == (Object)null))
				{
					int itemCount = self.inventory.GetItemCount(Items.CritDamage);
					if (itemCount > 0)
					{
						args.critDamageMultAdd += (Main.LaserScopeDamage.Value + (float)(itemCount - 1) * Main.LaserScopeDamageStack.Value) / 100f - (float)itemCount;
						args.critAdd += Main.LaserScope.Value + (float)(itemCount - 1) * Main.LaserScopeStack.Value;
					}
				}
			}

			internal string <LaserScopeRework>b__4_1(orig_GetLocalizedStringByToken orig, Language self, string token)
			{
				if (token == "ITEM_CRITDAMAGE_DESC")
				{
					return ((Main.LaserScope.Value != 0f || Main.LaserScopeStack.Value != 0f) ? ("Gain " + <LaserScopeRework>g__s|4_2(Main.LaserScope.Value, Main.LaserScopeStack.Value, (float f) => f + "%") + " chance to <style=cIsDamage>Critically Strike</style>. ") : "") + ((Main.LaserScopeDamage.Value != 0f || Main.LaserScopeDamageStack.Value != 0f) ? ("<style=cIsDamage>Critical Strikes</style> deal an additional " + <LaserScopeRework>g__s|4_2(Main.LaserScopeDamage.Value, Main.LaserScopeDamageStack.Value, (float f) => f + "%") + ".") : "");
				}
				return orig.Invoke(self, token);
			}

			internal string <LaserScopeRework>b__4_3(float f)
			{
				return f + "%";
			}

			internal string <LaserScopeRework>b__4_4(float f)
			{
				return f + "%";
			}

			internal bool <MoonglassesRework>b__5_2(ItemIndex x)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				return ((Object)ItemCatalog.GetItemDef(x)).name == "MysticsItems_Moonglasses";
			}

			internal void <MoonglassesRework>b__5_0(orig_RecalculateStats orig, CharacterBody self)
			{
				orig.Invoke(self);
				if (!((Object)(object)((self != null) ? self.inventory : null) != (Object)null))
				{
					return;
				}
				int itemCount = self.inventory.GetItemCount(Items.MysticsItems_Moonglasses);
				if (itemCount != 0)
				{
					self.crit *= Mathf.Pow(2f, (float)itemCount);
					self.crit -= Main.Moonglasses.Value * (float)itemCount;
					if (self.crit < 0f && self.inventory.GetItemCount(Items.ConvertCritChanceToCritDamage) > 0)
					{
						Chat.AddMessage("Hypercrit makes crit chance past 100 give a chance to do a hit that is your crit damage +100%. So in a scenario where your crit is 101% and crit damage is x2, mean your actual crit damage will be x2 in 100% cases and x3 in 1% cases. So to put it simply from x2 to x3.\r\nNow negative crit would work like this. Let's say you have -50% chance and x3.5 crit damage. Obviously no way for you to proc crits randomly, but could give a change to deal \"negative crit\" in other ways, that is -100% from you crit damage for every -100% crit chance past 0. So your crit damage range would be from x2.5 to x3.5.\r\nAt the least I was hoping that negative would work with survivors that can't have chance and instead get it converted to crit damage. Like railgunner.");
						self.master.TrueKill();
					}
					self.crit = Mathf.Max(0f, self.crit);
				}
			}

			internal string <MoonglassesRework>b__5_1(orig_GetLocalizedStringByToken orig, Language self, string token)
			{
				if (token == "ITEM_MYSTICSITEMS_MOONGLASSES_PICKUP")
				{
					return orig.Invoke(self, "ITEM_HYPERCRIT_MOONGLASSES_PICKUP");
				}
				if (token == "ITEM_MYSTICSITEMS_MOONGLASSES_DESC")
				{
					return orig.Invoke(self, "ITEM_HYPERCRIT_MOONGLASSES_DESC");
				}
				return orig.Invoke(self, token);
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass3_0
		{
			public int message;

			internal bool <Patch>b__14(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdloc(x, ref message);
			}
		}

		public static ConditionalWeakTable<object, Main.AdditionalProcInfo> critInfoAttachments = new ConditionalWeakTable<object, Main.AdditionalProcInfo>();

		public static Main.AdditionalProcInfo lastNetworkedCritInfo = null;

		public static DamageInfo info;

		public static void Patch()
		{
			//IL_0025: 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_0030: Expected O, but got Unknown
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Expected O, but got Unknown
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Expected O, but got Unknown
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Expected O, but got Unknown
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Expected O, but got Unknown
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Expected O, but got Unknown
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Expected O, but got Unknown
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Expected O, but got Unknown
			Main.Log.LogDebug((object)"The Spirit of ThinkInvis Embraces You...");
			object obj = <>c.<>9__3_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_00b0: 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)
					ILCursor val14 = new ILCursor(il);
					ILLabel val15 = default(ILLabel);
					val14.GotoNext(new Func<Instruction, bool>[2]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "crit"),
						(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val15)
					});
					val14.EmitDelegate<Func<DamageInfo, DamageInfo>>((Func<DamageInfo, DamageInfo>)delegate(DamageInfo x)
					{
						info = x;
						return x;
					});
					val14.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_critMultiplier")
					});
					val14.Emit(OpCodes.Ldarg_0);
					val14.Emit(OpCodes.Ldarg_1);
					val14.EmitDelegate<Func<float, HealthComponent, DamageInfo, float>>((Func<float, HealthComponent, DamageInfo, float>)delegate(float orig, HealthComponent self, DamageInfo info)
					{
						if (!Object.op_Implicit((Object)(object)self))
						{
							return orig;
						}
						CharacterBody component = info.attacker.GetComponent<CharacterBody>();
						if (!Object.op_Implicit((Object)(object)component))
						{
							return orig;
						}
						Main.AdditionalProcInfo value3 = null;
						if (!critInfoAttachments.TryGetValue(info, out value3))
						{
							value3 = RollHypercrit(orig - 2f, component);
							critInfoAttachments.Add(info, value3);
						}
						return Mathf.Max(orig, value3.damageMult);
					});
				};
				<>c.<>9__3_0 = val;
				obj = (object)val;
			}
			HealthComponent.TakeDamageProcess += (Manipulator)obj;
			object obj2 = <>c.<>9__3_1;
			if (obj2 == null)
			{
				Manipulator val2 = delegate(ILContext il)
				{
					//IL_0008: Unknown result type (might be due to invalid IL or missing references)
					//IL_000e: Expected O, but got Unknown
					//IL_0065: 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)
					ILCursor val13 = new ILCursor(il);
					int message = -1;
					val13.GotoNext(new Func<Instruction, bool>[2]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref message),
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<NetworkServer>(x, "SendToAll")
					});
					int index = val13.Index;
					val13.Index = index + 1;
					val13.Emit(OpCodes.Ldloc, message);
					val13.Emit(OpCodes.Ldarg_0);
					val13.EmitDelegate<Action<DamageDealtMessage, DamageReport>>((Action<DamageDealtMessage, DamageReport>)delegate(DamageDealtMessage msg, DamageReport report)
					{
						TryPassHypercrit(report.damageInfo, msg);
					});
				};
				<>c.<>9__3_1 = val2;
				obj2 = (object)val2;
			}
			HealthComponent.SendDamageDealt += (Manipulator)obj2;
			object obj3 = <>c.<>9__3_2;
			if (obj3 == null)
			{
				hook_Serialize val3 = delegate(orig_Serialize orig, DamageDealtMessage self, NetworkWriter writer)
				{
					orig.Invoke(self, writer);
					if (!critInfoAttachments.TryGetValue(self, out var value2))
					{
						value2 = new Main.AdditionalProcInfo();
					}
					value2.Serialize(writer);
				};
				<>c.<>9__3_2 = val3;
				obj3 = (object)val3;
			}
			DamageDealtMessage.Serialize += (hook_Serialize)obj3;
			object obj4 = <>c.<>9__3_3;
			if (obj4 == null)
			{
				hook_Deserialize val4 = delegate(orig_Deserialize orig, DamageDealtMessage self, NetworkReader reader)
				{
					orig.Invoke(self, reader);
					Main.AdditionalProcInfo additionalProcInfo2 = new Main.AdditionalProcInfo();
					additionalProcInfo2.Deserialize(reader);
					critInfoAttachments.Add(self, additionalProcInfo2);
					lastNetworkedCritInfo = additionalProcInfo2;
				};
				<>c.<>9__3_3 = val4;
				obj4 = (object)val4;
			}
			DamageDealtMessage.Deserialize += (hook_Deserialize)obj4;
			object obj5 = <>c.<>9__3_4;
			if (obj5 == null)
			{
				hook_OnCrit val5 = delegate(orig_OnCrit orig, GlobalEventManager self, CharacterBody body, DamageInfo damageInfo, CharacterMaster master, float procCoefficient, ProcChainMask procChainMask)
				{
					//IL_0061: Unknown result type (might be due to invalid IL or missing references)
					//IL_003f: Unknown result type (might be due to invalid IL or missing references)
					critInfoAttachments.TryGetValue(damageInfo, out var value);
					if (value != null && value.numProcs > 1)
					{
						int numProcs = value.numProcs;
						value.numProcs = 0;
						for (int i = 0; i < numProcs; i++)
						{
							orig.Invoke(self, body, damageInfo, master, procCoefficient, procChainMask);
						}
					}
					else
					{
						orig.Invoke(self, body, damageInfo, master, procCoefficient, procChainMask);
					}
				};
				<>c.<>9__3_4 = val5;
				obj5 = (object)val5;
			}
			GlobalEventManager.OnCrit += (hook_OnCrit)obj5;
			object obj6 = <>c.<>9__3_5;
			if (obj6 == null)
			{
				Manipulator val6 = 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 val12 = new ILCursor(il);
					val12.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, typeof(DamageColor), "FindColor")
					});
					val12.EmitDelegate<Func<Color, Color>>((Func<Color, Color>)delegate(Color origColor)
					{
						//IL_000d: Unknown result type (might be due to invalid IL or missing references)
						//IL_000e: Unknown result type (might be due to invalid IL or missing references)
						//IL_006f: Unknown result type (might be due to invalid IL or missing references)
						//IL_0074: Unknown result type (might be due to invalid IL or missing references)
						//IL_0033: Unknown result type (might be due to invalid IL or missing references)
						//IL_0034: Unknown result type (might be due to invalid IL or missing references)
						//IL_0078: Unknown result type (might be due to invalid IL or missing references)
						if (lastNetworkedCritInfo == null)
						{
							return origColor;
						}
						Main.AdditionalProcInfo aci = lastNetworkedCritInfo;
						lastNetworkedCritInfo = null;
						float effectiveCount = GetEffectiveCount(aci);
						if (effectiveCount == 0f)
						{
							return origColor;
						}
						float num = 1f / 6f - (effectiveCount - 1f) / (float)Main.CritColor.Value;
						return Color.HSVToRGB((num % 1f + 1f) % 1f, 1f, 1f);
					});
				};
				<>c.<>9__3_5 = val6;
				obj6 = (object)val6;
			}
			DamageNumberManager.SpawnDamageNumber += (Manipulator)obj6;
			if (!Main.Flurry.Value)
			{
				return;
			}
			object obj7 = <>c.<>9__3_6;
			if (obj7 == null)
			{
				hook_OnEnter val7 = delegate(orig_OnEnter orig, FireFlurrySeekingArrow self)
				{
					orig.Invoke(self);
					Main.AdditionalProcInfo additionalProcInfo = RollHypercrit(((EntityState)self).characterBody.critMultiplier - 2f, ((EntityState)self).characterBody);
					if (additionalProcInfo.num > 1)
					{
						additionalProcInfo.damageMult *= 6f / (float)(3 + 3 * additionalProcInfo.num);
					}
					critInfoAttachments.Add(self, additionalProcInfo);
					((FireSeekingArrow)self).isCrit = additionalProcInfo.num > 0;
					((FireSeekingArrow)self).maxArrowCount = 3 + additionalProcInfo.num * 3;
					((FireSeekingArrow)self).arrowReloadDuration = ((FireSeekingArrow)self).baseArrowReloadDuration * (3f / (float)((FireSeekingArrow)self).maxArrowCount) / ((BaseState)self).attackSpeedStat;
				};
				<>c.<>9__3_6 = val7;
				obj7 = (object)val7;
			}
			FireFlurrySeekingArrow.OnEnter += (hook_OnEnter)obj7;
			object obj8 = <>c.<>9__3_7;
			if (obj8 == null)
			{
				Manipulator val8 = delegate(ILContext il)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Expected O, but got Unknown
					//IL_0038: Unknown result type (might be due to invalid IL or missing references)
					//IL_0044: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val11 = new ILCursor(il);
					val11.GotoNext(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 0)
					});
					val11.Emit(OpCodes.Dup);
					val11.Emit(OpCodes.Ldarg_0);
					val11.EmitDelegate<Action<GenericDamageOrb, FireSeekingArrow>>((Action<GenericDamageOrb, FireSeekingArrow>)delegate(GenericDamageOrb orb, FireSeekingArrow self)
					{
						TryPassHypercrit(self, orb);
					});
				};
				<>c.<>9__3_7 = val8;
				obj8 = (object)val8;
			}
			FireSeekingArrow.FireOrbArrow += (Manipulator)obj8;
			object obj9 = <>c.<>9__3_8;
			if (obj9 == null)
			{
				Manipulator val9 = 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_0039: Unknown result type (might be due to invalid IL or missing references)
					//IL_0045: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val10 = new ILCursor(il);
					val10.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchNewobj<DamageInfo>(x)
					});
					val10.Emit(OpCodes.Dup);
					val10.Emit(OpCodes.Ldarg_0);
					val10.EmitDelegate<Action<DamageInfo, GenericDamageOrb>>((Action<DamageInfo, GenericDamageOrb>)delegate(DamageInfo di, GenericDamageOrb orb)
					{
						TryPassHypercrit(orb, di);
					});
				};
				<>c.<>9__3_8 = val9;
				obj9 = (object)val9;
			}
			GenericDamageOrb.OnArrival += (Manipulator)obj9;
		}

		public static void LaserScopeRework()
		{
			//IL_0015: 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_0020: Expected O, but got Unknown
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			object obj = <>c.<>9__4_0;
			if (obj == null)
			{
				StatHookEventHandler val = delegate(CharacterBody self, StatHookEventArgs args)
				{
					if (!((Object)(object)self == (Object)null) && !((Object)(object)self.inventory == (Object)null))
					{
						int itemCount = self.inventory.GetItemCount(Items.CritDamage);
						if (itemCount > 0)
						{
							args.critDamageMultAdd += (Main.LaserScopeDamage.Value + (float)(itemCount - 1) * Main.LaserScopeDamageStack.Value) / 100f - (float)itemCount;
							args.critAdd += Main.LaserScope.Value + (float)(itemCount - 1) * Main.LaserScopeStack.Value;
						}
					}
				};
				<>c.<>9__4_0 = val;
				obj = (object)val;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj;
			object obj2 = <>c.<>9__4_1;
			if (obj2 == null)
			{
				hook_GetLocalizedStringByToken val2 = (orig_GetLocalizedStringByToken orig, Language self, string token) => (token == "ITEM_CRITDAMAGE_DESC") ? (((Main.LaserScope.Value != 0f || Main.LaserScopeStack.Value != 0f) ? ("Gain " + s(Main.LaserScope.Value, Main.LaserScopeStack.Value, (float f) => f + "%") + " chance to <style=cIsDamage>Critically Strike</style>. ") : "") + ((Main.LaserScopeDamage.Value != 0f || Main.LaserScopeDamageStack.Value != 0f) ? ("<style=cIsDamage>Critical Strikes</style> deal an additional " + s(Main.LaserScopeDamage.Value, Main.LaserScopeDamageStack.Value, (float f) => f + "%") + ".") : "")) : orig.Invoke(self, token);
				<>c.<>9__4_1 = val2;
				obj2 = (object)val2;
			}
			Language.GetLocalizedStringByToken += (hook_GetLocalizedStringByToken)obj2;
			static string s(float first, float stack, Func<float, string> fn)
			{
				string text = "<style=cIsDamage>" + fn(first) + "</style>";
				if (stack != 0f)
				{
					text = text + "<style=cStack>(" + ((stack > 0f) ? "+" : "-") + fn(stack) + " per stack)</style>";
				}
				return text;
			}
		}

		public static void MoonglassesRework()
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Expected O, but got Unknown
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Expected O, but got Unknown
			if (General.disabledItems.Keys.Any((ItemIndex x) => ((Object)ItemCatalog.GetItemDef(x)).name == "MysticsItems_Moonglasses"))
			{
				return;
			}
			object obj = <>c.<>9__5_0;
			if (obj == null)
			{
				hook_RecalculateStats val = delegate(orig_RecalculateStats orig, CharacterBody self)
				{
					orig.Invoke(self);
					if ((Object)(object)((self != null) ? self.inventory : null) != (Object)null)
					{
						int itemCount = self.inventory.GetItemCount(Items.MysticsItems_Moonglasses);
						if (itemCount != 0)
						{
							self.crit *= Mathf.Pow(2f, (float)itemCount);
							self.crit -= Main.Moonglasses.Value * (float)itemCount;
							if (self.crit < 0f && self.inventory.GetItemCount(Items.ConvertCritChanceToCritDamage) > 0)
							{
								Chat.AddMessage("Hypercrit makes crit chance past 100 give a chance to do a hit that is your crit damage +100%. So in a scenario where your crit is 101% and crit damage is x2, mean your actual crit damage will be x2 in 100% cases and x3 in 1% cases. So to put it simply from x2 to x3.\r\nNow negative crit would work like this. Let's say you have -50% chance and x3.5 crit damage. Obviously no way for you to proc crits randomly, but could give a change to deal \"negative crit\" in other ways, that is -100% from you crit damage for every -100% crit chance past 0. So your crit damage range would be from x2.5 to x3.5.\r\nAt the least I was hoping that negative would work with survivors that can't have chance and instead get it converted to crit damage. Like railgunner.");
								self.master.TrueKill();
							}
							self.crit = Mathf.Max(0f, self.crit);
						}
					}
				};
				<>c.<>9__5_0 = val;
				obj = (object)val;
			}
			CharacterBody.RecalculateStats += (hook_RecalculateStats)obj;
			object obj2 = <>c.<>9__5_1;
			if (obj2 == null)
			{
				hook_GetLocalizedStringByToken val2 = delegate(orig_GetLocalizedStringByToken orig, Language self, string token)
				{
					if (token == "ITEM_MYSTICSITEMS_MOONGLASSES_PICKUP")
					{
						return orig.Invoke(self, "ITEM_HYPERCRIT_MOONGLASSES_PICKUP");
					}
					return (token == "ITEM_MYSTICSITEMS_MOONGLASSES_DESC") ? orig.Invoke(self, "ITEM_HYPERCRIT_MOONGLASSES_DESC") : orig.Invoke(self, token);
				};
				<>c.<>9__5_1 = val2;
				obj2 = (object)val2;
			}
			Language.GetLocalizedStringByToken += (hook_GetLocalizedStringByToken)obj2;
			LanguageAPI.Add("ITEM_HYPERCRIT_MOONGLASSES_PICKUP", "Increase Critical Strike damage... <color=#FF7F7F>BUT reduce Critical Strike chance.</color>");
			LanguageAPI.Add("ITEM_HYPERCRIT_MOONGLASSES_DESC", "Increase Critical Strike damage by <style=cIsDamage>{CritDamageIncrease}% <style=cStack>(+{CritDamageIncreasePerStack}% per stack)</style></style>. <style=cIsUtility>reduce Critical Strike chance by {0}% <style=cStack>(+{0}% per stack)</style> for each stack.</style>".Replace("{0}", Main.Moonglasses.Value.ToString()).Replace("{CritDamageIncrease}", ((object)Moonglasses.critDamageIncrease).ToString()).Replace("{CritDamageIncreasePerStack}", ((object)Moonglasses.critDamageIncreasePerStack).ToString()));
		}

		public static bool TryGetHypercrit(object target, ref Main.AdditionalProcInfo aci)
		{
			return critInfoAttachments.TryGetValue(target, out aci);
		}

		private static bool TryPassHypercrit(object from, object to)
		{
			Main.AdditionalProcInfo value;
			bool flag = critInfoAttachments.TryGetValue(from, out value);
			if (flag)
			{
				critInfoAttachments.Add(to, value);
			}
			return flag;
		}

		private static bool TryPassHypercrit(object from, object to, out Main.AdditionalProcInfo aci)
		{
			bool flag = critInfoAttachments.TryGetValue(from, out aci);
			if (flag)
			{
				critInfoAttachments.Add(to, aci);
			}
			return flag;
		}

		public static Main.AdditionalProcInfo RollHypercrit(float damage, CharacterBody body)
		{
			Main.AdditionalProcInfo additionalProcInfo = new Main.AdditionalProcInfo();
			if (Object.op_Implicit((Object)(object)body))
			{
				additionalProcInfo.totalChance = body.crit;
				float effectiveCount = GetEffectiveCount(body.crit, body);
				additionalProcInfo.num = (int)effectiveCount;
				if (additionalProcInfo.num == 0)
				{
					additionalProcInfo.damageMult = 1f;
				}
				else
				{
					additionalProcInfo.damageMult = (1f + damage) * Main.Calc(Main.CritMode.Value, Main.CritA.Value, Main.CritB.Value, effectiveCount);
				}
				float num = 0f;
				if (additionalProcInfo.num != 0)
				{
					num = Main.Calc(Main.CritProcMode.Value, Main.CritProcA.Value, Main.CritProcB.Value, effectiveCount);
				}
				additionalProcInfo.numProcs = (int)num + (Util.CheckRoll(num % 1f * 100f, 0f, (CharacterMaster)null) ? 1 : 0);
			}
			return additionalProcInfo;
		}

		public static float GetDamage(float chance, float damage, CharacterBody body)
		{
			return (1f + damage) * Main.Calc(Main.CritMode.Value, Main.CritA.Value, Main.CritB.Value, Mathf.Max(1f, GetEffectiveCount(chance + (100f - chance % 100f), body)));
		}

		public static float GetEffectiveCount(Main.AdditionalProcInfo aci)
		{
			return aci.num;
		}

		public static float GetEffectiveCount(float chance, CharacterBody body, bool forceSingleCrit = false)
		{
			float num = Mathf.Max(0f, (chance - (float)(forceSingleCrit ? 100 : 0)) / 100f);
			if (Main.CritCap.Value >= 0f)
			{
				num = Mathf.Min(num, Main.CritCap.Value);
			}
			if (num <= 0f)
			{
				return 0f;
			}
			return Main.CalcChance(Main.CritChance.Value, num, body.master.luck);
		}

		[CompilerGenerated]
		internal static string <LaserScopeRework>g__s|4_2(float first, float stack, Func<float, string> fn)
		{
			string text = "<style=cIsDamage>" + fn(first) + "</style>";
			if (stack != 0f)
			{
				text = text + "<style=cStack>(" + ((stack > 0f) ? "+" : "-") + fn(stack) + " per stack)</style>";
			}
			return text;
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("prodzpod.Hypercrit2", "Hypercrit2", "2.0.0")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Main : BaseUnityPlugin
	{
		public enum CritStackingMode
		{
			Basic,
			Exponential,
			Cumulative,
			Asymptotic,
			Logarithmic
		}

		public enum CritChanceMode
		{
			Rollover,
			Uniform,
			Binomial,
			Halves,
			ReverseHalves
		}

		public class AdditionalProcInfo : ISerializableObject
		{
			public float totalChance = 0f;

			public int num = 0;

			public float damageMult = 1f;

			public int numProcs = 0;

			public void Deserialize(NetworkReader reader)
			{
				totalChance = reader.ReadSingle();
				num = reader.ReadInt32();
				numProcs = reader.ReadInt32();
				damageMult = reader.ReadSingle();
			}

			public void Serialize(NetworkWriter writer)
			{
				writer.Write(totalChance);
				writer.Write(num);
				writer.Write(numProcs);
				writer.Write(damageMult);
			}
		}

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

			public static StatHookEventHandler <>9__45_0;

			public static Func<CharacterBody, string> <>9__50_0;

			public static Func<CharacterBody, string> <>9__50_1;

			public static Func<CharacterBody, string> <>9__50_2;

			public static Func<CharacterBody, string> <>9__50_3;

			public static Func<CharacterBody, string> <>9__50_4;

			public static Func<CharacterBody, string> <>9__50_5;

			public static Func<CharacterBody, string> <>9__50_6;

			public static Func<CharacterBody, string> <>9__50_7;

			public static Func<CharacterBody, string> <>9__50_8;

			internal void <Awake>b__45_0(CharacterBody self, StatHookEventArgs args)
			{
				self.baseCrit = BaseCritChance.Value * 100f;
				self.bleedChance += BaseBleedChance.Value * 100f;
			}

			internal string <LookingGlassCompat>b__50_0(CharacterBody statBody)
			{
				return GetWLuck(statBody.crit / 100f, statBody).ToString("0.##");
			}

			internal string <LookingGlassCompat>b__50_1(CharacterBody statBody)
			{
				return GetWLuck(statBody.bleedChance / 100f, statBody).ToString("0.##");
			}

			internal string <LookingGlassCompat>b__50_2(CharacterBody statBody)
			{
				return <LookingGlassCompat>g___d|50_9((GetCollapse(statBody) * 100f).ToString("0.##"));
			}

			internal string <LookingGlassCompat>b__50_3(CharacterBody statBody)
			{
				return <LookingGlassCompat>g___d|50_9(GetWLuck(GetCollapse(statBody), statBody).ToString("0.##"));
			}

			internal string <LookingGlassCompat>b__50_4(CharacterBody statBody)
			{
				return <LookingGlassCompat>g___d|50_9(statBody.GetBleedDamage().ToString("0.##"));
			}

			internal string <LookingGlassCompat>b__50_5(CharacterBody statBody)
			{
				return <LookingGlassCompat>g___d|50_9(statBody.GetCollapseDamage().ToString("0.##"));
			}

			internal string <LookingGlassCompat>b__50_6(CharacterBody statBody)
			{
				return <LookingGlassCompat>g___d|50_9(Crit.GetDamage(statBody.crit, statBody.critMultiplier - 2f, statBody).ToString("0.##"));
			}

			internal string <LookingGlassCompat>b__50_7(CharacterBody statBody)
			{
				return <LookingGlassCompat>g___d|50_9(Bleed.GetDamage(statBody.bleedChance, statBody.GetBleedDamage() - 1f, statBody).ToString("0.##"));
			}

			internal string <LookingGlassCompat>b__50_8(CharacterBody statBody)
			{
				return <LookingGlassCompat>g___d|50_9(Bleed.GetDamage(GetCollapse(statBody) * 100f, statBody.GetCollapseDamage() - 1f, statBody).ToString("0.##"));
			}
		}

		public const string PluginGUID = "prodzpod.Hypercrit2";

		public const string PluginAuthor = "prodzpod";

		public const string PluginName = "Hypercrit2";

		public const string PluginVersion = "2.0.0";

		public static ManualLogSource Log;

		internal static PluginInfo pluginInfo;

		public static ConfigFile Config;

		public static ConfigEntry<float> BaseCritChance;

		public static ConfigEntry<float> CritCap;

		public static ConfigEntry<CritStackingMode> CritMode;

		public static ConfigEntry<float> CritA;

		public static ConfigEntry<float> CritB;

		public static ConfigEntry<CritStackingMode> CritProcMode;

		public static ConfigEntry<float> CritProcA;

		public static ConfigEntry<float> CritProcB;

		public static ConfigEntry<CritChanceMode> CritChance;

		public static ConfigEntry<int> CritColor;

		public static ConfigEntry<bool> Flurry;

		public static ConfigEntry<float> LaserScope;

		public static ConfigEntry<float> LaserScopeStack;

		public static ConfigEntry<float> LaserScopeDamage;

		public static ConfigEntry<float> LaserScopeDamageStack;

		public static ConfigEntry<float> Moonglasses;

		public static ConfigEntry<float> BaseBleedChance;

		public static ConfigEntry<float> BleedCap;

		public static ConfigEntry<CritStackingMode> BleedMode;

		public static ConfigEntry<float> BleedA;

		public static ConfigEntry<float> BleedB;

		public static ConfigEntry<CritStackingMode> BleedProcMode;

		public static ConfigEntry<float> BleedProcA;

		public static ConfigEntry<float> BleedProcB;

		public static ConfigEntry<CritChanceMode> BleedChance;

		public static ConfigEntry<int> BleedColor;

		public static ConfigEntry<float> CollapseCap;

		public static ConfigEntry<CritStackingMode> CollapseMode;

		public static ConfigEntry<float> CollapseA;

		public static ConfigEntry<float> CollapseB;

		public static ConfigEntry<CritStackingMode> CollapseProcMode;

		public static ConfigEntry<float> CollapseProcA;

		public static ConfigEntry<float> CollapseProcB;

		public static ConfigEntry<CritChanceMode> CollapseChance;

		public static ConfigEntry<bool> LamerShatterspleen;

		public void Awake()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			//IL_054d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0552: Unknown result type (might be due to invalid IL or missing references)
			//IL_0558: Expected O, but got Unknown
			pluginInfo = ((BaseUnityPlugin)this).Info;
			Log = ((BaseUnityPlugin)this).Logger;
			Config = new ConfigFile(Path.Combine(Paths.ConfigPath, "prodzpod.Hypercrit2.cfg"), true);
			BaseCritChance = Config.Bind<float>("Hypercrit 2", "Base Crit Chance", 0.01f, "Crit chance every survivors start with.");
			CritCap = Config.Bind<float>("Hypercrit 2", "Crit Cap", -1f, "Maximum number of crits. set to -1 to uncap, set to 1 to disable.");
			CritMode = Config.Bind<CritStackingMode>("Hypercrit 2", "Mode", CritStackingMode.Basic, "Crit damage calculation, See README for details");
			CritA = Config.Bind<float>("Hypercrit 2", "A", 1f, "See README for details");
			CritB = Config.Bind<float>("Hypercrit 2", "B", 1f, "See README for details");
			CritProcMode = Config.Bind<CritStackingMode>("Hypercrit 2", "Proc Mode", CritStackingMode.Basic, "Crit proc amount calculation, See README for details");
			CritProcA = Config.Bind<float>("Hypercrit 2", "Proc A", 1f, "See README for details");
			CritProcB = Config.Bind<float>("Hypercrit 2", "Proc B", 1f, "See README for details");
			CritChance = Config.Bind<CritChanceMode>("Hypercrit 2", "Crit Chance Distribution", CritChanceMode.Rollover, "See README for details");
			CritColor = Config.Bind<int>("Hypercrit 2", "Color Cycle", 12, "Set to 1 to disable color change");
			Flurry = Config.Bind<bool>("Hypercrit 2", "Procs Affects Flurry", true, "yeah!!");
			LaserScope = Config.Bind<float>("Hypercrit 2", "Laser Scope Crit Chance on First Stack", 25f, "Gives crit chance on first stack, like other crit synergy items.");
			LaserScopeStack = Config.Bind<float>("Hypercrit 2", "Laser Scope Crit Chance on Subsequent Stack", 0f, "Gives crit chance on first stack, like other crit synergy items.");
			LaserScopeDamage = Config.Bind<float>("Hypercrit 2", "Laser Scope Crit Damage on First Stack", 100f, "Gives crit chance on first stack, like other crit synergy items.");
			LaserScopeDamageStack = Config.Bind<float>("Hypercrit 2", "Laser Scope Crit Damage on Subsequent Stack", 100f, "Gives crit chance on first stack, like other crit synergy items.");
			Moonglasses = Config.Bind<float>("Hypercrit 2", "Moonglasses Rework", 50f, "makes it so moonglasses reduces crit chance. actual downside?? set to 0 to disable.");
			BaseBleedChance = Config.Bind<float>("Hyperbleed 2", "Base Bleed Chance", 0f, "Bleed chance every survivors start with.");
			BleedCap = Config.Bind<float>("Hyperbleed 2", "Bleed Cap", -1f, "Maximum number of bleeds. set to -1 to uncap, set to 1 to disable.");
			BleedMode = Config.Bind<CritStackingMode>("Hyperbleed 2", "Mode", CritStackingMode.Basic, "Bleed damage calculation, See README for details");
			BleedA = Config.Bind<float>("Hyperbleed 2", "A", 1f, "See README for details");
			BleedB = Config.Bind<float>("Hyperbleed 2", "B", 1f, "See README for details");
			BleedProcMode = Config.Bind<CritStackingMode>("Hyperbleed 2", "Proc Mode", CritStackingMode.Basic, "Bleed proc amount calculation, See README for details");
			BleedProcA = Config.Bind<float>("Hyperbleed 2", "Proc A", 1f, "See README for details");
			BleedProcB = Config.Bind<float>("Hyperbleed 2", "Proc B", 1f, "See README for details");
			BleedChance = Config.Bind<CritChanceMode>("Hyperbleed 2", "Bleed Chance Distribution", CritChanceMode.Rollover, "See README for details");
			BleedColor = Config.Bind<int>("Hyperbleed 2", "Color Cycle", 12, "Set to 1 to disable color change");
			CollapseCap = Config.Bind<float>("Hypercollapse 2", "Collapse Cap", -1f, "Maximum number of collapses. set to -1 to uncap, set to 1 to disable.");
			CollapseMode = Config.Bind<CritStackingMode>("Hypercollapse 2", "Mode", CritStackingMode.Basic, "Collapse damage calculation, See README for details");
			CollapseA = Config.Bind<float>("Hypercollapse 2", "A", 1f, "See README for details");
			CollapseB = Config.Bind<float>("Hypercollapse 2", "B", 1f, "See README for details");
			CollapseProcMode = Config.Bind<CritStackingMode>("Hypercollapse 2", "Proc Mode", CritStackingMode.Basic, "Collapse proc amount calculation, See README for details");
			CollapseProcA = Config.Bind<float>("Hypercollapse