Decompiled source of 1nsiderItems v1.2.0

InsiderItems.dll

Decompiled 2 days 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.Versioning;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using InsiderItems.Behaviours;
using InsiderItems.Buffs;
using InsiderItems.Effects;
using InsiderItems.Flags;
using InsiderItems.Items;
using On.EntityStates;
using On.RoR2;
using R2API;
using RoR2;
using RoR2.Orbs;
using TMPro;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;

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

		public abstract string ArtifactName { get; }

		public abstract string ArtifactLangTokenName { get; }

		public abstract string ArtifactDescription { get; }

		public abstract Sprite ArtifactEnabledIcon { get; }

		public abstract Sprite ArtifactDisabledIcon { get; }

		public bool ArtifactEnabled => RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef);

		public abstract void Init(ConfigFile config);

		protected void CreateLang()
		{
			LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_NAME", ArtifactName);
			LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION", ArtifactDescription);
		}

		protected void CreateArtifact()
		{
			ArtifactDef = ScriptableObject.CreateInstance<ArtifactDef>();
			ArtifactDef.cachedName = "ARTIFACT_" + ArtifactLangTokenName;
			ArtifactDef.nameToken = "ARTIFACT_" + ArtifactLangTokenName + "_NAME";
			ArtifactDef.descriptionToken = "ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION";
			ArtifactDef.smallIconSelectedSprite = ArtifactEnabledIcon;
			ArtifactDef.smallIconDeselectedSprite = ArtifactDisabledIcon;
			ContentAddition.AddArtifactDef(ArtifactDef);
		}

		public abstract void Hooks();
	}
	public abstract class ArtifactBase<T> : ArtifactBase where T : ArtifactBase<T>
	{
		public static T instance { get; private set; }

		public ArtifactBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ArtifactBase was instantiated twice");
			}
			instance = this as T;
		}
	}
	public class Assets
	{
		public static AssetBundle resources;

		public static AssetBundle resources2;

		private const string ModPrefix = "@InsidersItems:";

		internal static void Init()
		{
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("InsiderItems.1nsideritems"))
			{
				resources = AssetBundle.LoadFromStream(stream);
			}
			using Stream stream2 = Assembly.GetExecutingAssembly().GetManifestResourceStream("InsiderItems.1nsiderpack2");
			resources2 = AssetBundle.LoadFromStream(stream2);
		}
	}
	public abstract class BuffBase
	{
		public BuffDef Def;

		public abstract string BuffName { get; }

		public abstract string BuffLangTokenName { get; }

		public abstract bool CanStack { get; }

		public abstract Sprite BuffIcon { get; }

		public void Init()
		{
			CreateLang();
			CreateItem();
			Hooks();
		}

		protected virtual void CreateLang()
		{
			LanguageAPI.Add("INS_BUFF_" + BuffLangTokenName + "_NAME", BuffName);
		}

		protected void CreateItem()
		{
			Def = ScriptableObject.CreateInstance<BuffDef>();
			((Object)Def).name = "INS_BUFF_" + BuffLangTokenName + "_NAME";
			Def.iconSprite = BuffIcon;
			Def.canStack = CanStack;
			ContentAddition.AddBuffDef(Def);
		}

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

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

		public abstract GameObject EffectResource { get; }

		public void Init()
		{
			CreateEffect();
		}

		protected void CreateEffect()
		{
			Prefab = EffectResource;
			Prefab.AddComponent<EffectComponent>();
			Prefab.AddComponent<VFXAttributes>();
			ContentAddition.AddEffect(Prefab);
		}
	}
	public abstract class EffectBase<T> : EffectBase where T : EffectBase<T>
	{
		public static T instance { get; private set; }

		public EffectBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting EffectBase was instantiated twice");
			}
			instance = this as T;
		}
	}
	internal class EmployeeBadge : ItemBase<EmployeeBadge>
	{
		private ConfigEntry<float> luck;

		private ConfigEntry<int> amount;

		public override string ItemName => "Employee Badge";

		public override string ItemLangTokenName => "BADGE";

		public override string ItemPickupDesc => "Chests have a chance to drop an extra item.";

		public override string ItemFullDescription => "Chests have a <style=cIsDamage>" + luck.Value + "%</style> <style=cStack>(+" + luck.Value / 2f + "% per stack)</style> chance to drop an <style=cIsUtility>extra item</style>.";

		public override string ItemLore => "\"Sir, how are we supposed to get the extra cargo from the chests? We aren't royalty.\"\n\r\n\rCards are passed out to each trooper.\n\r\n\r\"Employee cards let us use a backdoor, so each and every one of you will be getting one. They will be returned afterwards, however, so don't get any ideas.\"";

		public override ItemTier Tier => (ItemTier)2;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/employee/employeecard.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/employee_icon/finish.png");

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

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

		public override void CreateConfig(ConfigFile config)
		{
			luck = config.Bind<float>("Item: " + ItemName, "Chance", 10f, "Chance to drop an extra item(s)? (stacks are half this value)");
			amount = config.Bind<int>("Item: " + ItemName, "Amount", 1, "How many extra items?");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		public void EmployeeBadgeFunction(orig_ItemDrop orig, ChestBehavior self)
		{
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active)
			{
				return;
			}
			int num = 0;
			int num2 = 0;
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				if ((Object)(object)instance.master.GetBody() != (Object)null)
				{
					num += instance.master.GetBody().inventory.GetItemCount(ItemBase<EmployeeBadge>.instance.ItemDef);
					num2 += instance.master.GetBody().inventory.GetItemCount(Items.Clover);
				}
			}
			if (num > 0)
			{
				self.tier3Chance += 0.1f + 0.05f * (float)(num - 1);
				if (Util.CheckRoll(luck.Value + luck.Value / 2f * (float)(num - 1), (float)num2, (CharacterMaster)null))
				{
					self.dropCount += amount.Value;
				}
			}
			if (!(self.dropPickup == PickupIndex.none) && self.dropCount >= 1)
			{
				float num3 = 360f / (float)self.dropCount;
				Vector3 val = Vector3.up * self.dropUpVelocityStrength + self.dropTransform.forward * self.dropForwardVelocityStrength;
				Quaternion val2 = Quaternion.AngleAxis(num3, Vector3.up);
				for (int i = 0; i < self.dropCount; i++)
				{
					PickupDropletController.CreatePickupDroplet(self.dropPickup, self.dropTransform.position + Vector3.up * 1.5f, val);
					val = val2 * val;
					self.Roll();
				}
				self.dropPickup = PickupIndex.none;
			}
		}
	}
	public abstract class EquipmentBase
	{
		public enum TargetingType
		{
			Enemies,
			Friendlies
		}

		public class TargetingControllerComponent : MonoBehaviour
		{
			public GameObject TargetObject;

			public GameObject VisualizerPrefab;

			public Indicator Indicator;

			public BullseyeSearch TargetFinder;

			public Action<BullseyeSearch> AdditionalBullseyeFunctionality = delegate
			{
			};

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

			public void OnDestroy()
			{
				Invalidate();
			}

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

			public void ConfigureTargetFinderBase(EquipmentSlot self)
			{
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_0067: 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_0082: Unknown result type (might be due to invalid IL or missing references)
				//IL_0087: 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_0099: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Expected O, but got Unknown
				if (TargetFinder == null)
				{
					TargetFinder = new BullseyeSearch();
				}
				TargetFinder.teamMaskFilter = TeamMask.allButNeutral;
				((TeamMask)(ref TargetFinder.teamMaskFilter)).RemoveTeam(self.characterBody.teamComponent.teamIndex);
				TargetFinder.sortMode = (SortMode)2;
				TargetFinder.filterByLoS = true;
				float num = default(float);
				Ray val = CameraRigController.ModifyAimRayIfApplicable(self.GetAimRay(), ((Component)self).gameObject, ref num);
				TargetFinder.searchOrigin = ((Ray)(ref val)).origin;
				TargetFinder.searchDirection = ((Ray)(ref val)).direction;
				TargetFinder.maxAngleFilter = 10f;
				TargetFinder.viewer = self.characterBody;
			}

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

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

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

		public EquipmentDef EquipmentDef;

		public GameObject TargetingIndicatorPrefabBase = null;

		public static Shader HGstandard = LegacyResourcesAPI.Load<Shader>("Shaders/Deferred/HGStandard");

		public abstract string EquipmentName { get; }

		public abstract string EquipmentLangTokenName { get; }

		public abstract string EquipmentPickupDesc { get; }

		public abstract string EquipmentFullDescription { get; }

		public abstract string EquipmentLore { get; }

		public abstract GameObject EquipmentModel { get; }

		public abstract Sprite EquipmentIcon { get; }

		public virtual bool AppearsInSinglePlayer => true;

		public virtual bool AppearsInMultiPlayer => true;

		public virtual bool CanDrop => true;

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


		public virtual bool EnigmaCompatible => true;

		public virtual bool IsBoss => false;

		public virtual bool IsLunar => false;

		public virtual bool UseTargeting => false;

		public virtual TargetingType TargetingTypeEnum => TargetingType.Enemies;

		public abstract ItemDisplayRuleDict CreateItemDisplayRules();

		public abstract void Init(ConfigFile config);

		protected virtual void CreateConfig(ConfigFile config)
		{
		}

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

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

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

		protected abstract bool ActivateEquipment(EquipmentSlot slot);

		public virtual void Hooks()
		{
		}

		public static GameObject UpdateGameObjectShader(GameObject originalModel, bool dither = true)
		{
			if (Object.op_Implicit((Object)(object)originalModel))
			{
				MeshRenderer[] componentsInChildren = originalModel.GetComponentsInChildren<MeshRenderer>();
				foreach (MeshRenderer val in componentsInChildren)
				{
					if (Object.op_Implicit((Object)(object)val))
					{
						((Renderer)val).material.shader = HGstandard;
						if (dither)
						{
							((Renderer)val).material.EnableKeyword("DITHER");
						}
					}
				}
				return originalModel;
			}
			return null;
		}

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

		public EquipmentBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting EquipmentBoilerplate/Equipment was instantiated twice");
			}
			instance = this as T;
		}
	}
	[BepInPlugin("1nsider.1nsiderItems", "1nsiderItems", "1.2.0")]
	[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.*/)]
	public class Initializer : BaseUnityPlugin
	{
		public const string pluginGUID = "1nsider.1nsiderItems";

		public const string pluginAuthor = "1nsider";

		public const string pluginName = "1nsiderItems";

		public const string pluginVersion = "1.1.15";

		public bool debugEnabled = false;

		internal static ManualLogSource Logger;

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

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

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

		public List<ArtifactBase> Artifacts = new List<ArtifactBase>();

		public void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Log.Init(Logger);
			Assets.Init();
			debugEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "Enable Debug Spawning", false, "Using F2 spawns all items added.").Value;
			IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase))
				select type;
			foreach (Type item in enumerable)
			{
				ItemBase itemBase = (ItemBase)Activator.CreateInstance(item);
				if (ValidateItem(itemBase, Items))
				{
					itemBase.Init(((BaseUnityPlugin)this).Config);
				}
			}
			IEnumerable<Type> enumerable2 = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(EquipmentBase))
				select type;
			foreach (Type item2 in enumerable2)
			{
				EquipmentBase equipmentBase = (EquipmentBase)Activator.CreateInstance(item2);
				if (ValidateEquipment(equipmentBase, Equipments))
				{
					equipmentBase.Init(((BaseUnityPlugin)this).Config);
				}
			}
			IEnumerable<Type> enumerable3 = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(BuffBase))
				select type;
			foreach (Type item3 in enumerable3)
			{
				BuffBase buffBase = (BuffBase)Activator.CreateInstance(item3);
				buffBase.Init();
			}
			IEnumerable<Type> enumerable4 = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(ArtifactBase))
				select type;
			foreach (Type item4 in enumerable4)
			{
				ArtifactBase artifactBase = (ArtifactBase)Activator.CreateInstance(item4);
				artifactBase.Init(((BaseUnityPlugin)this).Config);
			}
			IEnumerable<Type> enumerable5 = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(EffectBase))
				select type;
			foreach (Type item5 in enumerable5)
			{
				EffectBase effectBase = (EffectBase)Activator.CreateInstance(item5);
				effectBase.Init();
			}
		}

		[SystemInitializer(new Type[] { typeof(ItemTierCatalog) })]
		private static void RunItemDef(ItemBase item)
		{
		}

		private void Update()
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Invalid comparison between Unknown and I4
			//IL_007a: 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_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: 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_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			if (!Input.GetKeyDown((KeyCode)283) || !debugEnabled)
			{
				return;
			}
			Transform transform = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform;
			foreach (ItemBase item in Items)
			{
				if ((int)item.Tier != 5)
				{
					PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(item.ItemDef.itemIndex), transform.position, transform.forward * 20f);
				}
			}
			foreach (EquipmentBase equipment in Equipments)
			{
				PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(equipment.EquipmentDef.equipmentIndex), transform.position, transform.forward * 20f);
			}
		}

		public bool ValidateItem(ItemBase item, List<ItemBase> itemList)
		{
			string text = item.ItemName.Replace("'", "").Replace("-", "");
			bool value = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + text, "Enable Item?", true, "Should this item appear in runs?").Value;
			bool value2 = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + text, "Blacklist Item from AI Use?", false, "Should the AI not be able to obtain this item?").Value;
			if (value)
			{
				itemList.Add(item);
				if (value2)
				{
					item.AIBlacklisted = true;
				}
			}
			return value;
		}

		public bool ValidateEquipment(EquipmentBase equipment, List<EquipmentBase> equipmentList)
		{
			string text = equipment.EquipmentName.Replace("'", "").Replace("-", "");
			if (((BaseUnityPlugin)this).Config.Bind<bool>("Equipment: " + text, "Enable Equipment?", true, "Should this equipment appear in runs?").Value)
			{
				equipmentList.Add(equipment);
				return true;
			}
			return false;
		}
	}
	public abstract class ItemBase
	{
		public ItemDef ItemDef;

		public static Shader HGstandard = LegacyResourcesAPI.Load<Shader>("Shaders/Deferred/HGStandard");

		public abstract string ItemName { get; }

		public abstract string ItemLangTokenName { get; }

		public abstract string ItemPickupDesc { get; }

		public abstract string ItemFullDescription { get; }

		public abstract string ItemLore { get; }

		public abstract ItemTier Tier { get; }

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


		public abstract GameObject ItemModel { get; }

		public abstract Sprite ItemIcon { get; }

		public virtual bool CanRemove => true;

		public virtual bool AIBlacklisted { get; set; } = false;


		public virtual bool NaturalShader { get; set; } = false;


		public virtual bool IsVoid => false;

		public virtual ItemDef VoidReplacementDef { get; }

		public virtual bool IsHidden => false;

		public virtual UnlockableDef UnlockableDef { get; set; } = null;


		public abstract void Init(ConfigFile config);

		public virtual void CreateConfig(ConfigFile config)
		{
		}

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

		public abstract ItemDisplayRuleDict CreateItemDisplayRules();

		protected void CreateItem()
		{
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Expected O, but got Unknown
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Expected O, but got Unknown
			if (AIBlacklisted)
			{
				ItemTags = new List<ItemTag>(ItemTags) { (ItemTag)4 }.ToArray();
			}
			if (!NaturalShader)
			{
				UpdateGameObjectShader(ItemModel);
			}
			ItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)ItemDef).name = ItemLangTokenName;
			ItemDef.nameToken = "INS_ITEM_" + ItemLangTokenName + "_NAME";
			ItemDef.pickupToken = "INS_ITEM_" + ItemLangTokenName + "_PICKUP";
			ItemDef.descriptionToken = "INS_ITEM_" + ItemLangTokenName + "_DESCRIPTION";
			ItemDef.loreToken = "INS_ITEM_" + ItemLangTokenName + "_LORE";
			ItemDef.pickupModelPrefab = ItemModel;
			ItemDef.pickupIconSprite = ItemIcon;
			ItemDef.hidden = IsHidden;
			ItemDef.canRemove = CanRemove;
			ItemDef.deprecatedTier = Tier;
			if (ItemTags.Length != 0)
			{
				ItemDef.tags = ItemTags;
			}
			ItemAPI.Add(new CustomItem(ItemDef, CreateItemDisplayRules()));
			if (IsVoid)
			{
				ItemCatalog.SetItemRelationships += (hook_SetItemRelationships)delegate(orig_SetItemRelationships orig, ItemRelationshipProvider[] providers)
				{
					//IL_0021: Unknown result type (might be due to invalid IL or missing references)
					//IL_0041: Unknown result type (might be due to invalid IL or missing references)
					//IL_0043: Unknown result type (might be due to invalid IL or missing references)
					ItemRelationshipProvider val = ScriptableObject.CreateInstance<ItemRelationshipProvider>();
					val.relationshipType = ItemRelationshipTypes.ContagiousItem;
					ItemRelationshipProvider val2 = val;
					Pair[] array = (Pair[])(object)new Pair[1];
					int num = 0;
					array[num] = new Pair
					{
						itemDef1 = VoidReplacementDef,
						itemDef2 = ItemDef
					};
					val2.relationships = array;
					orig.Invoke(providers.Concat((IEnumerable<ItemRelationshipProvider>)(object)new ItemRelationshipProvider[1] { val }).ToArray());
				};
			}
		}

		public virtual void Hooks()
		{
		}

		public virtual void CreateAchievementLang()
		{
		}

		public static GameObject UpdateGameObjectShader(GameObject originalModel, bool dither = true)
		{
			if (Object.op_Implicit((Object)(object)originalModel))
			{
				MeshRenderer[] componentsInChildren = originalModel.GetComponentsInChildren<MeshRenderer>();
				foreach (MeshRenderer val in componentsInChildren)
				{
					if (Object.op_Implicit((Object)(object)val))
					{
						((Renderer)val).material.shader = HGstandard;
						if (dither)
						{
							((Renderer)val).material.EnableKeyword("DITHER");
						}
					}
				}
				return originalModel;
			}
			return null;
		}

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

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

		public int GetCountSpecific(CharacterBody body, ItemDef itemDef)
		{
			if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
			{
				return 0;
			}
			return body.inventory.GetItemCount(itemDef);
		}
	}
	public abstract class ItemBase<T> : ItemBase where T : ItemBase<T>
	{
		public static T instance { get; private set; }

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

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

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

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

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

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

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

		internal static void LogWarning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
}
namespace InsiderItems.Items
{
	internal class Accelerator : ItemBase<Accelerator>
	{
		private ConfigEntry<float> boost;

		private ConfigEntry<int> chance;

		public override string ItemName => "Charged Bullet Accelerator";

		public override string ItemLangTokenName => "ACCELERATOR";

		public override string ItemPickupDesc => "Each shot fired has a chance to deal much higher damage.";

		public override string ItemFullDescription => "When firing, each shot has a <style=cIsDamage>" + chance.Value + "% chance</style> to have an additional <style=cIsDamage>" + boost.Value * 10f + "% damage</style> <style=cStack>(+" + boost.Value * 10f / 4f + "% per stack)</style>.";

		public override string ItemLore => "The attachment whirrs lowly. It's barely audible.\n\r\n\rFlipping the switch, it switches into a higher gear, and begins whirring far louder.\n\r\n\rIt's deafening.\n\r\n\rHe fires the shot, killing thousands in one shot.\n\r\n\rHe falls dead from electric shock.\n\r\n\r\"No good. These bullet accelerators have killed more of our men than beasts.\"\n\r\n\r\"Will we get rid of them?\"\n\r\n\r\"No.\"";

		public override ItemTier Tier => (ItemTier)2;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/accel/box.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/accel/finish.png");

		public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 };

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

		public override void CreateConfig(ConfigFile config)
		{
			boost = config.Bind<float>("Item: " + ItemName, "Damage Increase", 10f, "By how much should the damage be multiplied? (10 = 1000%, etc.)");
			chance = config.Bind<int>("Item: " + ItemName, "Chance", 5, "Chance to spike damage? (5 = 5%, 10 = 10%, etc.)");
		}

		public override void CreateAchievementLang()
		{
			LanguageAPI.Add("INSIDER_ONEHITBOSS_ACHIEVEMENT_NAME", "Power Move");
			LanguageAPI.Add("INSIDER_ONEHITBOSS_ACHIEVEMENT_DESCRIPTION", "Kill an elite by dealing damage equal to their health.");
			ItemDef.unlockableDef = UnlockableDef;
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		public void Explode(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo info, GameObject victim)
		{
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, info, victim);
			if (!NetworkServer.active || !Object.op_Implicit((Object)(object)info.attacker) || !Object.op_Implicit((Object)(object)victim) || !Object.op_Implicit((Object)(object)info.attacker.GetComponent<CharacterBody>()) || !Object.op_Implicit((Object)(object)victim.GetComponent<CharacterBody>()))
			{
				return;
			}
			CharacterBody component = victim.GetComponent<CharacterBody>();
			CharacterBody component2 = info.attacker.GetComponent<CharacterBody>();
			if (!((Object)(object)component2.inventory == (Object)null))
			{
				int itemCount = component2.inventory.GetItemCount(ItemBase<Accelerator>.instance.ItemDef);
				if (itemCount > 0 && Util.CheckRoll((float)chance.Value, component2.master))
				{
					info.procCoefficient = 1f;
					info.force = Vector3.zero;
					info.damage *= boost.Value + boost.Value / 4f * (float)(itemCount - 1);
					info.damageType = DamageTypeCombo.op_Implicit((DamageType)0);
					info.damageColorIndex = (DamageColorIndex)3;
					((Component)component).GetComponent<HealthComponent>().TakeDamage(info);
				}
			}
		}
	}
	internal class AppleJuice : ItemBase<AppleJuice>
	{
		private ConfigEntry<float> boost;

		private ConfigEntry<float> boost2;

		public override string ItemName => "Juicy Apple";

		public override string ItemLangTokenName => "JUICECUP";

		public override string ItemPickupDesc => "Gain health and shield.";

		public override string ItemFullDescription => "Gain <style=cIsHealing>+" + boost.Value * 100f + "% health</style> <style=cStack>(+" + boost.Value * 100f + "% per stack)</style> and <style=cIsUtility>+" + boost2.Value * 100f + "% shield</style> <style=cStack>(+" + boost2.Value * 100f + "% per stack)</style>.";

		public override string ItemLore => "Does |||| want some apple slices? Yes he does!\n\r\n\rYes he does...";

		public override ItemTier Tier => (ItemTier)0;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/apple/apple.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/apple/finish.png");

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

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

		public override void CreateConfig(ConfigFile config)
		{
			boost = config.Bind<float>("Item: " + ItemName, "Health Gain", 0.04f, "How much health should be given?");
			boost2 = config.Bind<float>("Item: " + ItemName, "Shield Gain", 0.04f, "How much shield should be given?");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		public void HealthIncrease(CharacterBody body, StatHookEventArgs args)
		{
			int count = ItemBase<AppleJuice>.instance.GetCount(body);
			if (count > 0)
			{
				args.healthMultAdd += boost.Value * (float)count;
				args.baseShieldAdd += boost2.Value * (float)count * body.maxHealth;
			}
		}
	}
	internal class BitterRoot : ItemBase<BitterRoot>
	{
		private ConfigEntry<float> boost;

		public override string ItemName => "Odd Egg";

		public override string ItemLangTokenName => "BITTERROOT";

		public override string ItemPickupDesc => "Gain extra health.";

		public override string ItemFullDescription => "Gain an extra <style=cIsHealing>" + boost.Value * 100f + "% health</style> <style=cStack>(+" + boost.Value * 100f + "% per stack)</style>.";

		public override string ItemLore => "An egg, grown from a relic long past.";

		public override ItemTier Tier => (ItemTier)0;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/egg/egg.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/egg/finish.png");

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

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

		public override void CreateConfig(ConfigFile config)
		{
			boost = config.Bind<float>("Item: " + ItemName, "Health Increase", 0.08f, "How much extra health is given?");
		}

		public override void CreateAchievementLang()
		{
			LanguageAPI.Add("INSIDER_MXKILLSOUL_ACHIEVEMENT_NAME", "Truly Odd");
			LanguageAPI.Add("INSIDER_MXKILLSOUL_ACHIEVEMENT_DESCRIPTION", "Beat the game through the final boss while using Changeling Soul.");
			ItemDef.unlockableDef = UnlockableDef;
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		public void HealthIncrease(CharacterBody body, StatHookEventArgs args)
		{
			args.healthMultAdd += boost.Value * (float)ItemBase<BitterRoot>.instance.GetCount(body);
		}
	}
	internal class BlankSlate : ItemBase<BlankSlate>
	{
		private ConfigEntry<int> boost;

		public override string ItemName => "Blank Slate";

		public override string ItemLangTokenName => "SLATE";

		public override string ItemPickupDesc => "Gain barrier by hitting enemies. <style=cIsVoid>Corrupts all Topaz Brooches</style>.";

		public override string ItemFullDescription => "Hitting enemies gives <style=cIsUtility>+" + boost.Value + " barrier</style> <style=cStack>(+1 per stack)</style>. <style=cIsVoid>Corrupts all Topaz Brooches</style>.";

		public override string ItemLore => "\"What one takes from another may be great,\n\r\n\rhowever, one may take small bits forever,\n\r\n\runtil a whole is complete.\" - ???, UES Contact Light";

		public override ItemTier Tier => (ItemTier)6;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/slate/slate.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/slate/finish.png");

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

		public override bool IsVoid => true;

		public override ItemDef VoidReplacementDef => Items.BarrierOnKill;

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

		public override void CreateConfig(ConfigFile config)
		{
			boost = config.Bind<int>("Item: " + ItemName, "Barrier Gain", 3, "How much barrier should be given on hit?");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		public void TempBarrier(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo info, GameObject victim)
		{
			orig.Invoke(self, info, victim);
			if (!NetworkServer.active || (Object)(object)info.attacker == (Object)null || !Object.op_Implicit((Object)(object)info.attacker.GetComponent<CharacterBody>()) || !Object.op_Implicit((Object)(object)victim.GetComponent<CharacterBody>()))
			{
				return;
			}
			CharacterBody component = info.attacker.GetComponent<CharacterBody>();
			if (!((Object)(object)component.inventory == (Object)null))
			{
				int itemCount = component.inventory.GetItemCount(ItemBase<BlankSlate>.instance.ItemDef);
				if (itemCount > 0 && Object.op_Implicit((Object)(object)((Component)component).GetComponent<HealthComponent>()))
				{
					((Component)component).GetComponent<HealthComponent>().AddBarrier((float)(boost.Value + (itemCount - 1)));
				}
			}
		}
	}
	internal class Bread : ItemBase<Bread>
	{
		private ConfigEntry<float> boost;

		public override string ItemName => "Tumorous Bread";

		public override string ItemLangTokenName => "TUMORBREAD";

		public override string ItemPickupDesc => "Heal when beginning a teleporter event.";

		public override string ItemFullDescription => "<style=cIsHealing>Heal for " + boost.Value * 100f + "%</style> <style=cStack>(+" + boost.Value * 100f / 2f + "% per stack)</style> of your <style=cIsHealing>maximum health</style> when beginning a teleporter event.";

		public override string ItemLore => "<style=cEvent>[Laughing]</style> \"So, we're fine. As long as nobody teleports any bread.\"\n\r\n\r\"Question.\"\n\r\n\r\"What's your question, soldier?\"\n\r\n\r\"I teleported bread.\"\n\r\n\r\"... You what?\"\n\r\n\r\"You told me to!\"\n\r\n\r\"How... much...?\"\n\r\n\r\"I have done nothing but teleport bread for three days.\"\n\r\n\r<style=cEvent>[ Crashing is heard nearby, transmission ends. ]</style>";

		public override ItemTier Tier => (ItemTier)1;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/bread/bread.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/bread/finish.png");

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

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

		public override void CreateConfig(ConfigFile config)
		{
			boost = config.Bind<float>("Item: " + ItemName, "Health Boost", 0.2f, "How much max health (by percent) is regained when activated?");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			TeleporterInteraction.onTeleporterBeginChargingGlobal += TeleporterInteraction_onTeleporterBeginChargingGlobal;
		}

		private void TeleporterInteraction_onTeleporterBeginChargingGlobal(TeleporterInteraction obj)
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				CharacterBody body = instance.body;
				if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory))
				{
					int count = GetCount(body);
					if (count > 0)
					{
						body.healthComponent.HealFraction(boost.Value, default(ProcChainMask));
					}
				}
			}
		}
	}
	internal class CandyBracelet : ItemBase<CandyBracelet>
	{
		private ConfigEntry<float> boost;

		public override string ItemName => "Candy Bracelet";

		public override string ItemLangTokenName => "CANDYBRACELET";

		public override string ItemPickupDesc => "Using your equipment heals you.";

		public override string ItemFullDescription => "Using your equipment <style=cIsHealing>heals " + boost.Value * 100f + "%</style> <style=cStack>(+" + boost.Value * 100f + "% per stack)</style> of your health.";

		public override string ItemLore => "Order: Candy Bracelets (20-Pack)\r\nTracking Number: 146**********\r\nEstimated Delivery: 02/14/2056\r\nShipping Method:  Standard\r\nShipping Address: Timviech Elementary School, Earth\r\nShipping Details: \r\n\r\nAs you wanted, a 20-pack of candy bracelets for you and your favorite class! I know you like them a lot, so I got you the best kind we had in stock. Hope you have a good Valentine's Day!";

		public override ItemTier Tier => (ItemTier)0;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/candy/candy.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/candy_icon/finish.png");

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

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

		public override void CreateConfig(ConfigFile config)
		{
			boost = config.Bind<float>("Item: " + ItemName, "Healing Amount", 0.05f, "How much health is given on use (by percent)?");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			EquipmentSlot.onServerEquipmentActivated += UseEquipment;
		}

		public void UseEquipment(EquipmentSlot slot, EquipmentIndex index)
		{
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active)
			{
				return;
			}
			CharacterBody characterBody = slot.characterBody;
			if ((Object)(object)characterBody != (Object)null && (Object)(object)characterBody.inventory != (Object)null)
			{
				int itemCount = characterBody.inventory.GetItemCount(ItemBase<CandyBracelet>.instance.ItemDef);
				if (itemCount > 0)
				{
					slot.characterBody.healthComponent.HealFraction(boost.Value * (float)itemCount, default(ProcChainMask));
				}
			}
		}
	}
	internal class Cards : ItemBase<Cards>
	{
		private ConfigEntry<float> boost;

		public override string ItemName => "Near-Empty Deck";

		public override string ItemLangTokenName => "PLAYINGCARDS";

		public override string ItemPickupDesc => "Gain <style=cIsUtility>brief, low protection</style> after attacking.";

		public override string ItemFullDescription => "Gain a <style=cIsUtility>small armor boost</style> for " + boost.Value + " <style=cStack>(+" + boost.Value + " per stack)</style> seconds after <style=cIsUtility>using any move</style>.";

		public override string ItemLore => "A small-sized deck of playing cards. Or, playing card.\n\rThere lies only one card in this deck, that being the lone Joker card.";

		public override ItemTier Tier => (ItemTier)0;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/cards/box.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/cards/finish.png");

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

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

		public override void CreateConfig(ConfigFile config)
		{
			boost = config.Bind<float>("Item: NearEmpty Deck", "Buff Time", 0.25f, "How long does the buff last?");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		private void CharacterBody_OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill)
		{
			orig.Invoke(self, skill);
			if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.skillLocator))
			{
				float value = boost.Value;
				int count = GetCount(self);
				if (count > 0)
				{
					self.AddTimedBuff(Buffs.SmallArmorBoost, value * (float)count);
				}
			}
		}
	}
	internal class ChangelingSoul : ItemBase<ChangelingSoul>
	{
		private static string[] removes = new string[51]
		{
			"AffixEarthHealerBody", "BirdsharkBody", "ArtifactShellBody", "AssassinBody", "AltarSkeletonBody", "BackupDroneBody", "BackupDroneOldBody", "BeetleCrystalBody", "BeetleGuardAllyBody", "BeetleGuardCrystalBody",
			"BeetleWard", "BrotherGlassBody", "DeathProjectile", "EmergencyDroneBody", "Drone2Body", "DroneCommanderBody", "EmergencyDroneBody", "ExplosivePotDestructibleBody", "FusionCellDestructibleBody", "GolemBodyInvincible",
			"GravekeeperTrackingFireball", "HaulerBody", "LemurianBruiserBody", "LunarWispTrackingBomb", "MinorConstructAttachableBody", "MinorConstructBody", "MinorConstructOnKillBody", "NullifierBody", "OilBeetle", "PaladinBody",
			"ParentPodBody", "Pot2Body", "PotMobileBody", "SMInfiniteTowerMaulingRockLarge", "SMInfiniteTowerMaulingRockMedium", "SMInfiniteTowerMaulingRockSmall", "SMMaulingRockLarge", "SMMaulingRockMedium", "SMMaulingRockSmall", "ScavSackProjectile",
			"ShopkeeperBody", "SpectatorBody", "SpectatorSlowBody", "SulfurPodBody", "TimeCrystalBody", "UrchinTurretBody", "VagrantTrackingBomb", "VoidBarnacleNoCastBody", "VoidRaidCrabJointBody", "VoidInfestorBody",
			"VultureEggBody"
		};

		public override string ItemName => "Changeling Soul";

		public override string ItemLangTokenName => "SOUL";

		public override string ItemPickupDesc => "Become another entity when levelling up.";

		public override string ItemFullDescription => "Every time you <style=cIsUtility>level up</style>, become another entity <style=cStack>(-1 seconds to cooldowns per stack)</style>. The entity may be a <style=cIsUtility>survivor</style>, <style=cDeath>enemy</style>, or even a <style=cShrine>boss</style>.";

		public override string ItemLore => "Changing.\n\r\n\rEver changing.\n\r\n\rNever complete, always fractions.\n\r\n\rNothing is ever the same.\n\r\n\rReality is but an illusion to a Changeling.";

		public override ItemTier Tier => (ItemTier)3;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/spirit/soul.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/spirit/finish.png");

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

		public override bool NaturalShader => true;

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

		public override void CreateConfig(ConfigFile config)
		{
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0010: 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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Expected O, but got Unknown
			ItemDisplayRule[] array = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			array[0].ruleType = (ItemDisplayRuleType)0;
			array[0].followerPrefab = ItemModel;
			array[0].childName = "Head";
			array[0].localScale = new Vector3(0.3f, 0.3f, 0.3f);
			array[0].localAngles = new Vector3(0f, 180f, 0f);
			array[0].localPos = new Vector3(0f, 0f, 0f);
			return new ItemDisplayRuleDict(array);
		}

		public override void Hooks()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			GlobalEventManager.onCharacterLevelUp += GlobalEventManager_onCharacterLevelUp;
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(SoulIncrease);
		}

		public static void SoulIncrease(CharacterBody body, StatHookEventArgs args)
		{
			if (NetworkServer.active && (Object)(object)body != (Object)null && (Object)(object)body.inventory != (Object)null)
			{
				int itemCount = body.inventory.GetItemCount(ItemBase<ChangelingSoul>.instance.ItemDef);
				if (itemCount > 1)
				{
					args.cooldownReductionAdd += (float)(itemCount - 1);
				}
			}
		}

		public static void GlobalEventManager_onCharacterLevelUp(CharacterBody body)
		{
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)body != (Object)null) || !((Object)(object)body.inventory != (Object)null) || !NetworkServer.active)
			{
				return;
			}
			int itemCount = body.inventory.GetItemCount(ItemBase<ChangelingSoul>.instance.ItemDef);
			if (itemCount <= 0)
			{
				return;
			}
			List<GameObject> list = new List<GameObject>();
			foreach (GameObject allBodyPrefab in BodyCatalog.allBodyPrefabs)
			{
				list.Add(allBodyPrefab);
			}
			string[] array = removes;
			foreach (string text in array)
			{
				list.Remove(BodyCatalog.FindBodyPrefab(text));
			}
			body.master.bodyPrefab = list[RoR2Application.rng.RangeInt(0, list.Count)];
			Log.LogInfo("ChangelingSoul: changed into " + ((Object)body.master.bodyPrefab).name);
			body.AddTimedBuff(Buffs.Immune, 6f);
			bool value = Stage.stage1PodConVar.value;
			Stage.stage1PodConVar.SetBool(false);
			body.master.Respawn(body.master.GetBody().transform.position, body.master.GetBody().transform.rotation, false);
			Stage.stage1PodConVar.SetBool(value);
		}
	}
	internal class Charger : ItemBase<Charger>
	{
		public override string ItemName => "Charging Block";

		public override string ItemLangTokenName => "CHARGER";

		public override string ItemPickupDesc => "Criticals increase damage overall for a short period.";

		public override string ItemFullDescription => "Critical hits give a <style=cIsDamage>10% damage</style> <style=cStack>(+10% per stack)</style> boost on the attacked enemy. Reaching <style=cIsUtility>10 stacks</style> of Shocked removes all stacks and <style=cIsUtility>stuns</style> the enemy.";

		public override string ItemLore => "Order: Portable USB Charging Block\r\nTracking Number: 242**********\r\nEstimated Delivery: 12/27/2057\r\nShipping Method:  Standard\r\nShipping Address: Colony 4.1b Corridor 3, Scorpii\r\nShipping Details: \r\n\r\nI've heard Scorpii doesn't have much when it comes to charging outlets. Are you sure you want this?";

		public override ItemTier Tier => (ItemTier)1;

		public override GameObject ItemModel => Assets.resources2.LoadAsset<GameObject>("Assets/Import/charger/charger.prefab");

		public override Sprite ItemIcon => Assets.resources2.LoadAsset<Sprite>("Assets/Import/charger/finish.png");

		public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 };

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

		public override void CreateConfig(ConfigFile config)
		{
		}

		public override void CreateAchievementLang()
		{
			LanguageAPI.Add("INSIDER_CRITCOMBO_ACHIEVEMENT_NAME", "100% Charged!");
			LanguageAPI.Add("INSIDER_CRITCOMBO_ACHIEVEMENT_DESCRIPTION", "Have 10 shots in a row be critical.");
			ItemDef.unlockableDef = UnlockableDef;
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		public static void Charge(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo info, GameObject victim)
		{
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Expected O, but got Unknown
			orig.Invoke(self, info, victim);
			if (!NetworkServer.active || !((Object)(object)info.attacker != (Object)null) || !Object.op_Implicit((Object)(object)info.attacker.GetComponent<CharacterBody>()) || !Object.op_Implicit((Object)(object)victim.GetComponent<CharacterBody>()))
			{
				return;
			}
			CharacterBody component = info.attacker.GetComponent<CharacterBody>();
			CharacterBody component2 = victim.GetComponent<CharacterBody>();
			if ((Object)(object)component.inventory != (Object)null)
			{
				int itemCount = component.inventory.GetItemCount(ItemBase<Charger>.instance.ItemDef);
				if (itemCount > 0 && info.crit)
				{
					component2.AddBuff(BuffBase<Shocked>.instance.Def);
					EffectData val = new EffectData
					{
						origin = ((Component)component2.healthComponent).transform.position
					};
					val.SetNetworkedObjectReference(((Component)component2.healthComponent).gameObject);
					EffectManager.SpawnEffect(EffectBase<ShockEffect>.instance.Prefab, val, true);
				}
			}
		}
	}
	internal class CheeseWheel : ItemBase<CheeseWheel>
	{
		private ConfigEntry<int> boost;

		public override string ItemName => "Cheese Wheel";

		public override string ItemLangTokenName => "CHEESEWHEEL";

		public override string ItemPickupDesc => "Move faster after using your Utility.";

		public override string ItemFullDescription => "Using your Utility gives a <style=cIsUtility>400% speed boost</style> for " + boost.Value + " <style=cStack>(+" + boost.Value + " per stack)</style> seconds.";

		public override string ItemLore => "\"Gee, this sure is good, where'd you get it from?\"\n\r\n\r\"Hey, where'd you go?\"";

		public override ItemTier Tier => (ItemTier)0;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/cheese/cheese.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/cheese/finish.png");

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

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

		public override void CreateConfig(ConfigFile config)
		{
			boost = config.Bind<int>("Item: " + ItemName, "Buff Time", 2, "How long does the buff last?");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		private void OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Invalid comparison between Unknown and I4
			orig.Invoke(self, skill);
			if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.skillLocator) && (int)self.skillLocator.FindSkillSlot(skill) == 2)
			{
				int count = GetCount(self);
				if (count > 0)
				{
					self.AddTimedBuff(BuffBase<CheeseBuff>.instance.Def, (float)(count * boost.Value));
				}
			}
		}
	}
	internal class DemonicMask : ItemBase<DemonicMask>
	{
		public override string ItemName => "Silent Mask";

		public override string ItemLangTokenName => "MASK";

		public override string ItemPickupDesc => "Become invisible and intangible momentarily when using your Special.";

		public override string ItemFullDescription => "Become <style=cIsUtility>invisible and armored</style> for half the time of your cooldown <style=cStack>(+1 second per stack)</style> when using your Special ability.";

		public override string ItemLore => "A ferocious war.\n\r\n\rLasting for years on end.\n\r\n\rThis was the battle to turn the tides.\n\r\n\rOnly two are left, against five others. One, out of ammo, resorts to his pistol. His friend stops him from trying to kill an enemy.\n\r\n\rHe says, \"I'll handle this.\"\n\r\n\rHe puts on a mask, and vanishes from his friend's sight.\n\r\n\rOnly two are left, against none others.";

		public override ItemTier Tier => (ItemTier)2;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/mask/mask.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/mask/finish.png");

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

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

		public override void CreateConfig(ConfigFile config)
		{
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		private void OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill)
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Invalid comparison between Unknown and I4
			orig.Invoke(self, skill);
			if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.skillLocator) && (int)self.skillLocator.FindSkillSlot(skill) == 3)
			{
				float num = skill.cooldownRemaining / 2f;
				int count = GetCount(self);
				if (count > 0)
				{
					self.AddTimedBuff(Buffs.ArmorBoost, num + (float)(count - 1));
					self.AddTimedBuff(Buffs.Cloak, num + (float)(count - 1));
				}
			}
		}
	}
	internal class DissolutionDust : ItemBase<DissolutionDust>
	{
		public override string ItemName => "Dust";

		public override string ItemLangTokenName => "DISSOLUTIONDUST";

		public override string ItemPickupDesc => "Dust... Does nothing.";

		public override string ItemFullDescription => "Dust... Does nothing.";

		public override string ItemLore => "It whispers sadly. It is your fault.";

		public override ItemTier Tier => (ItemTier)5;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/drumstick/drumstick.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/Dissolution/dust.png");

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

		public override void CreateConfig(ConfigFile config)
		{
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
		}
	}
	internal class Drumstick : ItemBase<Drumstick>
	{
		private ConfigEntry<float> boost;

		public override string ItemName => "Cheap Drumstick";

		public override string ItemLangTokenName => "DRUMSTICK";

		public override string ItemPickupDesc => "Attack faster. Breaks when at low health.";

		public override string ItemFullDescription => "Attack <style=cIsUtility>" + boost.Value * 100f + "% faster</style>. Taking damage to below <style=cIsHealth>25% health</style> <style=cIsUtility>breaks</style> this item.";

		public override string ItemLore => "She plays a song softly. The drummer follows the beat.\n\r\n\rListening, more join in.\n\r\n\rSoon, a band is formed.\n\r\n\rCan you hear them play?";

		public override ItemTier Tier => (ItemTier)0;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/drumstick/drumstick.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/drumstick/finish.png");

		public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 };

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

		public override void CreateConfig(ConfigFile config)
		{
			boost = config.Bind<float>("Item: " + ItemName, "Speed Increase", 0.28f, "How much attack speed should be added (flatly) per stack?");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			HealthComponent.UpdateLastHitTime += new hook_UpdateLastHitTime(Hit);
			CharacterBody.RecalculateStats += new hook_RecalculateStats(Stats);
		}

		private void Stats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && ItemBase<Drumstick>.instance.GetCount(self) > 0)
			{
				float num = boost.Value * (float)ItemBase<Drumstick>.instance.GetCount(self);
				self.attackSpeed += num;
			}
		}

		private void Hit(orig_UpdateLastHitTime orig, HealthComponent self, float damageValue, Vector3 damagePosition, bool damageIsSilent, GameObject attacker, bool delayedDamage, bool firstHitOfDelayedDamage)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: 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_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Expected O, but got Unknown
			orig.Invoke(self, damageValue, damagePosition, damageIsSilent, attacker, delayedDamage, firstHitOfDelayedDamage);
			if (NetworkServer.active && Object.op_Implicit((Object)(object)attacker) && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && ItemBase<Drumstick>.instance.GetCount(self.body) > 0 && self.isHealthLow)
			{
				self.body.inventory.GiveItem(ItemBase<DrumstickConsumed>.instance.ItemDef, ItemBase<Drumstick>.instance.GetCount(self.body));
				self.body.inventory.RemoveItem(ItemBase<Drumstick>.instance.ItemDef, ItemBase<Drumstick>.instance.GetCount(self.body));
				CharacterMasterNotificationQueue.PushItemTransformNotification(self.body.master, ItemBase<Drumstick>.instance.ItemDef.itemIndex, ItemBase<DrumstickConsumed>.instance.ItemDef.itemIndex, (TransformationType)0);
				EffectData val = new EffectData
				{
					origin = ((Component)self).transform.position
				};
				val.SetNetworkedObjectReference(((Component)self).gameObject);
				EffectManager.SpawnEffect(EffectBase<DrumstickBreakEffect>.instance.Prefab, val, true);
			}
		}
	}
	internal class DrumstickConsumed : ItemBase<DrumstickConsumed>
	{
		public override string ItemName => "Broken Drumstick";

		public override string ItemLangTokenName => "DRUMSTICKCONSUMED";

		public override string ItemPickupDesc => "A broken stick with no use.";

		public override string ItemFullDescription => "A broken stick with no use.";

		public override string ItemLore => "It broke. Whoops.";

		public override ItemTier Tier => (ItemTier)5;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/drumstick/drumstick.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/drumstick/finish2.png");

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

		public override void CreateConfig(ConfigFile config)
		{
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
		}
	}
	internal class GoldOnCritical : ItemBase<GoldOnCritical>
	{
		private ConfigEntry<int> amount;

		public override string ItemName => "Electromagnetic Vault";

		public override string ItemLangTokenName => "GOLDONCRITICAL";

		public override string ItemPickupDesc => "Gain gold on critical hits.";

		public override string ItemFullDescription => "Dealing a critical hit gives " + amount.Value + " <style=cStack>(+" + amount.Value + " per stack)</style> gold. <style=cIsUtility>Scales over time</style>.";

		public override string ItemLore => "\"Yup, this is where I've kept everything all this time! It's an unbreakable vault, that needs my spoken passcode to get into! Shame you'll never get it!\"\n\r\n\r\"So, what will you do when you die? Just keep this locked away forever?\"\n\r\n\r\"Yup!\"";

		public override ItemTier Tier => (ItemTier)1;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/vault/vault.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/vault/finish.png");

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

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

		public override void CreateConfig(ConfigFile config)
		{
			amount = config.Bind<int>("Item: " + ItemName, "Gold Given", 2, "How much gold is given per critical, ignoring time?");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Expected O, but got Unknown
			orig.Invoke(self, damageInfo);
			if (NetworkServer.active && (Object)(object)damageInfo.attacker != (Object)null && (Object)(object)damageInfo.attacker.GetComponent<CharacterBody>() != (Object)null && damageInfo.crit && GetCount(damageInfo.attacker.GetComponent<CharacterBody>()) > 0)
			{
				CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
				GoldOrb val = new GoldOrb
				{
					origin = damageInfo.position,
					target = component.mainHurtBox,
					goldAmount = (uint)((float)(GetCount(component) * amount.Value) * Run.instance.difficultyCoefficient * damageInfo.procCoefficient)
				};
				OrbManager.instance.AddOrb((Orb)(object)val);
			}
		}
	}
	internal class Ham : ItemBase<Ham>
	{
		private ConfigEntry<int> chance;

		private ConfigEntry<float> boost;

		public override string ItemName => "Grilled Ham";

		public override string ItemLangTokenName => "HAM";

		public override string ItemPickupDesc => "Chance to burn on hit.";

		public override string ItemFullDescription => "<style=cIsDamage>" + chance.Value + "%</style> <style=cStack>(+" + chance.Value + "% per stack)</style> chance to <style=cIsDamage>burn</style> an enemy for <style=cIsDamage>120%</style> base damage for <style=cIsUtility>" + boost.Value + " seconds</style> <style=cStack>(+1s per stack)</style>.";

		public override string ItemLore => "I thought we were having grilled clams.\n\r\n\rOh no, I said 'grilled hams'.";

		public override ItemTier Tier => (ItemTier)1;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/ham/ham.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/ham/finish.png");

		public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 };

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

		public override void CreateConfig(ConfigFile config)
		{
			chance = config.Bind<int>("Item: " + ItemName, "Chance", 8, "Chance to cause a bite? (8 = 8%, 10 = 10%, etc.)");
			boost = config.Bind<float>("Item: " + ItemName, "Length", 3f, "Base length of burn? (In seconds, disreguarding proc coefficient.)");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		public void ChancePoison(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo info, GameObject victim)
		{
			orig.Invoke(self, info, victim);
			if (!NetworkServer.active || (Object)(object)info.attacker == (Object)null || (Object)(object)victim == (Object)null || !((Object)(object)info.attacker.GetComponent<CharacterBody>() != (Object)null))
			{
				return;
			}
			CharacterBody component = info.attacker.GetComponent<CharacterBody>();
			if (!((Object)(object)component.inventory == (Object)null))
			{
				int itemCount = component.inventory.GetItemCount(ItemBase<Ham>.instance.ItemDef);
				if (itemCount > 0 && Util.CheckRoll((float)(chance.Value * itemCount), component.master))
				{
					DotController.InflictDot(victim, info.attacker, (DotIndex)3, (boost.Value + (float)(itemCount - 1)) * info.procCoefficient, 1.2f * component.baseDamage, (uint?)null);
				}
			}
		}
	}
	internal class InteractionBuff : ItemBase<InteractionBuff>
	{
		private ConfigEntry<int> boost;

		public override string ItemName => "Pocket NR-g";

		public override string ItemLangTokenName => "INTERACTIONBUFF";

		public override string ItemPickupDesc => "Barrels give a speed boost a few seconds upon opening.";

		public override string ItemFullDescription => "Barrels give a <style=cIsUtility>speed and attack boost</style> for " + boost.Value + " seconds. <style=cStack>(+" + boost.Value / 2 + " seconds per stack)</style>";

		public override string ItemLore => "\"Did you know that the barrels here actually have small drinks in them?\"\n\r\n\rHe pulls out a drink from the small barrel.\n\r\n\r\"No, I never saw them.\"\n\r\n\r\"Yeah, you have to dig in to find it. Want one?\" He said, taking a drink from another barrel.";

		public override ItemTier Tier => (ItemTier)1;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/interactable/can.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/interactable_icon/finish.png");

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

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

		public override void CreateConfig(ConfigFile config)
		{
			boost = config.Bind<int>("Item: " + ItemName, "Buff Time", 6, "How long does the buff last?");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		public void Interact(orig_OnInteractionBegin orig, BarrelInteraction self, Interactor interactor)
		{
			if (!NetworkServer.active)
			{
				return;
			}
			if ((Object)(object)((Component)interactor).gameObject.GetComponent<CharacterBody>() != (Object)null)
			{
				CharacterBody component = ((Component)interactor).gameObject.GetComponent<CharacterBody>();
				if ((Object)(object)component.inventory != (Object)null)
				{
					int itemCount = component.inventory.GetItemCount(ItemBase<InteractionBuff>.instance.ItemDef);
					if (itemCount > 0)
					{
						component.AddTimedBuff(Buffs.WarCryBuff, (float)(boost.Value + boost.Value / 2 * (itemCount - 1)));
					}
				}
			}
			orig.Invoke(self, interactor);
		}
	}
	internal class Jera : ItemBase<Jera>
	{
		public override string ItemName => "Rune of Jera";

		public override string ItemLangTokenName => "JERA";

		public override string ItemPickupDesc => "<style=cKeywordName>Abundance.</style> Split into two characters.";

		public override string ItemFullDescription => "Gain a <style=cIsUtility>clone that has all of your items</style>, however, <color=#FF7F7F>lose half your health</color>. <color=#FF7F7F>All players using Jera die if a clone dies</color>.";

		public override string ItemLore => "<style=cKeywordName>Abundance.</style>";

		public override ItemTier Tier => (ItemTier)3;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/jera/jera.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/jera/finish.png");

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

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

		public override void CreateConfig(ConfigFile config)
		{
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal;
			GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
		}

		private void GlobalEventManager_onCharacterDeathGlobal(DamageReport report)
		{
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active || !((Object)(object)report.victimBody != (Object)null))
			{
				return;
			}
			CharacterBody victimBody = report.victimBody;
			if (!((Object)(object)victimBody.inventory != (Object)null) || victimBody.inventory.GetItemCount(ItemBase<JeraCloneIndicator>.instance.ItemDef) <= 0)
			{
				return;
			}
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				if (Object.op_Implicit((Object)(object)instance.body) && Object.op_Implicit((Object)(object)instance.body.inventory) && GetCount(instance.body) > 0)
				{
					instance.body.healthComponent.Suicide((GameObject)null, (GameObject)null, DamageTypeCombo.op_Implicit((DamageType)0));
				}
			}
		}

		private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body)
		{
			if (NetworkServer.active && (Object)(object)body != (Object)null && GetCount(body) > 0)
			{
				if (!Object.op_Implicit((Object)(object)((Component)body.master).gameObject.GetComponent<JeraBehaviour>()))
				{
					((Component)body).gameObject.AddComponent<JeraBehaviour>();
				}
				JeraBehaviour component = ((Component)body).gameObject.GetComponent<JeraBehaviour>();
				if (component.spawned < GetCount(body) && ((Component)component).GetComponent<JeraCloneIndicator>() == null)
				{
					component.Split(body);
				}
				for (int i = body.inventory.GetItemCount(ItemBase<JeraHealthModifier>.instance.ItemDef); i < GetCount(body); i++)
				{
					body.inventory.GiveItem(ItemBase<JeraHealthModifier>.instance.ItemDef, 1);
				}
			}
		}
	}
	internal class Jet : ItemBase<Jet>
	{
		private ConfigEntry<float> boost;

		private ConfigEntry<int> length;

		public override string ItemName => "Experimental Jets";

		public override string ItemLangTokenName => "JET";

		public override string ItemPickupDesc => "Taking large damage increases move speed and attack speed momentarily.";

		public override string ItemFullDescription => "Taking <style=cIsDamage>" + boost.Value * 100f + "% or more damage</style> <style=cStack>(-5% per stack)</style> increases attack and move speed for " + length.Value + " seconds.";

		public override string ItemLore => "Order: Jet Attachments\r\nTracking Number: 637**********\r\nEstimated Delivery: 08/26/2056\r\nShipping Method:  Fragile\r\nShipping Address: Shadownight Experimental Labs Co., Cygni B b\r\nShipping Details: \r\n\r\nYou reqested specifically \"Broken and/or tinkerable.\" with your order? If this was a mistake, call back at [ REDACTED ] and we can get you a new one.\n\r\n\r(P.S. And if not, please tell me what you're up to! Experimenting on old equipment?)";

		public override ItemTier Tier => (ItemTier)1;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/jet/jet.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/jet_icon/finish.png");

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

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

		public override void CreateConfig(ConfigFile config)
		{
			boost = config.Bind<float>("Item: " + ItemName, "Damage Requirement", 0.5f, "How much damage of total health is required to cause an explosion (by percent)?");
			length = config.Bind<int>("Item: " + ItemName, "Length", 8, "How long does the buff last?");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		public void TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo info)
		{
			if (!NetworkServer.active)
			{
				return;
			}
			if ((Object)(object)self.body != (Object)null && (Object)(object)self.body.inventory != (Object)null)
			{
				CharacterBody body = self.body;
				int itemCount = body.inventory.GetItemCount(ItemBase<Jet>.instance.ItemDef);
				if (itemCount > 0 && info.damage >= self.fullHealth * (boost.Value - 0.05f * (float)(itemCount - 1)))
				{
					body.AddTimedBuff(Buffs.WarCryBuff, (float)length.Value);
				}
			}
			orig.Invoke(self, info);
		}
	}
	internal class Nanomachine : ItemBase<Nanomachine>
	{
		private ConfigEntry<float> boost;

		public override string ItemName => "Nanomachine";

		public override string ItemLangTokenName => "NANOMACHINE";

		public override string ItemPickupDesc => "They harden in response to physical trauma.";

		public override string ItemFullDescription => "Gain <style=cIsUtility>protection</style> for " + boost.Value + " <style=cStack>(+" + boost.Value / 2f + " per stack)</style> seconds when being hit to <style=cIsHealth>low health</style>.";

		public override string ItemLore => "\"Nanomachines, son! They harden in response to physical trauma!\"";

		public override ItemTier Tier => (ItemTier)1;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/nanomachine/nanomachine.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/nanomachine/finish.png");

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

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

		public override void CreateConfig(ConfigFile config)
		{
			boost = config.Bind<float>("Item: " + ItemName, "Length", 2f, "For how long do you have the armor buff?");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		private void Hit(orig_UpdateLastHitTime orig, HealthComponent self, float damageValue, Vector3 damagePosition, bool damageIsSilent, GameObject attacker, bool delayedDamage, bool firstHitOfDelayedDamage)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageValue, damagePosition, damageIsSilent, attacker, delayedDamage, firstHitOfDelayedDamage);
			if (NetworkServer.active && Object.op_Implicit((Object)(object)attacker) && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && ItemBase<Nanomachine>.instance.GetCount(self.body) > 0 && self.isHealthLow)
			{
				self.body.AddTimedBuff(Buffs.ArmorBoost, boost.Value * (float)ItemBase<Nanomachine>.instance.GetCount(self.body));
			}
		}
	}
	internal class Ommoran : ItemBase<Ommoran>
	{
		private ConfigEntry<float> boost;

		public override string ItemName => "Ommoran Chunk";

		public override string ItemLangTokenName => "OMMORAN";

		public override string ItemPickupDesc => "Increase damage.";

		public override string ItemFullDescription => "Increase overall <style=cIsDamage>damage by " + boost.Value + "</style> <style=cStack>(+" + boost.Value + " per stack)</style>. <style=cIsUtility>Scales over time</style>.";

		public override string ItemLore => "<style=cKeywordName>Mission Control</style>\n\rOkay team, you've signed up for escort duty;\n\r\n\rOur target is an Ommoran Heartstone, and your job is to protect and maintain the Drilldozer as it makes its way there. Get ready!";

		public override ItemTier Tier => (ItemTier)1;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/ommoran/ommoran.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/ommoran/finish.png");

		public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 };

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

		public override void CreateConfig(ConfigFile config)
		{
			boost = config.Bind<float>("Item: " + ItemName, "Damage Increase", 2f, "How much damage should be added (flatly) per stack?");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		public void Increase(CharacterBody body, StatHookEventArgs args)
		{
			int count = ItemBase<Ommoran>.instance.GetCount(body);
			if (count > 0)
			{
				args.baseDamageAdd += boost.Value * (float)count * Run.instance.difficultyCoefficient;
			}
		}
	}
	internal class ScrapGenerator : ItemBase<ScrapGenerator>
	{
		private ConfigEntry<int> req;

		public override string ItemName => "Quantum Scrapper";

		public override string ItemLangTokenName => "SCRAPGENERATOR";

		public override string ItemPickupDesc => "Generate scrap by killing enemies.";

		public override string ItemFullDescription => "After <style=cIsDamage>killing " + req.Value + " enemies</style>, <style=cIsUtility>generate scrap</style>. <style=cStack>(Stacks generate more and better scrap.)</style>";

		public override string ItemLore => "<style=cKeywordName>quan·tum</style>\n\r/ˈkwän(t)əm/\n\r\n\rA discrete quantity of energy proportional in magnitude to the frequency of the radiation it represents.";

		public override ItemTier Tier => (ItemTier)2;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/quanScrapper/quanScrapper.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/quanScrapper/finish.png");

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

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

		public override void CreateConfig(ConfigFile config)
		{
			req = config.Bind<int>("Item: " + ItemName, "Kill Requirement", 80, "How many kills should be needed to gain scrap?");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal;
		}

		private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body)
		{
			if ((Object)(object)body != (Object)null && (Object)(object)body.master != (Object)null && GetCount(body) > 0)
			{
				CharacterMaster master = body.master;
				if (!Object.op_Implicit((Object)(object)((Component)master).gameObject.GetComponent<GeneratorBehaviour>()))
				{
					GeneratorBehaviour generatorBehaviour = ((Component)master).gameObject.AddComponent<GeneratorBehaviour>();
					generatorBehaviour.Init(req);
				}
			}
		}
	}
	internal class SnakeCan : ItemBase<SnakeCan>
	{
		private ConfigEntry<int> boost;

		public override string ItemName => "Defunct Snake Repellent";

		public override string ItemLangTokenName => "SNAKECAN";

		public override string ItemPickupDesc => "Occasionally inflict poison and bleed on hit.";

		public override string ItemFullDescription => "Direct attacks have a <style=cIsDamage>" + boost.Value + "% chance</style> <style=cStack>(+" + boost.Value + "% per stack)</style> to bite and cause <style=cIsUtility>bleed and poison on hit</style>.";

		public override string ItemLore => "Order: Camping Snake Repellent\r\nTracking Number: 776**********\r\nEstimated Delivery: 07/11/2054\r\nShipping Method:  Standard\r\nShipping Address: Aerie of Sand, Mars\r\nShipping Details: \r\n\r\nThis stuff is guarenteed to work. I know last time it didn't, and I did pay for your hospital bills, but this time I can assure you it will work. New formula, new spray nozzle, this should cover EVERYTHING. Have fun camping out in the Aerie!";

		public override ItemTier Tier => (ItemTier)1;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/snake/can.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/snake/finish.png");

		public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 };

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

		public override void CreateConfig(ConfigFile config)
		{
			boost = config.Bind<int>("Item: " + ItemName, "Chance", 5, "Chance to cause a bite? (5 = 5%, 10 = 10%, etc.)");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		public void ChancePoison(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo info, GameObject victim)
		{
			orig.Invoke(self, info, victim);
			if (!NetworkServer.active || (Object)(object)info.attacker == (Object)null || (Object)(object)victim == (Object)null || !((Object)(object)info.attacker.GetComponent<CharacterBody>() != (Object)null))
			{
				return;
			}
			CharacterBody component = info.attacker.GetComponent<CharacterBody>();
			if (!((Object)(object)component.inventory == (Object)null))
			{
				int itemCount = component.inventory.GetItemCount(ItemBase<SnakeCan>.instance.ItemDef);
				if (itemCount > 0 && Util.CheckRoll((float)(boost.Value * itemCount), component.master))
				{
					DotController.InflictDot(victim, info.attacker, (DotIndex)0, 3f * info.procCoefficient, 0.7f, (uint?)null);
					DotController.InflictDot(victim, info.attacker, (DotIndex)4, 10f * info.procCoefficient, 0.5f, (uint?)null);
				}
			}
		}
	}
	internal class Steve : ItemBase<Steve>
	{
		public override string ItemName => "Steve";

		public override string ItemLangTokenName => "VOIDFEATHER";

		public override string ItemPickupDesc => "Gain extra jump height. <style=cIsVoid>Corrupts all Hopoo Feathers</style>.";

		public override string ItemFullDescription => "Gain 1.2x <style=cStack>(+1.2x per stack)</style> <style=cIsUtility>jump height</style>. <style=cIsVoid>Corrupts all Hopoo Feathers</style>.";

		public override string ItemLore => "\"It's an owl? From Earth?\"\n\r\n\r\"I know, it's weird, right?\"\n\r\"Hey, is that just me, or is it glowi-\"\n\r\n\r\n\r<style=cEvent>[ DATA CORRUPTED, ENDING TRANSMISSION ]</style>";

		public override ItemTier Tier => (ItemTier)7;

		public override GameObject ItemModel => Assets.resources.LoadAsset<GameObject>("Assets/Import/steve/steve.prefab");

		public override Sprite ItemIcon => Assets.resources.LoadAsset<Sprite>("Assets/Import/steve_icon/finish.png");

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

		public override bool IsVoid => true;

		public override ItemDef VoidReplacementDef => Items.Feather;

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

		public override void CreateConfig(ConfigFile config)
		{
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

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

		public static void JumpVelocity(orig_ApplyJumpVelocity orig, CharacterMotor motor, CharacterBody body, float horiz, float vert, bool vault)
		{
			if ((Object)(object)body != (Object)null && (Object)(object)body.inventory != (Object)null)
			{
				int itemCount = body.inventory.GetItemCount(ItemBase<Steve>.instance.ItemDef);
				if (itemCount > 0)
				{
					vert *= 1f + 0.2f * (float)itemCount;
				}
			}
			orig.Invoke(motor, body, horiz, vert, vault);
		}