Decompiled source of RealerMysticsRisky2Utils v2.0.20

MysticsRisky2Utils.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
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 System.Text;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using HG;
using HG.Coroutines;
using IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using MysticsRisky2Utils.BaseAssetTypes;
using MysticsRisky2Utils.ContentManagement;
using MysticsRisky2Utils.SoftDependencies;
using On.RoR2;
using On.RoR2.UI.LogBook;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Hologram;
using RoR2.Navigation;
using RoR2.Networking;
using RoR2.Orbs;
using RoR2.UI;
using RoR2.UI.LogBook;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.UI;

[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("MysticsRisky2Utils")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+b9285edc4a2d12a67ef4885c0bd5e77fa01185aa")]
[assembly: AssemblyProduct("MysticsRisky2Utils")]
[assembly: AssemblyTitle("MysticsRisky2Utils")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace MysticsRisky2Utils
{
	public static class BrotherInfection
	{
		private static GameObject _white;

		private static GameObject _green;

		private static GameObject _red;

		private static GameObject _blue;

		public static GameObject white
		{
			get
			{
				//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)
				if ((Object)(object)_white == (Object)null)
				{
					_white = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/ItemInfection, White.prefab").WaitForCompletion();
				}
				return _white;
			}
		}

		public static GameObject green
		{
			get
			{
				//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)
				if ((Object)(object)_green == (Object)null)
				{
					_green = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/ItemInfection, Green.prefab").WaitForCompletion();
				}
				return _green;
			}
		}

		public static GameObject red
		{
			get
			{
				//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)
				if ((Object)(object)_red == (Object)null)
				{
					_red = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/ItemInfection, Red.prefab").WaitForCompletion();
				}
				return _red;
			}
		}

		public static GameObject blue
		{
			get
			{
				//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)
				if ((Object)(object)_blue == (Object)null)
				{
					_blue = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/ItemInfection, Blue.prefab").WaitForCompletion();
				}
				return _blue;
			}
		}
	}
	public static class CharacterModelMaterialOverrides
	{
		private class MysticsRisky2UtilsCharacterModelMaterialOverridesComponent : MonoBehaviour
		{
			public List<string> activeOverrides = new List<string>();
		}

		public delegate void MaterialOverrideHandler(CharacterModel characterModel, ref Material material, ref bool ignoreOverlays);

		public struct MaterialOverrideInfo
		{
			public string key;

			public MaterialOverrideHandler handler;
		}

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

			public static hook_Awake <>9__0_0;

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

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

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

			public static Manipulator <>9__0_1;

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

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

			public static Action<CharacterModel, ItemDisplay> <>9__0_10;

			public static Manipulator <>9__0_2;

			internal void <Init>b__0_0(orig_Awake orig, CharacterModel self)
			{
				orig.Invoke(self);
				((Component)self).gameObject.AddComponent<MysticsRisky2UtilsCharacterModelMaterialOverridesComponent>();
			}

			internal void <Init>b__0_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_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
				//IL_010c: Unknown result type (might be due to invalid IL or missing references)
				<>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0();
				ILCursor val = new ILCursor(il);
				CS$<>8__locals0.ignoreOverlaysPos = 0;
				ILLabel val2 = default(ILLabel);
				if (!val.TryGotoNext((MoveType)1, new Func<Instruction, bool>[4]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref CS$<>8__locals0.ignoreOverlaysPos),
					(Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref val2),
					(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
					(Instruction x) => ILPatternMatchingExt.MatchLdfld<CharacterModel>(x, "activeOverlayCount")
				}))
				{
					return;
				}
				<>c__DisplayClass0_1 CS$<>8__locals1 = new <>c__DisplayClass0_1();
				val.Emit(OpCodes.Ldarg, 0);
				val.Emit(OpCodes.Ldloc, 0);
				val.Emit(OpCodes.Ldarg, CS$<>8__locals0.ignoreOverlaysPos);
				CS$<>8__locals1.ignoreOverlays2 = false;
				val.EmitDelegate<Func<CharacterModel, Material, bool, Material>>((Func<CharacterModel, Material, bool, Material>)delegate(CharacterModel characterModel, Material material, bool ignoreOverlays)
				{
					<>c__DisplayClass0_2 CS$<>8__locals2 = new <>c__DisplayClass0_2
					{
						component = ((Component)characterModel).GetComponent<MysticsRisky2UtilsCharacterModelMaterialOverridesComponent>()
					};
					if (Object.op_Implicit((Object)(object)CS$<>8__locals2.component))
					{
						MaterialOverrideInfo materialOverrideInfo = materialOverrides.FirstOrDefault((MaterialOverrideInfo x) => CS$<>8__locals2.component.activeOverrides.Contains(x.key));
						if (!materialOverrideInfo.Equals(default(MaterialOverrideInfo)))
						{
							materialOverrideInfo.handler(characterModel, ref material, ref ignoreOverlays);
						}
					}
					CS$<>8__locals1.ignoreOverlays2 = ignoreOverlays;
					return material;
				});
				val.Emit(OpCodes.Stloc, 0);
				val.EmitDelegate<Func<bool>>((Func<bool>)(() => CS$<>8__locals1.ignoreOverlays2));
				val.Emit(OpCodes.Starg, CS$<>8__locals0.ignoreOverlaysPos);
			}

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

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

			internal bool <Init>b__0_6(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdfld<CharacterModel>(x, "activeOverlayCount");
			}

			internal void <Init>b__0_2(ILContext il)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Expected O, but got Unknown
				//IL_008d: Unknown result type (might be due to invalid IL or missing references)
				//IL_009a: Unknown result type (might be due to invalid IL or missing references)
				<>c__DisplayClass0_3 CS$<>8__locals0 = new <>c__DisplayClass0_3();
				ILCursor val = new ILCursor(il);
				CS$<>8__locals0.itemDisplayPos = 0;
				if (!val.TryGotoNext((MoveType)1, new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<ParentedPrefabDisplay>(x, "get_itemDisplay"),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref CS$<>8__locals0.itemDisplayPos)
				}) || !val.TryGotoNext((MoveType)1, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<ItemDisplay>(x, "SetVisibilityLevel")
				}))
				{
					return;
				}
				val.Emit(OpCodes.Ldarg, 0);
				val.Emit(OpCodes.Ldloc, CS$<>8__locals0.itemDisplayPos);
				val.EmitDelegate<Action<CharacterModel, ItemDisplay>>((Action<CharacterModel, ItemDisplay>)delegate(CharacterModel characterModel, ItemDisplay itemDisplay)
				{
					//IL_008a: Unknown result type (might be due to invalid IL or missing references)
					//IL_008f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0092: Unknown result type (might be due to invalid IL or missing references)
					<>c__DisplayClass0_4 CS$<>8__locals1 = new <>c__DisplayClass0_4
					{
						component = ((Component)characterModel).GetComponent<MysticsRisky2UtilsCharacterModelMaterialOverridesComponent>()
					};
					if (Object.op_Implicit((Object)(object)CS$<>8__locals1.component))
					{
						MaterialOverrideInfo materialOverrideInfo = materialOverrides.FirstOrDefault((MaterialOverrideInfo x) => CS$<>8__locals1.component.activeOverrides.Contains(x.key));
						if (!materialOverrideInfo.Equals(default(MaterialOverrideInfo)))
						{
							Material material = null;
							bool ignoreOverlays = false;
							materialOverrideInfo.handler(characterModel, ref material, ref ignoreOverlays);
							RendererInfo[] rendererInfos = itemDisplay.rendererInfos;
							foreach (RendererInfo val2 in rendererInfos)
							{
								val2.renderer.material = material;
							}
						}
					}
				});
			}

			internal bool <Init>b__0_11(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<ParentedPrefabDisplay>(x, "get_itemDisplay");
			}

			internal bool <Init>b__0_13(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<ItemDisplay>(x, "SetVisibilityLevel");
			}

			internal void <Init>b__0_10(CharacterModel characterModel, ItemDisplay itemDisplay)
			{
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				//IL_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0092: Unknown result type (might be due to invalid IL or missing references)
				<>c__DisplayClass0_4 CS$<>8__locals0 = new <>c__DisplayClass0_4
				{
					component = ((Component)characterModel).GetComponent<MysticsRisky2UtilsCharacterModelMaterialOverridesComponent>()
				};
				if (!Object.op_Implicit((Object)(object)CS$<>8__locals0.component))
				{
					return;
				}
				MaterialOverrideInfo materialOverrideInfo = materialOverrides.FirstOrDefault((MaterialOverrideInfo x) => CS$<>8__locals0.component.activeOverrides.Contains(x.key));
				if (!materialOverrideInfo.Equals(default(MaterialOverrideInfo)))
				{
					Material material = null;
					bool ignoreOverlays = false;
					materialOverrideInfo.handler(characterModel, ref material, ref ignoreOverlays);
					RendererInfo[] rendererInfos = itemDisplay.rendererInfos;
					foreach (RendererInfo val in rendererInfos)
					{
						val.renderer.material = material;
					}
				}
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_0
		{
			public int ignoreOverlaysPos;

			internal bool <Init>b__3(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdarg(x, ref ignoreOverlaysPos);
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_1
		{
			public bool ignoreOverlays2;

			internal Material <Init>b__7(CharacterModel characterModel, Material material, bool ignoreOverlays)
			{
				<>c__DisplayClass0_2 CS$<>8__locals0 = new <>c__DisplayClass0_2
				{
					component = ((Component)characterModel).GetComponent<MysticsRisky2UtilsCharacterModelMaterialOverridesComponent>()
				};
				if (Object.op_Implicit((Object)(object)CS$<>8__locals0.component))
				{
					MaterialOverrideInfo materialOverrideInfo = materialOverrides.FirstOrDefault((MaterialOverrideInfo x) => CS$<>8__locals0.component.activeOverrides.Contains(x.key));
					if (!materialOverrideInfo.Equals(default(MaterialOverrideInfo)))
					{
						materialOverrideInfo.handler(characterModel, ref material, ref ignoreOverlays);
					}
				}
				ignoreOverlays2 = ignoreOverlays;
				return material;
			}

			internal bool <Init>b__8()
			{
				return ignoreOverlays2;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_2
		{
			public MysticsRisky2UtilsCharacterModelMaterialOverridesComponent component;

			internal bool <Init>b__9(MaterialOverrideInfo x)
			{
				return component.activeOverrides.Contains(x.key);
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_3
		{
			public int itemDisplayPos;

			internal bool <Init>b__12(Instruction x)
			{
				return ILPatternMatchingExt.MatchStloc(x, ref itemDisplayPos);
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_4
		{
			public MysticsRisky2UtilsCharacterModelMaterialOverridesComponent component;

			internal bool <Init>b__14(MaterialOverrideInfo x)
			{
				return component.activeOverrides.Contains(x.key);
			}
		}

		public static List<MaterialOverrideInfo> materialOverrides = new List<MaterialOverrideInfo>();

		internal static void Init()
		{
			//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
			object obj = <>c.<>9__0_0;
			if (obj == null)
			{
				hook_Awake val = delegate(orig_Awake orig, CharacterModel self)
				{
					orig.Invoke(self);
					((Component)self).gameObject.AddComponent<MysticsRisky2UtilsCharacterModelMaterialOverridesComponent>();
				};
				<>c.<>9__0_0 = val;
				obj = (object)val;
			}
			CharacterModel.Awake += (hook_Awake)obj;
			object obj2 = <>c.<>9__0_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_00a6: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
					//IL_010c: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val6 = new ILCursor(il);
					int ignoreOverlaysPos = 0;
					ILLabel val7 = default(ILLabel);
					if (val6.TryGotoNext((MoveType)1, new Func<Instruction, bool>[4]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref ignoreOverlaysPos),
						(Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref val7),
						(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
						(Instruction x) => ILPatternMatchingExt.MatchLdfld<CharacterModel>(x, "activeOverlayCount")
					}))
					{
						val6.Emit(OpCodes.Ldarg, 0);
						val6.Emit(OpCodes.Ldloc, 0);
						val6.Emit(OpCodes.Ldarg, ignoreOverlaysPos);
						bool ignoreOverlays3 = false;
						val6.EmitDelegate<Func<CharacterModel, Material, bool, Material>>((Func<CharacterModel, Material, bool, Material>)delegate(CharacterModel characterModel, Material material, bool ignoreOverlays)
						{
							MysticsRisky2UtilsCharacterModelMaterialOverridesComponent component2 = ((Component)characterModel).GetComponent<MysticsRisky2UtilsCharacterModelMaterialOverridesComponent>();
							if (Object.op_Implicit((Object)(object)component2))
							{
								MaterialOverrideInfo materialOverrideInfo2 = materialOverrides.FirstOrDefault((MaterialOverrideInfo x) => component2.activeOverrides.Contains(x.key));
								if (!materialOverrideInfo2.Equals(default(MaterialOverrideInfo)))
								{
									materialOverrideInfo2.handler(characterModel, ref material, ref ignoreOverlays);
								}
							}
							ignoreOverlays3 = ignoreOverlays;
							return material;
						});
						val6.Emit(OpCodes.Stloc, 0);
						val6.EmitDelegate<Func<bool>>((Func<bool>)(() => ignoreOverlays3));
						val6.Emit(OpCodes.Starg, ignoreOverlaysPos);
					}
				};
				<>c.<>9__0_1 = val2;
				obj2 = (object)val2;
			}
			CharacterModel.UpdateRendererMaterials += (Manipulator)obj2;
			object obj3 = <>c.<>9__0_2;
			if (obj3 == null)
			{
				Manipulator val3 = 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_008d: Unknown result type (might be due to invalid IL or missing references)
					//IL_009a: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val4 = new ILCursor(il);
					int itemDisplayPos = 0;
					if (val4.TryGotoNext((MoveType)1, new Func<Instruction, bool>[2]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<ParentedPrefabDisplay>(x, "get_itemDisplay"),
						(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref itemDisplayPos)
					}) && val4.TryGotoNext((MoveType)1, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<ItemDisplay>(x, "SetVisibilityLevel")
					}))
					{
						val4.Emit(OpCodes.Ldarg, 0);
						val4.Emit(OpCodes.Ldloc, itemDisplayPos);
						val4.EmitDelegate<Action<CharacterModel, ItemDisplay>>((Action<CharacterModel, ItemDisplay>)delegate(CharacterModel characterModel, ItemDisplay itemDisplay)
						{
							//IL_008a: Unknown result type (might be due to invalid IL or missing references)
							//IL_008f: Unknown result type (might be due to invalid IL or missing references)
							//IL_0092: Unknown result type (might be due to invalid IL or missing references)
							MysticsRisky2UtilsCharacterModelMaterialOverridesComponent component = ((Component)characterModel).GetComponent<MysticsRisky2UtilsCharacterModelMaterialOverridesComponent>();
							if (Object.op_Implicit((Object)(object)component))
							{
								MaterialOverrideInfo materialOverrideInfo = materialOverrides.FirstOrDefault((MaterialOverrideInfo x) => component.activeOverrides.Contains(x.key));
								if (!materialOverrideInfo.Equals(default(MaterialOverrideInfo)))
								{
									Material material2 = null;
									bool ignoreOverlays2 = false;
									materialOverrideInfo.handler(characterModel, ref material2, ref ignoreOverlays2);
									RendererInfo[] rendererInfos = itemDisplay.rendererInfos;
									foreach (RendererInfo val5 in rendererInfos)
									{
										val5.renderer.material = material2;
									}
								}
							}
						});
					}
				};
				<>c.<>9__0_2 = val3;
				obj3 = (object)val3;
			}
			CharacterModel.UpdateMaterials += (Manipulator)obj3;
		}

		public static void SetOverrideActive(CharacterModel model, string key, bool active)
		{
			//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_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			MysticsRisky2UtilsCharacterModelMaterialOverridesComponent component = ((Component)model).GetComponent<MysticsRisky2UtilsCharacterModelMaterialOverridesComponent>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			bool flag = component.activeOverrides.Contains(key);
			if (flag == active)
			{
				return;
			}
			if (flag)
			{
				component.activeOverrides.Remove(key);
			}
			else
			{
				component.activeOverrides.Add(key);
			}
			model.materialsDirty = true;
			foreach (ParentedPrefabDisplay parentedPrefabDisplay in model.parentedPrefabDisplays)
			{
				ParentedPrefabDisplay current = parentedPrefabDisplay;
				ItemDisplay itemDisplay = ((ParentedPrefabDisplay)(ref current)).itemDisplay;
				VisibilityLevel visibilityLevel = itemDisplay.visibilityLevel;
				itemDisplay.visibilityLevel = (VisibilityLevel)(-1);
				itemDisplay.SetVisibilityLevel(visibilityLevel);
			}
		}

		public static void AddOverride(string key, MaterialOverrideHandler handler)
		{
			materialOverrides.Add(new MaterialOverrideInfo
			{
				key = key,
				handler = handler
			});
		}
	}
	[Obsolete("for EliteVariety support, dont use this (use R2API instead)")]
	public class CharacterStats
	{
		public delegate float StatModifierApplyTimes(MysticsRisky2UtilsPlugin.GenericCharacterInfo genericCharacterInfo);

		public delegate bool StatModifierShouldApply(MysticsRisky2UtilsPlugin.GenericCharacterInfo genericCharacterInfo);

		public struct StatModifier
		{
			public float multiplier;

			public float flat;

			public StatModifierApplyTimes times;
		}

		public struct FlatStatModifier
		{
			public float amount;

			public StatModifierApplyTimes times;
		}

		public struct BoolStatModifier
		{
			public StatModifierShouldApply shouldApply;
		}

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

			public static StatHookEventHandler <>9__17_0;

			internal void <Init>b__17_0(CharacterBody self, StatHookEventArgs args)
			{
				MysticsRisky2UtilsPlugin.GenericCharacterInfo genericCharacterInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(self);
				AddStatModifier(genericCharacterInfo, levelModifiers, ref args.levelFlatAdd);
				AddStatModifier(genericCharacterInfo, healthModifiers, ref args.baseHealthAdd, ref args.healthMultAdd);
				AddStatModifier(genericCharacterInfo, shieldModifiers, ref args.baseShieldAdd, ref args.shieldMultAdd);
				AddStatModifier(genericCharacterInfo, regenModifiers, ref args.baseRegenAdd);
				AddStatModifier(genericCharacterInfo, cursePenaltyModifiers, ref args.baseCurseAdd);
				AddStatModifier(genericCharacterInfo, damageModifiers, ref args.baseDamageAdd, ref args.damageMultAdd);
				AddStatModifier(genericCharacterInfo, attackSpeedModifiers, ref args.baseAttackSpeedAdd, ref args.attackSpeedMultAdd);
				AddStatModifier(genericCharacterInfo, moveSpeedModifiers, ref args.baseMoveSpeedAdd, ref args.moveSpeedMultAdd);
				AddStatModifier(genericCharacterInfo, cooldownModifiers, ref args.cooldownReductionAdd, ref args.cooldownMultAdd);
				AddStatModifier(genericCharacterInfo, critModifiers, ref args.critAdd);
				AddStatModifier(genericCharacterInfo, armorModifiers, ref args.armorAdd);
				foreach (BoolStatModifier rootMovementModifier in rootMovementModifiers)
				{
					if (rootMovementModifier.shouldApply(genericCharacterInfo))
					{
						self.moveSpeed = 0f;
						self.acceleration = 80f;
					}
				}
			}
		}

		public static List<FlatStatModifier> levelModifiers = new List<FlatStatModifier>();

		public static List<StatModifier> healthModifiers = new List<StatModifier>();

		public static List<StatModifier> shieldModifiers = new List<StatModifier>();

		public static List<FlatStatModifier> regenModifiers = new List<FlatStatModifier>();

		public static List<StatModifier> moveSpeedModifiers = new List<StatModifier>();

		public static List<BoolStatModifier> rootMovementModifiers = new List<BoolStatModifier>();

		public static List<StatModifier> damageModifiers = new List<StatModifier>();

		public static List<StatModifier> attackSpeedModifiers = new List<StatModifier>();

		public static List<FlatStatModifier> critModifiers = new List<FlatStatModifier>();

		public static List<FlatStatModifier> armorModifiers = new List<FlatStatModifier>();

		public static List<StatModifier> cooldownModifiers = new List<StatModifier>();

		public static List<FlatStatModifier> cursePenaltyModifiers = new List<FlatStatModifier>();

		public static void Init()
		{
			//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
			object obj = <>c.<>9__17_0;
			if (obj == null)
			{
				StatHookEventHandler val = delegate(CharacterBody self, StatHookEventArgs args)
				{
					MysticsRisky2UtilsPlugin.GenericCharacterInfo genericCharacterInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(self);
					AddStatModifier(genericCharacterInfo, levelModifiers, ref args.levelFlatAdd);
					AddStatModifier(genericCharacterInfo, healthModifiers, ref args.baseHealthAdd, ref args.healthMultAdd);
					AddStatModifier(genericCharacterInfo, shieldModifiers, ref args.baseShieldAdd, ref args.shieldMultAdd);
					AddStatModifier(genericCharacterInfo, regenModifiers, ref args.baseRegenAdd);
					AddStatModifier(genericCharacterInfo, cursePenaltyModifiers, ref args.baseCurseAdd);
					AddStatModifier(genericCharacterInfo, damageModifiers, ref args.baseDamageAdd, ref args.damageMultAdd);
					AddStatModifier(genericCharacterInfo, attackSpeedModifiers, ref args.baseAttackSpeedAdd, ref args.attackSpeedMultAdd);
					AddStatModifier(genericCharacterInfo, moveSpeedModifiers, ref args.baseMoveSpeedAdd, ref args.moveSpeedMultAdd);
					AddStatModifier(genericCharacterInfo, cooldownModifiers, ref args.cooldownReductionAdd, ref args.cooldownMultAdd);
					AddStatModifier(genericCharacterInfo, critModifiers, ref args.critAdd);
					AddStatModifier(genericCharacterInfo, armorModifiers, ref args.armorAdd);
					foreach (BoolStatModifier rootMovementModifier in rootMovementModifiers)
					{
						if (rootMovementModifier.shouldApply(genericCharacterInfo))
						{
							self.moveSpeed = 0f;
							self.acceleration = 80f;
						}
					}
				};
				<>c.<>9__17_0 = val;
				obj = (object)val;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj;
		}

		public static void AddStatModifier(MysticsRisky2UtilsPlugin.GenericCharacterInfo info, List<StatModifier> list, ref float flat, ref float mult)
		{
			foreach (StatModifier item in list)
			{
				if (item.times(info) != 0f)
				{
					if (item.flat != 0f)
					{
						flat += item.flat * item.times(info);
					}
					if (item.multiplier != 0f)
					{
						mult += item.multiplier * item.times(info);
					}
				}
			}
		}

		public static void AddStatModifier(MysticsRisky2UtilsPlugin.GenericCharacterInfo info, List<FlatStatModifier> list, ref float flat)
		{
			foreach (FlatStatModifier item in list)
			{
				if (item.amount != 0f && item.times(info) != 0f)
				{
					flat += item.amount * item.times(info);
				}
			}
		}
	}
	public static class ChildLocatorAdditions
	{
		public struct Addition
		{
			public string modelName;

			public string transformLocation;

			public string childName;
		}

		public static List<Addition> list = new List<Addition>();

		internal static void Init()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			CharacterModel.Awake += new hook_Awake(CharacterModel_Awake);
		}

		private static void CharacterModel_Awake(orig_Awake orig, CharacterModel self)
		{
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)self.childLocator))
			{
				return;
			}
			foreach (Addition addition in list.FindAll((Addition x) => x.modelName == Utils.TrimCloneFromString(((Object)((Component)self).gameObject).name)))
			{
				if (!self.childLocator.transformPairs.Any((NameTransformPair x) => x.name == addition.childName))
				{
					Transform val = ((Component)self).transform.Find(addition.transformLocation);
					if (Object.op_Implicit((Object)(object)val))
					{
						ref NameTransformPair[] transformPairs = ref self.childLocator.transformPairs;
						NameTransformPair val2 = new NameTransformPair
						{
							name = addition.childName,
							transform = val
						};
						ArrayUtils.ArrayAppend<NameTransformPair>(ref transformPairs, ref val2);
					}
				}
			}
		}
	}
	public static class ConfigOptions
	{
		public abstract class ConfigurableValue
		{
			public static List<ConfigurableValue> instancesList = new List<ConfigurableValue>();

			public List<string> stringsToAffect = new List<string>();

			public string key = "";

			public string id = "";

			public static ConfigurableValue<T> Create<T>(ConfigFile configFile, string section, string key, T defaultValue, string description = "", List<string> stringsToAffect = null, ConfigEntry<bool> useDefaultValueConfigEntry = null, bool restartRequired = false, Action<T> onChanged = null)
			{
				return new ConfigurableValue<T>(configFile, section, key, defaultValue, description, stringsToAffect, useDefaultValueConfigEntry, restartRequired, onChanged);
			}

			public static ConfigurableValue<int> CreateInt(string modGUID, string modName, ConfigFile configFile, string section, string key, int defaultValue, int min = 0, int max = 1000, string description = "", List<string> stringsToAffect = null, ConfigEntry<bool> useDefaultValueConfigEntry = null, bool restartRequired = false, Action<int> onChanged = null)
			{
				ConfigurableValue<int> configurableValue = Create(configFile, section, key, defaultValue, description, stringsToAffect, useDefaultValueConfigEntry, restartRequired, onChanged);
				if (SoftDependencyManager.RiskOfOptionsDependency.enabled)
				{
					SoftDependencyManager.RiskOfOptionsDependency.AddOptionInt(modGUID, modName, configurableValue.bepinexConfigEntry, min, max, restartRequired);
				}
				return configurableValue;
			}

			public static ConfigurableValue<float> CreateFloat(string modGUID, string modName, ConfigFile configFile, string section, string key, float defaultValue, float min = 0f, float max = 1000f, string description = "", List<string> stringsToAffect = null, ConfigEntry<bool> useDefaultValueConfigEntry = null, bool restartRequired = false, Action<float> onChanged = null)
			{
				ConfigurableValue<float> configurableValue = Create(configFile, section, key, defaultValue, description, stringsToAffect, useDefaultValueConfigEntry, restartRequired, onChanged);
				if (SoftDependencyManager.RiskOfOptionsDependency.enabled)
				{
					SoftDependencyManager.RiskOfOptionsDependency.AddOptionFloat(modGUID, modName, configurableValue.bepinexConfigEntry, min, max, restartRequired);
				}
				return configurableValue;
			}

			public static ConfigurableValue<bool> CreateBool(string modGUID, string modName, ConfigFile configFile, string section, string key, bool defaultValue, string description = "", List<string> stringsToAffect = null, ConfigEntry<bool> useDefaultValueConfigEntry = null, bool restartRequired = false, Action<bool> onChanged = null)
			{
				ConfigurableValue<bool> configurableValue = Create(configFile, section, key, defaultValue, description, stringsToAffect, useDefaultValueConfigEntry, restartRequired, onChanged);
				if (SoftDependencyManager.RiskOfOptionsDependency.enabled)
				{
					SoftDependencyManager.RiskOfOptionsDependency.AddOptionBool(modGUID, modName, configurableValue.bepinexConfigEntry, restartRequired);
				}
				return configurableValue;
			}

			public static ConfigurableValue<string> CreateString(string modGUID, string modName, ConfigFile configFile, string section, string key, string defaultValue, string description = "", List<string> stringsToAffect = null, ConfigEntry<bool> useDefaultValueConfigEntry = null, bool restartRequired = false, Action<string> onChanged = null)
			{
				ConfigurableValue<string> configurableValue = Create(configFile, section, key, defaultValue, description, stringsToAffect, useDefaultValueConfigEntry, restartRequired, onChanged);
				if (SoftDependencyManager.RiskOfOptionsDependency.enabled)
				{
					SoftDependencyManager.RiskOfOptionsDependency.AddOptionString(modGUID, modName, configurableValue.bepinexConfigEntry, restartRequired);
				}
				return configurableValue;
			}
		}

		public class ConfigurableValue<T> : ConfigurableValue
		{
			public ConfigEntry<T> bepinexConfigEntry;

			private ConfigEntry<bool> useDefaultValueConfigEntry;

			private T defaultValue;

			public T Value
			{
				get
				{
					if (useDefaultValueConfigEntry != null && useDefaultValueConfigEntry.Value)
					{
						return defaultValue;
					}
					return bepinexConfigEntry.Value;
				}
			}

			public ConfigurableValue(ConfigFile configFile, string section, string key, T defaultValue, string description = "", List<string> stringsToAffect = null, ConfigEntry<bool> useDefaultValueConfigEntry = null, bool restartRequired = false, Action<T> onChanged = null)
			{
				ConfigurableValue<T> configurableValue = this;
				id = Path.GetFileNameWithoutExtension(configFile.ConfigFilePath) + "." + section + "." + key;
				ConfigurableValue configurableValue2 = ConfigurableValue.instancesList.FirstOrDefault((ConfigurableValue x) => x.id == configurableValue.id);
				if (configurableValue2 != null)
				{
					ConfigurableValue<T> configurableValue3 = configurableValue2 as ConfigurableValue<T>;
					bepinexConfigEntry = configurableValue3.bepinexConfigEntry;
					this.useDefaultValueConfigEntry = useDefaultValueConfigEntry;
				}
				else
				{
					bepinexConfigEntry = configFile.Bind<T>(section, key, defaultValue, description);
					ConfigurableValue.instancesList.Add(this);
				}
				this.useDefaultValueConfigEntry = useDefaultValueConfigEntry;
				base.key = key;
				this.defaultValue = defaultValue;
				if (stringsToAffect != null)
				{
					base.stringsToAffect = stringsToAffect;
				}
				else
				{
					base.stringsToAffect = new List<string>();
				}
				if (onChanged != null)
				{
					bepinexConfigEntry.SettingChanged += delegate
					{
						onChanged(configurableValue.Value);
						reloadLogbook = true;
					};
					onChanged(Value);
					reloadLogbook = true;
				}
			}

			public override string ToString()
			{
				return Convert.ToString(Value, CultureInfo.InvariantCulture);
			}

			public static implicit operator T(ConfigurableValue<T> configurableValue)
			{
				return configurableValue.Value;
			}
		}

		private static bool reloadLogbook;

		internal static void Init()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			LogBookController.Awake += new hook_Awake(LogBookController_Awake);
			Language.GetLocalizedStringByToken += new hook_GetLocalizedStringByToken(Language_GetLocalizedStringByToken);
		}

		private static void LogBookController_Awake(orig_Awake orig, LogBookController self)
		{
			orig.Invoke(self);
			if (reloadLogbook)
			{
				reloadLogbook = false;
				LogBookController.BuildStaticData();
			}
		}

		private static string Language_GetLocalizedStringByToken(orig_GetLocalizedStringByToken orig, Language self, string token)
		{
			string text = orig.Invoke(self, token);
			foreach (ConfigurableValue item in ConfigurableValue.instancesList.FindAll((ConfigurableValue x) => x.stringsToAffect.Contains(token)))
			{
				text = text.Replace("{" + item.key + "}", item.ToString());
			}
			return text;
		}
	}
	public static class CostTypeCreation
	{
		public struct CustomCostTypeInfo
		{
			public CostTypeDef costTypeDef;

			public Action<CostTypeIndex> onRegister;

			public CostTypeIndex index;
		}

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

			public static Action<List<CostTypeDef>> <>9__0_0;

			public static hook_Register <>9__0_1;

			internal void <Init>b__0_0(List<CostTypeDef> list)
			{
				foreach (CustomCostTypeInfo customCostType in customCostTypes)
				{
					list.Add(customCostType.costTypeDef);
				}
			}

			internal void <Init>b__0_1(orig_Register orig, CostTypeIndex costType, CostTypeDef costTypeDef)
			{
				//IL_000f: 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_0059: 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)
				<>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0
				{
					costTypeDef = costTypeDef
				};
				orig.Invoke(costType, CS$<>8__locals0.costTypeDef);
				CustomCostTypeInfo customCostTypeInfo = customCostTypes.FirstOrDefault((CustomCostTypeInfo x) => x.costTypeDef == CS$<>8__locals0.costTypeDef);
				if (!customCostTypeInfo.Equals(default(CustomCostTypeInfo)))
				{
					customCostTypeInfo.index = costType;
					if (customCostTypeInfo.onRegister != null)
					{
						customCostTypeInfo.onRegister(customCostTypeInfo.index);
					}
				}
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_0
		{
			public CostTypeDef costTypeDef;

			internal bool <Init>b__2(CustomCostTypeInfo x)
			{
				return x.costTypeDef == costTypeDef;
			}
		}

		public static List<CustomCostTypeInfo> customCostTypes = new List<CustomCostTypeInfo>();

		internal static void Init()
		{
			//IL_003f: 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_004a: Expected O, but got Unknown
			CostTypeCatalog.modHelper.getAdditionalEntries += delegate(List<CostTypeDef> list)
			{
				foreach (CustomCostTypeInfo customCostType in customCostTypes)
				{
					list.Add(customCostType.costTypeDef);
				}
			};
			object obj = <>c.<>9__0_1;
			if (obj == null)
			{
				hook_Register val = delegate(orig_Register orig, CostTypeIndex costType, CostTypeDef costTypeDef)
				{
					//IL_000f: 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_0059: 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)
					orig.Invoke(costType, costTypeDef);
					CustomCostTypeInfo customCostTypeInfo = customCostTypes.FirstOrDefault((CustomCostTypeInfo x) => x.costTypeDef == costTypeDef);
					if (!customCostTypeInfo.Equals(default(CustomCostTypeInfo)))
					{
						customCostTypeInfo.index = costType;
						if (customCostTypeInfo.onRegister != null)
						{
							customCostTypeInfo.onRegister(customCostTypeInfo.index);
						}
					}
				};
				<>c.<>9__0_1 = val;
				obj = (object)val;
			}
			CostTypeCatalog.Register += (hook_Register)obj;
		}

		public static void CreateCostType(CustomCostTypeInfo customCostType)
		{
			customCostTypes.Add(customCostType);
		}
	}
	public static class CustomTempVFXManagement
	{
		public struct VFXInfo
		{
			public GameObject prefab;

			public string child;

			public Func<CharacterBody, bool> condition;

			public Func<CharacterBody, float> radius;
		}

		public class MysticsRisky2UtilsTempVFX : MonoBehaviour
		{
			public enum VisualState
			{
				Enter,
				Exit
			}

			public Transform parentTransform;

			public bool rotateWithParent = false;

			public HealthComponent healthComponent;

			public GameObject[] enterObjects = (GameObject[])(object)new GameObject[0];

			public MonoBehaviour[] enterBehaviours = (MonoBehaviour[])(object)new MonoBehaviour[0];

			public GameObject[] exitObjects = (GameObject[])(object)new GameObject[0];

			public MonoBehaviour[] exitBehaviours = (MonoBehaviour[])(object)new MonoBehaviour[0];

			public VisualState visualState;

			public VisualState prevVisualState;

			public float radius;

			private Transform cachedTransform;

			public void Awake()
			{
				cachedTransform = ((Component)this).transform;
			}

			public void Start()
			{
				RebuildVisuals();
			}

			public void Update()
			{
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_007b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: Unknown result type (might be due to invalid IL or missing references)
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				if (!Object.op_Implicit((Object)(object)healthComponent) || !healthComponent.alive)
				{
					visualState = VisualState.Exit;
				}
				if (Object.op_Implicit((Object)(object)parentTransform))
				{
					cachedTransform.position = parentTransform.position;
					if (rotateWithParent)
					{
						cachedTransform.rotation = parentTransform.rotation;
					}
					cachedTransform.localScale = Vector3.one * radius;
					if (visualState != prevVisualState)
					{
						prevVisualState = visualState;
						RebuildVisuals();
					}
				}
				else
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
				}
			}

			public void RebuildVisuals()
			{
				bool flag = visualState == VisualState.Enter;
				GameObject[] array = enterObjects;
				foreach (GameObject val in array)
				{
					val.SetActive(flag);
				}
				MonoBehaviour[] array2 = enterBehaviours;
				foreach (MonoBehaviour val2 in array2)
				{
					((Behaviour)val2).enabled = flag;
				}
				GameObject[] array3 = exitObjects;
				foreach (GameObject val3 in array3)
				{
					val3.SetActive(!flag);
				}
				MonoBehaviour[] array4 = exitBehaviours;
				foreach (MonoBehaviour val4 in array4)
				{
					((Behaviour)val4).enabled = !flag;
				}
			}
		}

		public class MysticsRisky2UtilsCharacterCustomTempVFXHolder : MonoBehaviour
		{
			public CharacterBody characterBody;

			public Dictionary<GameObject, MysticsRisky2UtilsTempVFX> dictionary = new Dictionary<GameObject, MysticsRisky2UtilsTempVFX>();

			public static Dictionary<CharacterBody, MysticsRisky2UtilsCharacterCustomTempVFXHolder> bodyToVFXHolder = new Dictionary<CharacterBody, MysticsRisky2UtilsCharacterCustomTempVFXHolder>();

			public void Awake()
			{
				characterBody = ((Component)this).GetComponent<CharacterBody>();
				bodyToVFXHolder[characterBody] = this;
				foreach (VFXInfo item in allVFX)
				{
					dictionary.Add(item.prefab, null);
				}
			}

			public void OnDestroy()
			{
				if (bodyToVFXHolder.ContainsKey(characterBody))
				{
					bodyToVFXHolder.Remove(characterBody);
				}
			}
		}

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

			public static hook_Awake <>9__4_0;

			public static hook_UpdateAllTemporaryVisualEffects <>9__4_1;

			internal void <Init>b__4_0(orig_Awake orig, CharacterBody self)
			{
				orig.Invoke(self);
				((Component)self).gameObject.AddComponent<MysticsRisky2UtilsCharacterCustomTempVFXHolder>();
			}

			internal void <Init>b__4_1(orig_UpdateAllTemporaryVisualEffects orig, CharacterBody self)
			{
				//IL_0080: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self);
				if (!MysticsRisky2UtilsCharacterCustomTempVFXHolder.bodyToVFXHolder.TryGetValue(self, out var value))
				{
					return;
				}
				foreach (VFXInfo item in allVFX)
				{
					bool flag = item.condition(self);
					MysticsRisky2UtilsTempVFX mysticsRisky2UtilsTempVFX = value.dictionary[item.prefab];
					if (flag)
					{
						if (!Object.op_Implicit((Object)(object)mysticsRisky2UtilsTempVFX))
						{
							GameObject val = Object.Instantiate<GameObject>(item.prefab, self.corePosition, Quaternion.identity);
							mysticsRisky2UtilsTempVFX = val.GetComponent<MysticsRisky2UtilsTempVFX>();
							value.dictionary[item.prefab] = mysticsRisky2UtilsTempVFX;
							mysticsRisky2UtilsTempVFX.parentTransform = self.coreTransform;
							mysticsRisky2UtilsTempVFX.visualState = MysticsRisky2UtilsTempVFX.VisualState.Enter;
							mysticsRisky2UtilsTempVFX.healthComponent = self.healthComponent;
							mysticsRisky2UtilsTempVFX.radius = item.radius(self);
							LocalCameraEffect component = val.GetComponent<LocalCameraEffect>();
							if (Object.op_Implicit((Object)(object)component))
							{
								component.targetCharacter = ((Component)self).gameObject;
							}
							if (string.IsNullOrEmpty(item.child))
							{
								continue;
							}
							ModelLocator modelLocator = self.modelLocator;
							if (!Object.op_Implicit((Object)(object)modelLocator))
							{
								continue;
							}
							Transform modelTransform = modelLocator.modelTransform;
							if (!Object.op_Implicit((Object)(object)modelTransform))
							{
								continue;
							}
							ChildLocator component2 = ((Component)modelTransform).GetComponent<ChildLocator>();
							if (Object.op_Implicit((Object)(object)component2))
							{
								Transform val2 = component2.FindChild(item.child);
								if (Object.op_Implicit((Object)(object)val2))
								{
									mysticsRisky2UtilsTempVFX.parentTransform = val2;
									break;
								}
							}
						}
						else
						{
							mysticsRisky2UtilsTempVFX.visualState = MysticsRisky2UtilsTempVFX.VisualState.Enter;
						}
					}
					else if (Object.op_Implicit((Object)(object)mysticsRisky2UtilsTempVFX))
					{
						mysticsRisky2UtilsTempVFX.visualState = MysticsRisky2UtilsTempVFX.VisualState.Exit;
					}
				}
			}
		}

		public static List<VFXInfo> allVFX = new List<VFXInfo>();

		public static float DefaultRadiusCall(CharacterBody body)
		{
			return body.radius;
		}

		public static float DefaultBestFitRadiusCall(CharacterBody body)
		{
			return body.bestFitRadius;
		}

		internal static void Init()
		{
			//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)
			{
				hook_Awake val = delegate(orig_Awake orig, CharacterBody self)
				{
					orig.Invoke(self);
					((Component)self).gameObject.AddComponent<MysticsRisky2UtilsCharacterCustomTempVFXHolder>();
				};
				<>c.<>9__4_0 = val;
				obj = (object)val;
			}
			CharacterBody.Awake += (hook_Awake)obj;
			object obj2 = <>c.<>9__4_1;
			if (obj2 == null)
			{
				hook_UpdateAllTemporaryVisualEffects val2 = delegate(orig_UpdateAllTemporaryVisualEffects orig, CharacterBody self)
				{
					//IL_0080: Unknown result type (might be due to invalid IL or missing references)
					//IL_0085: Unknown result type (might be due to invalid IL or missing references)
					orig.Invoke(self);
					if (MysticsRisky2UtilsCharacterCustomTempVFXHolder.bodyToVFXHolder.TryGetValue(self, out var value))
					{
						foreach (VFXInfo item in allVFX)
						{
							bool flag = item.condition(self);
							MysticsRisky2UtilsTempVFX mysticsRisky2UtilsTempVFX = value.dictionary[item.prefab];
							if (flag)
							{
								if (!Object.op_Implicit((Object)(object)mysticsRisky2UtilsTempVFX))
								{
									GameObject val3 = Object.Instantiate<GameObject>(item.prefab, self.corePosition, Quaternion.identity);
									mysticsRisky2UtilsTempVFX = val3.GetComponent<MysticsRisky2UtilsTempVFX>();
									value.dictionary[item.prefab] = mysticsRisky2UtilsTempVFX;
									mysticsRisky2UtilsTempVFX.parentTransform = self.coreTransform;
									mysticsRisky2UtilsTempVFX.visualState = MysticsRisky2UtilsTempVFX.VisualState.Enter;
									mysticsRisky2UtilsTempVFX.healthComponent = self.healthComponent;
									mysticsRisky2UtilsTempVFX.radius = item.radius(self);
									LocalCameraEffect component = val3.GetComponent<LocalCameraEffect>();
									if (Object.op_Implicit((Object)(object)component))
									{
										component.targetCharacter = ((Component)self).gameObject;
									}
									if (!string.IsNullOrEmpty(item.child))
									{
										ModelLocator modelLocator = self.modelLocator;
										if (Object.op_Implicit((Object)(object)modelLocator))
										{
											Transform modelTransform = modelLocator.modelTransform;
											if (Object.op_Implicit((Object)(object)modelTransform))
											{
												ChildLocator component2 = ((Component)modelTransform).GetComponent<ChildLocator>();
												if (Object.op_Implicit((Object)(object)component2))
												{
													Transform val4 = component2.FindChild(item.child);
													if (Object.op_Implicit((Object)(object)val4))
													{
														mysticsRisky2UtilsTempVFX.parentTransform = val4;
														break;
													}
												}
											}
										}
									}
								}
								else
								{
									mysticsRisky2UtilsTempVFX.visualState = MysticsRisky2UtilsTempVFX.VisualState.Enter;
								}
							}
							else if (Object.op_Implicit((Object)(object)mysticsRisky2UtilsTempVFX))
							{
								mysticsRisky2UtilsTempVFX.visualState = MysticsRisky2UtilsTempVFX.VisualState.Exit;
							}
						}
					}
				};
				<>c.<>9__4_1 = val2;
				obj2 = (object)val2;
			}
			CharacterBody.UpdateAllTemporaryVisualEffects += (hook_UpdateAllTemporaryVisualEffects)obj2;
		}
	}
	public static class DamageColorAPI
	{
		public static List<DamageColorIndex> registeredColorIndicies = new List<DamageColorIndex>();

		internal static void Init()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			DamageColor.FindColor += new hook_FindColor(DamageColor_FindColor);
		}

		private static Color DamageColor_FindColor(orig_FindColor orig, DamageColorIndex colorIndex)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			if (registeredColorIndicies.Contains(colorIndex))
			{
				return DamageColor.colors[colorIndex];
			}
			return orig.Invoke(colorIndex);
		}

		public static DamageColorIndex RegisterDamageColor(Color color)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			int num = DamageColor.colors.Length;
			DamageColorIndex val = (DamageColorIndex)(byte)num;
			ArrayUtils.ArrayAppend<Color>(ref DamageColor.colors, ref color);
			registeredColorIndicies.Add(val);
			return val;
		}
	}
	public static class EliteDisplays
	{
		private static GameObject _fireHorn;

		private static GameObject _lightningHorn;

		private static GameObject _iceCrown;

		private static GameObject _poisonCrown;

		private static GameObject _hauntedCrown;

		private static GameObject _lunarEye;

		public static GameObject fireHorn
		{
			get
			{
				//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)
				if ((Object)(object)_fireHorn == (Object)null)
				{
					_fireHorn = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteFire/DisplayEliteHorn.prefab").WaitForCompletion();
				}
				return _fireHorn;
			}
		}

		public static GameObject lightningHorn
		{
			get
			{
				//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)
				if ((Object)(object)_lightningHorn == (Object)null)
				{
					_lightningHorn = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteLightning/DisplayEliteRhinoHorn.prefab").WaitForCompletion();
				}
				return _lightningHorn;
			}
		}

		public static GameObject iceCrown
		{
			get
			{
				//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)
				if ((Object)(object)_iceCrown == (Object)null)
				{
					_iceCrown = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteIce/DisplayEliteIceCrown.prefab").WaitForCompletion();
				}
				return _iceCrown;
			}
		}

		public static GameObject poisonCrown
		{
			get
			{
				//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)
				if ((Object)(object)_poisonCrown == (Object)null)
				{
					_poisonCrown = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ElitePoison/DisplayEliteUrchinCrown.prefab").WaitForCompletion();
				}
				return _poisonCrown;
			}
		}

		public static GameObject hauntedCrown
		{
			get
			{
				//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)
				if ((Object)(object)_hauntedCrown == (Object)null)
				{
					_hauntedCrown = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteHaunted/DisplayEliteStealthCrown.prefab").WaitForCompletion();
				}
				return _hauntedCrown;
			}
		}

		public static GameObject lunarEye
		{
			get
			{
				//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)
				if ((Object)(object)_lunarEye == (Object)null)
				{
					_lunarEye = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteLunar/DisplayEliteLunar,Eye.prefab").WaitForCompletion();
				}
				return _lunarEye;
			}
		}
	}
	internal static class GenericChildLocatorAdditions
	{
		public static void Init()
		{
			ChildLocatorAdditions.list.Add(new ChildLocatorAdditions.Addition
			{
				modelName = "mdlRoboBallMini",
				transformLocation = "RoboBallMiniArmature/ROOT",
				childName = "ROOT"
			});
			ChildLocatorAdditions.list.Add(new ChildLocatorAdditions.Addition
			{
				modelName = "mdlTreebot",
				transformLocation = "TreebotArmature/ROOT/Base/PlatformBase/ArmPlatformBase/Antennae.1/Antennae.005/Antennae.003/Antennae.007/Antennae.002/Antennae.006/Antennae.004",
				childName = "MR2UAntennae4"
			});
			ChildLocatorAdditions.list.Add(new ChildLocatorAdditions.Addition
			{
				modelName = "mdlClayBruiser",
				transformLocation = "ClayBruiserArmature/ROOT/base/stomach/chest",
				childName = "Chest"
			});
			ChildLocatorAdditions.list.Add(new ChildLocatorAdditions.Addition
			{
				modelName = "mdlRoboBallBoss",
				transformLocation = "RoboBallBossArmature/ROOT/Shell",
				childName = "Shell"
			});
			ChildLocatorAdditions.list.Add(new ChildLocatorAdditions.Addition
			{
				modelName = "mdlGravekeeper",
				transformLocation = "GravekeeperArmature/ROOT/JarBase",
				childName = "JarBase"
			});
			ChildLocatorAdditions.list.Add(new ChildLocatorAdditions.Addition
			{
				modelName = "mdlGrandparent",
				transformLocation = "GrandparentArmature/ROOT/base/stomach/chest",
				childName = "Chest"
			});
		}
	}
	public class GenericGameEvents
	{
		public struct OnTakeDamageEventInfo
		{
			public float damageTaken;
		}

		public delegate void DamageAttackerVictimEventHandler(DamageInfo damageInfo, MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo, MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo);

		public delegate void DamageAttackerEventHandler(DamageInfo damageInfo, MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo);

		public delegate void DamageModifierEventHandler(DamageInfo damageInfo, MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo, MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo, ref float damage);

		public delegate void DamageExecutionEventHandler(DamageInfo damageInfo, MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo, MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo, float damage, ref float executionThreshold, ref GameObject executionEffectPrefab, ref bool forceExecution);

		public delegate void DamageVictimEventHandler(DamageInfo damageInfo, MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo);

		public delegate void DamageReportEventHandler(DamageReport damageReport);

		public delegate void SceneRNGEventHandler(Xoroshiro128Plus rng);

		public delegate void InteractionEventHandler(Interactor interactor, IInteractable interactable, GameObject interactableObject, bool canProc);

		public delegate void PlayerCharacterDeathEventHandler(DamageReport damageReport, ref string deathQuote);

		public class MysticsRisky2UtilsDamageEvents : MonoBehaviour, IOnIncomingDamageServerReceiver, IOnTakeDamageServerReceiver
		{
			public HealthComponent healthComponent;

			public CharacterBody victimBody;

			public void Start()
			{
				healthComponent = ((Component)this).GetComponent<HealthComponent>();
				if (!Object.op_Implicit((Object)(object)healthComponent))
				{
					Object.Destroy((Object)(object)this);
				}
				else
				{
					victimBody = healthComponent.body;
				}
			}

			public void OnIncomingDamageServer(DamageInfo damageInfo)
			{
				MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo = default(MysticsRisky2UtilsPlugin.GenericCharacterInfo);
				if (Object.op_Implicit((Object)(object)damageInfo.attacker))
				{
					attackerInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(damageInfo.attacker.GetComponent<CharacterBody>());
				}
				MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(victimBody);
				if (GenericGameEvents.BeforeTakeDamage != null)
				{
					GenericGameEvents.BeforeTakeDamage(damageInfo, attackerInfo, victimInfo);
				}
			}

			public void OnTakeDamageServer(DamageReport damageReport)
			{
				if (Object.op_Implicit((Object)(object)victimBody) && GenericGameEvents.OnTakeDamage != null)
				{
					GenericGameEvents.OnTakeDamage(damageReport);
				}
			}
		}

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

			public static hook_Awake <>9__44_0;

			public static hook_OnHitEnemy <>9__44_1;

			public static hook_OnHitAll <>9__44_2;

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

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

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

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

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

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

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

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

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

			public static Func<HealthComponent, DamageInfo, CharacterBody, float, float> <>9__44_7;

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

			public static Func<HealthComponent, DamageInfo, CharacterBody, float, float> <>9__44_8;

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

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

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

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

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

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

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

			public static Func<HealthComponent, DamageInfo, CharacterBody, float, float> <>9__44_9;

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

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

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

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

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

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

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

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

			public static Manipulator <>9__44_3;

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

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

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

			public static Action<Xoroshiro128Plus> <>9__44_46;

			public static Manipulator <>9__44_4;

			public static Action<Interactor, IInteractable, GameObject> <>9__44_5;

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

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

			public static Func<string, DamageReport, string> <>9__44_51;

			public static Manipulator <>9__44_6;

			internal void <Init>b__44_0(orig_Awake orig, HealthComponent self)
			{
				((Component)self).gameObject.AddComponent<MysticsRisky2UtilsDamageEvents>();
				orig.Invoke(self);
			}

			internal void <Init>b__44_1(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
			{
				orig.Invoke(self, damageInfo, victim);
				if (Object.op_Implicit((Object)(object)damageInfo.attacker))
				{
					CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
					CharacterBody body = (Object.op_Implicit((Object)(object)victim) ? victim.GetComponent<CharacterBody>() : null);
					MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(component);
					MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(body);
					if (GenericGameEvents.OnHitEnemy != null)
					{
						GenericGameEvents.OnHitEnemy(damageInfo, attackerInfo, victimInfo);
					}
				}
			}

			internal void <Init>b__44_2(orig_OnHitAll orig, GlobalEventManager self, DamageInfo damageInfo, GameObject hitObject)
			{
				orig.Invoke(self, damageInfo, hitObject);
				if (Object.op_Implicit((Object)(object)damageInfo.attacker))
				{
					CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
					MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(component);
					if (GenericGameEvents.OnHitAll != null)
					{
						GenericGameEvents.OnHitAll(damageInfo, attackerInfo);
					}
				}
			}

			internal void <Init>b__44_3(ILContext il)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Expected O, but got Unknown
				//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_01db: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_022b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0290: Unknown result type (might be due to invalid IL or missing references)
				//IL_029c: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a8: 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_02ec: Unknown result type (might be due to invalid IL or missing references)
				//IL_042f: Unknown result type (might be due to invalid IL or missing references)
				//IL_043b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0447: Unknown result type (might be due to invalid IL or missing references)
				//IL_0453: Unknown result type (might be due to invalid IL or missing references)
				//IL_048b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0676: Unknown result type (might be due to invalid IL or missing references)
				//IL_0682: Unknown result type (might be due to invalid IL or missing references)
				//IL_068e: Unknown result type (might be due to invalid IL or missing references)
				//IL_069a: Unknown result type (might be due to invalid IL or missing references)
				//IL_06ac: Unknown result type (might be due to invalid IL or missing references)
				//IL_06be: Unknown result type (might be due to invalid IL or missing references)
				//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0726: Unknown result type (might be due to invalid IL or missing references)
				//IL_074c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0772: Unknown result type (might be due to invalid IL or missing references)
				<>c__DisplayClass44_0 CS$<>8__locals0 = new <>c__DisplayClass44_0();
				ILCursor val = new ILCursor(il);
				CS$<>8__locals0.bypassArmorFlagPosition = 5;
				CS$<>8__locals0.damagePosition = 7;
				CS$<>8__locals0.executionThresholdPosition = 59;
				CS$<>8__locals0.executionEffectPosition = 11;
				CS$<>8__locals0.forceExecutionPosition = 9;
				if (val.TryGotoNext((MoveType)1, new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1),
					(Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "damageType"),
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 2)
				}) && val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCgtUn(x),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref CS$<>8__locals0.bypassArmorFlagPosition)
				}) && val.TryGotoNext((MoveType)1, new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1),
					(Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "damage"),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref CS$<>8__locals0.damagePosition)
				}))
				{
					ILLabel val3 = default(ILLabel);
					if (val.TryGotoNext((MoveType)1, new Func<Instruction, bool>[3]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1),
						(Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "crit"),
						(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val3)
					}))
					{
						val.Emit(OpCodes.Ldarg_0);
						val.Emit(OpCodes.Ldarg_1);
						val.Emit(OpCodes.Ldloc_1);
						val.Emit(OpCodes.Ldloc, CS$<>8__locals0.damagePosition);
						val.EmitDelegate<Func<HealthComponent, DamageInfo, CharacterBody, float, float>>((Func<HealthComponent, DamageInfo, CharacterBody, float, float>)delegate(HealthComponent healthComponent, DamageInfo damageInfo, CharacterBody attackerBody, float damage)
						{
							CharacterBody body4 = healthComponent.body;
							MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo4 = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(attackerBody);
							MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo4 = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(body4);
							if (GenericGameEvents.OnApplyDamageIncreaseModifiers != null)
							{
								GenericGameEvents.OnApplyDamageIncreaseModifiers(damageInfo, attackerInfo4, victimInfo4, ref damage);
							}
							return damage;
						});
						val.Emit(OpCodes.Stloc, CS$<>8__locals0.damagePosition);
					}
					else
					{
						ErrorHookFailed("on apply damage increase modifiers");
					}
					ILLabel val2 = default(ILLabel);
					if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, CS$<>8__locals0.bypassArmorFlagPosition),
						(Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref val2)
					}))
					{
						val.Emit(OpCodes.Ldarg_0);
						val.Emit(OpCodes.Ldarg_1);
						val.Emit(OpCodes.Ldloc_1);
						val.Emit(OpCodes.Ldloc, CS$<>8__locals0.damagePosition);
						val.EmitDelegate<Func<HealthComponent, DamageInfo, CharacterBody, float, float>>((Func<HealthComponent, DamageInfo, CharacterBody, float, float>)delegate(HealthComponent healthComponent, DamageInfo damageInfo, CharacterBody attackerBody, float damage)
						{
							CharacterBody body3 = healthComponent.body;
							MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo3 = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(attackerBody);
							MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo3 = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(body3);
							if (GenericGameEvents.OnApplyDamageReductionModifiers != null)
							{
								GenericGameEvents.OnApplyDamageReductionModifiers(damageInfo, attackerInfo3, victimInfo3, ref damage);
							}
							return damage;
						});
						val.Emit(OpCodes.Stloc, CS$<>8__locals0.damagePosition);
					}
					else
					{
						ErrorHookFailed("on apply damage reduction modifiers");
					}
					if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[5]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<HealthComponent>(x, "get_fullHealth"),
						(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.1f),
						(Instruction x) => ILPatternMatchingExt.MatchMul(x),
						(Instruction x) => ILPatternMatchingExt.MatchStloc(x, CS$<>8__locals0.damagePosition)
					}) && val.TryGotoPrev((MoveType)1, new Func<Instruction, bool>[3]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
						(Instruction x) => ILPatternMatchingExt.MatchLdfld<HealthComponent>(x, "body"),
						(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "LunarShell")
					}))
					{
						val.Emit(OpCodes.Ldarg_0);
						val.Emit(OpCodes.Ldarg_1);
						val.Emit(OpCodes.Ldloc_1);
						val.Emit(OpCodes.Ldloc, CS$<>8__locals0.damagePosition);
						val.EmitDelegate<Func<HealthComponent, DamageInfo, CharacterBody, float, float>>((Func<HealthComponent, DamageInfo, CharacterBody, float, float>)delegate(HealthComponent healthComponent, DamageInfo damageInfo, CharacterBody attackerBody, float damage)
						{
							CharacterBody body2 = healthComponent.body;
							MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo2 = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(attackerBody);
							MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo2 = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(body2);
							if (GenericGameEvents.OnApplyDamageCapModifiers != null)
							{
								GenericGameEvents.OnApplyDamageCapModifiers(damageInfo, attackerInfo2, victimInfo2, ref damage);
							}
							return damage;
						});
						val.Emit(OpCodes.Stloc, CS$<>8__locals0.damagePosition);
					}
					else
					{
						ErrorHookFailed("on apply damage cap modifiers");
					}
					if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdfld<CharacterBody>(x, "bodyFlags"),
						(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 16)
					}) && val.TryGotoPrev((MoveType)2, new Func<Instruction, bool>[2]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdfld<CharacterBody>(x, "bodyFlags"),
						(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 2048)
					}) && val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref CS$<>8__locals0.forceExecutionPosition)
					}) && val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, float.NegativeInfinity),
						(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref CS$<>8__locals0.executionThresholdPosition)
					}) && val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdsfld<FrozenState>(x, "executeEffectPrefab"),
						(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref CS$<>8__locals0.executionEffectPosition)
					}) && val.TryGotoPrev((MoveType)2, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<HealthComponent>(x, "get_isInFrozenState")
					}) && val.TryGotoPrev((MoveType)0, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0)
					}))
					{
						<>c__DisplayClass44_1 CS$<>8__locals1 = new <>c__DisplayClass44_1();
						val.MoveAfterLabels();
						val.Emit(OpCodes.Ldarg_0);
						val.Emit(OpCodes.Ldarg_1);
						val.Emit(OpCodes.Ldloc_1);
						val.Emit(OpCodes.Ldloc, CS$<>8__locals0.damagePosition);
						val.Emit(OpCodes.Ldloc, CS$<>8__locals0.executionThresholdPosition);
						val.Emit(OpCodes.Ldloc, CS$<>8__locals0.executionEffectPosition);
						val.Emit(OpCodes.Ldloc, CS$<>8__locals0.forceExecutionPosition);
						CS$<>8__locals1.newExecutionThreshold = 0f;
						CS$<>8__locals1.newExecutionEffectPrefab = null;
						CS$<>8__locals1.newForceExecution = false;
						val.EmitDelegate<Action<HealthComponent, DamageInfo, CharacterBody, float, float, GameObject, bool>>((Action<HealthComponent, DamageInfo, CharacterBody, float, float, GameObject, bool>)delegate(HealthComponent healthComponent, DamageInfo damageInfo, CharacterBody attackerBody, float damage, float executionThreshold, GameObject executionEffectPrefab, bool forceExecution)
						{
							CS$<>8__locals1.newExecutionThreshold = executionThreshold;
							CS$<>8__locals1.newExecutionEffectPrefab = executionEffectPrefab;
							CS$<>8__locals1.newForceExecution = forceExecution;
							CharacterBody body = healthComponent.body;
							MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(attackerBody);
							MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(body);
							if (GenericGameEvents.OnApplyDamageExecutions != null)
							{
								GenericGameEvents.OnApplyDamageExecutions(damageInfo, attackerInfo, victimInfo, damage, ref executionThreshold, ref executionEffectPrefab, ref forceExecution);
							}
						});
						val.EmitDelegate<Func<float>>((Func<float>)(() => CS$<>8__locals1.newExecutionThreshold));
						val.Emit(OpCodes.Stloc, CS$<>8__locals0.executionThresholdPosition);
						val.EmitDelegate<Func<GameObject>>((Func<GameObject>)(() => CS$<>8__locals1.newExecutionEffectPrefab));
						val.Emit(OpCodes.Stloc, CS$<>8__locals0.executionEffectPosition);
						val.EmitDelegate<Func<bool>>((Func<bool>)(() => CS$<>8__locals1.newForceExecution));
						val.Emit(OpCodes.Stloc, CS$<>8__locals0.forceExecutionPosition);
					}
					else
					{
						ErrorHookFailed("on apply damage executions");
					}
				}
				else
				{
					ErrorHookFailed("get HealthComponent local variable positions");
				}
			}

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

			internal bool <Init>b__44_11(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "damageType");
			}

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

			internal bool <Init>b__44_13(Instruction x)
			{
				return ILPatternMatchingExt.MatchCgtUn(x);
			}

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

			internal bool <Init>b__44_16(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "damage");
			}

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

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

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

			internal float <Init>b__44_7(HealthComponent healthComponent, DamageInfo damageInfo, CharacterBody attackerBody, float damage)
			{
				CharacterBody body = healthComponent.body;
				MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(attackerBody);
				MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(body);
				if (GenericGameEvents.OnApplyDamageIncreaseModifiers != null)
				{
					GenericGameEvents.OnApplyDamageIncreaseModifiers(damageInfo, attackerInfo, victimInfo, ref damage);
				}
				return damage;
			}

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

			internal float <Init>b__44_8(HealthComponent healthComponent, DamageInfo damageInfo, CharacterBody attackerBody, float damage)
			{
				CharacterBody body = healthComponent.body;
				MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(attackerBody);
				MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(body);
				if (GenericGameEvents.OnApplyDamageReductionModifiers != null)
				{
					GenericGameEvents.OnApplyDamageReductionModifiers(damageInfo, attackerInfo, victimInfo, ref damage);
				}
				return damage;
			}

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

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

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

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

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

			internal bool <Init>b__44_29(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdfld<HealthComponent>(x, "body");
			}

			internal bool <Init>b__44_30(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "LunarShell");
			}

			internal float <Init>b__44_9(HealthComponent healthComponent, DamageInfo damageInfo, CharacterBody attackerBody, float damage)
			{
				CharacterBody body = healthComponent.body;
				MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(attackerBody);
				MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(body);
				if (GenericGameEvents.OnApplyDamageCapModifiers != null)
				{
					GenericGameEvents.OnApplyDamageCapModifiers(damageInfo, attackerInfo, victimInfo, ref damage);
				}
				return damage;
			}

			internal bool <Init>b__44_31(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdfld<CharacterBody>(x, "bodyFlags");
			}

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

			internal bool <Init>b__44_33(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdfld<CharacterBody>(x, "bodyFlags");
			}

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

			internal bool <Init>b__44_36(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdcR4(x, float.NegativeInfinity);
			}

			internal bool <Init>b__44_38(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdsfld<FrozenState>(x, "executeEffectPrefab");
			}

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

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

			internal void <Init>b__44_4(ILContext il)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Expected O, but got Unknown
				//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
				<>c__DisplayClass44_2 CS$<>8__locals0 = new <>c__DisplayClass44_2();
				ILCursor val = new ILCursor(il);
				CS$<>8__locals0.rngPos = -1;
				if (val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<SceneInfo>(x, "get_instance"),
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<SceneInfo>(x, "get_countsAsStage")
				}) && val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdfld<SceneDirector>(x, "rng")
				}) && val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref CS$<>8__locals0.rngPos)
				}))
				{
					val.Emit(OpCodes.Ldloc, CS$<>8__locals0.rngPos);
					val.EmitDelegate<Action<Xoroshiro128Plus>>((Action<Xoroshiro128Plus>)delegate(Xoroshiro128Plus xoroshiro128Plus)
					{
						if (SceneInfo.instance.countsAsStage && GenericGameEvents.OnPopulateScene != null)
						{
							GenericGameEvents.OnPopulateScene(xoroshiro128Plus);
						}
					});
				}
				else
				{
					ErrorHookFailed("on populate scene");
				}
			}

			internal bool <Init>b__44_47(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<SceneInfo>(x, "get_instance");
			}

			internal bool <Init>b__44_48(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<SceneInfo>(x, "get_countsAsStage");
			}

			internal bool <Init>b__44_49(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdfld<SceneDirector>(x, "rng");
			}

			internal void <Init>b__44_46(Xoroshiro128Plus xoroshiro128Plus)
			{
				if (SceneInfo.instance.countsAsStage && GenericGameEvents.OnPopulateScene != null)
				{
					GenericGameEvents.OnPopulateScene(xoroshiro128Plus);
				}
			}

			internal void <Init>b__44_5(Interactor interactor, IInteractable interactable, GameObject interactableObject)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				MonoBehaviour val = (MonoBehaviour)interactable;
				bool canProc = !Object.op_Implicit((Object)(object)((Component)val).GetComponent<GenericPickupController>()) && !Object.op_Implicit((Object)(object)((Component)val).GetComponent<VehicleSeat>()) && !Object.op_Implicit((Object)(object)((Component)val).GetComponent<NetworkUIPromptController>());
				InteractionProcFilter component = interactableObject.GetComponent<InteractionProcFilter>();
				if (Object.op_Implicit((Object)(object)component))
				{
					canProc = component.shouldAllowOnInteractionBeginProc;
				}
				if (GenericGameEvents.OnInteractionBegin != null)
				{
					GenericGameEvents.OnInteractionBegin(interactor, interactable, interactableObject, canProc);
				}
			}

			internal void <Init>b__44_6(ILContext il)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Expected O, but got Unknown
				//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
				<>c__DisplayClass44_3 CS$<>8__locals0 = new <>c__DisplayClass44_3();
				ILCursor val = new ILCursor(il);
				CS$<>8__locals0.deathQuotePos = -1;
				if (val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "PLAYER_DEATH_QUOTE_VOIDDEATH"),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref CS$<>8__locals0.deathQuotePos)
				}) && val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdsfld<GlobalEventManager>(x, "standardDeathQuoteTokens")
				}) && val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, CS$<>8__locals0.deathQuotePos)
				}))
				{
					val.Emit(OpCodes.Ldarg_1);
					val.EmitDelegate<Func<string, DamageReport, string>>((Func<string, DamageReport, string>)delegate(string deathQuote, DamageReport damageReport)
					{
						if (GenericGameEvents.OnPlayerCharacterDeath != null)
						{
							GenericGameEvents.OnPlayerCharacterDeath(damageReport, ref deathQuote);
						}
						return deathQuote;
					});
				}
				else
				{
					ErrorHookFailed("on player character death");
				}
			}

			internal bool <Init>b__44_52(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdstr(x, "PLAYER_DEATH_QUOTE_VOIDDEATH");
			}

			internal bool <Init>b__44_54(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdsfld<GlobalEventManager>(x, "standardDeathQuoteTokens");
			}

			internal string <Init>b__44_51(string deathQuote, DamageReport damageReport)
			{
				if (GenericGameEvents.OnPlayerCharacterDeath != null)
				{
					GenericGameEvents.OnPlayerCharacterDeath(damageReport, ref deathQuote);
				}
				return deathQuote;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass44_0
		{
			public int bypassArmorFlagPosition;

			public int damagePosition;

			public int forceExecutionPosition;

			public int executionThresholdPosition;

			public int executionEffectPosition;

			internal bool <Init>b__14(Instruction x)
			{
				return ILPatternMatchingExt.MatchStloc(x, ref bypassArmorFlagPosition);
			}

			internal bool <Init>b__17(Instruction x)
			{
				return ILPatternMatchingExt.MatchStloc(x, ref damagePosition);
			}

			internal bool <Init>b__21(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdloc(x, bypassArmorFlagPosition);
			}

			internal bool <Init>b__27(Instruction x)
			{
				return ILPatternMatchingExt.MatchStloc(x, damagePosition);
			}

			internal bool <Init>b__35(Instruction x)
			{
				return ILPatternMatchingExt.MatchStloc(x, ref forceExecutionPosition);
			}

			internal bool <Init>b__37(Instruction x)
			{
				return ILPatternMatchingExt.MatchStloc(x, ref executionThresholdPosition);
			}

			internal bool <Init>b__39(Instruction x)
			{
				return ILPatternMatchingExt.MatchStloc(x, ref executionEffectPosition);
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass44_1
		{
			public float newExecutionThreshold;

			public GameObject newExecutionEffectPrefab;

			public bool newForceExecution;

			internal void <Init>b__42(HealthComponent healthComponent, DamageInfo damageInfo, CharacterBody attackerBody, float damage, float executionThreshold, GameObject executionEffectPrefab, bool forceExecution)
			{
				newExecutionThreshold = executionThreshold;
				newExecutionEffectPrefab = executionEffectPrefab;
				newForceExecution = forceExecution;
				CharacterBody body = healthComponent.body;
				MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(attackerBody);
				MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(body);
				if (GenericGameEvents.OnApplyDamageExecutions != null)
				{
					GenericGameEvents.OnApplyDamageExecutions(damageInfo, attackerInfo, victimInfo, damage, ref executionThreshold, ref executionEffectPrefab, ref forceExecution);
				}
			}

			internal float <Init>b__43()
			{
				return newExecutionThreshold;
			}

			internal GameObject <Init>b__44()
			{
				return newExecutionEffectPrefab;
			}

			internal bool <Init>b__45()
			{
				return newForceExecution;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass44_2
		{
			public int rngPos;

			internal bool <Init>b__50(Instruction x)
			{
				return ILPatternMatchingExt.MatchStloc(x, ref rngPos);
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass44_3
		{
			public int deathQuotePos;

			internal bool <Init>b__53(Instruction x)
			{
				return ILPatternMatchingExt.MatchStloc(x, ref deathQuotePos);
			}

			internal bool <Init>b__55(Instruction x)
			{
				return ILPatternMatchingExt.MatchStloc(x, deathQuotePos);
			}
		}

		public static event DamageAttackerVictimEventHandler OnHitEnemy;

		public static event DamageAttackerEventHandler OnHitAll;

		public static event DamageAttackerVictimEventHandler BeforeTakeDamage;

		public static event DamageModifierEventHandler OnApplyDamageIncreaseModifiers;

		public static event DamageModifierEventHandler OnApplyDamageReductionModifiers;

		public static event DamageModifierEventHandler OnApplyDamageCapModifiers;

		public static event DamageExecutionEventHandler OnApplyDamageExecutions;

		public static event DamageReportEventHandler OnTakeDamage;

		public static event SceneRNGEventHandler OnPopulateScene;

		public static event InteractionEventHandler OnInteractionBegin;

		public static event PlayerCharacterDeathEventHandler OnPlayerCharacterDeath;

		internal static void ErrorHookFailed(string name)
		{
			MysticsRisky2UtilsPlugin.logger.LogError((object)("generic game event '" + name + "' hook failed"));
		}

		internal static void Init()
		{
			//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_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
			object obj = <>c.<>9__44_0;
			if (obj == null)
			{
				hook_Awake val = delegate(orig_Awake orig, HealthComponent self)
				{
					((Component)self).gameObject.AddComponent<MysticsRisky2UtilsDamageEvents>();
					orig.Invoke(self);
				};
				<>c.<>9__44_0 = val;
				obj = (object)val;
			}
			HealthComponent.Awake += (hook_Awake)obj;
			object obj2 = <>c.<>9__44_1;
			if (obj2 == null)
			{
				hook_OnHitEnemy val2 = delegate(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
				{
					orig.Invoke(self, damageInfo, victim);
					if (Object.op_Implicit((Object)(object)damageInfo.attacker))
					{
						CharacterBody component3 = damageInfo.attacker.GetComponent<CharacterBody>();
						CharacterBody body5 = (Object.op_Implicit((Object)(object)victim) ? victim.GetComponent<CharacterBody>() : null);
						MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo6 = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(component3);
						MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo5 = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(body5);
						if (GenericGameEvents.OnHitEnemy != null)
						{
							GenericGameEvents.OnHitEnemy(damageInfo, attackerInfo6, victimInfo5);
						}
					}
				};
				<>c.<>9__44_1 = val2;
				obj2 = (object)val2;
			}
			GlobalEventManager.OnHitEnemy += (hook_OnHitEnemy)obj2;
			object obj3 = <>c.<>9__44_2;
			if (obj3 == null)
			{
				hook_OnHitAll val3 = delegate(orig_OnHitAll orig, GlobalEventManager self, DamageInfo damageInfo, GameObject hitObject)
				{
					orig.Invoke(self, damageInfo, hitObject);
					if (Object.op_Implicit((Object)(object)damageInfo.attacker))
					{
						CharacterBody component2 = damageInfo.attacker.GetComponent<CharacterBody>();
						MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo5 = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(component2);
						if (GenericGameEvents.OnHitAll != null)
						{
							GenericGameEvents.OnHitAll(damageInfo, attackerInfo5);
						}
					}
				};
				<>c.<>9__44_2 = val3;
				obj3 = (object)val3;
			}
			GlobalEventManager.OnHitAll += (hook_OnHitAll)obj3;
			object obj4 = <>c.<>9__44_3;
			if (obj4 == null)
			{
				Manipulator val4 = 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_01cf: Unknown result type (might be due to invalid IL or missing references)
					//IL_01db: Unknown result type (might be due to invalid IL or missing references)
					//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
					//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
					//IL_022b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0290: Unknown result type (might be due to invalid IL or missing references)
					//IL_029c: Unknown result type (might be due to invalid IL or missing references)
					//IL_02a8: 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_02ec: Unknown result type (might be due to invalid IL or missing references)
					//IL_042f: Unknown result type (might be due to invalid IL or missing references)
					//IL_043b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0447: Unknown result type (might be due to invalid IL or missing references)
					//IL_0453: Unknown result type (might be due to invalid IL or missing references)
					//IL_048b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0676: Unknown result type (might be due to invalid IL or missing references)
					//IL_0682: Unknown result type (might be due to invalid IL or missing references)
					//IL_068e: Unknown result type (might be due to invalid IL or missing references)
					//IL_069a: Unknown result type (might be due to invalid IL or missing references)
					//IL_06ac: Unknown result type (might be due to invalid IL or missing references)
					//IL_06be: Unknown result type (might be due to invalid IL or missing references)
					//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
					//IL_0726: Unknown result type (might be due to invalid IL or missing references)
					//IL_074c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0772: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val10 = new ILCursor(il);
					int bypassArmorFlagPosition = 5;
					int damagePosition = 7;
					int executionThresholdPosition = 59;
					int executionEffectPosition = 11;
					int forceExecutionPosition = 9;
					if (val10.TryGotoNext((MoveType)1, new Func<Instruction, bool>[3]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1),
						(Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "damageType"),
						(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 2)
					}) && val10.TryGotoNext(new Func<Instruction, bool>[2]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCgtUn(x),
						(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref bypassArmorFlagPosition)
					}) && val10.TryGotoNext((MoveType)1, new Func<Instruction, bool>[3]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1),
						(Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "damage"),
						(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref damagePosition)
					}))
					{
						ILLabel val12 = default(ILLabel);
						if (val10.TryGotoNext((MoveType)1, new Func<Instruction, bool>[3]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1),
							(Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "crit"),
							(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val12)
						}))
						{
							val10.Emit(OpCodes.Ldarg_0);
							val10.Emit(OpCodes.Ldarg_1);
							val10.Emit(OpCodes.Ldloc_1);
							val10.Emit(OpCodes.Ldloc, damagePosition);
							val10.EmitDelegate<Func<HealthComponent, DamageInfo, CharacterBody, float, float>>((Func<HealthComponent, DamageInfo, CharacterBody, float, float>)delegate(HealthComponent healthComponent, DamageInfo damageInfo, CharacterBody attackerBody, float damage)
							{
								CharacterBody body4 = healthComponent.body;
								MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo4 = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(attackerBody);
								MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo4 = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(body4);
								if (GenericGameEvents.OnApplyDamageIncreaseModifiers != null)
								{
									GenericGameEvents.OnApplyDamageIncreaseModifiers(damageInfo, attackerInfo4, victimInfo4, ref damage);
								}
								return damage;
							});
							val10.Emit(OpCodes.Stloc, damagePosition);
						}
						else
						{
							ErrorHookFailed("on apply damage increase modifiers");
						}
						ILLabel val11 = default(ILLabel);
						if (val10.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, bypassArmorFlagPosition),
							(Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref val11)
						}))
						{
							val10.Emit(OpCodes.Ldarg_0);
							val10.Emit(OpCodes.Ldarg_1);
							val10.Emit(OpCodes.Ldloc_1);
							val10.Emit(OpCodes.Ldloc, damagePosition);
							val10.EmitDelegate<Func<HealthComponent, DamageInfo, CharacterBody, float, float>>((Func<HealthComponent, DamageInfo, CharacterBody, float, float>)delegate(HealthComponent healthComponent, DamageInfo damageInfo, CharacterBody attackerBody, float damage)
							{
								CharacterBody body3 = healthComponent.body;
								MysticsRisky2UtilsPlugin.GenericCharacterInfo attackerInfo3 = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(attackerBody);
								MysticsRisky2UtilsPlugin.GenericCharacterInfo victimInfo3 = new MysticsRisky2UtilsPlugin.GenericCharacterInfo(body3);
								if (GenericGameEvents.OnApplyDamageReductionModifiers != null)
								{
									GenericGameEvents.OnApplyDamageReductionModifiers(damageInfo, attackerInfo3, victimInfo3, ref damage);
								}
								return damage;
							});
							val10.Emit(OpCodes.Stloc, damagePosition);
						}
						else
						{
							ErrorHookFailed("on apply damage reduction modifiers");
						}
						if (val10.TryGotoNext((MoveType)2, new Func<Instruction, bool>[5]
						{
							(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
							(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<HealthComponent>(x, "get_fullHealth"),
							(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.1f),
							(Instruction x) => ILPatternMatchingExt.MatchMul(x),
							(Instruction x) => ILPatternMatchingExt.MatchStloc(x, damagePosition)
						}) && val10.TryGotoPrev((MoveType)1, new F