Decompiled source of Caeli Imperium v0.7.8

CaeliImperium.dll

Decompiled 3 weeks 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 CaeliImperium.Artifact;
using CaeliImperium.Buffs;
using CaeliImperium.Elites;
using CaeliImperium.Equipment;
using CaeliImperium.Items;
using CaeliImperiumPlugin;
using EmotesAPI;
using HG.Reflection;
using Microsoft.CodeAnalysis;
using On.RoR2;
using ProperSave;
using ProperSave.Data;
using R2API;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Audio;
using RoR2.ExpansionManagement;
using RoR2.Items;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace CaeliImperiumPlugin
{
	[Serializable]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("BrynzananasCaeliImperium", "CaeliImperium", "0.7.8")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class CaeliImperium : BaseUnityPlugin
	{
		public const string PluginGUID = "BrynzananasCaeliImperium";

		public const string PluginAuthor = "Brynzananas";

		public const string PluginName = "CaeliImperium";

		public const string PluginVersion = "0.7.8";

		public static ExpansionDef CaeliImperiumExpansionDef = ScriptableObject.CreateInstance<ExpansionDef>();

		public static AssetBundle MainAssets;

		public static ConfigFile Config;

		public static EliteTierDef[] CanAppearInEliteTiers = EliteAPI.GetCombatDirectorEliteTiers();

		public static Vector3[] deadPositionArray = (Vector3[])(object)new Vector3[420];

		public static Inventory[] deadInventoryArray = (Inventory[])(object)new Inventory[420];

		public static GameObject[] deadMasterPrefabArray = (GameObject[])(object)new GameObject[420];

		public static GameObject deadMasterprefab;

		public static GameObject[] ArchNemesisBodyBlacklist = (GameObject[])(object)new GameObject[0];

		public static Vector3 deadPosition;

		public static Inventory deadInventory;

		public bool canSwitch = true;

		public static Dictionary<string, string> ShaderLookup = new Dictionary<string, string>
		{
			{ "fake ror/hopoo games/deferred/hgstandard", "shaders/deferred/hgstandard" },
			{ "fake ror/hopoo games/fx/hgcloud intersection remap", "shaders/fx/hgintersectioncloudremap" },
			{ "fake ror/hopoo games/fx/hgcloud remap", "shaders/fx/hgcloudremap" },
			{ "fake ror/hopoo games/fx/hgdistortion", "shaders/fx/hgdistortion" },
			{ "fake ror/hopoo games/deferred/hgsnow topped", "shaders/deferred/hgsnowtopped" },
			{ "fake ror/hopoo games/fx/hgsolid parallax", "shaders/fx/hgsolidparallax" }
		};

		public static Dictionary<string, string> ShaderLookup3 = new Dictionary<string, string>
		{
			{ "stubbed ro r2/base/shaders/hg standard", "shaders/deferred/hgstandard" },
			{ "stubbed ro r2/base/shaders/hg intersection cloud remap", "shaders/fx/hgintersectioncloudremap" },
			{ "stubbed ro r2/base/shaders/hg cloud remap", "shaders/fx/hgcloudremap" },
			{ "stubbed ro r2/base/shaders/hg distortion", "shaders/fx/hgdistortion" },
			{ "stubbed ro r2/base/shaders/hg snow topped", "shaders/deferred/hgsnowtopped" },
			{ "stubbed ro r2/base/shaders/hg solid parallax", "shaders/fx/hgsolidparallax" }
		};

		public static Dictionary<string, string> ShaderLookup4 = new Dictionary<string, string>
		{
			{ "stubbedror2/base/shaders/hgstandard", "shaders/deferred/hgstandard" },
			{ "stubbedror2/base/shaders/hgintersectioncloudremap", "shaders/fx/hgintersectioncloudremap" },
			{ "stubbedror2/base/shaders/hgcloudremap", "shaders/fx/hgcloudremap" },
			{ "stubbedror2/base/shaders/hgdistortion", "shaders/fx/hgdistortion" },
			{ "stubbedror2/base/shaders/hgsnowtopped", "shaders/deferred/hgsnowtopped" },
			{ "stubbedror2/base/shaders/hgsolidparallax", "shaders/fx/hgsolidparallax" }
		};

		public static Dictionary<string, string> ShaderLookup2 = new Dictionary<string, string>
		{
			{ "stubbed hopoo games/deferred/standard", "shaders/deferred/hgstandard" },
			{ "stubbed hopoo games/fx/cloud intersection remap", "shaders/fx/hgintersectioncloudremap" },
			{ "stubbed hopoo games/fx/cloud remap", "shaders/fx/hgcloudremap" },
			{ "stubbed hopoo games/fx/opaque cloud remap", "shaders/fx/hgopaquecloudremap" },
			{ "stubbed hopoo games/fx/distortion", "shaders/fx/hgdistortion" }
		};

		public static List<Material> SwappedMaterials = new List<Material>();

		private bool restartRequired = true;

		public static ManualLogSource ModLogger;

		public static string SavesDirectory { get; } = Path.Combine(Application.persistentDataPath, "ArchNemesis");


		public void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Expected O, but got Unknown
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Expected O, but got Unknown
			Config = new ConfigFile(Paths.ConfigPath + "\\BrynzananasCaeliImperium.cfg", true);
			ModLogger = ((BaseUnityPlugin)this).Logger;
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("CaeliImperium.assets"))
			{
				MainAssets = AssetBundle.LoadFromStream(stream);
			}
			Material[] array = MainAssets.LoadAllAssets<Material>();
			foreach (Material val in array)
			{
				if (((Object)val.shader).name.StartsWith("StubbedRoR2"))
				{
					Shader val2 = Resources.Load<Shader>(ShaderLookup4[((Object)val.shader).name.ToLower()]);
					if (Object.op_Implicit((Object)(object)val2))
					{
						val.shader = val2;
					}
				}
			}
			GenerateExpansionDef();
			using (Stream stream2 = Assembly.GetExecutingAssembly().GetManifestResourceStream("CaeliImperium.KSFsounds.bnk"))
			{
				byte[] array2 = new byte[stream2.Length];
				stream2.Read(array2, 0, array2.Length);
				SoundBanks.Add(array2);
			}
			ModSettingsManager.SetModIcon(MainAssets.LoadAsset<Sprite>("Assets/Icons/ModIcon.png"));
			CharacterBody.OnDeathStart += new hook_OnDeathStart(BufferDeaths);
			CharacterBody.HandleOnKillEffectsServer += new hook_HandleOnKillEffectsServer(ifItKillsPlayer);
			Stage.onStageStartGlobal += ResetArrays;
			WoundedBuff.Init();
			IrradiatedBuff.Init();
			DazzledBuff.Init();
			GuardianCrown.Init();
			Medicine.Init();
			EnergyChocolateBar.Init();
			FragileGiftBox.Init();
			Necronomicon.Init();
			new Hasting();
			BrassModality.Init();
			Dredged.Init();
			EmergencyMedicalTreatment.Init();
			EnforcerHand.Init();
			Battle.Init();
			SkullGammaGun.Init();
			BrassBell.Init();
			OtherworldlyManuscript.Init();
			ArchNemesis.Init();
			Keychain.Init();
			MajesticHand.Init();
			Defender.Init();
			RejectedDagger.Init();
			LikeADragon.Init();
			OpposingForce.Init();
			Chalk.Init();
			DiscoBall.Init();
			CapturedPotential.Init();
		}

		private void Update()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: 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_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			if (PauseManager.isPaused || !canSwitch || !CapturedPotential.CapturedPotentialEnable.Value || !Object.op_Implicit((Object)(object)Run.instance))
			{
				return;
			}
			bool flag = true;
			KeyboardShortcut value = CapturedPotential.CapturedPotentialKey1.Value;
			if ((int)((KeyboardShortcut)(ref value)).MainKey != 0)
			{
				value = CapturedPotential.CapturedPotentialKey1.Value;
				flag = Input.GetKey(((KeyboardShortcut)(ref value)).MainKey);
			}
			bool flag2 = false;
			if (CapturedPotential.CapturedPotentialWheel.Value)
			{
				flag2 = true;
			}
			if (flag)
			{
				if (!(Input.mouseScrollDelta == Vector2.up && flag2))
				{
					value = CapturedPotential.CapturedPotentialKey2.Value;
					if (!Input.GetKeyUp(((KeyboardShortcut)(ref value)).MainKey))
					{
						value = CapturedPotential.CapturedPotentialKey4.Value;
						if (!Input.GetKeyUp(((KeyboardShortcut)(ref value)).MainKey))
						{
							goto IL_00d3;
						}
					}
				}
				Console.instance.SubmitCmd(NetworkUser.readOnlyLocalPlayersList.FirstOrDefault(), "EquipArrayIndexUp", false);
			}
			goto IL_00d3;
			IL_00d3:
			if (!flag)
			{
				return;
			}
			if (!(Input.mouseScrollDelta == Vector2.down && flag2))
			{
				value = CapturedPotential.CapturedPotentialKey3.Value;
				if (!Input.GetKeyUp(((KeyboardShortcut)(ref value)).MainKey))
				{
					value = CapturedPotential.CapturedPotentialKey5.Value;
					if (!Input.GetKeyUp(((KeyboardShortcut)(ref value)).MainKey))
					{
						return;
					}
				}
			}
			Console.instance.SubmitCmd(NetworkUser.readOnlyLocalPlayersList.FirstOrDefault(), "EquipArrayIndexDown", false);
		}

		public void GenerateExpansionDef()
		{
			LanguageAPI.Add("CAELI_IMPERIUM_EXPANSION_DEF_NAME", "Caeli Imperium");
			LanguageAPI.Add("CAELI_IMPERIUM_EXPANSION_DEF_DESCRIPTION", "Brynzananas content mod");
			CaeliImperiumExpansionDef.descriptionToken = "CAELI_IMPERIUM_EXPANSION_DEF_DESCRIPTION";
			CaeliImperiumExpansionDef.nameToken = "CAELI_IMPERIUM_EXPANSION_DEF_NAME";
			CaeliImperiumExpansionDef.iconSprite = MainAssets.LoadAsset<Sprite>("Assets/Icons/ModIcon.png");
			CaeliImperiumExpansionDef.disabledIconSprite = MainAssets.LoadAsset<Sprite>("Assets/Icons/ModIconDisabled.png");
			ContentAddition.AddExpansionDef(CaeliImperiumExpansionDef);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ConvertAmplificationPercentageIntoReductionPercentage(float amplificationPercentage, float maxChance)
		{
			return (1f - maxChance / (maxChance + amplificationPercentage)) * maxChance;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ChanceFalloff(float amplificationPercentage, float maxChance, float maxDistance)
		{
			return (1f - maxDistance / (maxDistance + (maxDistance - amplificationPercentage))) * maxChance * 2f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Falloff(float amplificationPercentage, float maxDistance)
		{
			return (1f - maxDistance / (maxDistance + (maxDistance - amplificationPercentage))) * maxDistance * 2f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float StackFloat(float value, float stack, int itemCount)
		{
			return value + (float)(itemCount - 1) * stack;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int StackInt(int value, int stack, int itemCount)
		{
			return value + (itemCount - 1) * stack;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ConfigFloat(ConfigEntry<float> value, ConfigEntry<bool> enable)
		{
			if (enable.Value)
			{
				return value.Value;
			}
			return (float)((ConfigEntryBase)value).DefaultValue;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int ConfigInt(ConfigEntry<int> value, ConfigEntry<bool> enable)
		{
			if (enable.Value)
			{
				return value.Value;
			}
			return (int)((ConfigEntryBase)value).DefaultValue;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool ConfigBool(ConfigEntry<bool> value, ConfigEntry<bool> enable)
		{
			if (enable.Value)
			{
				return value.Value;
			}
			return (bool)((ConfigEntryBase)value).DefaultValue;
		}

		private void ResetArrays(Stage stage)
		{
			Array.Clear(deadPositionArray, 0, deadPositionArray.Length);
			Array.Clear(deadInventoryArray, 0, deadInventoryArray.Length);
			Array.Clear(deadMasterPrefabArray, 0, deadMasterPrefabArray.Length);
		}

		private void ifItKillsPlayer(orig_HandleOnKillEffectsServer orig, CharacterBody self, DamageReport damageReport)
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Invalid comparison between Unknown and I4
			//IL_004f: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Expected I4, but got Unknown
			orig.Invoke(self, damageReport);
			if (!Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)damageReport.victimBody) || !damageReport.victimBody.isPlayerControlled || (int)damageReport.victimBody.teamComponent.teamIndex != 1 || self.inventory.GetEquipmentIndex() == ArchNemesis.AffixArchNemesisEquipment.equipmentIndex || Run.instance.stageClearCount < ConfigInt(ArchNemesis.ArchNemesisStageBegin, ArchNemesis.ArchNemesisEnableConfig) || (self.isChampion && !ArchNemesis.ArchNemesisChampions.Value) || ArchNemesisBodyBlacklist.Contains(MasterCatalog.GetMasterPrefab(self.master.masterIndex)))
			{
				return;
			}
			try
			{
				Directory.CreateDirectory(SavesDirectory);
				string path = Path.Combine(SavesDirectory, "Prefab.txt");
				string path2 = Path.Combine(SavesDirectory, "Stage.txt");
				string path3 = Path.Combine(SavesDirectory, "Inventory.txt");
				string path4 = Path.Combine(SavesDirectory, "Team.txt");
				string path5 = Path.Combine(SavesDirectory, "IsDefeated.txt");
				string text = string.Concat(damageReport.victimBody.inventory.itemStacks.Select((int x) => x.ToString()));
				int num = 0;
				for (int i = 0; i < text.Length; i++)
				{
					if (int.Parse(text[i].ToString()) > 0)
					{
						num++;
					}
				}
				string[] array = new string[num * 2];
				int num2 = 0;
				for (int j = 0; j < text.Length; j++)
				{
					if (int.Parse(text[j].ToString()) > 0)
					{
						array[num2] = ((object)ItemCatalog.GetItemDef((ItemIndex)j)).ToString().Replace(" (RoR2.ItemDef)", "");
						num2++;
						array[num2] = text[j].ToString();
						num2++;
					}
				}
				File.WriteAllText(path, ((Object)self.master).name.ToString().Replace("(Clone)", ""));
				File.WriteAllText(path3, string.Join(",", array));
				File.WriteAllText(path2, Stage.instance.sceneDef.stageOrder.ToString());
				File.WriteAllText(path4, ((int)self.teamComponent.teamIndex).ToString());
				File.WriteAllText(path5, "False");
			}
			catch (Exception ex)
			{
				Debug.LogError((object)"Failed to save Arch Nemesis");
				Debug.LogError((object)ex);
			}
		}

		private void BufferDeaths(orig_OnDeathStart orig, CharacterBody self)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && !self.isPlayerControlled && Object.op_Implicit((Object)(object)self.inventory) && self.inventory.GetItemCount(Items.Ghost) <= 0 && Dredged.DredgedEnable.Value && self.inventory.GetEquipmentIndex() != Dredged.AffixDredgedEquipment.equipmentIndex)
			{
				deadPosition = self.transform.position;
				deadPositionArray.SetValue(deadPosition, deadPositionArray.Length - 1);
				Array.Copy(deadPositionArray, 1, deadPositionArray, 0, deadPositionArray.Length - 1);
				deadMasterprefab = MasterCatalog.GetMasterPrefab(self.master.masterIndex);
				deadMasterPrefabArray.SetValue(deadMasterprefab, deadMasterPrefabArray.Length - 1);
				Array.Copy(deadMasterPrefabArray, 1, deadMasterPrefabArray, 0, deadMasterPrefabArray.Length - 1);
				deadInventory = self.inventory;
				deadInventoryArray.SetValue(deadInventory, deadInventoryArray.Length - 1);
				Array.Copy(deadInventoryArray, 1, deadInventoryArray, 0, deadInventoryArray.Length - 1);
			}
		}
	}
	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 CaeliImperium
{
	public class ModCompatability
	{
		public static class ProperSaveCompatibility
		{
			private static bool? _enabled;

			public static bool enabled
			{
				get
				{
					if (!_enabled.HasValue)
					{
						_enabled = Chainloader.PluginInfos.ContainsKey("com.KingEnderBrine.ProperSave");
					}
					return _enabled.Value;
				}
			}

			[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
			public static void SomeMethodThatRequireTheDependencyToBeHere()
			{
				_ = enabled;
			}
		}

		public static class EmotesCompatibility
		{
			private static bool? _brynzaEmotesEnabled;

			private static bool? _badassEmotesEnabled;

			public static bool brynzaEmotesEnabled
			{
				get
				{
					if (!_brynzaEmotesEnabled.HasValue)
					{
						_brynzaEmotesEnabled = Chainloader.PluginInfos.ContainsKey("com.brynzananas.brynzaemotes");
					}
					return _brynzaEmotesEnabled.Value;
				}
			}

			public static bool badassEmotesEnabled
			{
				get
				{
					if (!_badassEmotesEnabled.HasValue)
					{
						_badassEmotesEnabled = Chainloader.PluginInfos.ContainsKey("com.weliveinasociety.badassemotes");
					}
					return _badassEmotesEnabled.Value;
				}
			}

			[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
			public static void SomeMethodThatRequireTheDependencyToBeHere()
			{
			}
		}
	}
}
namespace CaeliImperium.Items
{
	public static class BrassBell
	{
		public class BrassBellBehaviour : ItemBehavior
		{
			public bool appliedRegen;

			private void Awake()
			{
				((Behaviour)this).enabled = false;
			}

			public void FixedUpdate()
			{
				if (!Object.op_Implicit((Object)(object)base.body))
				{
					return;
				}
				int stack = base.stack;
				if (stack <= 0 || base.body.HasBuff(BrassBoostedBuff.BrassBoostedBuffDef) || base.body.HasBuff(BrassTimerBuff.BrassTimerBuffDef))
				{
					return;
				}
				float num = CaeliImperiumPlugin.CaeliImperium.ConfigFloat(BrassBellCooldown, BrassBellEnableConfig);
				if (CaeliImperiumPlugin.CaeliImperium.ConfigFloat(BrassBellCooldownStack, BrassBellEnableConfig) != 0f)
				{
					for (int i = 0; i < stack - 1; i++)
					{
						num -= num * (CaeliImperiumPlugin.CaeliImperium.ConfigFloat(BrassBellCooldownStack, BrassBellEnableConfig) / 100f);
					}
				}
				base.body.AddTimedBuff(BrassTimerBuff.BrassTimerBuffDef, num);
			}

			public void OnDisable()
			{
				if (Object.op_Implicit((Object)(object)base.body))
				{
					base.body.RemoveBuff(BrassTimerBuff.BrassTimerBuffDef);
					base.body.RemoveBuff(BrassBoostedBuff.BrassBoostedBuffDef);
				}
			}
		}

		[CompilerGenerated]
		private static class <>O
		{
			public static hook_OnInventoryChanged <0>__AddBuff;
		}

		internal static GameObject BrassBellPrefab;

		internal static Sprite BrassBellIcon;

		public static ItemDef BrassBellItemDef;

		public static ConfigEntry<bool> BrassBellEnable;

		public static ConfigEntry<bool> BrassBellEnableConfig;

		public static ConfigEntry<bool> BrassBellAIBlacklist;

		public static ConfigEntry<float> BrassBellTier;

		public static ConfigEntry<float> BrassBellCooldown;

		public static ConfigEntry<float> BrassBellCooldownStack;

		public static ConfigEntry<float> BrassBellEffectTime;

		public static ConfigEntry<float> BrassBellEffectTimeStack;

		public static ConfigEntry<float> BrassBellDamageIncrease;

		public static ConfigEntry<float> BrassBellDamageIncreaseStack;

		public static ConfigEntry<bool> BrassBellIsReloadSecondary;

		public static ConfigEntry<bool> BrassBellIsReloadutility;

		public static ConfigEntry<bool> BrassBellIsReloadSpecial;

		public static ConfigEntry<bool> BrassBellIsReloadSound;

		public static NetworkSoundEventDef BellSound;

		public static string name = "Brass Bell";

		internal static void Init()
		{
			AddConfigs();
			Debug.Log(((ConfigEntryBase)BrassBellTier).DefaultValue);
			string text = "Assets/Icons/BrassBellIcon.png";
			float num = CaeliImperiumPlugin.CaeliImperium.ConfigFloat(BrassBellTier, BrassBellEnableConfig);
			if (num != 1f)
			{
				if (num != 2f)
				{
					if (num == 3f)
					{
						text = "Assets/Icons/BrassBellIconTier3.png";
					}
				}
				else
				{
					text = "Assets/Icons/BrassBellIcon.png";
				}
			}
			else
			{
				text = "Assets/Icons/BrassBellIconTier1.png";
			}
			BrassBellPrefab = CaeliImperiumPlugin.CaeliImperium.MainAssets.LoadAsset<GameObject>("Assets/Models/Prefabs/hotelbell.prefab");
			BrassBellIcon = CaeliImperiumPlugin.CaeliImperium.MainAssets.LoadAsset<Sprite>(text);
			if (BrassBellEnable.Value)
			{
				Item();
				CreateSound();
				AddLanguageTokens();
				BrassBoostedBuff.Init();
				BrassTimerBuff.Init();
			}
		}

		public static void AddConfigs()
		{
			//IL_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Expected O, but got Unknown
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Expected O, but got Unknown
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Expected O, but got Unknown
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Expected O, but got Unknown
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Expected O, but got Unknown
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Expected O, but got Unknown
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02db: Expected O, but got Unknown
			//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Expected O, but got Unknown
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f9: Expected O, but got Unknown
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Expected O, but got Unknown
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0317: Expected O, but got Unknown
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Expected O, but got Unknown
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0335: Expected O, but got Unknown
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0344: Expected O, but got Unknown
			//IL_0349: Unknown result type (might be due to invalid IL or missing references)
			//IL_0353: Expected O, but got Unknown
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Expected O, but got Unknown
			BrassBellEnable = CaeliImperiumPlugin.CaeliImperium.Config.Bind<bool>("Item : " + name, "Activation", true, "Enable this item?");
			BrassBellEnableConfig = CaeliImperiumPlugin.CaeliImperium.Config.Bind<bool>("Item : " + name, "Config activation", false, "Enable config?\nActivation option and |options under these brackets| are always taken in effect");
			BrassBellAIBlacklist = CaeliImperiumPlugin.CaeliImperium.Config.Bind<bool>("Item : " + name, "AI Blacklist", false, "Blacklist this item from enemies?");
			BrassBellTier = CaeliImperiumPlugin.CaeliImperium.Config.Bind<float>("Item : " + name, "Item tier", 2f, "1: Common/White\n2: Rare/Green\n3: Legendary/Red");
			BrassBellCooldown = CaeliImperiumPlugin.CaeliImperium.Config.Bind<float>("Item : " + name, "Interval between effects", 15f, "Control the interval for this item activation");
			BrassBellCooldownStack = CaeliImperiumPlugin.CaeliImperium.Config.Bind<float>("Item : " + name, "Interval reduction", 0f, "Control the interval reduction per stack in percentage\nSet to 0 to disable stacking");
			BrassBellEffectTime = CaeliImperiumPlugin.CaeliImperium.Config.Bind<float>("Item : " + name, "Effect time", 1f, "Control how long this item effect lasts in seconds");
			BrassBellEffectTimeStack = CaeliImperiumPlugin.CaeliImperium.Config.Bind<float>("Item : " + name, "Effect time stack", 0f, "Control addition effect duration in seconds\nSet it to 0 to disable stacking");
			BrassBellDamageIncrease = CaeliImperiumPlugin.CaeliImperium.Config.Bind<float>("Item : " + name, "Damage increase", 80f, "Control the damage increase in percentage");
			BrassBellDamageIncreaseStack = CaeliImperiumPlugin.CaeliImperium.Config.Bind<float>("Item : " + name, "Damage increase stack", 80f, "Control the damage increase stack in percentage\nSet it to 0 to disable stacking");
			BrassBellIsReloadSecondary = CaeliImperiumPlugin.CaeliImperium.Config.Bind<bool>("Item : " + name, "Secondary skill reload", true, "Will this item reload secondary skill on activation?");
			BrassBellIsReloadutility = CaeliImperiumPlugin.CaeliImperium.Config.Bind<bool>("Item : " + name, "Utility skill reload", false, "Will this item reload utility skill on activation?");
			BrassBellIsReloadSpecial = CaeliImperiumPlugin.CaeliImperium.Config.Bind<bool>("Item : " + name, "Special skill reload", false, "Will this item reload special skill on activation?");
			BrassBellIsReloadSound = CaeliImperiumPlugin.CaeliImperium.Config.Bind<bool>("Item : " + name, "|Sound|", false, "Play sound on activation?");
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(BrassBellEnable, new CheckBoxConfig
			{
				restartRequired = true
			}));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(BrassBellEnableConfig));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(BrassBellAIBlacklist, new CheckBoxConfig
			{
				restartRequired = true
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(BrassBellTier, new StepSliderConfig
			{
				min = 1f,
				max = 3f,
				increment = 1f,
				restartRequired = true
			}));
			ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(BrassBellCooldown));
			ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(BrassBellCooldownStack));
			ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(BrassBellEffectTime));
			ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(BrassBellEffectTimeStack));
			ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(BrassBellDamageIncrease));
			ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(BrassBellDamageIncreaseStack));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(BrassBellIsReloadSecondary));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(BrassBellIsReloadutility));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(BrassBellIsReloadSpecial));
		}

		public static void Item()
		{
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Expected O, but got Unknown
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: 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_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Unknown result type (might be due to invalid IL or missing references)
			//IL_033b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Unknown result type (might be due to invalid IL or missing references)
			//IL_0356: Unknown result type (might be due to invalid IL or missing references)
			//IL_035b: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_040a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Unknown result type (might be due to invalid IL or missing references)
			//IL_0441: Unknown result type (might be due to invalid IL or missing references)
			//IL_0446: Unknown result type (might be due to invalid IL or missing references)
			//IL_045c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0461: Unknown result type (might be due to invalid IL or missing references)
			//IL_0477: Unknown result type (might be due to invalid IL or missing references)
			//IL_047c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			//IL_0483: Unknown result type (might be due to invalid IL or missing references)
			//IL_049d: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_050a: Unknown result type (might be due to invalid IL or missing references)
			//IL_050f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0514: Unknown result type (might be due to invalid IL or missing references)
			//IL_0516: Unknown result type (might be due to invalid IL or missing references)
			//IL_0530: Unknown result type (might be due to invalid IL or missing references)
			//IL_0539: Unknown result type (might be due to invalid IL or missing references)
			//IL_0567: Unknown result type (might be due to invalid IL or missing references)
			//IL_056c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0582: Unknown result type (might be due to invalid IL or missing references)
			//IL_0587: Unknown result type (might be due to invalid IL or missing references)
			//IL_059d: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0615: Unknown result type (might be due to invalid IL or missing references)
			//IL_061a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0630: Unknown result type (might be due to invalid IL or missing references)
			//IL_0635: Unknown result type (might be due to invalid IL or missing references)
			//IL_063a: Unknown result type (might be due to invalid IL or missing references)
			//IL_063c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0656: Unknown result type (might be due to invalid IL or missing references)
			//IL_065f: Unknown result type (might be due to invalid IL or missing references)
			//IL_068d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0692: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0720: Unknown result type (might be due to invalid IL or missing references)
			//IL_0725: Unknown result type (might be due to invalid IL or missing references)
			//IL_073b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0740: Unknown result type (might be due to invalid IL or missing references)
			//IL_0756: Unknown result type (might be due to invalid IL or missing references)
			//IL_075b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0760: Unknown result type (might be due to invalid IL or missing references)
			//IL_0762: Unknown result type (might be due to invalid IL or missing references)
			//IL_077c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0785: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_080f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0818: Unknown result type (might be due to invalid IL or missing references)
			//IL_0846: Unknown result type (might be due to invalid IL or missing references)
			//IL_084b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0861: Unknown result type (might be due to invalid IL or missing references)
			//IL_0866: Unknown result type (might be due to invalid IL or missing references)
			//IL_087c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0881: Unknown result type (might be due to invalid IL or missing references)
			//IL_0886: Unknown result type (might be due to invalid IL or missing references)
			//IL_0888: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08de: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_090f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0914: Unknown result type (might be due to invalid IL or missing references)
			//IL_0919: Unknown result type (might be due to invalid IL or missing references)
			//IL_091b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0935: Unknown result type (might be due to invalid IL or missing references)
			//IL_093e: Unknown result type (might be due to invalid IL or missing references)
			//IL_096c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0971: Unknown result type (might be due to invalid IL or missing references)
			//IL_0987: Unknown result type (might be due to invalid IL or missing references)
			//IL_098c: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a04: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a1a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a1f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a35: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a41: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a5b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a64: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a92: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a97: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0acd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b25: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b2a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b40: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b45: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b60: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b65: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b67: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b81: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b8a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bbd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bfa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c05: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c0b: Expected O, but got Unknown
			//IL_0c11: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c1b: Expected O, but got Unknown
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c2c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c31: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c37: Expected O, but got Unknown
			BrassBellItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)BrassBellItemDef).name = name.Replace(" ", "");
			BrassBellItemDef.nameToken = name.Replace(" ", "").ToUpper() + "_NAME";
			BrassBellItemDef.pickupToken = name.Replace(" ", "").ToUpper() + "_PICKUP";
			BrassBellItemDef.descriptionToken = name.Replace(" ", "").ToUpper() + "_DESC";
			BrassBellItemDef.loreToken = name.Replace(" ", "").ToUpper() + "_LORE";
			float num = CaeliImperiumPlugin.CaeliImperium.ConfigFloat(BrassBellTier, BrassBellEnableConfig);
			if (num != 1f)
			{
				if (num != 2f)
				{
					if (num == 3f)
					{
						BrassBellItemDef.deprecatedTier = (ItemTier)2;
					}
				}
				else
				{
					BrassBellItemDef.deprecatedTier = (ItemTier)1;
				}
			}
			else
			{
				BrassBellItemDef.deprecatedTier = (ItemTier)0;
			}
			BrassBellItemDef.pickupIconSprite = BrassBellIcon;
			BrassBellItemDef.pickupModelPrefab = BrassBellPrefab;
			BrassBellItemDef.canRemove = true;
			BrassBellItemDef.hidden = false;
			BrassBellItemDef.requiredExpansion = CaeliImperiumPlugin.CaeliImperium.CaeliImperiumExpansionDef;
			List<ItemTag> list = new List<ItemTag> { (ItemTag)1 };
			if (CaeliImperiumPlugin.CaeliImperium.ConfigBool(BrassBellAIBlacklist, BrassBellEnableConfig))
			{
				list.Add((ItemTag)4);
			}
			BrassBellItemDef.tags = list.ToArray();
			ItemDisplayRuleDict val = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
			val.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Pelvis",
					localPos = new Vector3(-0.16116f, 0.01811f, 0.05452f),
					localAngles = new Vector3(0f, 0f, 201.6437f),
					localScale = new Vector3(0.04981f, 0.04981f, 0.04981f)
				}
			});
			val.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Head",
					localPos = new Vector3(0f, -0.00528f, 0.0624f),
					localAngles = new Vector3(347.1176f, 0f, 0f),
					localScale = new Vector3(0.05116f, 0.05369f, 0.05369f)
				}
			});
			val.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Head",
					localPos = new Vector3(-0.06211f, -0.07434f, 0.07202f),
					localAngles = new Vector3(9.13731f, 313.1105f, 349.6901f),
					localScale = new Vector3(0.02397f, 0.02397f, 0.02397f)
				}
			});
			val.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Chest",
					localPos = new Vector3(0f, -0.43046f, 2.33586f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(1f, 1f, 1f)
				}
			});
			val.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Chest",
					localPos = new Vector3(0f, 0.13773f, 0.21466f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(0.06118f, 0.06118f, 0.06118f)
				}
			});
			val.Add("mdlEngiTurret", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Chest",
					localPos = new Vector3(0f, 0f, 0f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(1f, 1f, 1f)
				}
			});
			val.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Head",
					localPos = new Vector3(0f, -0.09482f, 0.04086f),
					localAngles = new Vector3(348.9679f, 0f, 0f),
					localScale = new Vector3(0.02953f, 0.02953f, 0.02953f)
				}
			});
			val.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Head",
					localPos = new Vector3(0.08917f, 0.01914f, 0.06002f),
					localAngles = new Vector3(0f, 90f, 0f),
					localScale = new Vector3(0.03624f, 0.03624f, 0.03624f)
				}
			});
			val.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Chest",
					localPos = new Vector3(0f, 0f, 0f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(1f, 1f, 1f)
				}
			});
			val.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Chest",
					localPos = new Vector3(0f, 0f, 0f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(1f, 1f, 1f)
				}
			});
			val.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Chest",
					localPos = new Vector3(0f, 0f, 0f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(1f, 1f, 1f)
				}
			});
			val.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Chest",
					localPos = new Vector3(0f, 0f, 0f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(1f, 1f, 1f)
				}
			});
			val.Add("mdlRailGunner", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Chest",
					localPos = new Vector3(0f, 0f, 0f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(1f, 1f, 1f)
				}
			});
			val.Add("mdlVoidSurvivor", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Chest",
					localPos = new Vector3(0f, 0f, 0f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(1f, 1f, 1f)
				}
			});
			val.Add("mdlSeeker", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Chest",
					localPos = new Vector3(0f, 0f, 0f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(1f, 1f, 1f)
				}
			});
			val.Add("mdlChef", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Chest",
					localPos = new Vector3(0f, 0f, 0f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(1f, 1f, 1f)
				}
			});
			val.Add("mdlFalseSon", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Chest",
					localPos = new Vector3(0f, 0f, 0f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(1f, 1f, 1f)
				}
			});
			val.Add("mdlScav", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = BrassBellPrefab,
					childName = "Chest",
					localPos = new Vector3(0f, 0f, 0f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(1f, 1f, 1f)
				}
			});
			ItemDisplayRuleDict val2 = new ItemDisplayRuleDict((ItemDisplayRule[])null);
			ItemAPI.Add(new CustomItem(BrassBellItemDef, val2));
			object obj = <>O.<0>__AddBuff;
			if (obj == null)
			{
				hook_OnInventoryChanged val3 = AddBuff;
				<>O.<0>__AddBuff = val3;
				obj = (object)val3;
			}
			CharacterBody.OnInventoryChanged += (hook_OnInventoryChanged)obj;
		}

		private static void CreateSound()
		{
			BellSound = ScriptableObject.CreateInstance<NetworkSoundEventDef>();
			BellSound.eventName = "Play_bell";
			ContentAddition.AddNetworkSoundEventDef(BellSound);
		}

		private static void AddBuff(orig_OnInventoryChanged orig, CharacterBody self)
		{
			orig.Invoke(self);
			int num = (Object.op_Implicit((Object)(object)self.inventory) ? self.inventory.GetItemCount(BrassBellItemDef) : 0);
			self.AddItemBehavior<BrassBellBehaviour>(num);
		}

		public static void AddLanguageTokens()
		{
			string text = ".";
			if (CaeliImperiumPlugin.CaeliImperium.ConfigBool(BrassBellIsReloadSecondary, BrassBellEnableConfig) || CaeliImperiumPlugin.CaeliImperium.ConfigBool(BrassBellIsReloadutility, BrassBellEnableConfig) || CaeliImperiumPlugin.CaeliImperium.ConfigBool(BrassBellIsReloadSpecial, BrassBellEnableConfig))
			{
				text += " Reload ";
				if (CaeliImperiumPlugin.CaeliImperium.ConfigBool(BrassBellIsReloadSecondary, BrassBellEnableConfig))
				{
					text += "<style=cIsUtility>secondary</style>";
				}
				if (CaeliImperiumPlugin.CaeliImperium.ConfigBool(BrassBellIsReloadutility, BrassBellEnableConfig) || CaeliImperiumPlugin.CaeliImperium.ConfigBool(BrassBellIsReloadSpecial, BrassBellEnableConfig))
				{
					text += ",";
				}
				if (CaeliImperiumPlugin.CaeliImperium.ConfigBool(BrassBellIsReloadutility, BrassBellEnableConfig))
				{
					text += " <style=cIsUtility>utility</style>";
				}
				if (CaeliImperiumPlugin.CaeliImperium.ConfigBool(BrassBellIsReloadSpecial, BrassBellEnableConfig))
				{
					text += ",";
				}
				if (CaeliImperiumPlugin.CaeliImperium.ConfigBool(BrassBellIsReloadSpecial, BrassBellEnableConfig))
				{
					text += "<style=cIsUtility>special</style> ";
				}
				text += " <style=cIsUtility>skills</style> on effect activation.";
			}
			string text2 = "";
			if (CaeliImperiumPlugin.CaeliImperium.ConfigFloat(BrassBellCooldownStack, BrassBellEnableConfig) != 0f)
			{
				text2 = " <style=cStack>(-" + CaeliImperiumPlugin.CaeliImperium.ConfigFloat(BrassBellCooldownStack, BrassBellEnableConfig) + "% per item stack)</style>";
			}
			string text3 = "";
			if (CaeliImperiumPlugin.CaeliImperium.ConfigFloat(BrassBellDamageIncreaseStack, BrassBellEnableConfig) != 0f)
			{
				text3 = " <style=cStack>(+" + CaeliImperiumPlugin.CaeliImperium.ConfigFloat(BrassBellDamageIncreaseStack, BrassBellEnableConfig) + "% per item stack)</style>";
			}
			string text4 = "";
			if (CaeliImperiumPlugin.CaeliImperium.ConfigFloat(BrassBellEffectTimeStack, BrassBellEnableConfig) != 0f)
			{
				text4 = " <style=cStack>(+" + CaeliImperiumPlugin.CaeliImperium.ConfigFloat(BrassBellEffectTimeStack, BrassBellEnableConfig) + " per item stack)</style>";
			}
			LanguageAPI.Add(name.Replace(" ", "").ToUpper() + "_NAME", name);
			LanguageAPI.Add(name.Replace(" ", "").ToUpper() + "_PICKUP", "Increases damage in a short time period");
			LanguageAPI.Add(name.Replace(" ", "").ToUpper() + "_DESC", "Every " + CaeliImperiumPlugin.CaeliImperium.ConfigFloat(BrassBellCooldown, BrassBellEnableConfig) + text2 + " seconds increase your damage by <style=cIsDamage>" + CaeliImperiumPlugin.CaeliImperium.ConfigFloat(BrassBellDamageIncrease, BrassBellEnableConfig) + "%</style>" + text3 + " for " + CaeliImperiumPlugin.CaeliImperium.ConfigFloat(BrassBellEffectTime, BrassBellEnableConfig) + text4 + " seconds" + text);
			LanguageAPI.Add(name.Replace(" ", "").ToUpper() + "_LORE", "");
		}
	}
	internal static class CapturedPotential
	{
		public class CapturedPotentialComponent : MonoBehaviour
		{
			[DataMember(Name = "EquipInventory")]
			public EquipmentIndex[] equipArray = (EquipmentIndex[])(object)new EquipmentIndex[0];

			[IgnoreDataMember]
			public CharacterMaster master;

			public void Update()
			{
			}

			public void Awake()
			{
			}

			public void OnEnable()
			{
			}

			private void FixedUpdate()
			{
				//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: Invalid comparison between Unknown and I4
				//IL_00b7: 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)
				//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
				//IL_019d: Unknown result type (might be due to invalid IL or missing references)
				//IL_019f: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ad: 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_01d5: Unknown result type (might be due to invalid IL or missing references)
				if (!NetworkServer.active || !Object.op_Implicit((Object)(object)master.GetBody()))
				{
					return;
				}
				int num = (Object.op_Implicit((Object)(object)master.inventory) ? master.inventory.GetItemCount(CapturedPotentialItemDef) : 0);
				if (num > 0)
				{
					num = CaeliImperiumPlugin.CaeliImperium.ConfigInt(CapturedPotentialEquipSlots, CapturedPotentialEnableConfig) + (master.inventory.GetItemCount(CapturedPotentialItemDef) - 1) * CaeliImperiumPlugin.CaeliImperium.ConfigInt(CapturedPotentialEquipSlotsStack, CapturedPotentialEnableConfig);
				}
				if (num < equipArray.Length)
				{
					for (int i = 0; i < equipArray.Length - num; i++)
					{
						EquipmentIndex val = (EquipmentIndex)equipArray.GetValue(equipArray.Length - (i + 1));
						if ((int)val != -1)
						{
							PickupIndex val2 = PickupCatalog.FindPickupIndex(val);
							Vector3 position = master.GetBody().transform.position;
							Quaternion rotation = master.GetBody().transform.rotation;
							PickupDropletController.CreatePickupDroplet(val2, position, ((Quaternion)(ref rotation)).eulerAngles * 20f);
						}
					}
					Array.Resize(ref equipArray, num);
				}
				if (num > equipArray.Length)
				{
					int num2 = equipArray.Length;
					Array.Resize(ref equipArray, num);
					for (int j = 0; j < num - num2; j++)
					{
						equipArray.SetValue((object)(EquipmentIndex)(-1), equipArray.Length - (j + 1));
					}
				}
				CharacterBody body = master.GetBody();
				if (!CaeliImperiumPlugin.CaeliImperium.ConfigBool(CapturedPotentialAffixes, CapturedPotentialEnableConfig))
				{
					return;
				}
				EquipmentIndex[] array = equipArray;
				foreach (EquipmentIndex val3 in array)
				{
					if (Object.op_Implicit((Object)(object)EquipmentCatalog.GetEquipmentDef(val3)) && Object.op_Implicit((Object)(object)EquipmentCatalog.GetEquipmentDef(val3).passiveBuffDef) && !body.HasBuff(EquipmentCatalog.GetEquipmentDef(val3).passiveBuffDef))
					{
						body.AddTimedBuff(EquipmentCatalog.GetEquipmentDef(val3).passiveBuffDef, 1f);
					}
				}
			}

			public static CapturedPotentialComponent GetOrCreateComponent(CharacterMaster master)
			{
				return GetOrCreateComponent(((Component)master).gameObject);
			}

			public static CapturedPotentialComponent GetOrCreateComponent(GameObject masterObject)
			{
				CapturedPotentialComponent capturedPotentialComponent = masterObject.GetComponent<CapturedPotentialComponent>();
				if (!Object.op_Implicit((Object)(object)capturedPotentialComponent))
				{
					capturedPotentialComponent = masterObject.AddComponent<CapturedPotentialComponent>();
				}
				return capturedPotentialComponent;
			}
		}

		public class CapturedPotentialBehaviour : ItemBehavior
		{
			public float testTimer;

			public bool hasCard;

			private static ItemDef GetItemDef()
			{
				return CapturedPotentialItemDef;
			}

			private void Awake()
			{
				((Behaviour)this).enabled = false;
			}

			private void OnEnable()
			{
			}

			private void Update()
			{
				if (base.body.hasEffectiveAuthority && !PauseManager.isPaused)
				{
					_ = base.stack;
					_ = 0;
				}
			}

			private void FixedUpdate()
			{
				if (NetworkServer.active && Object.op_Implicit((Object)(object)base.body))
				{
					testTimer += Time.deltaTime;
					if (testTimer > 1f)
					{
						testTimer = 0f;
						Object.op_Implicit((Object)(object)base.body.masterObject.GetComponent<CapturedPotentialComponent>());
					}
				}
			}
		}

		public struct CapturedPotentialSaveStructure
		{
			[DataMember(Name = "UserID")]
			public UserIDData userID;

			[DataMember(Name = "EquipInventory")]
			public EquipmentIndex[] EquipInventory;
		}

		[CompilerGenerated]
		private static class <>O
		{
			public static hook_OnInventoryChanged <0>__ChangeArraySize;

			public static hook_OnInteractionBegin <1>__CardCompatibility;

			public static Action<Dictionary<string, object>> <2>__SaveFile_OnGatherSaveData;

			public static Action<SaveFile> <3>__Loading_OnLoadingStarted;
		}

		internal static GameObject CapturedPotentialPrefab;

		internal static Sprite CapturedPotentialIcon;

		public static ItemDef CapturedPotentialItemDef;

		public static ConfigEntry<bool> CapturedPotentialEnable;

		public static ConfigEntry<bool> CapturedPotentialEnableConfig;

		public static ConfigEntry<float> CapturedPotentialTier;

		public static ConfigEntry<int> CapturedPotentialEquipSlots;

		public static ConfigEntry<int> CapturedPotentialEquipSlotsStack;

		public static ConfigEntry<bool> CapturedPotentialAffixes;

		public static ConfigEntry<bool> CapturedPotentialCard;

		public static ConfigEntry<bool> CapturedPotentialSound;

		public static ConfigEntry<bool> CapturedPotentialWheel;

		public static ConfigEntry<KeyboardShortcut> CapturedPotentialKey1;

		public static ConfigEntry<KeyboardShortcut> CapturedPotentialKey2;

		public static ConfigEntry<KeyboardShortcut> CapturedPotentialKey3;

		public static ConfigEntry<KeyboardShortcut> CapturedPotentialKey4;

		public static ConfigEntry<KeyboardShortcut> CapturedPotentialKey5;

		public static ConfigEntry<bool> CapturedPotentialEnableDocumentation;

		public static NetworkSoundEventDef EquipArrayUpSound;

		public static NetworkSoundEventDef EquipArrayDownSound;

		internal static void Init()
		{
			AddConfigs();
			string text = "Assets/Icons/BrassBellIcon.png";
			float num = CaeliImperiumPlugin.CaeliImperium.ConfigFloat(CapturedPotentialTier, CapturedPotentialEnableConfig);
			if (num != 1f)
			{
				if (num != 2f)
				{
					if (num == 3f)
					{
						text = "Assets/Icons/CapturedPotentialTier3.png";
					}
				}
				else
				{
					text = "Assets/Icons/CapturedPotential.png";
				}
			}
			else
			{
				text = "Assets/Icons/CapturedPotentialTier1.png";
			}
			CapturedPotentialPrefab = CaeliImperiumPlugin.CaeliImperium.MainAssets.LoadAsset<GameObject>("Assets/Models/Prefabs/QuantumDeck.prefab");
			CapturedPotentialIcon = CaeliImperiumPlugin.CaeliImperium.MainAssets.LoadAsset<Sprite>(text);
			if (CapturedPotentialEnable.Value)
			{
				Item();
				CreateSound();
				Documentation.Init();
				AddLanguageTokens();
			}
		}

		private static void AddConfigs()
		{
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Expected O, but got Unknown
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Expected O, but got Unknown
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Expected O, but got Unknown
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Expected O, but got Unknown
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Expected O, but got Unknown
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Expected O, but got Unknown
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Expected O, but got Unknown
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Expected O, but got Unknown
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Expected O, but got Unknown
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Expected O, but got Unknown
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Expected O, but got Unknown
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Expected O, but got Unknown
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Expected O, but got Unknown
			//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: Expected O, but got Unknown
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_030e: Expected O, but got Unknown
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Expected O, but got Unknown
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Expected O, but got Unknown
			CapturedPotentialEnable = CaeliImperiumPlugin.CaeliImperium.Config.Bind<bool>("Item : Captured Potential", "Activation", true, "Enable Captured Potential item?");
			CapturedPotentialEnableConfig = CaeliImperiumPlugin.CaeliImperium.Config.Bind<bool>("Item : Captured Potential", "Config Activation", false, "Enable config?\nActivation option and |options under these brackets| are always taken in effect");
			CapturedPotentialTier = CaeliImperiumPlugin.CaeliImperium.Config.Bind<float>("Item : Captured Potential", "Item tier", 2f, "1: Common/White\n2: Rare/Green\n3: Legendary/Red");
			CapturedPotentialEquipSlots = CaeliImperiumPlugin.CaeliImperium.Config.Bind<int>("Item : Captured Potential", "Equipment slots", 2, "Control how much this item gives equipment slots");
			CapturedPotentialEquipSlotsStack = CaeliImperiumPlugin.CaeliImperium.Config.Bind<int>("Item : Captured Potential", "Equipment slots stacking", 1, "Control how much this item gives equipment slots per next stacks\nSet it to 0 to disable stacking");
			CapturedPotentialAffixes = CaeliImperiumPlugin.CaeliImperium.Config.Bind<bool>("Item : Captured Potential", "Affixes compatibility", true, "Enable working affixes in inventory");
			CapturedPotentialCard = CaeliImperiumPlugin.CaeliImperium.Config.Bind<bool>("Item : Captured Potential", "Credit Card compatibility", true, "Enable working Credit Card in inventory");
			CapturedPotentialSound = CaeliImperiumPlugin.CaeliImperium.Config.Bind<bool>("Item : Captured Potential", "|Sound|", true, "Enable switching equipments sound?");
			CapturedPotentialWheel = CaeliImperiumPlugin.CaeliImperium.Config.Bind<bool>("Item : Captured Potential", "|Mouse wheel|", true, "Enable Mouse Wheel as equipment switchng input?");
			CapturedPotentialKey1 = CaeliImperiumPlugin.CaeliImperium.Config.Bind<KeyboardShortcut>("Item : Captured Potential", "|Key 1|", new KeyboardShortcut((KeyCode)101, Array.Empty<KeyCode>()), "Key to start switching equipments\nUnbind it to always switch equipments on input");
			CapturedPotentialKey2 = CaeliImperiumPlugin.CaeliImperium.Config.Bind<KeyboardShortcut>("Item : Captured Potential", "|Key 2|", new KeyboardShortcut((KeyCode)49, Array.Empty<KeyCode>()), "Key to switch equipment up");
			CapturedPotentialKey3 = CaeliImperiumPlugin.CaeliImperium.Config.Bind<KeyboardShortcut>("Item : Captured Potential", "|Key 3|", new KeyboardShortcut((KeyCode)51, Array.Empty<KeyCode>()), "Key to switch equipment down");
			CapturedPotentialKey4 = CaeliImperiumPlugin.CaeliImperium.Config.Bind<KeyboardShortcut>("Item : Captured Potential", "|Key 4|", new KeyboardShortcut((KeyCode)354, Array.Empty<KeyCode>()), "Key to switch equipment up for game controllers\nWIP: Does not work");
			CapturedPotentialKey5 = CaeliImperiumPlugin.CaeliImperium.Config.Bind<KeyboardShortcut>("Item : Captured Potential", "|Key 5|", new KeyboardShortcut((KeyCode)356, Array.Empty<KeyCode>()), "Key to switch equipment down for game controllers\nWIP: Does not work");
			CapturedPotentialEnableDocumentation = CaeliImperiumPlugin.CaeliImperium.Config.Bind<bool>("Item : Captured Potential", "|Documentation Activation|", true, "Enable Documentation item?");
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(CapturedPotentialEnable, new CheckBoxConfig
			{
				restartRequired = true
			}));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(CapturedPotentialEnableConfig));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(CapturedPotentialTier, new StepSliderConfig
			{
				min = 1f,
				max = 3f,
				increment = 1f,
				restartRequired = true
			}));
			ModSettingsManager.AddOption((BaseOption)new IntFieldOption(CapturedPotentialEquipSlots));
			ModSettingsManager.AddOption((BaseOption)new IntFieldOption(CapturedPotentialEquipSlotsStack));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(CapturedPotentialCard));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(CapturedPotentialAffixes));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(CapturedPotentialSound));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(CapturedPotentialWheel));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(CapturedPotentialKey1));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(CapturedPotentialKey2));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(CapturedPotentialKey3));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(CapturedPotentialKey4));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(CapturedPotentialKey5));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(CapturedPotentialEnableDocumentation));
		}

		private static void CreateSound()
		{
			EquipArrayUpSound = ScriptableObject.CreateInstance<NetworkSoundEventDef>();
			EquipArrayUpSound.eventName = "Play_equip_up";
			ContentAddition.AddNetworkSoundEventDef(EquipArrayUpSound);
			EquipArrayDownSound = ScriptableObject.CreateInstance<NetworkSoundEventDef>();
			EquipArrayDownSound.eventName = "Play_equip_down";
			ContentAddition.AddNetworkSoundEventDef(EquipArrayDownSound);
		}

		private static void Item()
		{
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Expected O, but got Unknown
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: 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_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_0327: Unknown result type (might be due to invalid IL or missing references)
			//IL_033d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			//IL_0363: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0386: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_040f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0418: Unknown result type (might be due to invalid IL or missing references)
			//IL_0446: Unknown result type (might be due to invalid IL or missing references)
			//IL_044b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0461: Unknown result type (might be due to invalid IL or missing references)
			//IL_0466: Unknown result type (might be due to invalid IL or missing references)
			//IL_047c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			//IL_0486: Unknown result type (might be due to invalid IL or missing references)
			//IL_0487: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_050e: 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_0519: Unknown result type (might be due to invalid IL or missing references)
			//IL_0524: Unknown result type (might be due to invalid IL or missing references)
			//IL_0530: Unknown result type (might be due to invalid IL or missing references)
			//IL_053a: Expected O, but got Unknown
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_054b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0550: Unknown result type (might be due to invalid IL or missing references)
			//IL_0556: Expected O, but got Unknown
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_056b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0570: Unknown result type (might be due to invalid IL or missing references)
			//IL_0576: Expected O, but got Unknown
			CapturedPotentialItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)CapturedPotentialItemDef).name = "CapturedPotential";
			CapturedPotentialItemDef.nameToken = "CAPTUREDPOTENTIAL_NAME";
			CapturedPotentialItemDef.pickupToken = "CAPTUREDPOTENTIAL_PICKUP";
			CapturedPotentialItemDef.descriptionToken = "CAPTUREDPOTENTIAL_DESC";
			CapturedPotentialItemDef.loreToken = "CAPTUREDPOTENTIAL_LORE";
			float num = CaeliImperiumPlugin.CaeliImperium.ConfigFloat(CapturedPotentialTier, CapturedPotentialEnableConfig);
			if (num != 1f)
			{
				if (num != 2f)
				{
					if (num == 3f)
					{
						CapturedPotentialItemDef.deprecatedTier = (ItemTier)2;
					}
				}
				else
				{
					CapturedPotentialItemDef.deprecatedTier = (ItemTier)1;
				}
			}
			else
			{
				CapturedPotentialItemDef.deprecatedTier = (ItemTier)0;
			}
			CapturedPotentialItemDef.pickupIconSprite = CapturedPotentialIcon;
			CapturedPotentialItemDef.pickupModelPrefab = CapturedPotentialPrefab;
			CapturedPotentialItemDef.canRemove = true;
			CapturedPotentialItemDef.hidden = false;
			CapturedPotentialItemDef.requiredExpansion = CaeliImperiumPlugin.CaeliImperium.CaeliImperiumExpansionDef;
			List<ItemTag> list = new List<ItemTag>
			{
				(ItemTag)3,
				(ItemTag)4,
				(ItemTag)11,
				(ItemTag)7
			};
			CapturedPotentialItemDef.tags = list.ToArray();
			ItemDisplayRuleDict val = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
			val.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = CapturedPotentialPrefab,
					childName = "Head",
					localPos = new Vector3(0f, 0.21647f, 0.01699f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(0.2276f, 0.2276f, 0.2276f)
				}
			});
			val.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = CapturedPotentialPrefab,
					childName = "Head",
					localPos = new Vector3(0f, 0.14004f, -1E-05f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(0.20722f, 0.20722f, 0.20722f)
				}
			});
			val.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = CapturedPotentialPrefab,
					childName = "SideWeapon",
					localPos = new Vector3(-0.00871f, -0.09839f, 0.0979f),
					localAngles = new Vector3(331.6818f, 338.2739f, 310.0308f),
					localScale = new Vector3(0.06386f, 0.06386f, 0.06386f)
				}
			});
			val.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = CapturedPotentialPrefab,
					childName = "Base",
					localPos = new Vector3(0f, 0f, -0.74925f),
					localAngles = new Vector3(0f, 331.2403f, 0f),
					localScale = new Vector3(1.40124f, 1.40124f, 1.40124f)
				}
			});
			val.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = CapturedPotentialPrefab,
					childName = "Chest",
					localPos = new Vector3(0f, 0.54213f, 0.02324f),
					localAngles = new Vector3(28.7177f, 0f, 0f),
					localScale = new Vector3(0.22816f, 0.22816f, 0.22816f)
				}
			});
			val.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = CapturedPotentialPrefab,
					childName = "Head",
					localPos = new Vector3(0f, 0.06614f, -0.02483f),
					localAngles = new Vector3(21.02913f, 0f, 0f),
					localScale = new Vector3(0.14696f, 0.14696f, 0.19114f)
				}
			});
			val.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = CapturedPotentialPrefab,
					childName = "Head",
					localPos = new Vector3(0f, 0.13605f, 0.03262f),
					localAngles = new Vector3(354.4589f, 141.4038f, 4.4072f),
					localScale = new Vector3(0.16594f, 0.16594f, 0.16594f)
				}
			});
			new ItemDisplayRuleDict((ItemDisplayRule[])null);
			ItemAPI.Add(new CustomItem(CapturedPotentialItemDef, val));
			object obj = <>O.<0>__ChangeArraySize;
			if (obj == null)
			{
				hook_OnInventoryChanged val2 = ChangeArraySize;
				<>O.<0>__ChangeArraySize = val2;
				obj = (object)val2;
			}
			CharacterBody.OnInventoryChanged += (hook_OnInventoryChanged)obj;
			object obj2 = <>O.<1>__CardCompatibility;
			if (obj2 == null)
			{
				hook_OnInteractionBegin val3 = CardCompatibility;
				<>O.<1>__CardCompatibility = val3;
				obj2 = (object)val3;
			}
			PurchaseInteraction.OnInteractionBegin += (hook_OnInteractionBegin)obj2;
			ProperSaveCompat();
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static void ProperSaveCompat()
		{
			if (ModCompatability.ProperSaveCompatibility.enabled)
			{
				SaveFile.OnGatherSaveData += SaveFile_OnGatherSaveData;
				Loading.OnLoadingEnded += Loading_OnLoadingStarted;
			}
		}

		[ConCommand(/*Could not decode attribute arguments.*/)]
		private static void EquipArrayIndexUp(ConCommandArgs args)
		{
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: 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_0175: Unknown result type (might be due to invalid IL or missing references)
			CharacterMaster val = (Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderBody.masterObject.GetComponent<CapturedPotentialComponent>()) ? ((ConCommandArgs)(ref args)).senderBody.masterObject.GetComponent<CapturedPotentialComponent>().master : null);
			if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>()) && ((Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderBody.inventory) && ((ConCommandArgs)(ref args)).senderBody.inventory.GetItemCount(CapturedPotentialItemDef) != 0) ? 1 : 0) > (false ? 1 : 0))
			{
				_ = ((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray;
				EquipmentIndex equipmentIndex = (EquipmentIndex)((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray.GetValue(((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray.Length - ((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray.Length);
				Array.Copy(((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray, 1, ((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray, 0, ((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray.Length - 1);
				((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray.SetValue(val.inventory.GetEquipmentIndex(), ((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray.Length - 1);
				val.inventory.SetEquipmentIndex(equipmentIndex);
				if (CapturedPotentialSound.Value)
				{
					EntitySoundManager.EmitSoundServer(AkEventIdArg.op_Implicit(EquipArrayUpSound.akId), ((Component)((ConCommandArgs)(ref args)).senderBody).gameObject);
				}
			}
		}

		[ConCommand(/*Could not decode attribute arguments.*/)]
		private static void EquipArrayIndexDown(ConCommandArgs args)
		{
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: 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)
			CharacterMaster val = (Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderBody.masterObject.GetComponent<CapturedPotentialComponent>()) ? ((ConCommandArgs)(ref args)).senderBody.masterObject.GetComponent<CapturedPotentialComponent>().master : null);
			if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>()) && ((Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderBody.inventory) && ((ConCommandArgs)(ref args)).senderBody.inventory.GetItemCount(CapturedPotentialItemDef) != 0) ? 1 : 0) > (false ? 1 : 0))
			{
				_ = ((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray;
				Array.Reverse(((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray);
				EquipmentIndex equipmentIndex = (EquipmentIndex)((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray.GetValue(((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray.Length - ((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray.Length);
				Array.Copy(((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray, 1, ((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray, 0, ((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray.Length - 1);
				((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray.SetValue(val.inventory.GetEquipmentIndex(), ((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray.Length - 1);
				val.inventory.SetEquipmentIndex(equipmentIndex);
				Array.Reverse(((ConCommandArgs)(ref args)).senderMasterObject.GetComponent<CapturedPotentialComponent>().equipArray);
				if (CapturedPotentialSound.Value)
				{
					EntitySoundManager.EmitSoundServer(AkEventIdArg.op_Implicit(EquipArrayDownSound.akId), ((Component)((ConCommandArgs)(ref args)).senderBody).gameObject);
				}
			}
		}

		private static void CardCompatibility(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator)
		{
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Invalid comparison between I4 and Unknown
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Expected O, but got Unknown
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			CharacterMaster master = ((Component)activator).gameObject.GetComponent<CharacterBody>().master;
			int cost = self.cost;
			if (CaeliImperiumPlugin.CaeliImperium.ConfigBool(CapturedPotentialCard, CapturedPotentialEnableConfig) && Object.op_Implicit((Object)(object)master) && master.hasBody && Object.op_Implicit((Object)(object)master.inventory) && Object.op_Implicit((Object)(object)master.GetBody().masterObject.GetComponent<CapturedPotentialComponent>()) && master.GetBody().masterObject.GetComponent<CapturedPotentialComponent>().equipArray.Contains(Equipment.MultiShopCard.equipmentIndex))
			{
				CharacterBody body = master.GetBody();
				int num = 0;
				if (cost > 0)
				{
					EquipmentIndex[] equipArray = master.GetBody().masterObject.GetComponent<CapturedPotentialComponent>().equipArray;
					for (int i = 0; i < equipArray.Length; i++)
					{
						if ((int)equipArray[i] == (int)Equipment.MultiShopCard.equipmentIndex)
						{
							num++;
						}
					}
					GoldOrb val = new GoldOrb();
					GameObject gameObject = ((Component)self).gameObject;
					Vector3? val2;
					if ((Object)(object)gameObject == (Object)null)
					{
						val2 = null;
					}
					else
					{
						Transform transform = gameObject.transform;
						val2 = (((Object)(object)transform != (Object)null) ? new Vector3?(transform.position) : null);
					}
					((Orb)val).origin = (Vector3)(((??)val2) ?? body.corePosition);
					((Orb)val).target = body.mainHurtBox;
					val.goldAmount = (uint)(0.1f * (float)cost * (float)num);
					OrbManager.instance.AddOrb((Orb)(object)val);
				}
				GameObject gameObject2 = ((Component)self).gameObject;
				ShopTerminalBehavior val3 = (((Object)(object)gameObject2 != (Object)null) ? gameObject2.GetComponent<ShopTerminalBehavior>() : null);
				if (Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)val3.serverMultiShopController))
				{
					val3.serverMultiShopController.SetCloseOnTerminalPurchase(gameObject2.GetComponent<PurchaseInteraction>(), false);
				}
			}
			orig.Invoke(self, activator);
		}

		private static void ChangeArraySize(orig_OnInventoryChanged orig, CharacterBody self)
		{
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (((Object.op_Implicit((Object)(object)self.inventory) && self.inventory.GetItemCount(CapturedPotentialItemDef) != 0) ? 1 : 0) > (false ? 1 : 0) && !Object.op_Implicit((Object)(object)self.masterObject.GetComponent<CapturedPotentialComponent>()))
			{
				CapturedPotentialComponent capturedPotentialComponent = self.masterObject.AddComponent<CapturedPotentialComponent>();
				capturedPotentialComponent.equipArray = (EquipmentIndex[])(object)new EquipmentIndex[0];
				capturedPotentialComponent.master = self.master;
				if (CapturedPotentialEnableDocumentation.Value)
				{
					PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(Documentation.DocumentationItemDef.itemIndex), self.transform.position, self.transform.up * 20f);
				}
			}
		}

		private static void AddLanguageTokens()
		{
			string text = "";
			if (CaeliImperiumPlugin.CaeliImperium.ConfigInt(CapturedPotentialEquipSlotsStack, CapturedPotentialEnableConfig) != 0)
			{
				text = " <style=cStack>(+" + CaeliImperiumPlugin.CaeliImperium.ConfigInt(CapturedPotentialEquipSlotsStack, CapturedPotentialEnableConfig) + " per item stack)</style>";
			}
			LanguageAPI.Add("CAPTUREDPOTENTIAL_NAME", "Captured Potential");
			LanguageAPI.Add("CAPTUREDPOTENTIAL_PICKUP", "Increases equipment slots");
			LanguageAPI.Add("CAPTUREDPOTENTIAL_DESC", "Gain <style=cIsUtility>+" + CaeliImperiumPlugin.CaeliImperium.ConfigInt(CapturedPotentialEquipSlots, CapturedPotentialEnableConfig) + "</style>" + text + " <style=cIsUtility>equipment slots</style>");
			LanguageAPI.Add("CAPTUREDPOTENTIAL_LORE", "<style=cMono>//--ATTEMPT № 45122--//</style>\nVoid: 67.23%\nPressure: 921%\nStatus: <style=cDeath>FAILURE</style>\n\n<style=cMono>//--ATTEMPT № 45123--//</style>\nVoid: 67.23%\nPressure: 922%\nStatus: <style=cDeath>FAILURE</style>\n\n<style=cMono>//--ATTEMPT № 45124--//</style>\nVoid: 67.23%\nPressure: 923%\n<style=cDeath>FAILURE</style>\n\n<style=cMono>//--ATTEMPT № 45125--//</style>\nVoid: 67.23%\nPressure: 924%\nStatus: <style=cDeath>FAILURE</style>\n\n<style=cMono>//--ATTEMPT № 45126--//</style>\nVoid: 67.23%\nPressure: 925%\nStatus: <style=cIsHealing>SUCCESS</style>\n\n<style=cMono>//--ATTEMPT № 45127--//</style>\nVoid: 67.23%\nPressure: 926%\nStatus: <style=cArtifact>「SUCC?SS』</style>\n\n<style=cMono>//--ATTEMPT № 45128--//</style>\n<style=cArtifact>「Vo?d』</style>: 45.452%\nPressure: 927%\n<style=cArtifact>Stat?s: 「??IL?RE』</style>\n\n<style=cMono>//--ATTEMPT № 45129--//</style>\n<style=cArtifact>「Vo?d』: ?3.0?%</style>\n<style=cArtifact>「P??ssu??』</style>: 928%\n<style=cArtifact>??a??s: 「??I????』</style>");
		}

		private static void Loading_OnLoadingStarted(SaveFile file)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			string text = "KitchenSanFiero_CapturedPotentialInventory";
			foreach (CapturedPotentialSaveStructure moddedDatum in file.GetModdedData<List<CapturedPotentialSaveStructure>>(text))
			{
				NetworkUserId NUID = moddedDatum.userID.Load();
				CharacterMaster master = ((IEnumerable<NetworkUser>)NetworkUser.readOnlyInstancesList).FirstOrDefault((Func<NetworkUser, bool>)delegate(NetworkUser Nuser)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_0006: Unknown result type (might be due to invalid IL or missing references)
					//IL_000a: Unknown result type (might be due to invalid IL or missing references)
					NetworkUserId id2 = Nuser.id;
					return ((NetworkUserId)(ref id2)).Equals(NUID);
				}).master;
				GameObject masterObject = ((IEnumerable<NetworkUser>)NetworkUser.readOnlyInstancesList).FirstOrDefault((Func<NetworkUser, bool>)delegate(NetworkUser Nuser)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_0006: Unknown result type (might be due to invalid IL or missing references)
					//IL_000a: Unknown result type (might be due to invalid IL or missing references)
					NetworkUserId id = Nuser.id;
					return ((NetworkUserId)(ref id)).Equals(NUID);
				}).masterObject;
				EquipmentIndex[] array = (EquipmentIndex[])(object)new EquipmentIndex[0];
				int num = 0;
				Debug.Log((object)master);
				EquipmentIndex[] equipInventory = moddedDatum.EquipInventory;
				foreach (EquipmentIndex val in equipInventory)
				{
					Array.Resize(ref array, num + 1);
					array.SetValue(val, num);
					num++;
				}
				Debug.Log((object)array.Length);
				Debug.Log(array.GetValue(0));
				CapturedPotentialComponent capturedPotentialComponent = masterObject.AddComponent<CapturedPotentialComponent>();
				capturedPotentialComponent.master = master;
				capturedPotentialComponent.equipArray = array;
			}
		}

		private static void SaveFile_OnGatherSaveData(Dictionary<string, object> dictionary)
		{
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//