Decompiled source of ButterscotchandRosesBaseMod v0.1.3

butterscotchnroses.dll

Decompiled a week ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
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 AllyNames;
using BNR.items;
using BNR.patches;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CoolerEclipse;
using EntityStates;
using EntityStates.Executioner2;
using EntityStates.JunkCube;
using GoldenCoastPlusRevived.Modules;
using HG;
using HG.Reflection;
using HarmonyLib;
using Inferno.Stat_AI;
using Microsoft.CodeAnalysis;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.JunkCube;
using On.RoR2;
using On.RoR2.Hologram;
using On.RoR2.UI;
using On.RoR2.UI.SkinControllers;
using R2API;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Hologram;
using RoR2.Items;
using RoR2.UI;
using RoR2.UI.SkinControllers;
using RoR2BepInExPack.GameAssetPaths.Version_1_35_0;
using RoR2BepInExPack.GameAssetPathsBetter;
using SS2;
using ShaderSwapper;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("butterscotchnroses")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+456537ce7bf07415f989f8efb4042e2b961d082a")]
[assembly: AssemblyProduct("butterscotchnroses")]
[assembly: AssemblyTitle("butterscotchnroses")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ProdzModpackUtils
{
	public class Utils
	{
		public static Color TRANSPARENT = new Color(0f, 0f, 0f, 0f);

		public static Sprite GetComposite(Texture2D bg, Texture2D fg)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Expected O, but got Unknown
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = default(Vector2);
			((Vector2)(ref val))..ctor((float)Mathf.Max(((Texture)bg).width, ((Texture)fg).width), (float)Mathf.Max(((Texture)bg).height, ((Texture)fg).height));
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(Mathf.Floor(((float)((Texture)bg).width - val.x) / 2f), Mathf.Floor(((float)((Texture)bg).width - val.y) / 2f));
			Vector2 val3 = default(Vector2);
			((Vector2)(ref val3))..ctor(Mathf.Floor(((float)((Texture)fg).width - val.x) / 2f), Mathf.Floor(((float)((Texture)fg).width - val.y) / 2f));
			Texture2D val4 = new Texture2D((int)val.x, (int)val.y);
			for (int i = 0; (float)i < val.x; i++)
			{
				for (int j = 0; (float)j < val.y; j++)
				{
					val4.SetPixel(i, j, Over(Pixel(bg, (float)i + val2.x, (float)j + val2.y), Pixel(fg, (float)i + val3.x, (float)j + val3.y)));
				}
			}
			return Sprite.Create(val4, new Rect(0f, 0f, val.x, val.y), new Vector2(0.5f, 0.5f), 3f);
		}

		public static Color Pixel(Texture2D img, float x, float y)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			if (0f > x || x >= (float)((Texture)img).width || 0f > y || y >= (float)((Texture)img).height)
			{
				return TRANSPARENT;
			}
			return img.GetPixel((int)x, (int)y);
		}

		public static Color Over(Color bg, Color fg)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: 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)
			float num = bg.a * (1f - fg.a) + fg.a;
			return Color.op_Implicit((Color.op_Implicit(fg) * fg.a + Color.op_Implicit(bg) * bg.a * (1f - fg.a)) / num);
		}

		public static Sprite Load(params string[] path)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			Size dimensions = ImageHelper.GetDimensions(Path.Combine(path));
			byte[] array = File.ReadAllBytes(Path.Combine(path));
			Texture2D val = new Texture2D(dimensions.Width, dimensions.Height, (TextureFormat)3, false)
			{
				filterMode = (FilterMode)2
			};
			ImageConversion.LoadImage(val, array);
			return Sprite.Create(val, new Rect(0f, 0f, (float)dimensions.Width, (float)dimensions.Height), new Vector2(0.5f, 0.5f), 3f);
		}
	}
	public static class ImageHelper
	{
		private const string errorMessage = "Could not recognize image format.";

		private static Dictionary<byte[], Func<BinaryReader, Size>> imageFormatDecoders = new Dictionary<byte[], Func<BinaryReader, Size>>
		{
			{
				new byte[2] { 66, 77 },
				DecodeBitmap
			},
			{
				new byte[6] { 71, 73, 70, 56, 55, 97 },
				DecodeGif
			},
			{
				new byte[6] { 71, 73, 70, 56, 57, 97 },
				DecodeGif
			},
			{
				new byte[8] { 137, 80, 78, 71, 13, 10, 26, 10 },
				DecodePng
			},
			{
				new byte[2] { 255, 216 },
				DecodeJfif
			}
		};

		public static Size GetDimensions(string path)
		{
			using BinaryReader binaryReader = new BinaryReader(File.OpenRead(path));
			try
			{
				return GetDimensions(binaryReader);
			}
			catch (ArgumentException ex)
			{
				if (ex.Message.StartsWith("Could not recognize image format."))
				{
					throw new ArgumentException("Could not recognize image format.", "path", ex);
				}
				throw ex;
			}
		}

		public static Size GetDimensions(BinaryReader binaryReader)
		{
			int num = imageFormatDecoders.Keys.OrderByDescending((byte[] x) => x.Length).First().Length;
			byte[] array = new byte[num];
			for (int i = 0; i < num; i++)
			{
				array[i] = binaryReader.ReadByte();
				foreach (KeyValuePair<byte[], Func<BinaryReader, Size>> imageFormatDecoder in imageFormatDecoders)
				{
					if (array.StartsWith(imageFormatDecoder.Key))
					{
						return imageFormatDecoder.Value(binaryReader);
					}
				}
			}
			throw new ArgumentException("Could not recognize image format.", "binaryReader");
		}

		private static bool StartsWith(this byte[] thisBytes, byte[] thatBytes)
		{
			for (int i = 0; i < thatBytes.Length; i++)
			{
				if (thisBytes[i] != thatBytes[i])
				{
					return false;
				}
			}
			return true;
		}

		private static short ReadLittleEndianInt16(this BinaryReader binaryReader)
		{
			byte[] array = new byte[2];
			for (int i = 0; i < 2; i++)
			{
				array[1 - i] = binaryReader.ReadByte();
			}
			return BitConverter.ToInt16(array, 0);
		}

		private static int ReadLittleEndianInt32(this BinaryReader binaryReader)
		{
			byte[] array = new byte[4];
			for (int i = 0; i < 4; i++)
			{
				array[3 - i] = binaryReader.ReadByte();
			}
			return BitConverter.ToInt32(array, 0);
		}

		private static Size DecodeBitmap(BinaryReader binaryReader)
		{
			binaryReader.ReadBytes(16);
			int width = binaryReader.ReadInt32();
			int height = binaryReader.ReadInt32();
			return new Size(width, height);
		}

		private static Size DecodeGif(BinaryReader binaryReader)
		{
			short width = binaryReader.ReadInt16();
			int height = binaryReader.ReadInt16();
			return new Size(width, height);
		}

		private static Size DecodePng(BinaryReader binaryReader)
		{
			binaryReader.ReadBytes(8);
			int width = binaryReader.ReadLittleEndianInt32();
			int height = binaryReader.ReadLittleEndianInt32();
			return new Size(width, height);
		}

		private static Size DecodeJfif(BinaryReader binaryReader)
		{
			while (binaryReader.ReadByte() == byte.MaxValue)
			{
				byte num = binaryReader.ReadByte();
				short num2 = binaryReader.ReadLittleEndianInt16();
				if (num == 192)
				{
					binaryReader.ReadByte();
					int height = binaryReader.ReadLittleEndianInt16();
					return new Size(binaryReader.ReadLittleEndianInt16(), height);
				}
				binaryReader.ReadBytes(num2 - 2);
			}
			throw new ArgumentException("Could not recognize image format.");
		}
	}
}
namespace BNR
{
	[BepInPlugin("zzzicebro.BNR", "BNR", "0.1.3")]
	public class butterscotchnroses : BaseUnityPlugin
	{
		public const string PluginGUID = "zzzicebro.BNR";

		public const string PluginAuthor = "icebro";

		public const string PluginName = "BNR";

		public const string PluginVersion = "0.1.3";

		public static AssetBundle carvingKitBundle;

		private static ConfigEntry<Color> skyboxColor;

		private static Material skyboxMaterial;

		private static List<uint> sounds = new List<uint>();

		public void Awake()
		{
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Expected O, but got Unknown
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Expected O, but got Unknown
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Expected O, but got Unknown
			Log.Init(((BaseUnityPlugin)this).Logger);
			((BaseUnityPlugin)this).Logger.LogDebug((object)"loading mod !!");
			carvingKitBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "carvingkit_assets"));
			((MonoBehaviour)this).StartCoroutine(ShaderSwapper.UpgradeStubbedShadersAsync(carvingKitBundle));
			Harmony harmony = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID);
			foreach (Type item in from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(PatchBase))
				select type)
			{
				try
				{
					PatchBase obj = (PatchBase)Activator.CreateInstance(item);
					obj.Config(((BaseUnityPlugin)this).Config);
					obj.Init(harmony);
				}
				catch (Exception data)
				{
					Log.Warning("failed to patch something ! probably fine if you dont have whatever mod that was attempted to be patched enabled ,..,,.");
					Log.Warning(data);
				}
			}
			foreach (Type item2 in from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(BuffBase))
				select type)
			{
				((BuffBase)Activator.CreateInstance(item2)).AddBuff();
			}
			foreach (Type item3 in from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase))
				select type)
			{
				((ItemBase)Activator.CreateInstance(item3)).Init(((BaseUnityPlugin)this).Config);
			}
			SceneDirector.Start += new hook_Start(SceneDirectorOnStart);
			skyboxColor = ((BaseUnityPlugin)this).Config.Bind<Color>("BNR - testscene", "skyboxColor", BNRUtils.Color255(152, 122, 144), "tint of skybox in testscene !!!");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(skyboxColor));
		}

		private void SceneDirectorOnStart(orig_Start orig, SceneDirector self)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name == "testscene")
			{
				Material skybox = RenderSettings.skybox;
				activeScene = SceneManager.GetActiveScene();
				Log.Debug($"new scene !! {skybox} {((Scene)(ref activeScene)).name}");
				if ((Object)(object)skyboxMaterial == (Object)null)
				{
					skyboxMaterial = Object.Instantiate<Material>(RenderSettings.skybox);
					skyboxMaterial.SetColor("_Tint", skyboxColor.Value);
				}
				RenderSettings.skybox = skyboxMaterial;
			}
		}

		private void Update()
		{
		}

		[ConCommand(/*Could not decode attribute arguments.*/)]
		public static void akplaysound(ConCommandArgs args)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)("args = " + ((ConCommandArgs)(ref args))[0]));
			Debug.Log((object)$"sender body = {((ConCommandArgs)(ref args)).senderBody}");
			uint num = AkSoundEngine.PostEvent(((ConCommandArgs)(ref args))[0], ((Component)((ConCommandArgs)(ref args)).senderBody).gameObject);
			Debug.Log((object)$"sound id = {num}");
			sounds.Add(num);
		}

		[ConCommand(/*Could not decode attribute arguments.*/)]
		public static void akstopsound(ConCommandArgs args)
		{
			Debug.Log((object)$"sender body = {((ConCommandArgs)(ref args)).senderBody}");
			foreach (uint item in sounds.ToList())
			{
				AkSoundEngine.StopPlayingID(item);
				Debug.Log((object)$"stopped sound {item} !!!");
				sounds.Remove(item);
			}
		}

		[ConCommand(/*Could not decode attribute arguments.*/)]
		[ConCommand(/*Could not decode attribute arguments.*/)]
		public static void spawnEffect(ConCommandArgs args)
		{
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Expected O, but got Unknown
			float scale = 1f;
			if (((ConCommandArgs)(ref args)).Count > 1)
			{
				scale = Convert.ToSingle(((ConCommandArgs)(ref args))[1]);
			}
			Debug.Log((object)("args = " + ((ConCommandArgs)(ref args))[0] + " " + scale));
			EffectDef val = null;
			EffectDef[] entries = EffectCatalog.entries;
			foreach (EffectDef val2 in entries)
			{
				if (val2.prefabName.Contains(((ConCommandArgs)(ref args))[0]))
				{
					val = val2;
					break;
				}
			}
			if (val == null)
			{
				Log.Warning("couldnt find effect " + ((ConCommandArgs)(ref args))[0] + " !!!");
				return;
			}
			EffectManager.SpawnEffect(val.index, new EffectData
			{
				origin = ((ConCommandArgs)(ref args)).senderBody.transform.position,
				scale = scale,
				rotation = Util.QuaternionSafeLookRotation(Vector3.up)
			}, true);
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

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

		internal static void Debug(object data)
		{
		}

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

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

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

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

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	public class buttonrecolors : PatchBase<buttonrecolors>
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Awake <0>__ButtonSkinControllerOnAwake;

			public static hook_Awake <1>__PanelSkinControllerOnAwake;
		}

		private ConfigEntry<bool> enabled;

		private static ConfigEntry<bool> colorButtons;

		private static ConfigEntry<Color> buttonNorm;

		private static ConfigEntry<Color> buttonHigh;

		private static ConfigEntry<Color> buttonPress;

		private static ConfigEntry<Color> buttonSelect;

		public override void Init(Harmony harmony)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			if (enabled.Value)
			{
				object obj = <>O.<0>__ButtonSkinControllerOnAwake;
				if (obj == null)
				{
					hook_Awake val = ButtonSkinControllerOnAwake;
					<>O.<0>__ButtonSkinControllerOnAwake = val;
					obj = (object)val;
				}
				ButtonSkinController.Awake += (hook_Awake)obj;
				object obj2 = <>O.<1>__PanelSkinControllerOnAwake;
				if (obj2 == null)
				{
					hook_Awake val2 = PanelSkinControllerOnAwake;
					<>O.<1>__PanelSkinControllerOnAwake = val2;
					obj2 = (object)val2;
				}
				PanelSkinController.Awake += (hook_Awake)obj2;
			}
		}

		private static void PanelSkinControllerOnAwake(orig_Awake orig, PanelSkinController self)
		{
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (colorButtons.Value && !((Object)((Component)self).gameObject).name.Contains("ObjectivePanel") && !((Object)((Component)self).gameObject).name.Contains("NakedButton (Quit)"))
			{
				Image component = ((Component)self).gameObject.GetComponent<Image>();
				if (!((Object)((Component)component).gameObject).name.Contains("RuleBook"))
				{
					((Graphic)component).color = BNRUtils.Color255(buttonNorm.Value.r, buttonNorm.Value.g, buttonNorm.Value.b, ((Graphic)component).color.a);
				}
			}
		}

		private static void ButtonSkinControllerOnAwake(orig_Awake orig, ButtonSkinController self)
		{
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!colorButtons.Value)
			{
				return;
			}
			HGButton component = ((Component)self).gameObject.GetComponent<HGButton>();
			if (Object.op_Implicit((Object)(object)component) && !((Object)component).name.Contains("SurvivorIcon") && !((Object)((Component)component).gameObject).name.Contains("Choice") && !((Object)((Component)component).gameObject).name.Contains("Loadout") && !((Object)((Component)component).gameObject).name.Contains("ObjectivePanel") && !((Object)((Component)component).gameObject).name.Contains("NakedButton (Quit)"))
			{
				if (((Object)((Component)component).gameObject).name.Contains("Music&More"))
				{
					((Component)component).gameObject.SetActive(false);
				}
				ColorBlock colors = ((Selectable)component).colors;
				((ColorBlock)(ref colors)).normalColor = buttonNorm.Value;
				((ColorBlock)(ref colors)).highlightedColor = buttonHigh.Value;
				((ColorBlock)(ref colors)).pressedColor = buttonPress.Value;
				((ColorBlock)(ref colors)).selectedColor = buttonSelect.Value;
				((Selectable)component).colors = colors;
			}
		}

		public override void Config(ConfigFile config)
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Expected O, but got Unknown
			//IL_0079: 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)
			//IL_009c: Expected O, but got Unknown
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Expected O, but got Unknown
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Expected O, but got Unknown
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Expected O, but got Unknown
			enabled = config.Bind<bool>("BNR - UI", "enable patches for button recolors", true, "");
			BNRUtils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0063: Unknown result type (might be due to invalid IL or missing references)
				//IL_0069: Expected O, but got Unknown
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Expected O, but got Unknown
				//IL_007e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0083: Unknown result type (might be due to invalid IL or missing references)
				//IL_0089: Expected O, but got Unknown
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				//IL_0048: Expected O, but got Unknown
				if (enabled.Value)
				{
					object obj = <>O.<0>__ButtonSkinControllerOnAwake;
					if (obj == null)
					{
						hook_Awake val = ButtonSkinControllerOnAwake;
						<>O.<0>__ButtonSkinControllerOnAwake = val;
						obj = (object)val;
					}
					ButtonSkinController.Awake += (hook_Awake)obj;
					object obj2 = <>O.<1>__PanelSkinControllerOnAwake;
					if (obj2 == null)
					{
						hook_Awake val2 = PanelSkinControllerOnAwake;
						<>O.<1>__PanelSkinControllerOnAwake = val2;
						obj2 = (object)val2;
					}
					PanelSkinController.Awake += (hook_Awake)obj2;
				}
				else
				{
					object obj3 = <>O.<0>__ButtonSkinControllerOnAwake;
					if (obj3 == null)
					{
						hook_Awake val3 = ButtonSkinControllerOnAwake;
						<>O.<0>__ButtonSkinControllerOnAwake = val3;
						obj3 = (object)val3;
					}
					ButtonSkinController.Awake -= (hook_Awake)obj3;
					object obj4 = <>O.<1>__PanelSkinControllerOnAwake;
					if (obj4 == null)
					{
						hook_Awake val4 = PanelSkinControllerOnAwake;
						<>O.<1>__PanelSkinControllerOnAwake = val4;
						obj4 = (object)val4;
					}
					PanelSkinController.Awake -= (hook_Awake)obj4;
				}
			};
			colorButtons = config.Bind<bool>("BNR - UI", "change buttons colors", false, "whether or not to use custom menu button colors,..,");
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(colorButtons));
			buttonNorm = config.Bind<Color>("BNR - UI", "normal button color", BNRUtils.Color255(110, 83, 120), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonNorm));
			buttonHigh = config.Bind<Color>("BNR - UI", "highlighted button coor", BNRUtils.Color255(255, 177, 245), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonHigh));
			buttonPress = config.Bind<Color>("BNR - UI", "pressed button color", BNRUtils.Color255(192, 113, 182), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonPress));
			buttonSelect = config.Bind<Color>("BNR - UI", "selected button color", BNRUtils.Color255(255, 177, 238), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonSelect));
		}
	}
	public class drifter : PatchBase<drifter>
	{
		private ConfigEntry<bool> enabled;

		private ConfigEntry<bool> neverKillCubes;

		private ConfigEntry<int> cubeCount;

		public override void Init(Harmony harmony)
		{
			if (enabled.Value)
			{
				applyHooks();
			}
		}

		public void applyHooks()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			if (enabled.Value)
			{
				CharacterMaster.GetDeployableSameSlotLimit += new hook_GetDeployableSameSlotLimit(CharacterMasterOnGetDeployableSameSlotLimit);
				Idle.OnEnter += new hook_OnEnter(IdleOnOnEnter);
			}
			else
			{
				CharacterMaster.GetDeployableSameSlotLimit -= new hook_GetDeployableSameSlotLimit(CharacterMasterOnGetDeployableSameSlotLimit);
				Idle.OnEnter -= new hook_OnEnter(IdleOnOnEnter);
			}
		}

		private void IdleOnOnEnter(orig_OnEnter orig, Idle self)
		{
			orig.Invoke(self);
			if (neverKillCubes.Value)
			{
				((EntityState)self).fixedAge = float.NegativeInfinity;
			}
		}

		private int CharacterMasterOnGetDeployableSameSlotLimit(orig_GetDeployableSameSlotLimit orig, CharacterMaster self, DeployableSlot slot)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			if ((int)slot != 22)
			{
				return orig.Invoke(self, slot);
			}
			return cubeCount.Value;
		}

		public override void Config(ConfigFile config)
		{
			enabled = config.Bind<bool>("BNR - drifter", "enable patches for drifter", true, "");
			BNRUtils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				applyHooks();
			};
			cubeCount = config.Bind<int>("BNR - drifter", "junk cube count", 20, "limit of junk cubes !!");
			BNRUtils.SliderConfig(4, 300, cubeCount);
			neverKillCubes = config.Bind<bool>("BNR - drifter", "never kill cubes !!!", true, "byeah ,,.");
			BNRUtils.CheckboxConfig(neverKillCubes);
		}
	}
	public class dronevisibility : PatchBase<dronevisibility>
	{
		private ConfigEntry<bool> enabled;

		private ConfigEntry<bool> useSillyMaterials;

		private ConfigEntry<Color> sillyMaterialColor;

		private ConfigEntry<Color> operatorIndicatorColor;

		private ConfigEntry<float> visibilityDistance;

		private Material operatorMat;

		public override void Init(Harmony harmony)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			operatorMat = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC3/Drone Tech/matDroneTechCarryRings.mat").WaitForCompletion());
			operatorMat.SetColor("_TintColor", operatorIndicatorColor.Value);
			Hook();
		}

		private void Hook()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			if (enabled.Value)
			{
				HologramProjector.BuildHologram += new hook_BuildHologram(HologramProjectorOnBuildHologram);
				SummonMasterBehavior.OnEnable += new hook_OnEnable(SummonMasterBehaviorOnOnEnable);
			}
			else
			{
				HologramProjector.BuildHologram -= new hook_BuildHologram(HologramProjectorOnBuildHologram);
				SummonMasterBehavior.OnEnable -= new hook_OnEnable(SummonMasterBehaviorOnOnEnable);
			}
		}

		private void SummonMasterBehaviorOnOnEnable(orig_OnEnable orig, SummonMasterBehavior self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)((Component)self).GetComponent<DroneAvailability>()))
			{
				HologramProjector component = ((Component)self).GetComponent<HologramProjector>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.displayDistance = visibilityDistance.Value;
				}
				else
				{
					Log.Warning("failed to find projector on drone !!");
				}
			}
		}

		private void HologramProjectorOnBuildHologram(orig_BuildHologram orig, HologramProjector self)
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Expected O, but got Unknown
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: 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_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)((Component)self).gameObject.GetComponent<DroneAvailability>()) || ((Object)((Component)self).gameObject).name.Contains("Turret"))
			{
				return;
			}
			Texture portraitIcon = ((Component)self).gameObject.GetComponent<SummonMasterBehavior>().masterPrefab.GetComponent<CharacterMaster>().bodyPrefab.GetComponent<CharacterBody>().portraitIcon;
			Transform val = ((Component)self).gameObject.transform.Find("HologramPivot");
			GameObject val2 = new GameObject("HologramSprite");
			val2.transform.SetParent(((Component)val).transform);
			val2.AddComponent<HologramHelper>();
			SpriteRenderer val3 = val2.AddComponent<SpriteRenderer>();
			val3.sprite = Sprite.Create((Texture2D)(object)((portraitIcon is Texture2D) ? portraitIcon : null), new Rect(0f, 0f, (float)portraitIcon.width, (float)portraitIcon.height), new Vector2(0.5f, 0.5f));
			val2.transform.localScale = new Vector3(2f, 2f, 1f);
			if (useSillyMaterials.Value)
			{
				((Renderer)val3).sharedMaterial = Addressables.LoadAssetAsync<Material>((object)RoR2_DLC2.matHalcyoniteShrineCrystalGlow_mat).WaitForCompletion();
				((Renderer)val3).sharedMaterial.SetTexture("_Cloud2Tex", Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common.texCloudOrganic2_png).WaitForCompletion());
				((Renderer)val3).sharedMaterial.SetTexture("_Cloud1Tex", Addressables.LoadAssetAsync<Texture>((object)RoR2_DLC2_Child.texChildPrimaryStarCloud_png).WaitForCompletion());
				((Renderer)val3).sharedMaterial.SetColor("_TintColor", sillyMaterialColor.Value);
				((Renderer)val3).sharedMaterial.SetInt("_AlphaBias", 0);
			}
			GameObject val4 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC3/Drone Tech/CommandCarryTransportVFX.prefab").WaitForCompletion(), val2.transform, true);
			for (int i = 0; i < val4.transform.childCount; i++)
			{
				GameObject gameObject = ((Component)val4.transform.GetChild(i)).gameObject;
				if (((Object)gameObject).name != "MainRings")
				{
					Object.Destroy((Object)(object)gameObject);
					continue;
				}
				gameObject.GetComponent<ParticleSystem>().startSpeed = -10f;
				((Renderer)gameObject.GetComponent<ParticleSystemRenderer>()).sharedMaterial = operatorMat;
			}
			val4.transform.position = val4.transform.localPosition;
			val4.transform.localPosition = new Vector3(0f, 0f, 0f);
			val4.transform.position = new Vector3(val4.transform.position.x, val4.transform.position.y - 3.2f, val4.transform.position.z);
		}

		public override void Config(ConfigFile config)
		{
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Expected O, but got Unknown
			enabled = config.Bind<bool>("BNR - Drone Visibility", "enable patches for drone visibility", false, "");
			BNRUtils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				Hook();
			};
			useSillyMaterials = config.Bind<bool>("BNR - Drone Visibility", "use silly materials for indicator !!", true, "");
			BNRUtils.CheckboxConfig(useSillyMaterials);
			sillyMaterialColor = config.Bind<Color>("BNR - Drone Visibility", "colors for silly sprite hologram thing material !!", BNRUtils.Color255(191, 126, 211), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(sillyMaterialColor));
			operatorIndicatorColor = config.Bind<Color>("BNR - Drone Visibility", "colors for operator vfx thing !!", BNRUtils.Color255(252, 142, 249), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(operatorIndicatorColor));
			visibilityDistance = config.Bind<float>("BNR - Drone Visibility", "set distance which hologram becomes visible (set like 99999 for always !!", 99999f, "");
			BNRUtils.SliderConfig(15f, 999f, visibilityDistance);
		}
	}
	public class HologramHelper : MonoBehaviour
	{
		private Transform hologram;

		public Vector3 pos;

		public void OnEnable()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: 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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			hologram = ((Component)this).transform.parent.GetChild(0);
			((Component)this).transform.position = ((Component)this).transform.localPosition;
			((Component)this).transform.localPosition = new Vector3(0f, 0f, 0f);
			((Component)this).transform.position = new Vector3(((Component)this).transform.position.x, ((Component)this).transform.position.y + 2f, ((Component)this).transform.position.z);
		}

		public void FixedUpdate()
		{
			//IL_002d: 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_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)hologram))
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
				return;
			}
			Vector3 val = default(Vector3);
			val.x = 0f;
			val.y = hologram.eulerAngles.y;
			val.z = hologram.eulerAngles.z;
			((Component)this).transform.rotation = Quaternion.Euler(val);
		}
	}
	public class malachite : PatchBase<malachite>
	{
		private ConfigEntry<bool> enabled;

		public static ConfigEntry<float> timeBetweenSpawns;

		public override void Init(Harmony harmony)
		{
			applyHooks();
		}

		private void applyHooks()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			if (enabled.Value)
			{
				CharacterBody.OnBuffFirstStackGained += new hook_OnBuffFirstStackGained(CharacterBodyOnOnBuffFirstStackGained);
			}
			else
			{
				CharacterBody.OnBuffFirstStackGained += new hook_OnBuffFirstStackGained(CharacterBodyOnOnBuffFirstStackGained);
			}
		}

		private void CharacterBodyOnOnBuffFirstStackGained(orig_OnBuffFirstStackGained orig, CharacterBody self, BuffDef buffDef)
		{
			orig.Invoke(self, buffDef);
			if (!((Object)(object)buffDef != (Object)(object)Buffs.AffixPoison))
			{
				((Component)self).gameObject.AddComponent<EvilUrchinSpawner>()._characterBody = self;
			}
		}

		public override void Config(ConfigFile config)
		{
			enabled = config.Bind<bool>("BNR - malachite", "enable patches for malachite (have them naturally spawn urchins ,.,.", true, "");
			BNRUtils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				applyHooks();
			};
			timeBetweenSpawns = config.Bind<float>("BNR - malachite", "time between urchin spawns .,,.", 12f, "byeah.,,");
			BNRUtils.SliderConfig(1f, 30f, timeBetweenSpawns);
		}
	}
	public class EvilUrchinSpawner : MonoBehaviour
	{
		public CharacterBody _characterBody;

		private float urchinSpawnTimer;

		private void OnEnable()
		{
			Log.Debug("added urchin spawner !!");
		}

		private void FixedUpdate()
		{
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			urchinSpawnTimer += Time.fixedDeltaTime;
			if (!(urchinSpawnTimer > malachite.timeBetweenSpawns.Value))
			{
				return;
			}
			urchinSpawnTimer = 0f;
			Log.Debug("spawning urgin !!");
			if (!Object.op_Implicit((Object)(object)_characterBody) || !_characterBody.HasBuff(Buffs.AffixPoison))
			{
				Log.Debug("uh oh,,");
				Object.Destroy((Object)(object)this);
				return;
			}
			Vector3 position = ((Component)this).transform.position;
			Ray val = (Ray)(Object.op_Implicit((Object)(object)_characterBody.inputBank) ? _characterBody.inputBank.GetAimRay() : new Ray(((Component)this).transform.position, ((Component)this).transform.rotation * Vector3.forward));
			Quaternion val2 = Quaternion.LookRotation(((Ray)(ref val)).direction);
			GameObject val3 = Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterMasters/UrchinTurretMaster"), position, val2);
			CharacterMaster component = val3.GetComponent<CharacterMaster>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.teamIndex = _characterBody.teamComponent.teamIndex;
				NetworkServer.Spawn(val3);
				component.SpawnBodyHere();
			}
		}
	}
	public class pingrecolor : PatchBase<pingrecolor>
	{
		private ConfigEntry<Color> pingIndicatorDefault;

		private ConfigEntry<Color> pingIndicatorEnemy;

		private ConfigEntry<Color> pingIndicatorInteractable;

		private ConfigEntry<Color> pingIndicatorCount;

		private ConfigEntry<bool> enabled;

		public override void Init(Harmony harmony)
		{
			applyHooks();
		}

		private void applyHooks()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			if (enabled.Value)
			{
				PingIndicator.OnEnable += new hook_OnEnable(PingIndicatorOnOnEnable);
				PingIndicator.RebuildPing += new hook_RebuildPing(PingIndicatorOnRebuildPing);
			}
			else
			{
				PingIndicator.OnEnable -= new hook_OnEnable(PingIndicatorOnOnEnable);
				PingIndicator.RebuildPing -= new hook_RebuildPing(PingIndicatorOnRebuildPing);
			}
		}

		private void PingIndicatorOnOnEnable(orig_OnEnable orig, PingIndicator self)
		{
			recolorPingIndicator(self);
			orig.Invoke(self);
		}

		private void PingIndicatorOnRebuildPing(orig_RebuildPing orig, PingIndicator self)
		{
			recolorPingIndicator(self);
			orig.Invoke(self);
		}

		private void recolorPingIndicator(PingIndicator pingIndicator)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: 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)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected I4, but got Unknown
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//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_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			pingIndicator.defaultPingColor = pingIndicatorDefault.Value;
			pingIndicator.enemyPingColor = pingIndicatorEnemy.Value;
			pingIndicator.interactablePingColor = pingIndicatorInteractable.Value;
			PingType pingType = pingIndicator.pingType;
			pingIndicator.pingColor = (Color)((int)pingType switch
			{
				0 => pingIndicatorDefault.Value, 
				1 => pingIndicatorEnemy.Value, 
				2 => pingIndicatorInteractable.Value, 
				3 => pingIndicatorCount.Value, 
				_ => pingIndicator.pingColor, 
			});
			((Component)((Component)pingIndicator).transform.GetChild(0)).GetComponent<ParticleSystem>().startColor = pingIndicatorDefault.Value;
			((Component)((Component)pingIndicator).transform.GetChild(1)).GetComponent<ParticleSystem>().startColor = pingIndicatorInteractable.Value;
			((Component)((Component)pingIndicator).transform.GetChild(2)).GetComponent<ParticleSystem>().startColor = pingIndicatorEnemy.Value;
			((Component)pingIndicator.positionIndicator.alwaysVisibleObject.transform.GetChild(0)).GetComponent<SpriteRenderer>().color = pingIndicatorDefault.Value;
			((Component)pingIndicator.positionIndicator.alwaysVisibleObject.transform.GetChild(1)).GetComponent<SpriteRenderer>().color = pingIndicatorEnemy.Value;
			((Component)pingIndicator.positionIndicator.alwaysVisibleObject.transform.GetChild(2)).GetComponent<SpriteRenderer>().color = pingIndicatorInteractable.Value;
		}

		public override void Config(ConfigFile config)
		{
			//IL_0059: 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_007d: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Expected O, but got Unknown
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Expected O, but got Unknown
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Expected O, but got Unknown
			enabled = config.Bind<bool>("BNR - pingrecolor", "enable patches for pingrecolor", true, "");
			BNRUtils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				applyHooks();
			};
			pingIndicatorDefault = config.Bind<Color>("BNR - pingrecolor", "ping recolor for default ping !!", BNRUtils.Color255(252, 142, 249), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(pingIndicatorDefault));
			pingIndicatorEnemy = config.Bind<Color>("BNR - pingrecolor", "ping recolor for enemy ping !!", BNRUtils.Color255(252, 142, 249), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(pingIndicatorEnemy));
			pingIndicatorInteractable = config.Bind<Color>("BNR - pingrecolor", "ping recolor for interactable ping !!", BNRUtils.Color255(252, 142, 249), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(pingIndicatorInteractable));
			pingIndicatorCount = config.Bind<Color>("BNR - pingrecolor", "ping recolor for count ping (unsure what this one actually is !! !!", BNRUtils.Color255(252, 142, 249), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(pingIndicatorCount));
		}
	}
	public class quickerhalcshrine : PatchBase<quickerhalcshrine>
	{
		private HalcyoniteShrineInteractable halcshrineinteractable;

		private GameObject bluePortalRef;

		private float startingTickRate;

		private ConfigEntry<bool> enabled;

		private ConfigEntry<float> multiplier;

		private ConfigEntry<int> playerCount;

		private ConfigEntry<bool> scaleTime;

		private ConfigEntry<bool> greenToBlue;

		public override void Init(Harmony harmony)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			if (enabled.Value)
			{
				GameObject val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2.ShrineHalcyonite_prefab).WaitForCompletion();
				bluePortalRef = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_PortalShop.PortalShop_prefab).WaitForCompletion();
				halcshrineinteractable = val.GetComponent<HalcyoniteShrineInteractable>();
				startingTickRate = halcshrineinteractable.tickRate;
				halcshrineinteractable.tickRate = startingTickRate * multiplier.Value;
				multiplier.SettingChanged += delegate
				{
					halcshrineinteractable.tickRate = startingTickRate * multiplier.Value;
				};
				HalcyoniteShrineInteractable.Start += new hook_Start(HalcyoniteShrineInteractableOnStart);
				GoldSiphonNearbyBodyController.DrainGold += new hook_DrainGold(GoldSiphonNearbyBodyControllerOnDrainGold);
				BossGroup.OnDefeatedServer += new hook_OnDefeatedServer(BossGroupOnOnDefeatedServer);
			}
		}

		private void BossGroupOnOnDefeatedServer(orig_OnDefeatedServer orig, BossGroup self)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (greenToBlue.Value)
			{
				GameObject val = GameObject.Find("PortalColossus(Clone)");
				if (Object.op_Implicit((Object)(object)val))
				{
					GameObject obj = Object.Instantiate<GameObject>(bluePortalRef);
					obj.transform.position = val.transform.position;
					NetworkServer.Spawn(obj);
					Object.Destroy((Object)(object)val);
				}
			}
		}

		private void GoldSiphonNearbyBodyControllerOnDrainGold(orig_DrainGold orig, GoldSiphonNearbyBodyController self)
		{
			orig.Invoke(self);
			if (NetworkServer.active && self.isTetheredToAtLeastOneObject && scaleTime.Value && Run.instance.participatingPlayerCount <= playerCount.Value)
			{
				Run.instance.SetRunStopwatch((Run.instance.GetRunStopwatch() + 1f / self.tickRate) * (multiplier.Value - 1f));
			}
		}

		private void HalcyoniteShrineInteractableOnStart(orig_Start orig, HalcyoniteShrineInteractable self)
		{
			orig.Invoke(self);
			if (NetworkServer.active && Run.instance.participatingPlayerCount <= playerCount.Value)
			{
				self.tickRate = startingTickRate * multiplier.Value;
			}
		}

		public override void Config(ConfigFile config)
		{
			enabled = config.Bind<bool>("BNR - Halyc Shrines", "enable patches for halyc shrines", true, "");
			BNRUtils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: Expected O, but got Unknown
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: Expected O, but got Unknown
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Expected O, but got Unknown
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Expected O, but got Unknown
				if (enabled.Value)
				{
					HalcyoniteShrineInteractable.Start += new hook_Start(HalcyoniteShrineInteractableOnStart);
					GoldSiphonNearbyBodyController.DrainGold += new hook_DrainGold(GoldSiphonNearbyBodyControllerOnDrainGold);
				}
				else
				{
					HalcyoniteShrineInteractable.Start -= new hook_Start(HalcyoniteShrineInteractableOnStart);
					GoldSiphonNearbyBodyController.DrainGold -= new hook_DrainGold(GoldSiphonNearbyBodyControllerOnDrainGold);
				}
			};
			multiplier = config.Bind<float>("BNR - Halyc Shrines", "speed up halcyon shrine mutlipler", 2f, "");
			BNRUtils.SliderConfig(1f, 3f, multiplier);
			playerCount = config.Bind<int>("BNR - Halyc Shrines", "only apply multiplier under or equal to x amount of players", 1, "eg. 1 = only singleplayer 2 = only 2 people multiplayer");
			BNRUtils.SliderConfig(1, 4, playerCount);
			scaleTime = config.Bind<bool>("BNR - Halyc Shrines", "speed up time scale as well", true, "make time scale with halcyon shrine speed as well");
			BNRUtils.CheckboxConfig(scaleTime);
			greenToBlue = config.Bind<bool>("BNR - Halyc Shrines", "turn green portal to blue", true, "makes green portals become blue after the boss has been defeated !!!");
			BNRUtils.CheckboxConfig(greenToBlue);
		}
	}
	public class smallermoneyandlunars : PatchBase<smallermoneyandlunars>
	{
		private ConfigEntry<bool> enabled;

		public override void Init(Harmony harmony)
		{
			if (enabled.Value)
			{
				HUD.onHudTargetChangedGlobal += HUDOnonHudTargetChangedGlobal;
			}
		}

		private static void HUDOnonHudTargetChangedGlobal(HUD obj)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("UpperLeftCluster");
			if (Object.op_Implicit((Object)(object)val))
			{
				val.GetComponent<RectTransform>().offsetMin = new Vector2(0f, -64f);
				((HorizontalOrVerticalLayoutGroup)val.GetComponent<VerticalLayoutGroup>()).spacing = 0f;
				GameObject val2 = GameObject.Find("DollarSign");
				if (Object.op_Implicit((Object)(object)val2))
				{
					val2.transform.localPosition = new Vector3(4f, val2.transform.localPosition.y, val2.transform.localPosition.z);
				}
				GameObject val3 = GameObject.Find("SteamBuildLabel");
				if (Object.op_Implicit((Object)(object)val3))
				{
					val3.gameObject.SetActive(false);
				}
			}
		}

		public override void Config(ConfigFile config)
		{
			enabled = config.Bind<bool>("BNR - UI", "make currency thing smaller", true, "make the thing that has coins and lunar coins in the top left smaller like pre sotv (i miss you ,.,.");
			BNRUtils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				if (enabled.Value)
				{
					HUD.onHudTargetChangedGlobal += HUDOnonHudTargetChangedGlobal;
				}
				else
				{
					HUD.onHudTargetChangedGlobal -= HUDOnonHudTargetChangedGlobal;
				}
			};
		}
	}
	public class allynames : PatchBase<allynames>
	{
		[HarmonyPatch]
		public class AllyNamesChanges
		{
			[HarmonyPatch(typeof(NamesList), "InitConfig")]
			[HarmonyPostfix]
			public static void OnEnterPostFix(NamesList __instance)
			{
				//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
				string[] array = bodyNames.Value.Split('|');
				foreach (string text in array)
				{
					if (!string.IsNullOrEmpty(text))
					{
						string[] array2 = text.Split(',');
						string text2 = "";
						if (array2.Length >= 4)
						{
							text2 = array2[3].Trim().TrimStart('[').TrimEnd(']')
								.Replace(";", ",");
						}
						ConfigBodyIndex val = new ConfigBodyIndex(array2[0].Trim(), array2[1].Trim(), array2[2].Trim().TrimStart('[').TrimEnd(']')
							.Replace(";", ","), text2);
						ArrayUtils.ArrayAppend<ConfigBodyIndex>(ref NamesList.configBodyIndexes, ref val);
					}
				}
				ConfigBodyIndex[] configBodyIndexes = NamesList.configBodyIndexes;
				for (int i = 0; i < configBodyIndexes.Length; i++)
				{
					_ = ref configBodyIndexes[i];
				}
			}
		}

		public static ConfigEntry<string> bodyNames;

		private ConfigEntry<bool> enabled;

		public override void Init(Harmony harmony)
		{
			if (enabled.Value)
			{
				Log.Debug("applying allynames patches !!");
				harmony.CreateClassProcessor(typeof(AllyNamesChanges)).Patch();
				NamesList.InitConfig();
				NamesList.BuildNamesByBodyName();
			}
		}

		public override void Config(ConfigFile config)
		{
			enabled = config.Bind<bool>("BNR - allynames", "enable patches for allynames", true, "");
			BNRUtils.CheckboxConfig(enabled);
			bodyNames = config.Bind<string>("BNR - allynames", "ally name replace !!", "BombardmentDrone,Bombardment Drone,Default;Drones,Tsar Bomba;Fat Man;Little Boy|JunkDrone,Junk Drone,Default;Drones|RechargeDrone,Barrier Drone,Default;Drones|JailerDrone,Jailer Drone,Default;Drones|CleanupDrone,Cleanup Drone,Default;Drones,Roomba|CopycatDrone,Freeze Drone,Default;Drones,Frozone|HaulerDrone,Transport Drone,Default;Drones|DTGunnerDroneBody,CROSSHAIRS,Default;Drones,Ruxin|DTHealingDroneBody,DOC,Default;Drones,Bunny|DTHaulerDroneBody,CHIRP,Default;Drones,Moose|FriendUnitBody,Best Buddy,Default,Friend Inside Me;Stupid Baby;Son|DroneBomber,Lt. Droneboy,Default,Lt. Beep Boop", "add custom !! use bodynamewithoutBody,realname,category1;category2,customname1;customname2|seconditem format to add custom names !!");
			BNRUtils.StringConfig(bodyNames);
		}
	}
	public class coolereclipse : PatchBase<coolereclipse>
	{
		[HarmonyPatch]
		public class CoolerEclipseChanges
		{
			[HarmonyPatch(typeof(CoolerEclipse), "AddSkybox")]
			[HarmonyPrefix]
			public static bool CoolerEclipseAddSkyboxPreFix(orig_Start orig, SceneDirector self)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				CoolerEclipse.shouldBeChance.Value = false;
				Scene activeScene = SceneManager.GetActiveScene();
				string name = ((Scene)(ref activeScene)).name;
				int num = Run.instance.runRNG.RangeInt(0, 100);
				Log.Debug($"test ecluipse !! rng {num} < {eclipseChance.Value} ,,,.. applying ? {(float)num < eclipseChance.Value}");
				if (!((float)num < eclipseChance.Value))
				{
					orig.Invoke(self);
					return false;
				}
				if (!blacklistStages.Value.Equals(""))
				{
					string[] array = whitelistStages.Value.Split(",");
					foreach (string text in array)
					{
						if (name.Contains(text))
						{
							Log.Debug(text + " is in whitelist !! forcing !!");
							return true;
						}
					}
					array = blacklistStages.Value.Split(",");
					foreach (string text2 in array)
					{
						if (name.Contains(text2))
						{
							Log.Debug("name " + text2 + " is in config !! skipping !!");
							orig.Invoke(self);
							return false;
						}
					}
				}
				Log.Debug("appling eclipse to " + name);
				return true;
			}

			[HarmonyPatch(typeof(CoolerEclipse), "AddSkybox")]
			[HarmonyPostfix]
			public static void CoolerEclipseAddSkyboxPostFix(orig_Start orig, SceneDirector self)
			{
				//IL_0098: Unknown result type (might be due to invalid IL or missing references)
				//IL_009d: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00de: Unknown result type (might be due to invalid IL or missing references)
				//IL_0121: Unknown result type (might be due to invalid IL or missing references)
				//IL_0126: Unknown result type (might be due to invalid IL or missing references)
				//IL_0138: Unknown result type (might be due to invalid IL or missing references)
				//IL_013d: Unknown result type (might be due to invalid IL or missing references)
				//IL_014c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0151: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_0262: Unknown result type (might be due to invalid IL or missing references)
				//IL_0267: Unknown result type (might be due to invalid IL or missing references)
				//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_033c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0341: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0417: Unknown result type (might be due to invalid IL or missing references)
				//IL_041c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0477: Unknown result type (might be due to invalid IL or missing references)
				//IL_047c: Unknown result type (might be due to invalid IL or missing references)
				int num = Run.instance.runRNG.RangeInt(0, 100);
				Log.Debug($"pink eclipse ? rng {num} umm {(float)num < pinkEclipseChance.Value}");
				if (!Object.op_Implicit((Object)(object)GameObject.Find("Eclipse")))
				{
					return;
				}
				GameObject val = GameObject.Find("PP + Amb");
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.GetComponent<PostProcessVolume>()))
				{
					PostProcessVolume component = val.GetComponent<PostProcessVolume>();
					PostProcessProfile val2 = Object.Instantiate<PostProcessProfile>(component.sharedProfile);
					RampFog setting = val2.GetSetting<RampFog>();
					((ParameterOverride<Color>)(object)setting.fogColorStart).value = Color32.op_Implicit(new Color32((byte)55, (byte)87, (byte)82, (byte)15));
					((ParameterOverride<Color>)(object)setting.fogColorMid).value = Color32.op_Implicit(new Color32((byte)54, (byte)74, (byte)89, (byte)100));
					((ParameterOverride<Color>)(object)setting.fogColorEnd).value = Color32.op_Implicit(new Color32((byte)47, (byte)63, (byte)82, (byte)200));
					component.sharedProfile = val2;
				}
				if (!((float)num < pinkEclipseChance.Value))
				{
					return;
				}
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.GetComponent<SetAmbientLight>()))
				{
					SetAmbientLight component2 = val.GetComponent<SetAmbientLight>();
					component2.ambientSkyColor = BNRUtils.Color255(207, 97, 182);
					component2.ambientEquatorColor = BNRUtils.Color255(207, 97, 165);
					component2.ambientGroundColor = BNRUtils.Color255(146, 32, 93);
					component2.ApplyLighting();
				}
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.GetComponent<PostProcessVolume>()))
				{
					PostProcessVolume component3 = val.GetComponent<PostProcessVolume>();
					PostProcessProfile val3 = Object.Instantiate<PostProcessProfile>(component3.sharedProfile);
					RampFog setting2 = val3.GetSetting<RampFog>();
					((ParameterOverride<Color>)(object)setting2.fogColorStart).value = Color32.op_Implicit(new Color32((byte)190, (byte)154, (byte)150, (byte)15));
					((ParameterOverride<Color>)(object)setting2.fogColorMid).value = Color32.op_Implicit(new Color32((byte)110, (byte)73, (byte)69, (byte)100));
					((ParameterOverride<Color>)(object)setting2.fogColorEnd).value = Color32.op_Implicit(new Color32((byte)90, (byte)47, (byte)44, (byte)200));
					val3.RemoveSettings<ColorGrading>();
					component3.sharedProfile = val3;
				}
				GameObject val4 = GameObject.Find("Weather (Locked Position/Rotation)");
				if (Object.op_Implicit((Object)(object)val4) && Object.op_Implicit((Object)(object)val4.transform.Find("Embers")))
				{
					ParticleSystemRenderer component4 = ((Component)val4.transform.Find("Embers")).gameObject.GetComponent<ParticleSystemRenderer>();
					if (Object.op_Implicit((Object)(object)component4))
					{
						Material val5 = Object.Instantiate<Material>(((Renderer)component4).sharedMaterial);
						Texture2D val6 = Addressables.LoadAssetAsync<Texture2D>((object)RoR2_Base_Common_ColorRamps.texRampDiamondLaser_png).WaitForCompletion();
						val5.SetTexture("_RemapTex", (Texture)(object)val6);
						((Renderer)component4).sharedMaterial = val5;
					}
				}
				GameObject val7 = GameObject.Find("Sphere, Stars");
				if (Object.op_Implicit((Object)(object)val7) && Object.op_Implicit((Object)(object)val7.GetComponent<MeshRenderer>()))
				{
					MeshRenderer component5 = val7.GetComponent<MeshRenderer>();
					if (Object.op_Implicit((Object)(object)component5))
					{
						Material val8 = Object.Instantiate<Material>(((Renderer)component5).sharedMaterial);
						Texture2D val9 = Addressables.LoadAssetAsync<Texture2D>((object)RoR2_Base_Common_ColorRamps.texRampGolem_png).WaitForCompletion();
						val8.SetTexture("_RemapTex", (Texture)(object)val9);
						((Renderer)component5).sharedMaterial = val8;
					}
				}
				GameObject val10 = GameObject.Find("Sphere, Stars 2");
				if (Object.op_Implicit((Object)(object)val10) && Object.op_Implicit((Object)(object)val10.GetComponent<MeshRenderer>()))
				{
					MeshRenderer component6 = val10.GetComponent<MeshRenderer>();
					if (Object.op_Implicit((Object)(object)component6))
					{
						Material val11 = Object.Instantiate<Material>(((Renderer)component6).sharedMaterial);
						Texture2D val12 = Addressables.LoadAssetAsync<Texture2D>((object)RoR2_Base_Common_ColorRamps.texRampGolem_png).WaitForCompletion();
						val11.SetTexture("_RemapTex", (Texture)(object)val12);
						((Renderer)component6).sharedMaterial = val11;
					}
				}
				GameObject val13 = GameObject.Find("Sphere, Moon");
				if (Object.op_Implicit((Object)(object)val13) && Object.op_Implicit((Object)(object)val13.GetComponent<MeshRenderer>()))
				{
					MeshRenderer component7 = val13.GetComponent<MeshRenderer>();
					if (Object.op_Implicit((Object)(object)component7))
					{
						Material val14 = Object.Instantiate<Material>(((Renderer)component7).sharedMaterial);
						Texture2D val15 = Addressables.LoadAssetAsync<Texture2D>((object)RoR2_Base_Common_ColorRamps.texRampArchWisp_png).WaitForCompletion();
						val14.SetTexture("_RemapTex", (Texture)(object)val15);
						val14.SetColor("_TintColor", Color.op_Implicit(new Vector4(0.58431375f, 0.2784314f, 0.29411766f, 1f)));
						val14.SetColor("_SpecColor", Color.op_Implicit(new Vector4(1f, 0f, 0f, 1f)));
						((Renderer)component7).sharedMaterial = val14;
					}
				}
				GameObject val16 = GameObject.Find("Eclipse");
				if (Object.op_Implicit((Object)(object)val16) && Object.op_Implicit((Object)(object)val16.GetComponent<MeshRenderer>()))
				{
					MeshRenderer component8 = val16.GetComponent<MeshRenderer>();
					if (Object.op_Implicit((Object)(object)component8))
					{
						Material val17 = Object.Instantiate<Material>(((Renderer)component8).sharedMaterial);
						Texture2D val18 = Addressables.LoadAssetAsync<Texture2D>((object)RoR2_Base_Common_ColorRamps.texRampArchWisp_png).WaitForCompletion();
						val17.SetTexture("_RemapTex", (Texture)(object)val18);
						((Renderer)component8).sharedMaterial = val17;
					}
				}
			}
		}

		public static ConfigEntry<bool> applyCE;

		public static ConfigEntry<float> eclipseChance;

		public static ConfigEntry<float> pinkEclipseChance;

		public static ConfigEntry<string> blacklistStages;

		public static ConfigEntry<string> whitelistStages;

		public override void Init(Harmony harmony)
		{
			Log.Debug("init cooler eclipse !! " + applyCE.Value);
			if (applyCE.Value)
			{
				harmony.CreateClassProcessor(typeof(CoolerEclipseChanges)).Patch();
				Log.Debug("ptached cooler eclipse !!");
			}
		}

		public override void Config(ConfigFile config)
		{
			applyCE = config.Bind<bool>("Mods - CoolerEclipse", "apply cooler eclipse patches !!", true, "");
			BNRUtils.CheckboxConfig(applyCE);
			eclipseChance = config.Bind<float>("Mods - CoolerEclipse", "chance for eclipse", 15f, "bwaa,  (0-100 !!!");
			BNRUtils.SliderConfig(0f, 100f, eclipseChance);
			pinkEclipseChance = config.Bind<float>("Mods - CoolerEclipse", "chance for pink eclipse if enabled !", 50f, "bwaa,  (0-100 !!! if regular eclipse is rolled rolls this percent chance on top .,,. set to 0 to disable !!");
			BNRUtils.SliderConfig(0f, 100f, pinkEclipseChance);
			blacklistStages = config.Bind<string>("Mods - CoolerEclipse", "stage blacklist", "goldshores,bazaar,solutionalhaunt,ss2_voidshop,goldshores", "eclipse stage blacklist (seperate by , !! (eg golemplains,blackbeach!!");
			BNRUtils.StringConfig(blacklistStages);
			whitelistStages = config.Bind<string>("Mods - CoolerEclipse", "stage whitelist", "golemplains,golemplains2", "what stages to force eclipses on (seperate by , !! (eg golemplains,blackbeach!! will not work with moon2, ,..");
			BNRUtils.StringConfig(whitelistStages);
		}
	}
	public class gildedcoastplus : PatchBase<gildedcoastplus>
	{
		[HarmonyPatch]
		public class GoldenCoastChanges
		{
			[HarmonyPatch(typeof(FightChanges), "GoldshoresBossfight_GiveBuff")]
			[HarmonyPrefix]
			public static bool GoldenCoastPlusRevivedGiveBuffPreFix()
			{
				return !skipGoldenRewards.Value;
			}
		}

		public static ConfigEntry<bool> skipGoldenRewards;

		public static ConfigEntry<bool> applyGCP;

		public override void Init(Harmony harmony)
		{
			if (applyGCP.Value)
			{
				harmony.CreateClassProcessor(typeof(GoldenCoastChanges)).Patch();
			}
		}

		public override void Config(ConfigFile config)
		{
			applyGCP = config.Bind<bool>("Mods - GoldenCoastPlus", "apply golden coast plus patches !!", true, "");
			BNRUtils.CheckboxConfig(applyGCP);
			skipGoldenRewards = config.Bind<bool>("Mods - GoldenCoastPlus", "skip hidden buff", true, "");
			BNRUtils.CheckboxConfig(skipGoldenRewards);
		}
	}
	public class inferno : PatchBase<inferno>
	{
		[HarmonyPatch]
		public class InfernoChanges
		{
			[HarmonyPatch(typeof(Body), "BodyChanges")]
			[HarmonyILManipulator]
			public static void OnEnterPostFix(ILContext il)
			{
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Expected O, but got Unknown
				if (noBeetleStun.Value)
				{
					Log.Debug("ilh ook hate beetle grahhhhh");
					ILCursor val = new ILCursor(il);
					if (val.TryGotoNext(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Body), "beetleIndex")
					}))
					{
						val.Index += 6;
						val.RemoveRange(3);
					}
				}
			}
		}

		public static ConfigEntry<bool> noBeetleStun;

		public static ConfigEntry<bool> applyInferno;

		public override void Init(Harmony harmony)
		{
			if (applyInferno.Value)
			{
				harmony.CreateClassProcessor(typeof(InfernoChanges)).Patch();
			}
		}

		public override void Config(ConfigFile config)
		{
			applyInferno = config.Bind<bool>("Mods - Inferno", "apply inferno patches !!", true, "");
			BNRUtils.CheckboxConfig(applyInferno);
			noBeetleStun = config.Bind<bool>("Mods - Inferno", "makes beetles able to be stunned i hate beetle stun sm ,,..,", true, "");
			BNRUtils.CheckboxConfig(noBeetleStun);
		}
	}
	public class starstorm : PatchBase<starstorm>
	{
		[HarmonyPatch]
		public class Starstorm2ExeChanges
		{
			[HarmonyPatch(typeof(Dash), "OnEnter")]
			[HarmonyPostfix]
			public static void DashOnEnterPostFix(Dash __instance)
			{
				((Component)((EntityState)__instance).characterBody).gameObject.AddComponent<Boosted>();
			}

			[HarmonyPatch(typeof(Dash), "OnExit")]
			[HarmonyPostfix]
			public static void DashOnExitPostFix(Dash __instance)
			{
				bool flag = false;
				EntityStateMachine[] components = ((Component)((EntityState)__instance).characterBody).gameObject.GetComponents<EntityStateMachine>();
				for (int i = 0; i < components.Length; i++)
				{
					if (((object)components[i].state).ToString().ToLower().Contains("slam"))
					{
						flag = true;
					}
				}
				if (!flag)
				{
					Object.Destroy((Object)(object)((Component)((EntityState)__instance).characterBody).gameObject.GetComponent<Boosted>());
				}
			}

			[HarmonyPatch(typeof(ExecuteSlam), "HandleMovement")]
			[HarmonyILManipulator]
			public static void OnEnterPostFix(ILContext il)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				//IL_007c: Unknown result type (might be due to invalid IL or missing references)
				Log.Debug("loading il gook HandleMovement");
				ILCursor val = new ILCursor(il);
				if (val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(ExecuteSlam), "verticlalSpeed")
				}))
				{
					val.RemoveRange(2);
					val.Emit(OpCodes.Ldarg_0);
					val.EmitDelegate<Func<ExecuteSlam, float>>((Func<ExecuteSlam, float>)delegate(ExecuteSlam es)
					{
						if ((Object)(object)((Component)((EntityState)es).characterBody).gameObject.GetComponent<Boosted>() != (Object)null)
						{
							if (useMovespeed.Value)
							{
								return ((EntityState)es).characterBody.moveSpeed * boostedSpeed.Value;
							}
							return 10f * boostedSpeed.Value;
						}
						return useMovespeed.Value ? (((EntityState)es).characterBody.moveSpeed * baseSpeed.Value) : (10f * baseSpeed.Value);
					});
					val.Emit(OpCodes.Ldarg_0);
					val.EmitDelegate<Func<ExecuteSlam, float>>((Func<ExecuteSlam, float>)((ExecuteSlam es) => useMovespeed.Value ? (((EntityState)es).characterBody.moveSpeed * terminalSpeed.Value) : (10f * terminalSpeed.Value)));
				}
				else
				{
					Log.Debug("failedilbok");
				}
			}

			[HarmonyPatch(typeof(ExecuteSlam), "OnEnter")]
			[HarmonyPostfix]
			public static void OnEnterPostFix(ExecuteSlam __instance)
			{
				((Component)((EntityState)__instance).characterBody).gameObject.AddComponent<SpeedTester>();
			}

			[HarmonyPatch(typeof(ExecuteSlam), "OnExit")]
			[HarmonyPostfix]
			public static void OnExitPostFix(ExecuteSlam __instance)
			{
				if ((Object)(object)((Component)((EntityState)__instance).characterBody).gameObject.GetComponent<Boosted>() != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)((EntityState)__instance).characterBody).gameObject.GetComponent<Boosted>());
				}
				if ((Object)(object)((Component)((EntityState)__instance).characterBody).gameObject.GetComponent<SpeedTester>() != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)((EntityState)__instance).characterBody).gameObject.GetComponent<SpeedTester>());
				}
			}

			[HarmonyPatch(typeof(ExecuteSlam), "DoImpactAuthority")]
			[HarmonyILManipulator]
			private static void slam(ILContext il)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_008e: Unknown result type (might be due to invalid IL or missing references)
				Log.Debug("loading il gook DoImpactAuthority");
				ILCursor val = new ILCursor(il);
				if (val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(ExecuteSlam), "exesillymod.baseDamageCoefficient")
				}))
				{
					val.Index += 2;
					val.Emit(OpCodes.Ldarg_0);
					val.Emit(OpCodes.Ldloc_3);
					val.EmitDelegate<Func<ExecuteSlam, float, float>>((Func<ExecuteSlam, float, float>)delegate(ExecuteSlam es, float damage)
					{
						float num = 0f;
						if ((Object)(object)((Component)((EntityState)es).characterBody).gameObject.GetComponent<SpeedTester>() != (Object)null)
						{
							string text = "";
							num = ((Component)((EntityState)es).characterBody).gameObject.GetComponent<SpeedTester>().speedlist[0];
							for (int i = 0; i < ((Component)((EntityState)es).characterBody).gameObject.GetComponent<SpeedTester>().speedlist.Length; i++)
							{
								text = text + ((Component)((EntityState)es).characterBody).gameObject.GetComponent<SpeedTester>().speedlist[i] + " ";
								if (((Component)((EntityState)es).characterBody).gameObject.GetComponent<SpeedTester>().speedlist[i] > num)
								{
									num = ((Component)((EntityState)es).characterBody).gameObject.GetComponent<SpeedTester>().speedlist[i];
								}
							}
						}
						if ((Object)(object)((Component)((EntityState)es).characterBody).gameObject.GetComponent<Boosted>() != (Object)null)
						{
							if (useMovespeed.Value)
							{
								return boostedDamage.Value + (num / (((EntityState)es).characterBody.moveSpeed * boostedSpeed.Value) - 1f) * speedmult.Value;
							}
							return boostedDamage.Value + (num / (10f * boostedSpeed.Value) - 1f) * speedmult.Value;
						}
						return useMovespeed.Value ? (baseDamage.Value + (num / (((EntityState)es).characterBody.moveSpeed * baseSpeed.Value) - 1f) * speedmult.Value) : (baseDamage.Value + (num / (10f * baseSpeed.Value) - 1f) * speedmult.Value);
					});
					val.Emit(OpCodes.Stloc_3);
				}
				else
				{
					Log.Debug("failedilbok");
				}
			}

			public static void Patch(AssemblyDefinition assembly)
			{
				//IL_003a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Expected O, but got Unknown
				TypeDefinition type = assembly.MainModule.GetType("EntityStates.Executioner2", "ExecuteSlam");
				if (type != null)
				{
					type.Fields.Add(new FieldDefinition("flyingspeed", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(Vector3))));
				}
				else
				{
					Log.Debug("failed");
				}
			}
		}

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

			public static hook_TakeDamageProcess <>9__2_0;

			internal void <Hooks>b__2_0(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo info)
			{
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self, info);
				if (!NetworkServer.active || !Object.op_Implicit((Object)(object)info.attacker))
				{
					return;
				}
				CharacterBody component = info.attacker.GetComponent<CharacterBody>();
				if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.inventory))
				{
					return;
				}
				int itemCountEffective = component.inventory.GetItemCountEffective(Items.IceTool._itemIndex);
				if (itemCountEffective > 0 && Util.CheckRoll(iceToolFreezeChance.Value + iceToolFreezeChanceStack.Value * (float)(itemCountEffective - 1), component.master))
				{
					SetStateOnHurt component2 = ((Component)self.body).GetComponent<SetStateOnHurt>();
					if (Object.op_Implicit((Object)(object)component2))
					{
						component2.SetFrozen(iceToolFreezeTime.Value + iceToolFreezeTimeStack.Value * (float)(itemCountEffective - 1));
					}
				}
			}
		}

		public static ConfigEntry<bool> applySS2;

		public static ConfigEntry<float> baseSpeed;

		public static ConfigEntry<float> boostedSpeed;

		public static ConfigEntry<float> terminalSpeed;

		public static ConfigEntry<float> speedmult;

		public static ConfigEntry<float> baseDamage;

		public static ConfigEntry<float> boostedDamage;

		public static ConfigEntry<bool> useMovespeed;

		public static ConfigEntry<float> iceToolFreezeChance;

		public static ConfigEntry<float> iceToolFreezeTime;

		public static ConfigEntry<float> iceToolFreezeTimeStack;

		public static ConfigEntry<float> iceToolFreezeChanceStack;

		public override void Init(Harmony harmony)
		{
			if (applySS2.Value)
			{
				harmony.CreateClassProcessor(typeof(Starstorm2ExeChanges)).Patch();
				LanguageAPI.Add("SS2_ITEM_ICETOOL_DESC", $"While <style=cIsUtility>touching a wall</style>, gain <style=cIsUtility>+1</style> <style=cStack>(+1 per stack)</style> extra jump and a <style=\"cIsUtility\">{iceToolFreezeChance.Value}%</style> <style=\"cStack\">(+{iceToolFreezeChanceStack.Value}% per stack)</style> chance to <style=\"cIsUtility\">freeze enemies</style> for <style=\"cIsUtility\">{iceToolFreezeTime.Value} seconds</style> <style=\"cStack\">(+{iceToolFreezeTimeStack.Value} per stack)</style>. ");
				Hooks();
			}
		}

		public override void Hooks()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			object obj = <>c.<>9__2_0;
			if (obj == null)
			{
				hook_TakeDamageProcess val = delegate(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo info)
				{
					//IL_004b: Unknown result type (might be due to invalid IL or missing references)
					orig.Invoke(self, info);
					if (NetworkServer.active && Object.op_Implicit((Object)(object)info.attacker))
					{
						CharacterBody component = info.attacker.GetComponent<CharacterBody>();
						if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory))
						{
							int itemCountEffective = component.inventory.GetItemCountEffective(Items.IceTool._itemIndex);
							if (itemCountEffective > 0 && Util.CheckRoll(iceToolFreezeChance.Value + iceToolFreezeChanceStack.Value * (float)(itemCountEffective - 1), component.master))
							{
								SetStateOnHurt component2 = ((Component)self.body).GetComponent<SetStateOnHurt>();
								if (Object.op_Implicit((Object)(object)component2))
								{
									component2.SetFrozen(iceToolFreezeTime.Value + iceToolFreezeTimeStack.Value * (float)(itemCountEffective - 1));
								}
							}
						}
					}
				};
				<>c.<>9__2_0 = val;
				obj = (object)val;
			}
			HealthComponent.TakeDamageProcess += (hook_TakeDamageProcess)obj;
		}

		public override void Config(ConfigFile config)
		{
			applySS2 = config.Bind<bool>("Mods - SS2", "apply ss2 patches !!", true, "");
			BNRUtils.CheckboxConfig(applySS2);
			iceToolFreezeChance = config.Bind<float>("Mods - SS2", "ice tool freeze chance", 5f, "percent chance for icetool to freeze enemies !!");
			BNRUtils.SliderConfig(0f, 100f, iceToolFreezeChance);
			iceToolFreezeTime = config.Bind<float>("Mods - SS2", "ice tool freeze time", 0.5f, "how long icetool should freeze enemies !!");
			BNRUtils.SliderConfig(0f, 30f, iceToolFreezeTime);
			iceToolFreezeChanceStack = config.Bind<float>("Mods - SS2", "ice tool freeze chance stack", 2.5f, "percent chance for icetool to freeze enemies stack !!");
			BNRUtils.SliderConfig(0f, 100f, iceToolFreezeChanceStack);
			iceToolFreezeTimeStack = config.Bind<float>("Mods - SS2", "ice tool freeze time stack", 0.25f, "how long icetool should freeze enemies !!");
			BNRUtils.SliderConfig(0f, 30f, iceToolFreezeTimeStack);
			iceToolFreezeChance.SettingChanged += IceToolFreezeChanceOnSettingChanged;
			iceToolFreezeTime.SettingChanged += IceToolFreezeChanceOnSettingChanged;
			iceToolFreezeChanceStack.SettingChanged += IceToolFreezeChanceOnSettingChanged;
			iceToolFreezeTimeStack.SettingChanged += IceToolFreezeChanceOnSettingChanged;
			static void IceToolFreezeChanceOnSettingChanged(object sender, EventArgs e)
			{
				if (applySS2.Value)
				{
					LanguageAPI.Add("SS2_ITEM_ICETOOL_DESC", $"While <style=cIsUtility>touching a wall</style>, gain <style=cIsUtility>+1</style> <style=cStack>(+1 per stack)</style> extra jump and a <style=\"cIsUtility\">{iceToolFreezeChance.Value}%</style> <style=\"cStack\">(+{iceToolFreezeChanceStack.Value}% per stack)</style> chance to <style=\"cIsUtility\">freeze enemies</style> for <style=\"cIsUtility\">{iceToolFreezeTime.Value} seconds</style> <style=\"cStack\">(+{iceToolFreezeTimeStack.Value} per stack)</style>. ");
				}
			}
		}
	}
	public class SpeedTester : MonoBehaviour
	{
		public Vector3 lastPosition = Vector3.zero;

		public float speed;

		public float[] speedlist = new float[6];

		private void Start()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			lastPosition = ((Component)this).transform.position;
		}

		private void FixedUpdate()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: 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)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			speed = Vector3.Distance(lastPosition, ((Component)this).transform.position) / Time.deltaTime;
			lastPosition = ((Component)this).transform.position;
			for (int i = 1; i < speedlist.Length; i++)
			{
				speedlist[i] = speedlist[i - 1];
			}
			speedlist[0] = speed;
		}
	}
	public class Boosted : MonoBehaviour
	{
	}
	public class BNRUtils
	{
		public static Color Color255(int r, int g, int b, int a)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			return new Color((float)r / 255f, (float)g / 255f, (float)b / 255f, (float)a / 255f);
		}

		public static Color Color255(float r, float g, float b, float a)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			return new Color(r / 255f, g / 255f, b / 255f, a / 255f);
		}

		public static Color Color255(int r, int g, int b)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			return new Color((float)r / 255f, (float)g / 255f, (float)b / 255f, 1f);
		}

		public static void SliderConfig(float min, float max, ConfigEntry<float> config)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			StepSliderConfig val = new StepSliderConfig
			{
				max = max,
				min = min,
				FormatString = "{0:0}"
			};
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(config, val));
		}

		public static void SliderConfig(int min, int max, ConfigEntry<int> config)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			IntSliderConfig val = new IntSliderConfig
			{
				max = max,
				min = min,
				formatString = "{0:0}"
			};
			ModSettingsManager.AddOption((BaseOption)new IntSliderOption(config, val));
		}

		public static void CheckboxConfig(ConfigEntry<bool> config)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			CheckBoxConfig val = new CheckBoxConfig();
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(config, val));
		}

		public static void StringConfig(ConfigEntry<string> config)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			InputFieldConfig val = new InputFieldConfig();
			ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(config, val));
		}
	}
}
namespace BNR.patches
{
	public abstract class PatchBase<T> : PatchBase where T : PatchBase<T>
	{
		public static T instance { get; private set; }

		public PatchBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBase was instantiated twice");
			}
			instance = this as T;
		}
	}
	public abstract class PatchBase
	{
		public abstract void Init(Harmony harmony);

		public abstract void Config(ConfigFile config);

		public virtual void Hooks()
		{
		}
	}
}
namespace BNR.items
{
	public abstract class BuffBase<T> : BuffBase where T : BuffBase<T>
	{
		public static T instance { get; private set; }

		public BuffBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting BuffBase was instantiated twice");
			}
			instance = this as T;
		}
	}
	public abstract class BuffBase
	{
		internal abstract string name { get; }

		internal abstract Sprite icon { get; }

		internal abstract Color color { get; }

		internal abstract bool canStack { get; }

		internal abstract bool isDebuff { get; }

		internal abstract EliteDef eliteDef { get; }

		public BuffDef BuffDef { get; set; }

		internal BuffDef AddBuff()
		{
			//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)
			BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
			((Object)val).name = name;
			val.iconSprite = icon;
			val.buffColor = color;
			val.canStack = canStack;
			val.isDebuff = isDebuff;
			val.eliteDef = eliteDef;
			ContentAddition.AddBuffDef(val);
			BuffDef = val;
			return val;
		}
	}
	public abstract class ItemBase<T> : ItemBase where T : ItemBase<T>
	{
		public static T instance { get; private set; }

		public ItemBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBase was instantiated twice");
			}
			instance = this as T;
		}
	}
	public abstract class ItemBase
	{
		public ItemDef ItemDef;

		public abstract string ItemName { get; }

		public abstract string ItemLangTokenName { get; }

		public abstract string ItemPickupDesc { get; }

		public abstract string ItemFullDescription { get; }

		public abstract string ItemLore { get; }

		public abstract ItemTier Tier { get; }

		public virtual ItemTag[] ItemTags { get; set; } = (ItemTag[])(object)new ItemTag[0];


		public abstract GameObject ItemModel { get; }

		public abstract Sprite ItemIcon { get; }

		public virtual bool CanRemove { get; } = true;


		public virtual bool AIBlacklisted { get; set; }

		public abstract void Init(ConfigFile config);

		public virtual void CreateConfig(ConfigFile config)
		{
		}

		protected virtual void CreateLang()
		{
			LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_NAME", ItemName);
			LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc);
			LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription);
			LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_LORE", ItemLore);
		}

		public abstract ItemDisplayRuleDict CreateItemDisplayRules();

		protected void CreateItem()
		{
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Expected O, but got Unknown
			if (AIBlacklisted)
			{
				ItemTags = new List<ItemTag>(ItemTags) { (ItemTag)4 }.ToArray();
			}
			ItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)ItemDef).name = "ITEM_" + ItemLangTokenName;
			ItemDef.nameToken = "ITEM_" + ItemLangTokenName + "_NAME";
			ItemDef.pickupToken = "ITEM_" + ItemLangTokenName + "_PICKUP";
			ItemDef.descriptionToken = "ITEM_" + ItemLangTokenName + "_DESCRIPTION";
			ItemDef.loreToken = "ITEM_" + ItemLangTokenName + "_LORE";
			ItemDef.pickupModelPrefab = ItemModel;
			ItemDef.pickupIconSprite = ItemIcon;
			ItemDef.hidden = false;
			ItemDef.canRemove = CanRemove;
			ItemDef.deprecatedTier = Tier;
			if (ItemTags.Length != 0)
			{
				ItemDef.tags = ItemTags;
			}
			ItemAPI.Add(new CustomItem(ItemDef, CreateItemDisplayRules()));
		}

		public virtual void Hooks()
		{
		}

		public int GetCount(CharacterBody body)
		{
			if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
			{
				return 0;
			}
			return body.inventory.GetItemCount(ItemDef);
		}

		public int GetCount(CharacterMaster master)
		{
			if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory))
			{
				return 0;
			}
			return master.inventory.GetItemCount(ItemDef);
		}

		public int GetCountSpecific(CharacterBody body, ItemDef itemDef)
		{
			if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
			{
				return 0;
			}
			return body.inventory.GetItemCount(itemDef);
		}
	}
	public class WoodToolkit : ItemBase<WoodToolkit>
	{
		public sealed class Behavior : BaseItemBodyBehavior
		{
			private GameObject mushroomWardGameObject;

			private TeamFilter mushroomWardTeamFilter;

			private HealingWard mushroomHealingWard;

			private float timer;

			[ItemDefAssociation]
			private static ItemDef GetItemDef()
			{
				return ItemBase<WoodToolkit>.instance?.ItemDef;
			}

			private void OnEnable()
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				ShrineHealingBehavior.AddShrineStack += new hook_AddShrineStack(ShrineHealingBehaviorOnAddShrineStack);
			}

			private void ShrineHealingBehaviorOnAddShrineStack(orig_AddShrineStack orig, ShrineHealingBehavior self, Interactor activator)
			{
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self, activator);
				CharacterBody val = default(CharacterBody);
				if (((Component)activator).TryGetComponent<CharacterBody>(ref val) && val.inventory.GetItemCountEffective(ItemBase<WoodToolkit>.instance.ItemDef) > 0)
				{
					val.AddBuff(BuffBase<WoodToolkitBuff>.instance.BuffDef.buffIndex);
				}
			}

			private void OnDisable()
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				ShrineHealingBehavior.AddShrineStack -= new hook_AddShrineStack(ShrineHealingBehaviorOnAddShrineStack);
			}

			private void FixedUpdate()
			{
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_006e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_019c: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0182: Unknown result type (might be due to invalid IL or missing references)
				if (!NetworkServer.active)
				{
					return;
				}
				if (((BaseItemBodyBehavior)this).body.GetNotMoving() && ((BaseItemBodyBehavior)this).body.GetBuffCount(BuffBase<WoodToolkitBuff>.instance.BuffDef.buffIndex) > 0)
				{
					timer += Time.deltaTime;
				}
				else
				{
					timer = 0f;
				}
				if (timer > 2f && ((BaseItemBodyBehavior)this).body.GetBuffCount(BuffBase<WoodToolkitBuff>.instance.BuffDef.buffIndex) > 0)
				{
					timer = 0f;
					int count = ItemBase<WoodToolkit>.instance.GetCount(((BaseItemBodyBehavior)this).body);
					float num = ((BaseItemBodyBehavior)this).body.radius + 7f;
					num += 3f * (float)(count - 1);
					mushroomWardGameObject = Object.Instantiate<GameObject>(mushroomWardPrefab, ((BaseItemBodyBehavior)this).body.footPosition, Quaternion.identity);
					mushroomWardTeamFilter = mushroomWardGameObject.GetComponent<TeamFilter>();
					mushroomHealingWard = mushroomWardGameObject.GetComponent<HealingWard>();
					NetworkServer.Spawn(mushroomWardGameObject);
					if (Object.op_Implicit((Object)(object)mushroomHealingWard))
					{
						mushroomHealingWard.interval = 0.25f;
						mushroomHealingWard.healFraction = (0.06f + 0.04f * (float)(count - 1)) * mushroomHealingWard.interval