Decompiled source of Augmentum v1.0.3

Augmentum/BransItems.dll

Decompiled 3 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using BransItems.Modules.ColorCatalogEntry;
using BransItems.Modules.Compatability;
using BransItems.Modules.ItemTiers;
using BransItems.Modules.ItemTiers.CoreTier;
using BransItems.Modules.ItemTiers.HighlanderTier;
using BransItems.Modules.Pickups;
using BransItems.Modules.Pickups.Items.CoreItems;
using BransItems.Modules.Pickups.Items.Essences;
using BransItems.Modules.Pickups.Items.NoTier;
using BransItems.Modules.Pickups.Items.Tier1;
using BransItems.Modules.Pickups.Items.Tier2;
using BransItems.Modules.Pickups.Items.Tier3;
using BransItems.Modules.StandaloneBuffs;
using BransItems.Modules.Utils;
using HG;
using HarmonyLib;
using MonoMod.RuntimeDetour;
using On.RoR2;
using On.RoR2.Items;
using ProperSave;
using ProperSave.Data;
using R2API;
using R2API.Utils;
using RoR2;
using ShareSuite;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("BransItems")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BransItems")]
[assembly: AssemblyTitle("BransItems")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace BransItems
{
	[BepInDependency("com.bepis.r2api", "5.0.11")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.BrandonRosa.Augmentum", "Augmentum", "1.0.3")]
	public class BransItems : BaseUnityPlugin
	{
		public const string ModGuid = "com.BrandonRosa.Augmentum";

		public const string ModName = "Augmentum";

		public const string ModVer = "1.0.3";

		internal static ManualLogSource ModLogger;

		public static AssetBundle MainAssets;

		public List<BuffBase> Buffs = new List<BuffBase>();

		public List<ItemBase> Items = new List<ItemBase>();

		public List<EquipmentBase> Equipments = new List<EquipmentBase>();

		public List<ItemTierBase> ItemTiers = new List<ItemTierBase>();

		public List<EliteEquipmentBase> EliteEquipments = new List<EliteEquipmentBase>();

		public static HashSet<ItemDef> BlacklistedFromPrinter = new HashSet<ItemDef>();

		public static Dictionary<ItemBase, bool> ItemStatusDictionary = new Dictionary<ItemBase, bool>();

		public static Dictionary<EquipmentBase, bool> EquipmentStatusDictionary = new Dictionary<EquipmentBase, bool>();

		public static Dictionary<BuffBase, bool> BuffStatusDictionary = new Dictionary<BuffBase, bool>();

		public static Dictionary<EliteEquipmentBase, bool> EliteEquipmentStatusDictionary = new Dictionary<EliteEquipmentBase, bool>();

		public static string EssenceKeyword => "<color=#" + ColorCatalog.GetColorHexString(Colors.TempCoreLight) + ">Essence</color>";

		public static string EssencesKeyword => "<color=#" + ColorCatalog.GetColorHexString(Colors.TempCoreLight) + ">Essences</color>";

		public static string CoreColorString => "<color=#" + ColorCatalog.GetColorHexString(Colors.TempCoreLight) + ">";

		public void Awake()
		{
			ModLogger = ((BaseUnityPlugin)this).Logger;
		}

		private void Start()
		{
			//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Expected O, but got Unknown
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("BransItems.bransitems_assets"))
			{
				MainAssets = AssetBundle.LoadFromStream(stream);
			}
			Colors.Init();
			ItemTierPickupVFXHelper.SystemInitializer();
			bool flag = true;
			IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(ItemTierBase))
				select type;
			ModLogger.LogInfo((object)"-----------------ITEMTIERS---------------------");
			foreach (Type item in enumerable)
			{
				ItemTierBase itemTierBase = (ItemTierBase)Activator.CreateInstance(item);
				bool flag2 = true;
				itemTierBase.Init();
				ModLogger.LogInfo((object)("ItemTier: " + itemTierBase.TierName + " Initialized!"));
			}
			if (!((BaseUnityPlugin)this).Config.Bind<bool>("Buffs", "Disable All Standalone Buffs?", false, "Do you wish to disable every standalone buff in Aetherium?").Value)
			{
				IEnumerable<Type> enumerable2 = from type in Assembly.GetExecutingAssembly().GetTypes()
					where !type.IsAbstract && type.IsSubclassOf(typeof(BuffBase))
					select type;
				ModLogger.LogInfo((object)"--------------BUFFS---------------------");
				foreach (Type item2 in enumerable2)
				{
					BuffBase buffBase = (BuffBase)Activator.CreateInstance(item2);
					if (ValidateBuff(buffBase, Buffs))
					{
						buffBase.Init(((BaseUnityPlugin)this).Config);
						ModLogger.LogInfo((object)("Buff: " + buffBase.BuffName + " Initialized!"));
					}
				}
			}
			ConfigEntry<bool> val = ((BaseUnityPlugin)this).Config.Bind<bool>("Items", "Disable All Items?", false, "Do you wish to disable every item in BransItems?");
			if (!val.Value)
			{
				IEnumerable<Type> enumerable3 = from type in Assembly.GetExecutingAssembly().GetTypes()
					where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase))
					select type;
				ModLogger.LogInfo((object)"----------------------ITEMS--------------------");
				foreach (Type item3 in enumerable3)
				{
					ItemBase itemBase = (ItemBase)Activator.CreateInstance(item3);
					if (ValidateItem(itemBase, Items))
					{
						itemBase.Init(((BaseUnityPlugin)this).Config);
						ModLogger.LogInfo((object)("Item: " + itemBase.ItemName + " Initialized!"));
					}
				}
				ContagiousItemManager.Init += new hook_Init(ItemBase.RegisterVoidPairings);
			}
			ConfigEntry<bool> val2 = ((BaseUnityPlugin)this).Config.Bind<bool>("Equipment", "Disable All Equipment?", false, "Do you wish to disable every equipment in BransItems?");
			if (!val2.Value)
			{
				IEnumerable<Type> enumerable4 = from type in Assembly.GetExecutingAssembly().GetTypes()
					where !type.IsAbstract && type.IsSubclassOf(typeof(EquipmentBase))
					select type;
				ModLogger.LogInfo((object)"-----------------EQUIPMENT---------------------");
				foreach (Type item4 in enumerable4)
				{
					EquipmentBase equipmentBase = (EquipmentBase)Activator.CreateInstance(item4);
					if (ValidateEquipment(equipmentBase, Equipments))
					{
						equipmentBase.Init(((BaseUnityPlugin)this).Config);
						ModLogger.LogInfo((object)("Equipment: " + equipmentBase.EquipmentName + " Initialized!"));
					}
				}
			}
			IEnumerable<Type> enumerable5 = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(EliteEquipmentBase))
				select type;
			ModLogger.LogInfo((object)"-------------ELITE EQUIPMENT---------------------");
			foreach (Type item5 in enumerable5)
			{
				EliteEquipmentBase eliteEquipmentBase = (EliteEquipmentBase)Activator.CreateInstance(item5);
				if (ValidateEliteEquipment(eliteEquipmentBase, EliteEquipments))
				{
					eliteEquipmentBase.Init(((BaseUnityPlugin)this).Config);
					ModLogger.LogInfo((object)("Elite Equipment: " + eliteEquipmentBase.EliteEquipmentName + " Initialized!"));
				}
			}
			ModLogger.LogInfo((object)"-------------COMPATIBILITY---------------------");
			ValidateModCompatability();
		}

		private void ValidateModCompatability()
		{
			string text = "ITEM_MINI_MATROYSHKA,ITEM_ABYSSAL_BEACON,ITEM_AUGMENTED_CONTACT,ITEM_CURVED_HORN,ITEM_GOAT_LEG,ITEM_MEDIUM_MATROYSHKA,ITEM_CHARM_OF_DESIRES,ITEM_MASSIVE_MATROYSHKA,ITEM_BLOODBURST_CLAM,ITEM_DISCOVERY_MEDALLION,ITEM_MEGA_MATROYSHKA";
			bool value = ((BaseUnityPlugin)this).Config.Bind<bool>("Mod Compatability: ShareSuite", "Enable Compatability Patches?", true, "Attempt to patch ShareSuite (if installed) to work with this mod?").Value;
			string value2 = ((BaseUnityPlugin)this).Config.Bind<string>("Mod Compatability: ShareSuite", "ShareSuite Blacklist", text, "Add items to ShareSuite blacklist?").Value;
			if (ModCompatability.ShareSuiteCompat.IsShareSuiteInstalled && value)
			{
				ModLogger.LogInfo((object)"ModCompatability: ShareSuite Recognized!");
				ModCompatability.ShareSuiteCompat.AddTierToShareSuite();
				ModLogger.LogInfo((object)"ModCompatability: ShareSuite CoreTier added to Whitelist!");
				ModCompatability.ShareSuiteCompat.AddBransItemsBlacklist(value2);
				ModLogger.LogInfo((object)"ModCompatability: ShareSuite Blacklist added to Whitelist!");
			}
			bool value3 = ((BaseUnityPlugin)this).Config.Bind<bool>("Mod Compatability: HighItemVizability", "Enable Compatability Patches?", true, "Attempt to patch HighItemVizability (if installed) to work with this mod?").Value;
			if (ModCompatability.HighItemVizabilityCompat.IsHighItemVizabilityInstalled && value3)
			{
				ModLogger.LogInfo((object)"ModCompatability: HighItemVizability Recognized!");
			}
			bool value4 = ((BaseUnityPlugin)this).Config.Bind<bool>("Mod Compatability: ProperSave", "Enable Compatability Patches?", true, "Attempt to add Propersave compatability (if installed)?").Value;
			if (ModCompatability.ProperSaveCompat.IsProperSaveInstalled && value4)
			{
				ModLogger.LogInfo((object)"ModCompatability: ProperSave Recognized!");
				ModCompatability.ProperSaveCompat.AddProperSaveFunctionality = true;
			}
			if (value || value3 || value4)
			{
				ModCompatability.FinishedLoading();
			}
		}

		public bool ValidateItem(ItemBase item, List<ItemBase> itemList)
		{
			bool value = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + item.ConfigItemName, "Enable Item?", true, "Should this item appear in runs?").Value;
			bool value2 = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + item.ConfigItemName, "Blacklist Item from AI Use?", false, "Should the AI not be able to obtain this item?").Value;
			bool value3 = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + item.ConfigItemName, "Blacklist Item from Printers?", false, "Should the printers be able to print this item?").Value;
			bool value4 = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + item.ConfigItemName, "Require Unlock", true, "Should we require this item to be unlocked before it appears in runs? (Will only affect items with associated unlockables.)").Value;
			ItemStatusDictionary.Add(item, value);
			if (value)
			{
				itemList.Add(item);
				if (value2)
				{
					item.AIBlacklisted = true;
				}
				if (value3)
				{
					item.PrinterBlacklisted = true;
				}
			}
			return value;
		}

		public bool ValidateBuff(BuffBase buff, List<BuffBase> buffList)
		{
			bool value = ((BaseUnityPlugin)this).Config.Bind<bool>("Buff: " + buff.BuffName, "Enable Buff?", true, "Should this buff be registered for use in the game?").Value;
			BuffStatusDictionary.Add(buff, value);
			if (value)
			{
				buffList.Add(buff);
			}
			return value;
		}

		public bool ValidateEquipment(EquipmentBase equipment, List<EquipmentBase> equipmentList)
		{
			bool value = ((BaseUnityPlugin)this).Config.Bind<bool>("Equipment: " + equipment.EquipmentName, "Enable Equipment?", true, "Should this equipment appear in runs?").Value;
			EquipmentStatusDictionary.Add(equipment, value);
			if (value)
			{
				equipmentList.Add(equipment);
				return true;
			}
			return false;
		}

		public bool ValidateEliteEquipment(EliteEquipmentBase eliteEquipment, List<EliteEquipmentBase> eliteEquipmentList)
		{
			bool value = ((BaseUnityPlugin)this).Config.Bind<bool>("Equipment: " + eliteEquipment.EliteEquipmentName, "Enable Elite Equipment?", true, "Should this elite equipment appear in runs? If disabled, the associated elite will not appear in runs either.").Value;
			EliteEquipmentStatusDictionary.Add(eliteEquipment, value);
			if (value)
			{
				eliteEquipmentList.Add(eliteEquipment);
				return true;
			}
			return false;
		}

		private void Update()
		{
			bool flag = false;
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

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

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

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

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

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

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

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
}
namespace BransItems.Modules.Utils
{
	public static class ColorCatalogUtils
	{
		private static bool _hookEnabled = false;

		private static List<Color32> indexToColor32 = new List<Color32>();

		private static List<string> indexToHexString = new List<string>();

		internal static void SetHooks()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			if (!_hookEnabled)
			{
				ColorCatalog.GetColor += new hook_GetColor(ColorCatalog_GetColor);
				ColorCatalog.GetColorHexString += new hook_GetColorHexString(ColorCatalog_GetColorHexString);
				_hookEnabled = true;
			}
		}

		private static Color DamageColor_FindColor(orig_FindColor orig, DamageColorIndex colorIndex)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: 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)
			return orig.Invoke(colorIndex);
		}

		private static string ColorCatalog_GetColorHexString(orig_GetColorHexString orig, ColorIndex colorIndex)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected I4, but got Unknown
			if ((int)colorIndex < 0)
			{
				return indexToHexString[-1 - colorIndex];
			}
			return orig.Invoke(colorIndex);
		}

		private static Color32 ColorCatalog_GetColor(orig_GetColor orig, ColorIndex colorIndex)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected I4, but got Unknown
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			if ((int)colorIndex < 0)
			{
				return indexToColor32[-1 - colorIndex];
			}
			return orig.Invoke(colorIndex);
		}

		public static ColorIndex RegisterColor(Color color)
		{
			//IL_0016: 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_001d: 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_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			SetHooks();
			int num = -indexToColor32.Count - 1;
			ColorIndex result = (ColorIndex)num;
			indexToColor32.Add(Color32.op_Implicit(color));
			indexToHexString.Add(Util.RGBToHex(Color32.op_Implicit(color)));
			return result;
		}
	}
	public static class EffectHelpers
	{
		public static void SetParticleSystemColorOverTime(ref ParticleSystem particleSystem, MinMaxGradient color)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: 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)
			ColorOverLifetimeModule colorOverLifetime = particleSystem.colorOverLifetime;
			((ColorOverLifetimeModule)(ref colorOverLifetime)).color = color;
		}

		public static void SetParticleSystemLightColor(ref ParticleSystem particleSystem, Color color)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: 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)
			LightsModule lights = particleSystem.lights;
			((LightsModule)(ref lights)).light.color = color;
		}

		public static void SetTextureInParticleSystemRenderer(ref ParticleSystemRenderer particleSystemRenderer, string name, Texture2D texture)
		{
			((Renderer)particleSystemRenderer).GetMaterial().SetTexture(name, (Texture)(object)texture);
		}
	}
	public static class ExtensionMethods
	{
		public static void FilterElites(this BullseyeSearch search)
		{
			if (search.candidatesEnumerable.Any())
			{
				search.candidatesEnumerable = search.candidatesEnumerable.Where((CandidateInfo x) => Object.op_Implicit((Object)(object)x.hurtBox) && x.hurtBox.IsHurtboxAnElite());
			}
		}

		public static void FilterOutItemWielders(this BullseyeSearch search, ItemDef item)
		{
			if (search.candidatesEnumerable.Any())
			{
				search.candidatesEnumerable = search.candidatesEnumerable.Where((CandidateInfo x) => Object.op_Implicit((Object)(object)x.hurtBox) && !x.hurtBox.DoesHurtboxHaveItem(item));
			}
		}

		public static void FilterOutItemWielders(this BullseyeSearch search, List<ItemDef> items)
		{
			List<CandidateInfo> list = search.candidatesEnumerable.ToList();
			if (!list.Any())
			{
				return;
			}
			foreach (ItemDef item in items)
			{
				list.RemoveAll((CandidateInfo x) => Object.op_Implicit((Object)(object)x.hurtBox) && x.hurtBox.DoesHurtboxHaveItem(item));
			}
			search.candidatesEnumerable = list;
		}

		public static bool DoesHurtboxHaveItem(this HurtBox hurtbox, ItemDef item)
		{
			if (!Object.op_Implicit((Object)(object)hurtbox.healthComponent) || !Object.op_Implicit((Object)(object)hurtbox.healthComponent.body) || !Object.op_Implicit((Object)(object)item))
			{
				BransItems.ModLogger.LogError((object)"Can't check if the hurtbox has the item, some information is missing!");
				return false;
			}
			CharacterBody body = hurtbox.healthComponent.body;
			if (body.inventory.GetItemCount(item) > 0)
			{
				return true;
			}
			return false;
		}

		public static bool IsHurtboxAnElite(this HurtBox hurtbox)
		{
			if (!Object.op_Implicit((Object)(object)hurtbox.healthComponent) || !Object.op_Implicit((Object)(object)hurtbox.healthComponent.body))
			{
				BransItems.ModLogger.LogError((object)"Can't check if the hurtbox is an elite, some information is missing!");
				return false;
			}
			return hurtbox.healthComponent.body.isElite;
		}
	}
	internal class ItemHelpers
	{
		public static RendererInfo[] ItemDisplaySetup(GameObject obj, bool IgnoreOverlays = false, bool debugmode = false)
		{
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			List<Renderer> list = new List<Renderer>();
			MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>();
			if (componentsInChildren.Length != 0)
			{
				list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren);
			}
			SkinnedMeshRenderer[] componentsInChildren2 = obj.GetComponentsInChildren<SkinnedMeshRenderer>();
			if (componentsInChildren2.Length != 0)
			{
				list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren2);
			}
			RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[list.Count];
			for (int i = 0; i < list.Count; i++)
			{
				if (debugmode)
				{
				}
				array[i] = new RendererInfo
				{
					defaultMaterial = ((list[i] is SkinnedMeshRenderer) ? list[i].sharedMaterial : list[i].material),
					renderer = list[i],
					defaultShadowCastingMode = (ShadowCastingMode)1,
					ignoreOverlays = false
				};
			}
			return array;
		}

		public static string OrderManifestLoreFormatter(string deviceName, string estimatedDelivery, string sentTo, string trackingNumber, string devicePickupDesc, string shippingMethod, string orderDetails)
		{
			string[] value = new string[19]
			{
				"<align=left>Estimated Delivery:<indent=70%>Sent To:</indent></align>",
				"<align=left>" + estimatedDelivery + "<indent=70%>" + sentTo + "</indent></align>",
				"",
				"<indent=1%><style=cIsDamage><size=125%><u>  Shipping Details:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0</u></size></style></indent>",
				"",
				"<indent=2%>-Order: <style=cIsUtility>" + deviceName + "</style></indent>",
				"<indent=4%><style=cStack>Tracking Number:  " + trackingNumber + "</style></indent>",
				"",
				"<indent=2%>-Order Description: " + devicePickupDesc + "</indent>",
				"",
				"<indent=2%>-Shipping Method: <style=cIsHealth>" + shippingMethod + "</style></indent>",
				"",
				"",
				"",
				"<indent=2%>-Order Details: " + orderDetails + "</indent>",
				"",
				"",
				"",
				"<style=cStack>Delivery being brought to you by the brand new </style><style=cIsUtility>Orbital Drop-Crate System (TM)</style>. <style=cStack><u>No refunds.</u></style>"
			};
			return string.Join("\n", value);
		}

		public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float duration)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0)
			{
				return;
			}
			foreach (TimedBuff timedBuff in body.timedBuffs)
			{
				if (buffDef.buffIndex == timedBuff.buffIndex)
				{
					timedBuff.timer = duration;
				}
			}
		}

		public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float taperStart, float taperDuration)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0)
			{
				return;
			}
			int num = 0;
			foreach (TimedBuff timedBuff in body.timedBuffs)
			{
				if (buffDef.buffIndex == timedBuff.buffIndex)
				{
					timedBuff.timer = taperStart + (float)num * taperDuration;
					num++;
				}
			}
		}

		public static void AddBuffAndDot(BuffDef buff, float duration, int stackCount, CharacterBody body)
		{
			//IL_0024: 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_002c: Invalid comparison between Unknown and I4
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			DotIndex val = (DotIndex)Array.FindIndex(DotController.dotDefs, (DotDef dotDef) => (Object)(object)dotDef.associatedBuff == (Object)(object)buff);
			for (int i = 0; i < stackCount; i++)
			{
				if ((int)val != -1)
				{
					DotController.InflictDot(((Component)body).gameObject, ((Component)body).gameObject, val, duration, 0.25f, (uint?)null);
				}
				else if (NetworkServer.active)
				{
					body.AddTimedBuff(buff.buffIndex, duration);
				}
			}
		}

		public static DotIndex FindAssociatedDotForBuff(BuffDef buff)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			return (DotIndex)Array.FindIndex(DotController.dotDefs, (DotDef dotDef) => (Object)(object)dotDef.associatedBuff == (Object)(object)buff);
		}

		public static T[] GetRandomSelectionFromArray<T>(List<T> itemList, int maxCount, Xoroshiro128Plus rng)
		{
			int num = Math.Min(itemList.Count, maxCount);
			T[] array = new T[num];
			HashSet<T> hashSet = new HashSet<T>();
			for (int i = 0; i < num; i++)
			{
				T val;
				do
				{
					val = itemList[rng.RangeInt(0, itemList.Count)];
				}
				while (hashSet.Contains(val));
				array[i] = val;
				hashSet.Add(val);
			}
			return array;
		}

		public static List<ItemDef> ItemDefsWithTier(ItemTierDef itemTierDef)
		{
			//IL_0008: 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_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Invalid comparison between Unknown and I4
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			HashSet<ItemDef> hashSet = new HashSet<ItemDef>();
			Enumerator<ItemDef> enumerator = ItemCatalog.allItemDefs.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					ItemDef current = enumerator.Current;
					if ((int)current.itemIndex != -1 && current.tier == itemTierDef.tier)
					{
						hashSet.Add(current);
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			return hashSet.ToList();
		}

		public static List<PickupDef> PickupDefsWithTier(ItemTierDef itemTierDef)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Invalid comparison between Unknown and I4
			//IL_0027: 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)
			HashSet<PickupDef> hashSet = new HashSet<PickupDef>();
			foreach (PickupDef allPickup in PickupCatalog.allPickups)
			{
				if ((int)allPickup.itemIndex != -1 && allPickup.itemTier == itemTierDef.tier)
				{
					hashSet.Add(allPickup);
				}
			}
			return hashSet.ToList();
		}
	}
	public class ItemTierPickupVFXHelper : MonoBehaviour
	{
		private PickupDisplay display;

		private GameObject effectInstance;

		[SystemInitializer(new Type[]
		{
			typeof(ItemTierCatalog),
			typeof(ItemTierBase)
		})]
		public static void SystemInitializer()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			PickupDisplay.DestroyModel += new hook_DestroyModel(PickupDisplay_DestroyModel);
			PickupDisplay.RebuildModel += new hook_RebuildModel(PickupDisplay_RebuildModel);
		}

		private static void PickupDisplay_RebuildModel(orig_RebuildModel orig, PickupDisplay self)
		{
			ItemTierPickupVFXHelper component = ((Component)self).gameObject.GetComponent<ItemTierPickupVFXHelper>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				((Component)self).gameObject.AddComponent<ItemTierPickupVFXHelper>();
				component = ((Component)self).gameObject.GetComponent<ItemTierPickupVFXHelper>();
			}
			orig.Invoke(self);
			component.OnPickupDisplayRebuildModel();
		}

		private static void PickupDisplay_DestroyModel(orig_DestroyModel orig, PickupDisplay self)
		{
			ItemTierPickupVFXHelper component = ((Component)self).gameObject.GetComponent<ItemTierPickupVFXHelper>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				((Component)self).gameObject.AddComponent<ItemTierPickupVFXHelper>();
				component = ((Component)self).gameObject.GetComponent<ItemTierPickupVFXHelper>();
			}
			orig.Invoke(self);
			component.OnPickupDisplayDestroyModel();
		}

		private void Awake()
		{
			display = ((Component)this).GetComponent<PickupDisplay>();
		}

		private void OnPickupDisplayRebuildModel()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Invalid comparison between Unknown and I4
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: 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_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: 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_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Expected O, but got Unknown
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			BransItems.ModLogger.LogWarning((object)"REBUILD");
			if (!Object.op_Implicit((Object)(object)display))
			{
				return;
			}
			PickupDef pickupDef = PickupCatalog.GetPickupDef(display.pickupIndex);
			ItemIndex val = (ItemIndex)((pickupDef == null) ? (-1) : ((int)pickupDef.itemIndex));
			if ((int)val == -1)
			{
				return;
			}
			ItemTier tier = ItemCatalog.GetItemDef(val).tier;
			ItemTierDef itemTierDef = ItemTierCatalog.GetItemTierDef(tier);
			if (Object.op_Implicit((Object)(object)itemTierDef) && ItemTierBase.IsBransCustomTier(itemTierDef, out var itemTierBase) && itemTierBase != null && Object.op_Implicit((Object)(object)itemTierBase.PickupDisplayVFX))
			{
				BransItems.ModLogger.LogWarning((object)"Final");
				effectInstance = Object.Instantiate<GameObject>(itemTierBase.PickupDisplayVFX, ((Component)display).gameObject.transform);
				Transform transform = effectInstance.transform;
				transform.position -= Vector3.up * 1.5f;
				effectInstance.SetActive(true);
				Color32 color = ColorCatalog.GetColor(itemTierDef.colorIndex);
				ParticleSystem[] componentsInChildren = effectInstance.GetComponentsInChildren<ParticleSystem>();
				ParticleSystem[] array = componentsInChildren;
				foreach (ParticleSystem val2 in array)
				{
					((Component)val2).gameObject.SetActive(true);
					MainModule main = val2.main;
					((MainModule)(ref main)).startColor = new MinMaxGradient(Color32.op_Implicit(color));
				}
				if (ModCompatability.HighItemVizabilityCompat.IsHighItemVizabilityInstalled)
				{
					float num = 0f;
					float num2 = default(float);
					float num3 = default(float);
					Color.RGBToHSV(Color32.op_Implicit(color), ref num2, ref num3, ref num);
					Color32 val3 = Color32.op_Implicit(Color.HSVToRGB(num2, 1f, num));
					GameObject gameObject = ((Component)display).gameObject;
					Vector3 position = ((Component)display).transform.position;
					Vector3 val4 = position + new Vector3(0f, 100f, 0f);
					LineRenderer val5 = gameObject.AddComponent<LineRenderer>();
					val5.positionCount = 2;
					((Renderer)val5).material = new Material(LegacyShaderAPI.Find("Hopoo Games/FX/Vertex Colors Only"));
					val5.startColor = Color32.op_Implicit(val3);
					val5.endColor = Color32.op_Implicit(val3);
					val5.startWidth = 0.25f;
					val5.endWidth = 0f;
					val5.SetPosition(0, position);
					val5.SetPosition(1, val4);
					BransItems.ModLogger.LogWarning((object)"NOTPINK");
				}
			}
		}

		private void OnPickupDisplayDestroyModel()
		{
			BransItems.ModLogger.LogWarning((object)"Destroy");
			if (Object.op_Implicit((Object)(object)effectInstance))
			{
				Object.Destroy((Object)(object)effectInstance);
			}
		}
	}
}
namespace BransItems.Modules.StandaloneBuffs
{
	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
	{
		public BuffDef BuffDef;

		public abstract string BuffName { get; }

		public abstract Color Color { get; }

		public virtual bool CanStack { get; } = false;


		public virtual bool IsDebuff { get; } = false;


		public virtual bool IsCooldown { get; } = true;


		public virtual bool IsHidden { get; } = false;


		public virtual Sprite BuffIcon { get; } = Resources.Load<Sprite>("Textures/MiscIcons/texMysteryIcon");


		public abstract void Init(ConfigFile config);

		public void CreateBuff()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			BuffDef = ScriptableObject.CreateInstance<BuffDef>();
			((Object)BuffDef).name = BuffName;
			BuffDef.buffColor = Color;
			BuffDef.canStack = CanStack;
			BuffDef.isDebuff = IsDebuff;
			BuffDef.iconSprite = BuffIcon;
			BuffDef.isCooldown = IsCooldown;
			BuffDef.isHidden = IsHidden;
			ContentAddition.AddBuffDef(BuffDef);
		}

		public abstract void Hooks();
	}
	public class Fortified : BuffBase<Fortified>
	{
		public override string BuffName => "Fortified";

		public override Color Color => Color32.op_Implicit(new Color32((byte)245, (byte)245, (byte)245, byte.MaxValue));

		public override Sprite BuffIcon => BransItems.MainAssets.LoadAsset<Sprite>("Assets/Textrures/Icons/Buff/Fortified.png");

		public override bool CanStack => true;

		public override bool IsDebuff => false;

		public override bool IsCooldown => false;

		public override void Init(ConfigFile config)
		{
			CreateBuff();
			Hooks();
		}

		public override void Hooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
		}

		private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			bool flag = false;
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && self.body.GetBuffCount(BuffDef) > 0)
			{
				self.itemCounts.armorPlate += self.body.GetBuffCount(BuffDef);
				orig.Invoke(self, damageInfo);
				flag = true;
				self.itemCounts.armorPlate -= self.body.GetBuffCount(BuffDef);
			}
			if (!flag)
			{
				orig.Invoke(self, damageInfo);
			}
		}

		private void OnLoadModCompat()
		{
		}
	}
	public class Laceration : BuffBase<Laceration>
	{
		public override string BuffName => "Laceration";

		public override Color Color => Color32.op_Implicit(new Color32((byte)240, (byte)0, (byte)0, byte.MaxValue));

		public override Sprite BuffIcon => Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/ArmorReductionOnHit/texBuffPulverizeIcon.tif").WaitForCompletion();

		public override bool CanStack => true;

		public override bool IsDebuff => true;

		public override bool IsCooldown => false;

		public override void Init(ConfigFile config)
		{
			CreateBuff();
			Hooks();
		}

		public override void Hooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
		}

		private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			bool flag = false;
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && self.body.GetBuffCount(BuffDef) > 0)
			{
				BransItems.ModLogger.LogWarning((object)("Damage:" + damageInfo.damage));
				damageInfo.damage += (float)self.body.GetBuffCount(BuffDef) * 0.1f;
				orig.Invoke(self, damageInfo);
				flag = true;
			}
			if (!flag)
			{
				orig.Invoke(self, damageInfo);
			}
		}

		private void OnLoadModCompat()
		{
		}
	}
	public class Safegaurd : BuffBase<Safegaurd>
	{
		public override string BuffName => "Safegaurd";

		public override Color Color => Color32.op_Implicit(new Color32(byte.MaxValue, (byte)215, (byte)0, byte.MaxValue));

		public override bool CanStack => true;

		public override bool IsDebuff => false;

		public override bool IsCooldown => false;

		public override void Init(ConfigFile config)
		{
			CreateBuff();
			Hooks();
		}

		public override void Hooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
		}

		private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body))
			{
				int buffCount = self.body.GetBuffCount(BuffDef);
				if (buffCount > 0)
				{
					float num = (100f - (float)buffCount) / 100f * self.fullCombinedHealth;
					if (damageInfo.damage > num)
					{
						damageInfo.damage = num;
					}
				}
			}
			orig.Invoke(self, damageInfo);
		}

		private void OnLoadModCompat()
		{
		}
	}
	public class TemporaryShield : BuffBase<TemporaryShield>
	{
		public override string BuffName => "Temporary Shield";

		public override Color Color => Color32.op_Implicit(new Color32((byte)68, (byte)94, (byte)182, byte.MaxValue));

		public override Sprite BuffIcon => Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/texBuffGenericShield.tif").WaitForCompletion();

		public override bool CanStack => true;

		public override bool IsDebuff => false;

		public override bool IsCooldown => false;

		public override void Init(ConfigFile config)
		{
			CreateBuff();
			Hooks();
		}

		public override void Hooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
		}

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			args.baseShieldAdd += (float)sender.GetBuffCount(BuffDef);
		}

		private void OnLoadModCompat()
		{
		}
	}
}
namespace BransItems.Modules.Pickups
{
	public abstract class EliteEquipmentBase<T> : EliteEquipmentBase where T : EliteEquipmentBase<T>
	{
		public static T instance { get; private set; }

		public EliteEquipmentBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting EquipmentBoilerplate/Equipment was instantiated twice");
			}
			instance = this as T;
		}
	}
	public abstract class EliteEquipmentBase
	{
		public class EliteOverlayManager : MonoBehaviour
		{
			public TemporaryOverlay Overlay;

			public CharacterBody Body;

			public BuffDef EliteBuffDef;

			public void FixedUpdate()
			{
				if (!Body.HasBuff(EliteBuffDef))
				{
					Object.Destroy((Object)(object)Overlay);
					Object.Destroy((Object)(object)this);
				}
			}
		}

		public enum TargetingType
		{
			Enemies,
			Friendlies
		}

		public class TargetingControllerComponent : MonoBehaviour
		{
			public GameObject TargetObject;

			public GameObject VisualizerPrefab;

			public Indicator Indicator;

			public BullseyeSearch TargetFinder;

			public Action<BullseyeSearch> AdditionalBullseyeFunctionality = delegate
			{
			};

			public void Awake()
			{
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Expected O, but got Unknown
				Indicator = new Indicator(((Component)this).gameObject, (GameObject)null);
			}

			public void OnDestroy()
			{
				Invalidate();
			}

			public void Invalidate()
			{
				TargetObject = null;
				Indicator.targetTransform = null;
			}

			public void ConfigureTargetFinderBase(EquipmentSlot self)
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_0063: Unknown result type (might be due to invalid IL or missing references)
				//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_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_0090: 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_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Expected O, but got Unknown
				if (TargetFinder == null)
				{
					TargetFinder = new BullseyeSearch();
				}
				TargetFinder.teamMaskFilter = TeamMask.allButNeutral;
				((TeamMask)(ref TargetFinder.teamMaskFilter)).RemoveTeam(self.characterBody.teamComponent.teamIndex);
				TargetFinder.sortMode = (SortMode)2;
				TargetFinder.filterByLoS = true;
				float num = default(float);
				Ray val = CameraRigController.ModifyAimRayIfApplicable(self.GetAimRay(), ((Component)self).gameObject, ref num);
				TargetFinder.searchOrigin = ((Ray)(ref val)).origin;
				TargetFinder.searchDirection = ((Ray)(ref val)).direction;
				TargetFinder.maxAngleFilter = 10f;
				TargetFinder.viewer = self.characterBody;
			}

			public void ConfigureTargetFinderForEnemies(EquipmentSlot self)
			{
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				ConfigureTargetFinderBase(self);
				TargetFinder.teamMaskFilter = TeamMask.GetUnprotectedTeams(self.characterBody.teamComponent.teamIndex);
				TargetFinder.RefreshCandidates();
				TargetFinder.FilterOutGameObject(((Component)self).gameObject);
				AdditionalBullseyeFunctionality(TargetFinder);
				PlaceTargetingIndicator(TargetFinder.GetResults());
			}

			public void ConfigureTargetFinderForFriendlies(EquipmentSlot self)
			{
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				ConfigureTargetFinderBase(self);
				TargetFinder.teamMaskFilter = TeamMask.none;
				((TeamMask)(ref TargetFinder.teamMaskFilter)).AddTeam(self.characterBody.teamComponent.teamIndex);
				TargetFinder.RefreshCandidates();
				TargetFinder.FilterOutGameObject(((Component)self).gameObject);
				AdditionalBullseyeFunctionality(TargetFinder);
				PlaceTargetingIndicator(TargetFinder.GetResults());
			}

			public void PlaceTargetingIndicator(IEnumerable<HurtBox> TargetFinderResults)
			{
				HurtBox val = (TargetFinderResults.Any() ? TargetFinderResults.First() : null);
				if (Object.op_Implicit((Object)(object)val))
				{
					TargetObject = ((Component)val.healthComponent).gameObject;
					Indicator.visualizerPrefab = VisualizerPrefab;
					Indicator.targetTransform = ((Component)val).transform;
				}
				else
				{
					Invalidate();
				}
				Indicator.active = Object.op_Implicit((Object)(object)val);
			}
		}

		public EquipmentDef EliteEquipmentDef;

		public BuffDef EliteBuffDef;

		public EliteDef EliteDef;

		public static List<EliteEquipmentBase> elites = new List<EliteEquipmentBase>();

		public GameObject TargetingIndicatorPrefabBase = null;

		public abstract string EliteEquipmentName { get; }

		public abstract string EliteAffixToken { get; }

		public abstract string EliteEquipmentPickupDesc { get; }

		public abstract string EliteEquipmentFullDescription { get; }

		public abstract string EliteEquipmentLore { get; }

		public abstract string EliteModifier { get; }

		public virtual bool AppearsInSinglePlayer { get; } = true;


		public virtual bool AppearsInMultiPlayer { get; } = true;


		public virtual bool CanDrop { get; } = false;


		public virtual float Cooldown { get; } = 60f;


		public virtual bool EnigmaCompatible { get; } = false;


		public virtual bool IsBoss { get; } = false;


		public virtual bool IsLunar { get; } = false;


		public abstract GameObject EliteEquipmentModel { get; }

		public virtual GameObject EliteBodyModel { get; } = null;


		public abstract Sprite EliteEquipmentIcon { get; }

		public abstract Sprite EliteBuffIcon { get; }

		public virtual Color EliteBuffColor { get; set; } = Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue));


		public virtual EliteTierDef[] CanAppearInEliteTiers { get; set; } = EliteAPI.GetCombatDirectorEliteTiers();


		public virtual Material EliteMaterial { get; set; } = null;


		public virtual float HealthMultiplier { get; set; } = 1f;


		public virtual float DamageMultiplier { get; set; } = 1f;


		public virtual float CostMultiplierOfElite { get; set; } = 1f;


		public virtual int VanillaTier { get; set; } = 0;


		public static Color AffixColor { get; set; } = Color.grey;


		public static Color AffixLightColor { get; set; } = Color.white;


		public virtual bool UseTargeting { get; } = false;


		public virtual TargetingType TargetingTypeEnum { get; } = TargetingType.Enemies;


		public abstract void Init(ConfigFile config);

		public abstract ItemDisplayRuleDict CreateItemDisplayRules();

		protected void CreateLang()
		{
			LanguageAPI.Add("BRANS_ELITE_EQUIPMENT_" + EliteAffixToken + "_NAME", EliteEquipmentName);
			LanguageAPI.Add("BRANS_ELITE_EQUIPMENT_" + EliteAffixToken + "_PICKUP", EliteEquipmentPickupDesc);
			LanguageAPI.Add("BRANS_ELITE_EQUIPMENT_" + EliteAffixToken + "_DESCRIPTION", EliteEquipmentFullDescription);
			LanguageAPI.Add("BRANS_ELITE_EQUIPMENT_" + EliteAffixToken + "_LORE", EliteEquipmentLore);
			LanguageAPI.Add("BRANS_ELITE_" + EliteAffixToken + "_MODIFIER", EliteModifier + " {0}");
		}

		protected void CreateEquipment()
		{
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Expected O, but got Unknown
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Expected O, but got Unknown
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Expected O, but got Unknown
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Expected O, but got Unknown
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Expected O, but got Unknown
			EliteEquipmentDef = ScriptableObject.CreateInstance<EquipmentDef>();
			((Object)EliteEquipmentDef).name = "BRANS_ELITE_EQUIPMENT_" + EliteAffixToken;
			EliteEquipmentDef.nameToken = "BRANS_ELITE_EQUIPMENT_" + EliteAffixToken + "_NAME";
			EliteEquipmentDef.pickupToken = "BRANS_ELITE_EQUIPMENT_" + EliteAffixToken + "_PICKUP";
			EliteEquipmentDef.descriptionToken = "BRANS_ELITE_EQUIPMENT_" + EliteAffixToken + "_DESCRIPTION";
			EliteEquipmentDef.loreToken = "BRANS_ELITE_EQUIPMENT_" + EliteAffixToken + "_LORE";
			EliteEquipmentDef.pickupModelPrefab = EliteEquipmentModel;
			EliteEquipmentDef.pickupIconSprite = EliteEquipmentIcon;
			EliteEquipmentDef.appearsInSinglePlayer = AppearsInSinglePlayer;
			EliteEquipmentDef.appearsInMultiPlayer = AppearsInMultiPlayer;
			EliteEquipmentDef.canDrop = CanDrop;
			EliteEquipmentDef.cooldown = Cooldown;
			EliteEquipmentDef.enigmaCompatible = EnigmaCompatible;
			EliteEquipmentDef.isBoss = IsBoss;
			EliteEquipmentDef.isLunar = IsLunar;
			EliteEquipmentDef.passiveBuffDef = EliteBuffDef;
			elites.Add(this);
			DefaultTexture();
			ItemAPI.Add(new CustomEquipment(EliteEquipmentDef, CreateItemDisplayRules()));
			EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(PerformEquipmentAction);
			if (UseTargeting && Object.op_Implicit((Object)(object)TargetingIndicatorPrefabBase))
			{
				EquipmentSlot.Update += new hook_Update(UpdateTargeting);
			}
			if (Object.op_Implicit((Object)(object)EliteMaterial))
			{
				CharacterBody.FixedUpdate += new hook_FixedUpdate(OverlayManager);
			}
			CombatDirector.Init += new hook_Init(CombatDirector_Init);
		}

		private void CombatDirector_Init(orig_Init orig)
		{
			orig.Invoke();
			foreach (EliteEquipmentBase elite in elites)
			{
				switch (elite.VanillaTier)
				{
				case 1:
					ArrayUtils.ArrayAppend<EliteDef>(ref EliteAPI.VanillaEliteTiers[1].eliteTypes, ref elite.EliteDef);
					break;
				case 2:
					ArrayUtils.ArrayAppend<EliteDef>(ref EliteAPI.VanillaEliteTiers[3].eliteTypes, ref elite.EliteDef);
					break;
				}
			}
		}

		protected void CreateAffixBuffDef()
		{
			//IL_0031: 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)
			EliteBuffDef = ScriptableObject.CreateInstance<BuffDef>();
			((Object)EliteBuffDef).name = EliteAffixToken;
			EliteBuffDef.isDebuff = false;
			EliteBuffDef.buffColor = EliteBuffColor;
			EliteBuffDef.canStack = false;
			EliteBuffDef.iconSprite = EliteBuffIcon;
		}

		private void DefaultTexture()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			EliteEquipmentDef.pickupModelPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteFire/PickupEliteFire.prefab").WaitForCompletion(), "PickupAffixAdaptive", false);
			Material val = Object.Instantiate<Material>(((Renderer)EliteEquipmentDef.pickupModelPrefab.GetComponentInChildren<MeshRenderer>()).material);
			val.color = AffixColor;
			Renderer[] componentsInChildren = EliteEquipmentDef.pickupModelPrefab.GetComponentsInChildren<Renderer>();
			foreach (Renderer val2 in componentsInChildren)
			{
				val2.material = val;
			}
		}

		public virtual void OverlayManager(orig_FixedUpdate orig, CharacterBody self)
		{
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.modelLocator) && Object.op_Implicit((Object)(object)self.modelLocator.modelTransform) && self.HasBuff(EliteBuffDef) && !Object.op_Implicit((Object)(object)((Component)self).GetComponent<EliteOverlayManager>()))
			{
				TemporaryOverlay val = ((Component)self.modelLocator.modelTransform).gameObject.AddComponent<TemporaryOverlay>();
				val.duration = float.PositiveInfinity;
				val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
				val.animateShaderAlpha = true;
				val.destroyComponentOnEnd = true;
				val.originalMaterial = EliteMaterial;
				val.AddToCharacerModel(((Component)self.modelLocator.modelTransform).GetComponent<CharacterModel>());
				EliteOverlayManager eliteOverlayManager = ((Component)self).gameObject.AddComponent<EliteOverlayManager>();
				eliteOverlayManager.Overlay = val;
				eliteOverlayManager.Body = self;
				eliteOverlayManager.EliteBuffDef = EliteBuffDef;
			}
			orig.Invoke(self);
		}

		protected void CreateElite()
		{
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Expected O, but got Unknown
			EliteDef = ScriptableObject.CreateInstance<EliteDef>();
			((Object)EliteDef).name = "BRANS_ELITE_" + EliteAffixToken;
			EliteDef.modifierToken = "BRANS_ELITE_" + EliteAffixToken + "_MODIFIER";
			EliteDef.eliteEquipmentDef = EliteEquipmentDef;
			EliteDef.healthBoostCoefficient = HealthMultiplier;
			EliteDef.damageBoostCoefficient = DamageMultiplier;
			EliteTierDef[] baseEliteTierDefs = EliteAPI.GetCombatDirectorEliteTiers();
			if (VanillaTier != 0)
			{
				if (!CanAppearInEliteTiers.All((EliteTierDef x) => baseEliteTierDefs.Contains(x)))
				{
					IEnumerable<EliteTierDef> enumerable = CanAppearInEliteTiers.Except(baseEliteTierDefs);
					foreach (EliteTierDef eliteTierDef in enumerable)
					{
						int num = Array.FindIndex(baseEliteTierDefs, (EliteTierDef x) => x.costMultiplier >= eliteTierDef.costMultiplier);
						if (num >= 0)
						{
							EliteAPI.AddCustomEliteTier(eliteTierDef, num);
						}
						else
						{
							EliteAPI.AddCustomEliteTier(eliteTierDef);
						}
						baseEliteTierDefs = EliteAPI.GetCombatDirectorEliteTiers();
					}
				}
				EliteAPI.Add(new CustomElite(EliteDef, (IEnumerable<EliteTierDef>)CanAppearInEliteTiers));
			}
			EliteBuffDef.eliteDef = EliteDef;
			ContentAddition.AddBuffDef(EliteBuffDef);
		}

		protected bool PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef)
		{
			if ((Object)(object)equipmentDef == (Object)(object)EliteEquipmentDef)
			{
				return ActivateEquipment(self);
			}
			return orig.Invoke(self, equipmentDef);
		}

		protected abstract bool ActivateEquipment(EquipmentSlot slot);

		public abstract void Hooks();

		protected void UpdateTargeting(orig_Update orig, EquipmentSlot self)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (self.equipmentIndex != EliteEquipmentDef.equipmentIndex)
			{
				return;
			}
			TargetingControllerComponent targetingControllerComponent = ((Component)self).GetComponent<TargetingControllerComponent>();
			if (!Object.op_Implicit((Object)(object)targetingControllerComponent))
			{
				targetingControllerComponent = ((Component)self).gameObject.AddComponent<TargetingControllerComponent>();
				targetingControllerComponent.VisualizerPrefab = TargetingIndicatorPrefabBase;
			}
			if (self.stock > 0)
			{
				switch (TargetingTypeEnum)
				{
				case TargetingType.Enemies:
					targetingControllerComponent.ConfigureTargetFinderForEnemies(self);
					break;
				case TargetingType.Friendlies:
					targetingControllerComponent.ConfigureTargetFinderForFriendlies(self);
					break;
				}
			}
			else
			{
				targetingControllerComponent.Invalidate();
				targetingControllerComponent.Indicator.active = false;
			}
		}
	}
	public abstract class EquipmentBase<T> : EquipmentBase where T : EquipmentBase<T>
	{
		public static T instance { get; private set; }

		public EquipmentBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting EquipmentBoilerplate/Equipment was instantiated twice");
			}
			instance = this as T;
		}
	}
	public abstract class EquipmentBase
	{
		public enum TargetingType
		{
			Enemies,
			Friendlies,
			Interactables,
			Items
		}

		public class TargetingControllerComponent : MonoBehaviour
		{
			public GameObject TargetObject;

			public GameObject VisualizerPrefab;

			public Indicator Indicator;

			public BullseyeSearch TargetFinder;

			public Action<BullseyeSearch> AdditionalBullseyeFunctionality = delegate
			{
			};

			public void Awake()
			{
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Expected O, but got Unknown
				Indicator = new Indicator(((Component)this).gameObject, (GameObject)null);
			}

			public void OnDestroy()
			{
				Invalidate();
			}

			public void Invalidate()
			{
				TargetObject = null;
				Indicator.targetTransform = null;
			}

			public void ConfigureTargetFinderBase(EquipmentSlot self)
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_0063: Unknown result type (might be due to invalid IL or missing references)
				//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_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_0090: 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_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Expected O, but got Unknown
				if (TargetFinder == null)
				{
					TargetFinder = new BullseyeSearch();
				}
				TargetFinder.teamMaskFilter = TeamMask.allButNeutral;
				((TeamMask)(ref TargetFinder.teamMaskFilter)).RemoveTeam(self.characterBody.teamComponent.teamIndex);
				TargetFinder.sortMode = (SortMode)2;
				TargetFinder.filterByLoS = true;
				float num = default(float);
				Ray val = CameraRigController.ModifyAimRayIfApplicable(self.GetAimRay(), ((Component)self).gameObject, ref num);
				TargetFinder.searchOrigin = ((Ray)(ref val)).origin;
				TargetFinder.searchDirection = ((Ray)(ref val)).direction;
				TargetFinder.maxAngleFilter = 10f;
				TargetFinder.viewer = self.characterBody;
			}

			public void ConfigureTargetFinderForEnemies(EquipmentSlot self)
			{
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				ConfigureTargetFinderBase(self);
				TargetFinder.teamMaskFilter = TeamMask.GetUnprotectedTeams(self.characterBody.teamComponent.teamIndex);
				TargetFinder.RefreshCandidates();
				TargetFinder.FilterOutGameObject(((Component)self).gameObject);
				AdditionalBullseyeFunctionality(TargetFinder);
				PlaceTargetingIndicator(TargetFinder.GetResults());
			}

			public void ConfigureTargetFinderForFriendlies(EquipmentSlot self)
			{
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				ConfigureTargetFinderBase(self);
				TargetFinder.teamMaskFilter = TeamMask.none;
				((TeamMask)(ref TargetFinder.teamMaskFilter)).AddTeam(self.characterBody.teamComponent.teamIndex);
				TargetFinder.RefreshCandidates();
				TargetFinder.FilterOutGameObject(((Component)self).gameObject);
				AdditionalBullseyeFunctionality(TargetFinder);
				PlaceTargetingIndicator(TargetFinder.GetResults());
			}

			public void PlaceTargetingIndicator(IEnumerable<HurtBox> TargetFinderResults)
			{
				HurtBox val = (TargetFinderResults.Any() ? TargetFinderResults.First() : null);
				if (Object.op_Implicit((Object)(object)val))
				{
					TargetObject = ((Component)val.healthComponent).gameObject;
					Indicator.visualizerPrefab = VisualizerPrefab;
					Indicator.targetTransform = ((Component)val).transform;
				}
				else
				{
					Invalidate();
				}
				Indicator.active = Object.op_Implicit((Object)(object)val);
			}

			internal void ConfigureTargetFinderForInteractables(EquipmentSlot self)
			{
				throw new NotImplementedException();
			}

			internal void ConfigureTargetFinderForItems(EquipmentSlot self)
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				ConfigureTargetFinderBase(self);
				((TeamMask)(ref TargetFinder.teamMaskFilter)).AddTeam(self.characterBody.teamComponent.teamIndex);
				TargetFinder.RefreshCandidates();
				TargetFinder.FilterOutGameObject(((Component)self).gameObject);
				AdditionalBullseyeFunctionality(TargetFinder);
				PlaceTargetingIndicator(TargetFinder.GetResults());
			}
		}

		public EquipmentDef EquipmentDef;

		public GameObject TargetingIndicatorPrefabBase = null;

		public abstract string EquipmentName { get; }

		public abstract string EquipmentLangTokenName { get; }

		public abstract string EquipmentPickupDesc { get; }

		public abstract string EquipmentFullDescription { get; }

		public abstract string EquipmentLore { get; }

		public virtual GameObject EquipmentModel { get; } = Resources.Load<GameObject>("Prefabs/PickupModels/PickupMystery");


		public virtual Sprite EquipmentIcon { get; } = Resources.Load<Sprite>("Textures/MiscIcons/texMysteryIcon");


		public virtual bool AppearsInSinglePlayer { get; } = true;


		public virtual bool AppearsInMultiPlayer { get; } = true;


		public virtual bool CanDrop { get; } = true;


		public virtual float Cooldown { get; } = 60f;


		public virtual bool EnigmaCompatible { get; } = true;


		public virtual bool IsBoss { get; } = false;


		public virtual bool IsLunar { get; } = false;


		public virtual bool UseTargeting { get; } = false;


		public virtual TargetingType TargetingTypeEnum { get; } = TargetingType.Enemies;


		public abstract void Init(ConfigFile config);

		protected void CreateLang()
		{
			LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_NAME", EquipmentName);
			LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_PICKUP", EquipmentPickupDesc);
			LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_DESCRIPTION", EquipmentFullDescription);
			LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_LORE", EquipmentLore);
		}

		public abstract ItemDisplayRuleDict CreateItemDisplayRules();

		protected void CreateEquipment()
		{
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Expected O, but got Unknown
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Expected O, but got Unknown
			EquipmentDef = ScriptableObject.CreateInstance<EquipmentDef>();
			((Object)EquipmentDef).name = "EQUIPMENT_" + EquipmentLangTokenName;
			EquipmentDef.nameToken = "EQUIPMENT_" + EquipmentLangTokenName + "_NAME";
			EquipmentDef.pickupToken = "EQUIPMENT_" + EquipmentLangTokenName + "_PICKUP";
			EquipmentDef.descriptionToken = "EQUIPMENT_" + EquipmentLangTokenName + "_DESCRIPTION";
			EquipmentDef.loreToken = "EQUIPMENT_" + EquipmentLangTokenName + "_LORE";
			EquipmentDef.pickupModelPrefab = EquipmentModel;
			EquipmentDef.pickupIconSprite = EquipmentIcon;
			EquipmentDef.appearsInSinglePlayer = AppearsInSinglePlayer;
			EquipmentDef.appearsInMultiPlayer = AppearsInMultiPlayer;
			EquipmentDef.canDrop = CanDrop;
			EquipmentDef.cooldown = Cooldown;
			EquipmentDef.enigmaCompatible = EnigmaCompatible;
			EquipmentDef.isBoss = IsBoss;
			EquipmentDef.isLunar = IsLunar;
			ItemAPI.Add(new CustomEquipment(EquipmentDef, CreateItemDisplayRules()));
			EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(PerformEquipmentAction);
		}

		private bool PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef)
		{
			if ((Object)(object)equipmentDef == (Object)(object)EquipmentDef)
			{
				return ActivateEquipment(self);
			}
			return orig.Invoke(self, equipmentDef);
		}

		protected abstract bool ActivateEquipment(EquipmentSlot slot);

		public abstract void Hooks();

		protected void UpdateTargeting(orig_Update orig, EquipmentSlot self)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (self.equipmentIndex != EquipmentDef.equipmentIndex)
			{
				return;
			}
			TargetingControllerComponent targetingControllerComponent = ((Component)self).GetComponent<TargetingControllerComponent>();
			if (!Object.op_Implicit((Object)(object)targetingControllerComponent))
			{
				targetingControllerComponent = ((Component)self).gameObject.AddComponent<TargetingControllerComponent>();
				targetingControllerComponent.VisualizerPrefab = TargetingIndicatorPrefabBase;
			}
			if (self.stock > 0)
			{
				switch (TargetingTypeEnum)
				{
				case TargetingType.Enemies:
					targetingControllerComponent.ConfigureTargetFinderForEnemies(self);
					break;
				case TargetingType.Friendlies:
					targetingControllerComponent.ConfigureTargetFinderForFriendlies(self);
					break;
				case TargetingType.Interactables:
					targetingControllerComponent.ConfigureTargetFinderForInteractables(self);
					break;
				case TargetingType.Items:
					targetingControllerComponent.ConfigureTargetFinderForItems(self);
					break;
				}
			}
			else
			{
				targetingControllerComponent.Invalidate();
				targetingControllerComponent.Indicator.active = false;
			}
		}
	}
	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 string ConfigItemName => ItemName.Replace("'", "");

		public abstract string ItemLangTokenName { get; }

		public abstract string ItemPickupDesc { get; }

		public abstract string ItemFullDescription { get; }

		public abstract string ItemLore { get; }

		public virtual ItemTierDef ModdedTierDef { get; } = null;


		public abstract ItemTier Tier { get; }

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


		public virtual GameObject ItemModel { get; } = Resources.Load<GameObject>("Prefabs/PickupModels/PickupMystery");


		public virtual Sprite ItemIcon { get; } = Resources.Load<Sprite>("Textures/MiscIcons/texMysteryIcon");


		public virtual bool CanRemove { get; } = true;


		public virtual bool Hidden { get; } = false;


		public bool AIBlacklisted { get; internal set; }

		public bool PrinterBlacklisted { get; internal set; }

		public virtual string[] CorruptsItem { get; set; } = null;


		public abstract void Init(ConfigFile config);

		protected 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_0103: 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_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Expected O, but got Unknown
			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 = Hidden;
			ItemDef.canRemove = CanRemove;
			if ((Object)(object)ModdedTierDef == (Object)null)
			{
				ItemDef.deprecatedTier = Tier;
			}
			else
			{
				ItemDef._itemTierDef = ModdedTierDef;
			}
			ItemDef.tags = ItemTags;
			ItemDisplayRuleDict val = CreateItemDisplayRules();
			ItemAPI.Add(new CustomItem(ItemDef, val));
		}

		public abstract 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);
		}

		internal static void RegisterVoidPairings(orig_Init orig)
		{
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: 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)
			ItemTier[] array = new ItemTier[4];
			RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			ItemTier[] source = (ItemTier[])(object)array;
			foreach (KeyValuePair<ItemBase, bool> item2 in BransItems.ItemStatusDictionary)
			{
				if (!item2.Value)
				{
					continue;
				}
				ItemBase item = item2.Key;
				if (!Object.op_Implicit((Object)(object)item.ItemDef) || !source.Any((ItemTier x) => item.ItemDef.tier == x))
				{
					continue;
				}
				int i;
				for (i = 0; i < item.CorruptsItem.Count(); i++)
				{
					ItemDef val = ItemCatalog.itemDefs.Where((ItemDef x) => x.nameToken == item.CorruptsItem[i]).FirstOrDefault();
					if (!Object.op_Implicit((Object)(object)val))
					{
						BransItems.ModLogger.LogError((object)("Tried to add " + item.ItemName + " in a Void item tier but no relationship was set for what it corrupts or could not be found. Aborting!"));
						continue;
					}
					Pair[] array2 = (Pair[])(object)new Pair[1]
					{
						new Pair
						{
							itemDef1 = val,
							itemDef2 = item.ItemDef
						}
					};
					ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddRangeToArray<Pair>(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], array2);
				}
			}
			orig.Invoke();
		}
	}
}
namespace BransItems.Modules.Pickups.Items.Tier3
{
	internal class BloodburstClam : ItemBase<BloodburstClam>
	{
		public static GameObject ItemBodyModelPrefab;

		public static int DropCount;

		public static int AdditionalDrops;

		public override string ItemName => "Bloodburst Clam";

		public override string ItemLangTokenName => "BLOODBURST_CLAM";

		public override string ItemPickupDesc => $"On pickup, crack open for {DropCount} essences which boost stats. Future essence drops will come with 1 more.";

		public override string ItemFullDescription => $"Crack open for <style=cIsDamage>{DropCount}</style> " + BransItems.EssencesKeyword + ". Future " + BransItems.EssenceKeyword + $" drops will come with 1<style=cStack>(+{AdditionalDrops} per stack)</style> more.";

		public override string ItemLore => "Excerpt from Void Expedition Archives:\nFound within the void whales, the Bloodburst Clam is a rare species that thrives in the digestive tracks of these colossal creatures.The clam leeches off life forms unfortunate enough to enter the void whales, compressing their blood and life force into potent essences. Its unique adaptation allows it to extract and compress the essence of victims, creating small orbs of concentrated vitality.Encountering the Bloodburst Clam leaves some uneasy, as the reward of powerful essences is a reminder of the unknown number of lives sacrificed within the whale's innards.";

		public override ItemTier Tier => (ItemTier)2;

		public override GameObject ItemModel => BransItems.MainAssets.LoadAsset<GameObject>("Assets/Models/BloodBustClam/BBClam.prefab");

		public override Sprite ItemIcon => BransItems.MainAssets.LoadAsset<Sprite>("Assets/Textrures/Icons/Temporary/QuadModels/bloodburstclam.png");

		public override bool Hidden => false;

		public override bool CanRemove => false;

		public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2]
		{
			(ItemTag)4,
			(ItemTag)3
		};

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			CreateLang();
			CreateItem();
			Hooks();
		}

		public void CreateConfig(ConfigFile config)
		{
			DropCount = config.Bind<int>("Item: " + ItemName, "Number of essences dropped", 15, "How many essences should drop from this item?").Value;
			AdditionalDrops = config.Bind<int>("Item: " + ItemName, "Extra essences in future drops", 1, "How extra essences should come from future essence drops?").Value;
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_0044: 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_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: 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_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: 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_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_0323: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_035a: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0375: Unknown result type (might be due to invalid IL or missing references)
			//IL_037a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0390: Unknown result type (might be due to invalid IL or missing references)
			//IL_0395: Unknown result type (might be due to invalid IL or missing references)
			//IL_039a: Unknown result type (might be due to invalid IL or missing references)
			//IL_039b: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bf: 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_0408: Unknown result type (might be due to invalid IL or missing references)
			//IL_040d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0423: Unknown result type (might be due to invalid IL or missing references)
			//IL_0428: Unknown result type (might be due to invalid IL or missing references)
			//IL_042d: Unknown result type (might be due to invalid IL or missing references)
			//IL_042e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			//IL_0452: Unknown result type (might be due to invalid IL or missing references)
			//IL_0480: Unknown result type (might be due to invalid IL or missing references)
			//IL_0485: Unknown result type (might be due to invalid IL or missing references)
			//IL_049b: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0513: Unknown result type (might be due to invalid IL or missing references)
			//IL_0518: Unknown result type (might be due to invalid IL or missing references)
			//IL_052e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0533: Unknown result type (might be due to invalid IL or missing references)
			//IL_0549: Unknown result type (might be due to invalid IL or missing references)
			//IL_054e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0553: Unknown result type (might be due to invalid IL or missing references)
			//IL_0554: Unknown result type (might be due to invalid IL or missing references)
			//IL_056f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0578: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0602: Unknown result type (might be due to invalid IL or missing references)
			//IL_060b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0639: Unknown result type (might be due to invalid IL or missing references)
			//IL_063e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0654: Unknown result type (might be due to invalid IL or missing references)
			//IL_0659: Unknown result type (might be due to invalid IL or missing references)
			//IL_066f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0674: Unknown result type (might be due to invalid IL or missing references)
			//IL_0679: Unknown result type (might be due to invalid IL or missing references)
			//IL_067a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0695: Unknown result type (might be due to invalid IL or missing references)
			//IL_069e: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0702: Unknown result type (might be due to invalid IL or missing references)
			//IL_0707: Unknown result type (might be due to invalid IL or missing references)
			//IL_070c: Unknown result type (might be due to invalid IL or missing references)
			//IL_070d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0728: Unknown result type (might be due to invalid IL or missing references)
			//IL_0731: Unknown result type (might be due to invalid IL or missing references)
			//IL_075f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0764: Unknown result type (might be due to invalid IL or missing references)
			//IL_077a: Unknown result type (might be due to invalid IL or missing references)
			//IL_077f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0795: Unknown result type (might be due to invalid IL or missing references)
			//IL_079a: Unknown result type (might be due to invalid IL or missing references)
			//IL_079f: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_080d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0812: Unknown result type (might be due to invalid IL or missing references)
			//IL_0828: Unknown result type (might be due to invalid IL or missing references)
			//IL_082d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0832: Unknown result type (might be due to invalid IL or missing references)
			//IL_0833: Unknown result type (might be due to invalid IL or missing references)
			//IL_084e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0857: Unknown result type (might be due to invalid IL or missing references)
			//IL_0885: Unknown result type (might be due to invalid IL or missing references)
			//IL_088a: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0918: Unknown result type (might be due to invalid IL or missing references)
			//IL_091d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0933: Unknown result type (might be due to invalid IL or missing references)
			//IL_0938: Unknown result type (might be due to invalid IL or missing references)
			//IL_094e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0953: Unknown result type (might be due to invalid IL or missing references)
			//IL_0958: Unknown result type (might be due to invalid IL or missing references)
			//IL_0959: Unknown result type (might be due to invalid IL or missing references)
			//IL_0974: Unknown result type (might be due to invalid IL or missing references)
			//IL_097d: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_09cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_09eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ec: Unknown result type (might be due to invalid IL or missing references)
			ItemBodyModelPrefab = ItemModel;
			ItemDisplay val = ItemBodyModelPrefab.AddComponent<ItemDisplay>();
			val.rendererInfos = ItemHelpers.ItemDisplaySetup(ItemBodyModelPrefab, IgnoreOverlays: true);
			ItemDisplayRuleDict val2 = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
			val2.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Head",
					localPos = new Vector3(0f, 0.42142f, -0.10234f),
					localAngles = new Vector3(351.1655f, 45.64202f, 351.1029f),
					localScale = new Vector3(0.02f, 0.02f, 0.02f)
				}
			});
			val2.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Head",
					localPos = new Vector3(0f, 0.35414f, -0.14761f),
					localAngles = new Vector3(356.5505f, 45.08208f, 356.5588f),
					localScale = new Vector3(0.02f, 0.02f, 0.02f)
				}
			});
			val2.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Head",
					localPos = new Vector3(0f, 2.46717f, 2.64379f),
					localAngles = new Vector3(315.5635f, 233.7695f, 325.0397f),
					localScale = new Vector3(0.2f, 0.2f, 0.2f)
				}
			});
			val2.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "HeadCenter",
					localPos = new Vector3(0f, 0.24722f, -0.01662f),
					localAngles = new Vector3(10.68209f, 46.03322f, 11.01807f),
					localScale = new Vector3(0.025f, 0.025f, 0.025f)
				}
			});
			val2.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Head",
					localPos = new Vector3(0f, 0.24128f, -0.14951f),
					localAngles = new Vector3(6.07507f, 45.37084f, 6.11489f),
					localScale = new Vector3(0.017f, 0.017f, 0.017f)
				}
			});
			val2.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Head",
					localPos = new Vector3(0f, 0.31304f, -0.00747f),
					localAngles = new Vector3(359.2931f, 45.00048f, 359.2912f),
					localScale = new Vector3(0.02f, 0.02f, 0.02f)
				}
			});
			val2.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "FlowerBase",
					localPos = new Vector3(0f, 1.94424f, -0.47558f),
					localAngles = new Vector3(20.16552f, 48.87548f, 21.54582f),
					localScale = new Vector3(0.15f, 0.15f, 0.15f)
				}
			});
			val2.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Head",
					localPos = new Vector3(0f, 0.30118f, -0.0035f),
					localAngles = new Vector3(8.31363f, 45.67525f, 8.41428f),
					localScale = new Vector3(0.02f, 0.02f, 0.02f)
				}
			});
			val2.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Head",
					localPos = new Vector3(0f, -0.65444f, 1.64345f),
					localAngles = new Vector3(326.1803f, 277.2657f, 249.9269f),
					localScale = new Vector3(0.2f, 0.2f, 0.2f)
				}
			});
			val2.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Head",
					localPos = new Vector3(-0.0068f, 0.3225f, -0.03976f),
					localAngles = new Vector3(0f, 45f, 0f),
					localScale = new Vector3(0.02f, 0.02f, 0.02f)
				}
			});
			val2.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Head",
					localPos = new Vector3(-0.14076f, 0.15542f, -0.04648f),
					localAngles = new Vector3(356.9802f, 81.10978f, 353.687f),
					localScale = new Vector3(0.02f, 0.02f, 0.02f)
				}
			});
			val2.Add("CHEF", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Hat",
					localPos = new Vector3(0f, 0.01217f, -0.00126f),
					localAngles = new Vector3(356.9376f, 25.8988f, 14.69767f),
					localScale = new Vector3(0.001f, 0.001f, 0.001f)
				}
			});
			val2.Add("RobPaladinBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Head",
					localPos = new Vector3(0.00042f, 0.46133f, 0.01385f),
					localAngles = new Vector3(355.2848f, 47.55381f, 355.0908f),
					localScale = new Vector3(0.020392f, 0.020392f, 0.020392f)
				}
			});
			val2.Add("RedMistBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Chest",
					localPos = new Vector3(0.00076f, -0.0281f, 0.09539f),
					localAngles = new Vector3(338.9489f, 145.7505f, 217.6883f),
					localScale = new Vector3(0.005402f, 0.005402f, 0.005402f)
				}
			});
			val2.Add("ArbiterBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Head",
					localPos = new Vector3(0f, -0.00277f, -0.13259f),
					localAngles = new Vector3(322.1495f, 124.8318f, 235.476f),
					localScale = new Vector3(0.02f, 0.02f, 0.02f)
				}
			});
			val2.Add("EnforcerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Head",
					localPos = new Vector3(0f, 0.32104f, 0f),
					localAngles = new Vector3(0f, 321.2954f, 0f),
					localScale = new Vector3(0.024027f, 0.024027f, 0.024027f)
				}
			});
			val2.Add("NemesisEnforcerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "HeadCenter",
					localPos = new Vector3(0.00216f, 0.01033f, 0f),
					localAngles = new Vector3(0f, 323.6887f, 355.1232f),
					localScale = new Vector3(0.000551f, 0.000551f, 0.000551f)
				}
			});
			return val2;
		}

		public override void Hooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged);
		}

		private void CharacterBody_FixedUpdate(orig_FixedUpdate orig, CharacterBody self)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && NetworkServer.active && self.inventory.GetItemCount(ItemDef.itemIndex) > 0)
			{
				DropEssences(self);
				BreakItem(self);
			}
		}

		private void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && NetworkServer.active && self.inventory.GetItemCount(ItemDef.itemIndex) > 0 && Object.op_Implicit((Object)(object)self) && self.isPlayerControlled)
			{
				DropEssences(self);
				BreakItem(self);
			}
		}

		private void BreakItem(CharacterBody self)
		{
			//IL_0011: 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_0059: 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)
			self.inventory.RemoveItem(ItemBase<BloodburstClam>.instance.ItemDef.itemIndex, 1);
			self.inventory.GiveItem(ItemBase<LootedBloodburstClam>.instance.ItemDef.itemIndex, 1);
			if (Object.op_Implicit((Object)(object)self.master))
			{
				CharacterMasterNotificationQueue.SendTransformNotification(self.master, ItemBase<BloodburstClam>.instance.ItemDef.itemIndex, ItemBase<LootedBloodburstClam>.instance.ItemDef.itemIndex, (TransformationType)0);
			}
		}

		public void DropEssences(CharacterBody self)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: 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_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_0072: 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_0080: 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_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL