Decompiled source of EnemyCritFix v1.0.1

EnemyCritFix/EnemyCritFix.dll

Decompiled 2 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.BeetleGuardMonster;
using EntityStates.BeetleMonster;
using EntityStates.BigMush;
using EntityStates.Bison;
using EntityStates.BrotherMonster;
using EntityStates.ClayGrenadier;
using EntityStates.GolemMonster;
using EntityStates.Halcyonite;
using EntityStates.JellyfishMonster;
using EntityStates.Lynx2Monster;
using EntityStates.ParentMonster;
using EntityStates.SolusAmalgamator;
using EntityStates.Totem;
using IL.EntityStates.BigMush;
using IL.EntityStates.BrotherMonster;
using IL.EntityStates.ClayGrenadier;
using IL.EntityStates.GolemMonster;
using IL.EntityStates.Halcyonite;
using IL.EntityStates.JellyfishMonster;
using IL.EntityStates.Lynx2Monster;
using IL.EntityStates.MajorConstruct.Weapon;
using IL.EntityStates.ParentMonster;
using IL.EntityStates.SolusAmalgamator;
using IL.EntityStates.Totem;
using IL.RoR2;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.BeetleGuardMonster;
using On.EntityStates.BeetleMonster;
using On.EntityStates.Bison;
using On.EntityStates.Totem;
using R2API;
using RoR2;
using RoR2.Projectile;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("EnemyCritFix")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("EnemyCritFix")]
[assembly: AssemblyTitle("EnemyCritFix")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace EnemyCritFix;

internal static class Log
{
	private static ManualLogSource _logSource;

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

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

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

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

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

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

	internal static void Warning(object data)
	{
		_logSource.LogWarning(data);
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("Samuel17.EnemyCritFix", "EnemyCritFix", "1.0.1")]
public class Main : BaseUnityPlugin
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static hook_OnEnter <>9__5_0;

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

		public static Manipulator <>9__5_1;

		public static hook_OnEnter <>9__5_2;

		public static hook_OnEnter <>9__5_3;

		public static hook_ResetOverlapAttack <>9__5_4;

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

		public static Manipulator <>9__5_5;

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

		public static Manipulator <>9__5_6;

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

		public static Manipulator <>9__5_7;

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

		public static Manipulator <>9__5_8;

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

		public static Manipulator <>9__5_9;

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

		public static Manipulator <>9__5_10;

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

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

		public static Func<WhirlWindPersuitCycle, bool> <>9__5_30;

		public static Manipulator <>9__5_11;

		public static hook_OnEnter <>9__5_12;

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

		public static Manipulator <>9__5_13;

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

		public static Manipulator <>9__5_14;

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

		public static Manipulator <>9__5_15;

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

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

		public static Func<ShockArmor, GameObject> <>9__5_36;

		public static Manipulator <>9__5_16;

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

		public static Manipulator <>9__5_17;

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

		public static Manipulator <>9__5_18;

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

		public static Manipulator <>9__5_19;

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

		public static Manipulator <>9__5_20;

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

		public static Manipulator <>9__5_21;

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

		public static Manipulator <>9__5_22;

		internal void <CritHooks>b__5_0(orig_OnEnter orig, HeadbuttState self)
		{
			orig.Invoke(self);
			if (self.attack != null)
			{
				self.attack.isCrit = ((BaseState)self).RollCrit();
			}
		}

		internal void <CritHooks>b__5_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_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<JellyNova>(OpCodes.Ldfld, "attack");
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<BaseState>(OpCodes.Call, "RollCrit");
				val.Emit<BlastAttack>(OpCodes.Stfld, "crit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Jellyfish crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_23(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage");
		}

		internal void <CritHooks>b__5_2(orig_OnEnter orig, GroundSlam self)
		{
			orig.Invoke(self);
			if (self.attack != null)
			{
				self.attack.isCrit = ((BaseState)self).RollCrit();
			}
		}

		internal void <CritHooks>b__5_3(orig_OnEnter orig, Headbutt self)
		{
			orig.Invoke(self);
			if (self.attack != null)
			{
				self.attack.isCrit = ((BaseState)self).RollCrit();
			}
		}

		internal void <CritHooks>b__5_4(orig_ResetOverlapAttack orig, Charge self)
		{
			orig.Invoke(self);
			if (self.attack != null)
			{
				self.attack.isCrit = ((BaseState)self).RollCrit();
			}
		}

		internal void <CritHooks>b__5_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_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<FrenziedUpsetPoundSlamState>(OpCodes.Ldfld, "attack");
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<BaseState>(OpCodes.Call, "RollCrit");
				val.Emit<BlastAttack>(OpCodes.Stfld, "crit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Lynx Berserker slam crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_24(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage");
		}

		internal void <CritHooks>b__5_6(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
			}))
			{
				val.Emit(OpCodes.Dup);
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<BaseState>(OpCodes.Call, "RollCrit");
				val.Emit<BlastAttack>(OpCodes.Stfld, "crit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Stone Golem laser crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_25(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage");
		}

		internal void <CritHooks>b__5_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_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<ClapState>(OpCodes.Ldfld, "attack");
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<BaseState>(OpCodes.Call, "RollCrit");
				val.Emit<BlastAttack>(OpCodes.Stfld, "crit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Stone Golem clap crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_26(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage");
		}

		internal void <CritHooks>b__5_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_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<GroundSlam>(OpCodes.Ldfld, "attack");
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<BaseState>(OpCodes.Call, "RollCrit");
				val.Emit<BlastAttack>(OpCodes.Stfld, "crit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Parent crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_27(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage");
		}

		internal void <CritHooks>b__5_9(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<FaceSlam>(OpCodes.Ldfld, "attack");
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<BaseState>(OpCodes.Call, "RollCrit");
				val.Emit<BlastAttack>(OpCodes.Stfld, "crit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Clay Apothecary melee slam crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_28(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage");
		}

		internal void <CritHooks>b__5_10(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
			}))
			{
				val.Emit(OpCodes.Dup);
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<BaseState>(OpCodes.Call, "RollCrit");
				val.Emit<BlastAttack>(OpCodes.Stfld, "crit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Halcyonite laser crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_29(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage");
		}

		internal void <CritHooks>b__5_11(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			int num = default(int);
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "crit")
			}) && val.TryGotoPrev((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num)
			}))
			{
				val.Remove();
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<WhirlWindPersuitCycle, bool>>((Func<WhirlWindPersuitCycle, bool>)((WhirlWindPersuitCycle self) => ((EntityState)self).characterBody.RollCrit()));
				flag = false;
			}
			if (flag)
			{
				Log.Error("Halcyonite Whirlwind crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_31(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "crit");
		}

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

		internal bool <CritHooks>b__5_30(WhirlWindPersuitCycle self)
		{
			return ((EntityState)self).characterBody.RollCrit();
		}

		internal void <CritHooks>b__5_12(orig_OnEnter orig, GroundPound self)
		{
			orig.Invoke(self);
			if (self._attack != null)
			{
				self._attack.crit = ((BaseState)self).RollCrit();
			}
		}

		internal void <CritHooks>b__5_13(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
			}))
			{
				val.Emit(OpCodes.Dup);
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<BaseState>(OpCodes.Call, "RollCrit");
				val.Emit<BlastAttack>(OpCodes.Stfld, "crit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Lynx Totem pillar crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_33(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage");
		}

		internal void <CritHooks>b__5_14(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
			}))
			{
				val.Emit(OpCodes.Dup);
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<BaseState>(OpCodes.Call, "RollCrit");
				val.Emit<BlastAttack>(OpCodes.Stfld, "crit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Xi Construct laser finisher crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_34(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage");
		}

		internal void <CritHooks>b__5_15(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
			}))
			{
				val.Emit(OpCodes.Dup);
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<BaseState>(OpCodes.Call, "RollCrit");
				val.Emit<BlastAttack>(OpCodes.Stfld, "crit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Solus Amalgamator shock pulse crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_35(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage");
		}

		internal void <CritHooks>b__5_16(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "attacker")
			}) && val.TryGotoPrev((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdnull(x)
			}))
			{
				val.Remove();
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<ShockArmor, GameObject>>((Func<ShockArmor, GameObject>)((ShockArmor self) => ((EntityState)self).gameObject));
				flag = false;
			}
			if (flag)
			{
				Log.Error("Solus Amalgamator shock pulse attacker hook failed!");
			}
		}

		internal bool <CritHooks>b__5_37(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "attacker");
		}

		internal bool <CritHooks>b__5_38(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdnull(x);
		}

		internal GameObject <CritHooks>b__5_36(ShockArmor self)
		{
			return ((EntityState)self).gameObject;
		}

		internal void <CritHooks>b__5_17(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<FireProjectileInfo>(x, "damage")
			}))
			{
				val.Emit(OpCodes.Ldloca, 3);
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<BaseState>(OpCodes.Call, "RollCrit");
				val.Emit<FireProjectileInfo>(OpCodes.Stfld, "crit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Solus Amalgamator energy orb crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_39(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<FireProjectileInfo>(x, "damage");
		}

		internal void <CritHooks>b__5_18(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<FireProjectileInfo>(x, "damage")
			}))
			{
				val.Emit(OpCodes.Ldloca, 2);
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<BaseState>(OpCodes.Call, "RollCrit");
				val.Emit<FireProjectileInfo>(OpCodes.Stfld, "crit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Severed Breaker crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_40(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<FireProjectileInfo>(x, "damage");
		}

		internal void <CritHooks>b__5_19(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<Regrowth>(OpCodes.Ldfld, "_landingBlastAttack");
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<BaseState>(OpCodes.Call, "RollCrit");
				val.Emit<BlastAttack>(OpCodes.Stfld, "crit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Shruum landing attack crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_41(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage");
		}

		internal void <CritHooks>b__5_20(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<OverlapAttack>(x, "damage")
			}))
			{
				val.Emit(OpCodes.Dup);
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<BaseState>(OpCodes.Call, "RollCrit");
				val.Emit<OverlapAttack>(OpCodes.Stfld, "isCrit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Mithrix hammer slam (direct) crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_42(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<OverlapAttack>(x, "damage");
		}

		internal void <CritHooks>b__5_21(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<WeaponSlam>(OpCodes.Ldfld, "blastAttack");
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<BaseState>(OpCodes.Call, "RollCrit");
				val.Emit<BlastAttack>(OpCodes.Stfld, "crit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Mithrix hammer slam (explosion) crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_43(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage");
		}

		internal void <CritHooks>b__5_22(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			bool flag = true;
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<OverlapAttack>(x, "damage")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<ContactDamage>(OpCodes.Ldfld, "overlapAttack");
				val.Emit(OpCodes.Ldarg_0);
				val.Emit<ContactDamage>(OpCodes.Ldfld, "characterBody");
				val.Emit<CharacterBody>(OpCodes.Callvirt, "RollCrit");
				val.Emit<OverlapAttack>(OpCodes.Stfld, "isCrit");
				flag = false;
			}
			if (flag)
			{
				Log.Error("Contact damage crit hook failed!");
			}
		}

		internal bool <CritHooks>b__5_44(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<OverlapAttack>(x, "damage");
		}
	}

	public static ConfigEntry<float> enemyCritChance { get; private set; }

	public void Awake()
	{
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Expected O, but got Unknown
		Log.Init(((BaseUnityPlugin)this).Logger);
		enemyCritChance = ((BaseUnityPlugin)this).Config.Bind<float>("heha", "Monster Crit Chance", 0f, "Bonus crit percentage applied to all enemies. Set to a negative value (or zero) to disable.");
		CritHooks();
		if (enemyCritChance.Value > 0f)
		{
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(EnemyCritChance);
		}
	}

	private void CritHooks()
	{
		//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
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Expected O, but got Unknown
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Expected O, but got Unknown
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Expected O, but got Unknown
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Expected O, but got Unknown
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Expected O, but got Unknown
		//IL_0118: 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_0123: Expected O, but got Unknown
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Expected O, but got Unknown
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Expected O, but got Unknown
		//IL_0187: Unknown result type (might be due to invalid IL or missing references)
		//IL_018c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0192: Expected O, but got Unknown
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b7: Expected O, but got Unknown
		//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dc: Expected O, but got Unknown
		//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0201: Expected O, but got Unknown
		//IL_021b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0220: Unknown result type (might be due to invalid IL or missing references)
		//IL_0226: Expected O, but got Unknown
		//IL_0240: Unknown result type (might be due to invalid IL or missing references)
		//IL_0245: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: Expected O, but got Unknown
		//IL_0265: Unknown result type (might be due to invalid IL or missing references)
		//IL_026a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0270: Expected O, but got Unknown
		//IL_028a: Unknown result type (might be due to invalid IL or missing references)
		//IL_028f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Expected O, but got Unknown
		//IL_02af: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ba: Expected O, but got Unknown
		//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02df: Expected O, but got Unknown
		//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0304: Expected O, but got Unknown
		//IL_031e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0323: Unknown result type (might be due to invalid IL or missing references)
		//IL_0329: Expected O, but got Unknown
		//IL_0343: Unknown result type (might be due to invalid IL or missing references)
		//IL_0348: Unknown result type (might be due to invalid IL or missing references)
		//IL_034e: Expected O, but got Unknown
		object obj = <>c.<>9__5_0;
		if (obj == null)
		{
			hook_OnEnter val = delegate(orig_OnEnter orig, HeadbuttState self)
			{
				orig.Invoke(self);
				if (self.attack != null)
				{
					self.attack.isCrit = ((BaseState)self).RollCrit();
				}
			};
			<>c.<>9__5_0 = val;
			obj = (object)val;
		}
		HeadbuttState.OnEnter += (hook_OnEnter)obj;
		object obj2 = <>c.<>9__5_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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
				}))
				{
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<JellyNova>(OpCodes.Ldfld, "attack");
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<BaseState>(OpCodes.Call, "RollCrit");
					val24.Emit<BlastAttack>(OpCodes.Stfld, "crit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Jellyfish crit hook failed!");
				}
			};
			<>c.<>9__5_1 = val2;
			obj2 = (object)val2;
		}
		JellyNova.Detonate += (Manipulator)obj2;
		object obj3 = <>c.<>9__5_2;
		if (obj3 == null)
		{
			hook_OnEnter val3 = delegate(orig_OnEnter orig, GroundSlam self)
			{
				orig.Invoke(self);
				if (self.attack != null)
				{
					self.attack.isCrit = ((BaseState)self).RollCrit();
				}
			};
			<>c.<>9__5_2 = val3;
			obj3 = (object)val3;
		}
		GroundSlam.OnEnter += (hook_OnEnter)obj3;
		object obj4 = <>c.<>9__5_3;
		if (obj4 == null)
		{
			hook_OnEnter val4 = delegate(orig_OnEnter orig, Headbutt self)
			{
				orig.Invoke(self);
				if (self.attack != null)
				{
					self.attack.isCrit = ((BaseState)self).RollCrit();
				}
			};
			<>c.<>9__5_3 = val4;
			obj4 = (object)val4;
		}
		Headbutt.OnEnter += (hook_OnEnter)obj4;
		object obj5 = <>c.<>9__5_4;
		if (obj5 == null)
		{
			hook_ResetOverlapAttack val5 = delegate(orig_ResetOverlapAttack orig, Charge self)
			{
				orig.Invoke(self);
				if (self.attack != null)
				{
					self.attack.isCrit = ((BaseState)self).RollCrit();
				}
			};
			<>c.<>9__5_4 = val5;
			obj5 = (object)val5;
		}
		Charge.ResetOverlapAttack += (hook_ResetOverlapAttack)obj5;
		object obj6 = <>c.<>9__5_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
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
				}))
				{
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<FrenziedUpsetPoundSlamState>(OpCodes.Ldfld, "attack");
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<BaseState>(OpCodes.Call, "RollCrit");
					val24.Emit<BlastAttack>(OpCodes.Stfld, "crit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Lynx Berserker slam crit hook failed!");
				}
			};
			<>c.<>9__5_5 = val6;
			obj6 = (object)val6;
		}
		FrenziedUpsetPoundSlamState.DetonateAuthority += (Manipulator)obj6;
		object obj7 = <>c.<>9__5_6;
		if (obj7 == null)
		{
			Manipulator val7 = 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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: 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)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
				}))
				{
					val24.Emit(OpCodes.Dup);
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<BaseState>(OpCodes.Call, "RollCrit");
					val24.Emit<BlastAttack>(OpCodes.Stfld, "crit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Stone Golem laser crit hook failed!");
				}
			};
			<>c.<>9__5_6 = val7;
			obj7 = (object)val7;
		}
		FireLaser.OnEnter += (Manipulator)obj7;
		object obj8 = <>c.<>9__5_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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
				}))
				{
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<ClapState>(OpCodes.Ldfld, "attack");
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<BaseState>(OpCodes.Call, "RollCrit");
					val24.Emit<BlastAttack>(OpCodes.Stfld, "crit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Stone Golem clap crit hook failed!");
				}
			};
			<>c.<>9__5_7 = val8;
			obj8 = (object)val8;
		}
		ClapState.FixedUpdate += (Manipulator)obj8;
		object obj9 = <>c.<>9__5_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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
				}))
				{
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<GroundSlam>(OpCodes.Ldfld, "attack");
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<BaseState>(OpCodes.Call, "RollCrit");
					val24.Emit<BlastAttack>(OpCodes.Stfld, "crit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Parent crit hook failed!");
				}
			};
			<>c.<>9__5_8 = val9;
			obj9 = (object)val9;
		}
		GroundSlam.FixedUpdate += (Manipulator)obj9;
		object obj10 = <>c.<>9__5_9;
		if (obj10 == null)
		{
			Manipulator val10 = 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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
				}))
				{
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<FaceSlam>(OpCodes.Ldfld, "attack");
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<BaseState>(OpCodes.Call, "RollCrit");
					val24.Emit<BlastAttack>(OpCodes.Stfld, "crit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Clay Apothecary melee slam crit hook failed!");
				}
			};
			<>c.<>9__5_9 = val10;
			obj10 = (object)val10;
		}
		FaceSlam.FixedUpdate += (Manipulator)obj10;
		object obj11 = <>c.<>9__5_10;
		if (obj11 == null)
		{
			Manipulator val11 = 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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: 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)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
				}))
				{
					val24.Emit(OpCodes.Dup);
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<BaseState>(OpCodes.Call, "RollCrit");
					val24.Emit<BlastAttack>(OpCodes.Stfld, "crit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Halcyonite laser crit hook failed!");
				}
			};
			<>c.<>9__5_10 = val11;
			obj11 = (object)val11;
		}
		TriLaser.FireTriLaser += (Manipulator)obj11;
		object obj12 = <>c.<>9__5_11;
		if (obj12 == null)
		{
			Manipulator val12 = 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_007a: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				int num = default(int);
				if (val24.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "crit")
				}) && val24.TryGotoPrev((MoveType)0, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num)
				}))
				{
					val24.Remove();
					val24.Emit(OpCodes.Ldarg_0);
					val24.EmitDelegate<Func<WhirlWindPersuitCycle, bool>>((Func<WhirlWindPersuitCycle, bool>)((WhirlWindPersuitCycle self) => ((EntityState)self).characterBody.RollCrit()));
					flag = false;
				}
				if (flag)
				{
					Log.Error("Halcyonite Whirlwind crit hook failed!");
				}
			};
			<>c.<>9__5_11 = val12;
			obj12 = (object)val12;
		}
		WhirlWindPersuitCycle.UpdateAttack += (Manipulator)obj12;
		object obj13 = <>c.<>9__5_12;
		if (obj13 == null)
		{
			hook_OnEnter val13 = delegate(orig_OnEnter orig, GroundPound self)
			{
				orig.Invoke(self);
				if (self._attack != null)
				{
					self._attack.crit = ((BaseState)self).RollCrit();
				}
			};
			<>c.<>9__5_12 = val13;
			obj13 = (object)val13;
		}
		GroundPound.OnEnter += (hook_OnEnter)obj13;
		object obj14 = <>c.<>9__5_13;
		if (obj14 == null)
		{
			Manipulator val14 = 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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: 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)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
				}))
				{
					val24.Emit(OpCodes.Dup);
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<BaseState>(OpCodes.Call, "RollCrit");
					val24.Emit<BlastAttack>(OpCodes.Stfld, "crit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Lynx Totem pillar crit hook failed!");
				}
			};
			<>c.<>9__5_13 = val14;
			obj14 = (object)val14;
		}
		PillarAttack.GetPillarAttack += (Manipulator)obj14;
		object obj15 = <>c.<>9__5_14;
		if (obj15 == null)
		{
			Manipulator val15 = 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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: 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)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
				}))
				{
					val24.Emit(OpCodes.Dup);
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<BaseState>(OpCodes.Call, "RollCrit");
					val24.Emit<BlastAttack>(OpCodes.Stfld, "crit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Xi Construct laser finisher crit hook failed!");
				}
			};
			<>c.<>9__5_14 = val15;
			obj15 = (object)val15;
		}
		TerminateLaser.OnEnter += (Manipulator)obj15;
		object obj16 = <>c.<>9__5_15;
		if (obj16 == null)
		{
			Manipulator val16 = 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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: 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)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
				}))
				{
					val24.Emit(OpCodes.Dup);
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<BaseState>(OpCodes.Call, "RollCrit");
					val24.Emit<BlastAttack>(OpCodes.Stfld, "crit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Solus Amalgamator shock pulse crit hook failed!");
				}
			};
			<>c.<>9__5_15 = val16;
			obj16 = (object)val16;
		}
		ShockArmor.ApplyShock += (Manipulator)obj16;
		object obj17 = <>c.<>9__5_16;
		if (obj17 == null)
		{
			Manipulator val17 = 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_007a: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "attacker")
				}) && val24.TryGotoPrev((MoveType)0, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdnull(x)
				}))
				{
					val24.Remove();
					val24.Emit(OpCodes.Ldarg_0);
					val24.EmitDelegate<Func<ShockArmor, GameObject>>((Func<ShockArmor, GameObject>)((ShockArmor self) => ((EntityState)self).gameObject));
					flag = false;
				}
				if (flag)
				{
					Log.Error("Solus Amalgamator shock pulse attacker hook failed!");
				}
			};
			<>c.<>9__5_16 = val17;
			obj17 = (object)val17;
		}
		ShockArmor.ApplyShock += (Manipulator)obj17;
		object obj18 = <>c.<>9__5_17;
		if (obj18 == null)
		{
			Manipulator val18 = 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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: Unknown result type (might be due to invalid IL or missing references)
				//IL_0069: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<FireProjectileInfo>(x, "damage")
				}))
				{
					val24.Emit(OpCodes.Ldloca, 3);
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<BaseState>(OpCodes.Call, "RollCrit");
					val24.Emit<FireProjectileInfo>(OpCodes.Stfld, "crit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Solus Amalgamator energy orb crit hook failed!");
				}
			};
			<>c.<>9__5_17 = val18;
			obj18 = (object)val18;
		}
		ArtilleryStrike.FireMissiles += (Manipulator)obj18;
		object obj19 = <>c.<>9__5_18;
		if (obj19 == null)
		{
			Manipulator val19 = 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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: Unknown result type (might be due to invalid IL or missing references)
				//IL_0069: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<FireProjectileInfo>(x, "damage")
				}))
				{
					val24.Emit(OpCodes.Ldloca, 2);
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<BaseState>(OpCodes.Call, "RollCrit");
					val24.Emit<FireProjectileInfo>(OpCodes.Stfld, "crit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Severed Breaker crit hook failed!");
				}
			};
			<>c.<>9__5_18 = val19;
			obj19 = (object)val19;
		}
		MissilePod.OnEnter += (Manipulator)obj19;
		object obj20 = <>c.<>9__5_19;
		if (obj20 == null)
		{
			Manipulator val20 = 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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
				}))
				{
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<Regrowth>(OpCodes.Ldfld, "_landingBlastAttack");
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<BaseState>(OpCodes.Call, "RollCrit");
					val24.Emit<BlastAttack>(OpCodes.Stfld, "crit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Shruum landing attack crit hook failed!");
				}
			};
			<>c.<>9__5_19 = val20;
			obj20 = (object)val20;
		}
		Regrowth.FireLandingBlastAttack += (Manipulator)obj20;
		object obj21 = <>c.<>9__5_20;
		if (obj21 == null)
		{
			Manipulator val21 = 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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: 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)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<OverlapAttack>(x, "damage")
				}))
				{
					val24.Emit(OpCodes.Dup);
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<BaseState>(OpCodes.Call, "RollCrit");
					val24.Emit<OverlapAttack>(OpCodes.Stfld, "isCrit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Mithrix hammer slam (direct) crit hook failed!");
				}
			};
			<>c.<>9__5_20 = val21;
			obj21 = (object)val21;
		}
		WeaponSlam.OnEnter += (Manipulator)obj21;
		object obj22 = <>c.<>9__5_21;
		if (obj22 == null)
		{
			Manipulator val22 = 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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage")
				}))
				{
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<WeaponSlam>(OpCodes.Ldfld, "blastAttack");
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<BaseState>(OpCodes.Call, "RollCrit");
					val24.Emit<BlastAttack>(OpCodes.Stfld, "crit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Mithrix hammer slam (explosion) crit hook failed!");
				}
			};
			<>c.<>9__5_21 = val22;
			obj22 = (object)val22;
		}
		WeaponSlam.FixedUpdate += (Manipulator)obj22;
		object obj23 = <>c.<>9__5_22;
		if (obj23 == null)
		{
			Manipulator val23 = 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_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val24 = new ILCursor(il);
				bool flag = true;
				if (val24.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld<OverlapAttack>(x, "damage")
				}))
				{
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<ContactDamage>(OpCodes.Ldfld, "overlapAttack");
					val24.Emit(OpCodes.Ldarg_0);
					val24.Emit<ContactDamage>(OpCodes.Ldfld, "characterBody");
					val24.Emit<CharacterBody>(OpCodes.Callvirt, "RollCrit");
					val24.Emit<OverlapAttack>(OpCodes.Stfld, "isCrit");
					flag = false;
				}
				if (flag)
				{
					Log.Error("Contact damage crit hook failed!");
				}
			};
			<>c.<>9__5_22 = val23;
			obj23 = (object)val23;
		}
		ContactDamage.FireOverlaps += (Manipulator)obj23;
	}

	private void EnemyCritChance(CharacterBody body, StatHookEventArgs args)
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Invalid comparison between Unknown and I4
		if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.teamComponent) && (int)body.teamComponent.teamIndex != 1)
		{
			args.critAdd += enemyCritChance.Value;
		}
	}
}