Decompiled source of UltitemsCyan v0.10.2

plugins/UltitemsCyan.dll

Decompiled 3 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Scrapper;
using HG;
using IL.RoR2;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates;
using On.RoR2;
using On.RoR2.Items;
using R2API;
using Rewired.Utils;
using RoR2;
using RoR2.ExpansionManagement;
using RoR2.Projectile;
using UltitemsCyan.Buffs;
using UltitemsCyan.Equipment;
using UltitemsCyan.Items;
using UltitemsCyan.Items.Lunar;
using UltitemsCyan.Items.Tier1;
using UltitemsCyan.Items.Tier2;
using UltitemsCyan.Items.Tier3;
using UltitemsCyan.Items.Untiered;
using UltitemsCyan.Items.Void;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace UltitemsCyan
{
	internal static class Log
	{
		private static ManualLogSource _logSource;

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

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

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

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

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

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

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	public static class UltAssets
	{
		public static AssetBundle mainBundle;

		public static Sprite CremeBruleeSprite;

		public static Sprite FleaBagSprite;

		public static Sprite FrisbeeSprite;

		public static Sprite KoalaStickerSprite;

		public static Sprite ToyRobotSprite;

		public static GameObject CremeBruleePrefab;

		public static GameObject FleaBagPrefab;

		public static GameObject FrisbeePrefab;

		public static GameObject KoalaStickerPrefab;

		public static GameObject ToyRobotPrefab;

		public static Sprite BirthdayCandleSprite;

		public static Sprite DegreeScissorsSprite;

		public static Sprite HMTSprite;

		public static Sprite OverclockedGPUSprite;

		public static Sprite XenonAmpouleSprite;

		public static GameObject BirthdayCandlePrefab;

		public static GameObject DegreeScissorsPrefab;

		public static GameObject HMTPrefab;

		public static GameObject OverclockedGPUPrefab;

		public static GameObject XenonAmpoulePrefab;

		public static Sprite CorrodingVaultSprite;

		public static Sprite GrapevineSprite;

		public static Sprite PigsSporkSprite;

		public static Sprite RockyTaffySprite;

		public static Sprite SuesMandiblesSprite;

		public static Sprite ViralSmogSprite;

		public static GameObject CorrodingVaultPrefab;

		public static GameObject GrapevinePrefab;

		public static GameObject PigsSporkPrefab;

		public static GameObject RockyTaffyPrefab;

		public static GameObject SuesMandiblesPrefab;

		public static GameObject ViralSmogPrefab;

		public static Sprite CrysotopeSprite;

		public static Sprite DownloadedRAMSprite;

		public static Sprite DriedHamSprite;

		public static Sprite InhabitedCoffinSprite;

		public static Sprite JubilantFoeSprite;

		public static Sprite QuantumPeelSprite;

		public static Sprite RottenBonesSprite;

		public static Sprite ZorsePillSprite;

		public static GameObject DownloadedRAMPrefab;

		public static GameObject CrysotopePrefab;

		public static GameObject DriedHamPrefab;

		public static GameObject InhabitedCoffinPrefab;

		public static GameObject JubilantFoePrefab;

		public static GameObject QuantumPeelPrefab;

		public static GameObject RottenBonesPrefab;

		public static GameObject ZorsePillPrefab;

		public static Sprite DreamFuelSprite;

		public static Sprite UltravioletBulbSprite;

		public static Sprite SandPailSprite;

		public static Sprite SilverThreadSprite;

		public static GameObject UltravioletBulbPrefab;

		public static GameObject DreamFuelPrefab;

		public static GameObject SandPailPrefab;

		public static GameObject SilverThreadPrefab;

		public static Sprite CorrodingVaultConsumedSprite;

		public static Sprite InhabitedCoffinConsumedSprite;

		public static Sprite SuesMandiblesConsumedSprite;

		public static Sprite SilverThreadConsumedSprite;

		public static Sprite UniversalSolventSprite;

		public static GameObject CorrodingVaultConsumedPrefab;

		public static GameObject InhabitedCoffinConsumedPrefab;

		public static GameObject SuesMandiblesConsumedPrefab;

		public static GameObject SilverThreadConsumedPrefab;

		public static GameObject UniversalSolventPrefab;

		public static Sprite IceCubesSprite;

		public static Sprite YieldSignSprite;

		public static Sprite YieldSignStopSprite;

		public static GameObject IceCubesPrefab;

		public static GameObject YieldSignPrefab;

		public static GameObject YieldSignStopPrefab;

		public static Sprite MacroseismographSprite;

		public static Sprite MacroseismographConsumedSprite;

		public static Sprite PotOfRegolithSprite;

		public static Sprite ObsoluteSprite;

		public static GameObject MacroseismographPrefab;

		public static GameObject MacroseismographConsumedPrefab;

		public static GameObject PotOfRegolithPrefab;

		public static GameObject ObsolutePrefab;

		public static Sprite BirthdaySprite;

		public static Sprite CrysotopeFlySprite;

		public static Sprite DownloadedSprite;

		public static Sprite DreamSpeedSprite;

		public static Sprite EyeAwakeSprite;

		public static Sprite EyeDrowsySprite;

		public static Sprite EyeSleepySprite;

		public static Sprite FrisbeeGlideSprite;

		public static Sprite GrapeSprite;

		public static Sprite OverclockedSprite;

		public static Sprite PeelSprite;

		public static Sprite RottingSprite;

		public static Sprite SporkBleedSprite;

		public static Sprite TickCritSprite;

		public static Sprite ZorseStarveSprite;

		public static void Init()
		{
			string text = Path.Combine(Path.GetDirectoryName(Ultitems.PInfo.Location), "ultitembundle");
			Log.Debug("Path of bundle: " + text);
			mainBundle = AssetBundle.LoadFromFile(text);
			if ((Object)(object)mainBundle == (Object)null)
			{
				Log.Warning("Null Bundle... getting for Debug");
				text = Path.Combine(Path.GetDirectoryName(Path.GetDirectoryName(Ultitems.PInfo.Location)), "assetbundle", "ultitembundle");
				mainBundle = AssetBundle.LoadFromFile(text);
			}
			CremeBruleeSprite = mainBundle.LoadAsset<Sprite>("CremeBrulee.png");
			FleaBagSprite = mainBundle.LoadAsset<Sprite>("FleaBag.png");
			FrisbeeSprite = mainBundle.LoadAsset<Sprite>("Frisbee.png");
			KoalaStickerSprite = mainBundle.LoadAsset<Sprite>("KoalaSticker.png");
			ToyRobotSprite = mainBundle.LoadAsset<Sprite>("ToyRobot.png");
			CremeBruleePrefab = mainBundle.LoadAsset<GameObject>("CremeBrulee.prefab");
			FleaBagPrefab = mainBundle.LoadAsset<GameObject>("FleaBag.prefab");
			FrisbeePrefab = mainBundle.LoadAsset<GameObject>("Frisbee.prefab");
			KoalaStickerPrefab = mainBundle.LoadAsset<GameObject>("KoalaSticker.prefab");
			ToyRobotPrefab = mainBundle.LoadAsset<GameObject>("ToyRobot.prefab");
			BirthdayCandleSprite = mainBundle.LoadAsset<Sprite>("BirthdayCandles.png");
			DegreeScissorsSprite = mainBundle.LoadAsset<Sprite>("DegreeScissors.png");
			HMTSprite = mainBundle.LoadAsset<Sprite>("HMT.png");
			OverclockedGPUSprite = mainBundle.LoadAsset<Sprite>("OverclockedGPU.png");
			XenonAmpouleSprite = mainBundle.LoadAsset<Sprite>("XenonAmpoule.png");
			BirthdayCandlePrefab = mainBundle.LoadAsset<GameObject>("BirthdayCandle.prefab");
			DegreeScissorsPrefab = mainBundle.LoadAsset<GameObject>("DegreeScissors.prefab");
			HMTPrefab = mainBundle.LoadAsset<GameObject>("HMT.prefab");
			OverclockedGPUPrefab = mainBundle.LoadAsset<GameObject>("OverclockedGPU.prefab");
			XenonAmpoulePrefab = mainBundle.LoadAsset<GameObject>("XenonAmpoule.prefab");
			CorrodingVaultSprite = mainBundle.LoadAsset<Sprite>("CorrodingVault.png");
			GrapevineSprite = mainBundle.LoadAsset<Sprite>("Grapevine.png");
			PigsSporkSprite = mainBundle.LoadAsset<Sprite>("PigsSpork.png");
			RockyTaffySprite = mainBundle.LoadAsset<Sprite>("RockyTaffy.png");
			SuesMandiblesSprite = mainBundle.LoadAsset<Sprite>("SuesMandibles.png");
			ViralSmogSprite = mainBundle.LoadAsset<Sprite>("ViralSmog.png");
			CorrodingVaultPrefab = mainBundle.LoadAsset<GameObject>("CorrodingVault.prefab");
			GrapevinePrefab = mainBundle.LoadAsset<GameObject>("Grapevine.prefab");
			PigsSporkPrefab = mainBundle.LoadAsset<GameObject>("PigsSpork.prefab");
			RockyTaffyPrefab = mainBundle.LoadAsset<GameObject>("RockyTaffy.prefab");
			SuesMandiblesPrefab = mainBundle.LoadAsset<GameObject>("SuesMandibles.prefab");
			ViralSmogPrefab = mainBundle.LoadAsset<GameObject>("ViralSmog.prefab");
			CrysotopeSprite = mainBundle.LoadAsset<Sprite>("Chrysotope.png");
			DownloadedRAMSprite = mainBundle.LoadAsset<Sprite>("DownloadedRAM.png");
			DriedHamSprite = mainBundle.LoadAsset<Sprite>("DriedHam.png");
			InhabitedCoffinSprite = mainBundle.LoadAsset<Sprite>("InhabitedCoffin.png");
			JubilantFoeSprite = mainBundle.LoadAsset<Sprite>("JubilantFoe.png");
			QuantumPeelSprite = mainBundle.LoadAsset<Sprite>("QuantumPeel.png");
			RottenBonesSprite = mainBundle.LoadAsset<Sprite>("RottenBones.png");
			ZorsePillSprite = mainBundle.LoadAsset<Sprite>("ZorsePill.png");
			CrysotopePrefab = mainBundle.LoadAsset<GameObject>("Chrysotope.prefab");
			DownloadedRAMPrefab = mainBundle.LoadAsset<GameObject>("DownloadedRAM.prefab");
			DriedHamPrefab = mainBundle.LoadAsset<GameObject>("DriedHam.prefab");
			InhabitedCoffinPrefab = mainBundle.LoadAsset<GameObject>("InhabitedCoffin.prefab");
			JubilantFoePrefab = mainBundle.LoadAsset<GameObject>("JubilantFoe.prefab");
			QuantumPeelPrefab = mainBundle.LoadAsset<GameObject>("QuantumPeel.prefab");
			RottenBonesPrefab = mainBundle.LoadAsset<GameObject>("RottenBones.prefab");
			ZorsePillPrefab = mainBundle.LoadAsset<GameObject>("ZorsePill.prefab");
			DreamFuelSprite = mainBundle.LoadAsset<Sprite>("DreamFuel.png");
			UltravioletBulbSprite = mainBundle.LoadAsset<Sprite>("UltravioletBulb.png");
			SandPailSprite = mainBundle.LoadAsset<Sprite>("SandPail.png");
			SilverThreadSprite = mainBundle.LoadAsset<Sprite>("SilverThread.png");
			DreamFuelPrefab = mainBundle.LoadAsset<GameObject>("DreamFuel.prefab");
			UltravioletBulbPrefab = mainBundle.LoadAsset<GameObject>("UltravioletBulb.prefab");
			SandPailPrefab = mainBundle.LoadAsset<GameObject>("SandPail.prefab");
			SilverThreadPrefab = mainBundle.LoadAsset<GameObject>("SilverThread.prefab");
			CorrodingVaultConsumedSprite = mainBundle.LoadAsset<Sprite>("CorrodingVaultConsumed.png");
			InhabitedCoffinConsumedSprite = mainBundle.LoadAsset<Sprite>("InhabitedCoffinConsumed.png");
			SilverThreadConsumedSprite = mainBundle.LoadAsset<Sprite>("SilverThreadConsumed.png");
			SuesMandiblesConsumedSprite = mainBundle.LoadAsset<Sprite>("SuesMandiblesConsumed.png");
			UniversalSolventSprite = mainBundle.LoadAsset<Sprite>("UniversalSolvent.png");
			CorrodingVaultConsumedPrefab = mainBundle.LoadAsset<GameObject>("CorrodingVaultConsumed.prefab");
			InhabitedCoffinConsumedPrefab = mainBundle.LoadAsset<GameObject>("InhabitedCoffinConsumed.prefab");
			SilverThreadConsumedPrefab = mainBundle.LoadAsset<GameObject>("SilverThreadConsumed.prefab");
			SuesMandiblesConsumedPrefab = mainBundle.LoadAsset<GameObject>("SuesMandiblesConsumed.prefab");
			UniversalSolventPrefab = mainBundle.LoadAsset<GameObject>("UniversalSolvent.prefab");
			IceCubesSprite = mainBundle.LoadAsset<Sprite>("IceCubes.png");
			YieldSignSprite = mainBundle.LoadAsset<Sprite>("YieldSign.png");
			YieldSignStopSprite = mainBundle.LoadAsset<Sprite>("YieldSignStop.png");
			IceCubesPrefab = mainBundle.LoadAsset<GameObject>("IceCubes.prefab");
			YieldSignPrefab = mainBundle.LoadAsset<GameObject>("YieldSign.prefab");
			YieldSignStopPrefab = mainBundle.LoadAsset<GameObject>("YieldSignStop.prefab");
			MacroseismographSprite = mainBundle.LoadAsset<Sprite>("Macroseismograph.png");
			MacroseismographConsumedSprite = mainBundle.LoadAsset<Sprite>("MacroseismographConsumed.png");
			PotOfRegolithSprite = mainBundle.LoadAsset<Sprite>("PotOfRegolith.png");
			ObsoluteSprite = mainBundle.LoadAsset<Sprite>("UniversalSolute.png");
			MacroseismographPrefab = mainBundle.LoadAsset<GameObject>("Macroseismograph.prefab");
			MacroseismographConsumedPrefab = mainBundle.LoadAsset<GameObject>("MacroseismographConsumed.prefab");
			PotOfRegolithPrefab = mainBundle.LoadAsset<GameObject>("PotOfRegolith.prefab");
			ObsolutePrefab = mainBundle.LoadAsset<GameObject>("UniversalSolute.prefab");
			BirthdaySprite = mainBundle.LoadAsset<Sprite>("Birthday");
			CrysotopeFlySprite = mainBundle.LoadAsset<Sprite>("CrysotopeFly");
			DownloadedSprite = mainBundle.LoadAsset<Sprite>("Downloaded");
			DreamSpeedSprite = mainBundle.LoadAsset<Sprite>("DreamSpeed");
			EyeDrowsySprite = mainBundle.LoadAsset<Sprite>("EyeDrowsy");
			EyeAwakeSprite = mainBundle.LoadAsset<Sprite>("EyeAwake");
			EyeSleepySprite = mainBundle.LoadAsset<Sprite>("EyeSleepy");
			FrisbeeGlideSprite = mainBundle.LoadAsset<Sprite>("FrisbeeGlide");
			GrapeSprite = mainBundle.LoadAsset<Sprite>("Grape");
			OverclockedSprite = mainBundle.LoadAsset<Sprite>("Overclocked");
			PeelSprite = mainBundle.LoadAsset<Sprite>("Peel");
			RottingSprite = mainBundle.LoadAsset<Sprite>("Rotting");
			SporkBleedSprite = mainBundle.LoadAsset<Sprite>("SporkBleed");
			TickCritSprite = mainBundle.LoadAsset<Sprite>("TickCrit");
			ZorseStarveSprite = mainBundle.LoadAsset<Sprite>("ZorseStarve");
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("SporkySpig.UltitemsCyan", "UltitemsCyan", "0.10.2")]
	public class Ultitems : BaseUnityPlugin
	{
		public static float stageStartTime;

		public const string PluginGUID = "SporkySpig.UltitemsCyan";

		public const string PluginAuthor = "SporkySpig";

		public const string PluginName = "UltitemsCyan";

		public const string PluginVersion = "0.10.2";

		public const string PluginSuffix = "Oops, no zorse";

		public static List<Pair> CorruptionPairs = new List<Pair>();

		public static ExpansionDef sotvDLC;

		public static Sprite mysterySprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion();

		public static GameObject mysteryPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mystery/PickupMystery.prefab").WaitForCompletion();

		private static ConfigFile UltitemsConfig { get; set; }

		public static PluginInfo PInfo { get; private set; }

		public void Awake()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0355: Unknown result type (might be due to invalid IL or missing references)
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c9: Expected O, but got Unknown
			Log.Init(((BaseUnityPlugin)this).Logger);
			PInfo = ((BaseUnityPlugin)this).Info;
			UltitemsConfig = new ConfigFile(Paths.ConfigPath + "\\Ultitems_ConfigFile.cfg", true);
			UltAssets.Init();
			List<BuffBase> list = new List<BuffBase>();
			list.Add(new BirthdayBuff());
			list.Add(new CrysotopeFlyingBuff());
			list.Add(new EyeAwakeBuff());
			list.Add(new EyeDrowsyBuff());
			list.Add(new EyeSleepyBuff());
			list.Add(new DreamSpeedBuff());
			list.Add(new DownloadedBuff());
			list.Add(new FrisbeeGlidingBuff());
			list.Add(new OverclockedBuff());
			list.Add(new RottingBuff());
			list.Add(new SlipperyGrapeBuff());
			list.Add(new SporkBleedBuff());
			list.Add(new TickCritBuff());
			list.Add(new ZorseStarvingBuff());
			foreach (BuffBase item in list)
			{
				item.Init();
			}
			Log.Debug("Buffs Done");
			List<ItemBase> list2 = new List<ItemBase>();
			list2.Add(new CorrodingVaultConsumed());
			list2.Add(new InhabitedCoffinConsumed());
			list2.Add(new SuesMandiblesConsumed());
			list2.Add(new SilverThreadConsumed());
			list2.Add(new GreySolvent());
			list2.Add(new CremeBrulee());
			list2.Add(new KoalaSticker());
			list2.Add(new ToyRobot());
			list2.Add(new FleaBag());
			list2.Add(new Frisbee());
			list2.Add(new BirthdayCandles());
			list2.Add(new HMT());
			list2.Add(new OverclockedGPU());
			list2.Add(new XenonAmpoule());
			list2.Add(new CorrodingVault());
			list2.Add(new Grapevine());
			list2.Add(new PigsSpork());
			list2.Add(new RockyTaffy());
			list2.Add(new SuesMandibles());
			list2.Add(new ViralSmog());
			list2.Add(new DreamFuel());
			list2.Add(new UltravioletBulb());
			list2.Add(new SilverThread());
			list2.Add(new SonorousPail());
			list2.Add(new IceCubes());
			list2.Add(new YieldSign());
			list2.Add(new YieldSignStop());
			list2.Add(new Macroseismograph());
			list2.Add(new MacroseismographConsumed());
			list2.Add(new PotOfRegolith());
			list2.Add(new Obsolute());
			list2.Add(new Crysotope());
			list2.Add(new DriedHam());
			list2.Add(new RottenBones());
			list2.Add(new QuantumPeel());
			list2.Add(new DownloadedRAM());
			list2.Add(new JealousFoe());
			list2.Add(new InhabitedCoffin());
			list2.Add(new ZorsePill());
			list2.Add(new DegreeScissors());
			Log.Debug("List Done");
			foreach (ItemBase item2 in list2)
			{
				item2.Init(UltitemsConfig);
				if (Object.op_Implicit((Object)(object)item2.GetTransformItem))
				{
					CorruptionPairs.Add(new Pair
					{
						itemDef1 = item2.GetTransformItem,
						itemDef2 = item2.GetItemDef
					});
				}
			}
			Log.Debug("Items Done");
			Stage.onStageStartGlobal += Stage_onStageStartGlobal;
			ContagiousItemManager.Init += new hook_Init(ContagiousItemManager_Init);
			Log.Warning("Ultitems Cyan Done: 0.10.2 <- Oops, no zorse");
		}

		private void Stage_onStageStartGlobal(Stage obj)
		{
			stageStartTime = Run.instance.time;
			Log.Warning("Ultitem Starts at: " + stageStartTime);
		}

		public void ContagiousItemManager_Init(orig_Init orig)
		{
			Log.Warning("Ultitem Create Void Transformations!");
			List<Pair> first = ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem].ToList();
			Log.Debug("My Void Items:");
			printPairList(CorruptionPairs);
			ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = first.Union(CorruptionPairs).ToArray();
			Log.Debug("Error?");
			orig.Invoke();
		}

		private void printPairList(List<Pair> list)
		{
			//IL_000d: 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_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			foreach (Pair item in list)
			{
				Log.Debug(". " + ((Object)item.itemDef1).name + " -> " + ((Object)item.itemDef2).name);
			}
			Log.Debug("end");
		}
	}
}
namespace UltitemsCyan.Text
{
	internal class ArchivedCode
	{
	}
}
namespace UltitemsCyan.Items
{
	public abstract class ItemBase
	{
		private readonly ExpansionDef Sovt = ((IEnumerable<ExpansionDef>)(object)ExpansionCatalog.expansionDefs).FirstOrDefault((Func<ExpansionDef, bool>)((ExpansionDef expansion) => expansion.nameToken == "DLC1_NAME"));

		public ItemDef GetItemDef { get; set; }

		public EquipmentDef GetEquipmentDef { get; set; }

		public ItemDef GetTransformItem { get; set; }

		public abstract void Init(ConfigFile configs);

		public ItemDef CreateItemDef(string tokenPrefix, string name, string pick, string desc, string lore, ItemTier tier, Sprite sprite, GameObject prefab, ItemTag[] tags, ItemDef transformItem = null)
		{
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Invalid comparison between Unknown and I4
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Expected O, but got Unknown
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Expected O, but got Unknown
			ItemDef val = ScriptableObject.CreateInstance<ItemDef>();
			LanguageAPI.Add(tokenPrefix + "_NAME", name);
			LanguageAPI.Add(tokenPrefix + "_PICK", pick);
			LanguageAPI.Add(tokenPrefix + "_DESC", desc);
			LanguageAPI.Add(tokenPrefix + "_LORE", lore);
			((Object)val).name = tokenPrefix + "_NAME";
			val.nameToken = tokenPrefix + "_NAME";
			val.pickupToken = tokenPrefix + "_PICK";
			val.descriptionToken = tokenPrefix + "_DESC";
			val.loreToken = tokenPrefix + "_LORE";
			ItemTierDef val2 = ScriptableObject.CreateInstance<ItemTierDef>();
			val2.tier = tier;
			val._itemTierDef = val2;
			val.canRemove = (int)tier != 5;
			val.hidden = false;
			val.pickupIconSprite = sprite;
			val.pickupModelPrefab = prefab;
			val.tags = tags;
			ItemDisplayRuleDict val3 = new ItemDisplayRuleDict((ItemDisplayRule[])null);
			ItemAPI.Add(new CustomItem(val, val3));
			Hooks();
			GetItemDef = val;
			if (Object.op_Implicit((Object)(object)transformItem))
			{
				GetTransformItem = transformItem;
				val.requiredExpansion = Sovt;
			}
			return val;
		}

		public bool CheckItemEnabledConfig(string name, string tier, ConfigFile configs)
		{
			return configs.Bind<bool>("Enable " + tier + " Items", "Enable " + name + "?", true, (ConfigDescription)null).Value;
		}

		protected abstract void Hooks();
	}
	public class PowerChips : ItemBase
	{
		public static ItemDef item;

		private const float dontResetFraction = 0.5f;

		public override void Init(ConfigFile configs)
		{
			string name = "Power Chips";
			if (CheckItemEnabledConfig(name, "Lunar", configs))
			{
				item = CreateItemDef("POWERCHIPS", name, "a", "b", "c", (ItemTier)3, Ultitems.mysterySprite, Ultitems.mysteryPrefab, (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 });
			}
		}

		protected 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(ChestBehavior_ItemDrop);
		}

		private void ChestBehavior_ItemDrop(orig_ItemDrop orig, ChestBehavior self)
		{
			Log.Warning("Tier 1 Chance: " + self.tier1Chance);
			Log.Debug("Player Controller: " + ((NetworkBehaviour)self).playerControllerId);
		}
	}
}
namespace UltitemsCyan.Items.Void
{
	public class Crysotope : ItemBase
	{
		public class CrysotopeBehavior : ItemBehavior
		{
			private CharacterMotor characterMotor;

			private const float baseDuration = 0.6f;

			private const float durationPerStack = 0.4f;

			public float flyingStopwatch = 0f;

			private bool _canHaveBuff = false;

			public bool CanHaveBuff
			{
				get
				{
					return _canHaveBuff;
				}
				set
				{
					//IL_0032: Unknown result type (might be due to invalid IL or missing references)
					if (_canHaveBuff != value)
					{
						_canHaveBuff = value;
						if (!_canHaveBuff)
						{
							base.body.SetBuffCount(CrysotopeFlyingBuff.buff.buffIndex, 0);
						}
					}
				}
			}

			public void UpdateStopwatch(float newTime)
			{
				flyingStopwatch = newTime;
			}

			public void FixedUpdate()
			{
				if (Object.op_Implicit((Object)(object)characterMotor))
				{
					CanHaveBuff = !characterMotor.isGrounded && base.body.inputBank.jump.down && Run.instance.time <= flyingStopwatch + 0.6f + 0.4f * (float)(base.stack - 1);
					if (base.body.HasBuff(CrysotopeFlyingBuff.buff) && base.body.characterMotor.velocity.y < 18f)
					{
						base.body.characterMotor.velocity.y = (base.body.characterMotor.velocity.y - 18f) * 0.9f + 18f;
					}
				}
			}

			public void Start()
			{
				characterMotor = base.body.characterMotor;
				((Behaviour)this).enabled = false;
			}

			private void OnDisable()
			{
				flyingStopwatch = 0f;
				CanHaveBuff = false;
			}

			public void OnDestroy()
			{
				flyingStopwatch = 0f;
				CanHaveBuff = false;
			}
		}

		public static ItemDef item;

		public static ItemDef transformItem;

		public const float dampeningForce = 0.9f;

		public const float riseSpeed = 18f;

		public const float baseDuration = 0.6f;

		public const float durationPerStack = 0.4f;

		public override void Init(ConfigFile configs)
		{
			string name = "Crysotope";
			if (CheckItemEnabledConfig(name, "Void", configs))
			{
				item = CreateItemDef("CRYSOTOPE", name, "Rise after jumping. Hold jump to continue flying. <style=cIsVoid>Corrupts all Frisbees</style>.", "Rise after jumping for <style=cIsUtility>0.6</style> <style=cStack>(+0.4 per stack)</style> seconds. Hold jump to keep flying. <style=cIsVoid>Corrupts all Frisbees</style>.", "An eyeless crystal snake capbable of flying 100 meters", (ItemTier)6, UltAssets.CrysotopeSprite, UltAssets.CrysotopePrefab, (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }, Frisbee.item);
			}
		}

		protected 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
			CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged);
			GenericCharacterMain.ProcessJump += new hook_ProcessJump(GenericCharacterMain_ProcessJump);
		}

		private void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory))
			{
				self.AddItemBehavior<CrysotopeBehavior>(self.inventory.GetItemCount(item));
			}
		}

		private void GenericCharacterMain_ProcessJump(orig_ProcessJump orig, GenericCharacterMain self)
		{
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody) && Object.op_Implicit((Object)(object)((EntityState)self).characterBody.inventory))
			{
				CharacterBody characterBody = ((EntityState)self).characterBody;
				int itemCount = characterBody.inventory.GetItemCount(item);
				if (itemCount > 0 && ((BaseCharacterMain)self).hasCharacterMotor && self.jumpInputReceived && ((EntityState)self).characterMotor.jumpCount < ((EntityState)self).characterBody.maxJumpCount)
				{
					Log.Debug("Crysotope Jump ? ? ? adding buff for " + (0.6f + 0.4f * (float)(itemCount - 1)) + " seconds");
					CrysotopeBehavior component = ((Component)((EntityState)self).characterBody).GetComponent<CrysotopeBehavior>();
					((Behaviour)component).enabled = true;
					component.UpdateStopwatch(Run.instance.time);
					characterBody.SetBuffCount(CrysotopeFlyingBuff.buff.buffIndex, 1);
					Log.Debug("Has Timed def Buff? " + ((BaseState)self).HasBuff(CrysotopeFlyingBuff.buff));
				}
			}
			orig.Invoke(self);
		}
	}
	public class DownloadedRAM : ItemBase
	{
		public class DownloadedVoidBehavior : ItemBehavior
		{
			public float attackingStopwatch = 0f;

			private bool _attacking = false;

			public bool DealingDamage
			{
				get
				{
					return _attacking;
				}
				set
				{
					//IL_0032: Unknown result type (might be due to invalid IL or missing references)
					if (_attacking != value)
					{
						_attacking = value;
						if (!_attacking)
						{
							base.body.SetBuffCount(DownloadedBuff.buff.buffIndex, 0);
							((Behaviour)this).enabled = false;
						}
					}
				}
			}

			public void UpdateStopwatch(float newTime)
			{
				attackingStopwatch = newTime;
			}

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

			private void OnDisable()
			{
				attackingStopwatch = 0f;
				DealingDamage = false;
			}

			private void FixedUpdate()
			{
				DealingDamage = Run.instance.time <= attackingStopwatch + 4f;
			}

			private void OnCharacterDeathGlobal(DamageReport damageReport)
			{
				Log.Warning("RAM ran this on death?");
			}
		}

		public static ItemDef item;

		public static ItemDef transformItem;

		public const float downloadedBuffMultiplier = 8f;

		public const int downloadsPerItem = 4;

		private const float downloadChance = 12f;

		public const float notAttackingDelay = 4f;

		public override void Init(ConfigFile configs)
		{
			string name = "Downloaded RAM";
			if (CheckItemEnabledConfig(name, "Void", configs))
			{
				item = CreateItemDef("DOWNLOADEDRAM", name, "Chance on hit to increase damage. Lose stacks when not attacking. <style=cIsVoid>Corrupts all Overclocked GPUs</style>.", "<style=cIsDamage>12%</style> chance on hit to increase damage by <style=cIsDamage>8%</style>. Maxinum cap of <style=cIsDamage>4</style> <style=cStack>(+4 per stack)</style>. Lose stacks 4 seconds after inflicting damage. <style=cIsVoid>Corrupts all Overclocked GPUs</style>.", "Wow I can't belive it worked! I though for sure it was a scam!", (ItemTier)7, UltAssets.DownloadedRAMSprite, UltAssets.DownloadedRAMPrefab, (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }, OverclockedGPU.item);
			}
		}

		protected 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
			CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged);
			GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(GlobalEventManager_OnHitEnemy);
		}

		private void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory))
			{
				self.AddItemBehavior<DownloadedVoidBehavior>(self.inventory.GetItemCount(item));
			}
		}

		private void GlobalEventManager_OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Invalid comparison between Unknown and I4
			orig.Invoke(self, damageInfo, victim);
			try
			{
				if (!Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)victim) || !Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent<CharacterBody>()) || !Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent<CharacterBody>().inventory) || damageInfo.rejected || (int)damageInfo.damageType == 67108864)
				{
					return;
				}
				CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
				int itemCount = component.inventory.GetItemCount(item);
				if (itemCount <= 0)
				{
					return;
				}
				DownloadedVoidBehavior component2 = ((Component)component).GetComponent<DownloadedVoidBehavior>();
				((Behaviour)component2).enabled = true;
				component2.UpdateStopwatch(Run.instance.time);
				if (Util.CheckRoll(12f, component.master.luck, (CharacterMaster)null))
				{
					Log.Debug("downloading");
					if (component.GetBuffCount(DownloadedBuff.buff) < itemCount * 4)
					{
						component.AddBuff(DownloadedBuff.buff);
					}
				}
			}
			catch (NullReferenceException)
			{
			}
		}
	}
	public class DriedHam : ItemBase
	{
		public static ItemDef item;

		public static ItemDef transformItem;

		private const float threshold = 35f;

		private const float flatHealing = 4f;

		public override void Init(ConfigFile configs)
		{
			string name = "Dried Ham";
			if (CheckItemEnabledConfig(name, "Void", configs))
			{
				item = CreateItemDef("DRIEDHAM", name, "Heal when hitting enemies below 35% health. <style=cIsVoid>Corrupts all Crème Brûlées</style>.", "<style=cIsHealing>Heal</style> for <style=cIsHealing>4</style> <style=cStack>(+5 per stack)</style> when dealing damage to enemies below <style=cIsDamage>35% health</style>. <style=cIsVoid>Corrupts all Crème Brûlées</style>.", "The bitter aftertaste is just the spoilage", (ItemTier)6, UltAssets.DriedHamSprite, UltAssets.DriedHamPrefab, (ItemTag[])(object)new ItemTag[1] { (ItemTag)2 }, CremeBrulee.item);
			}
		}

		protected 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_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Invalid comparison between Unknown and I4
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent<CharacterBody>()) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent<CharacterBody>().inventory) && !damageInfo.rejected && (int)damageInfo.damageType != 67108864)
				{
					CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
					int itemCount = component.inventory.GetItemCount(item);
					if (itemCount > 0 && self.combinedHealthFraction <= 0.35f)
					{
						component.healthComponent.Heal(4f * (float)itemCount, damageInfo.procChainMask, true);
						Util.PlaySound("Play_item_proc_thorns", ((Component)component).gameObject);
					}
				}
			}
			catch (NullReferenceException)
			{
			}
			orig.Invoke(self, damageInfo);
		}
	}
	public class InhabitedCoffin : ItemBase
	{
		public static ItemDef item;

		public static ItemDef transformItem;

		private const float freeCoffinChance = 20f;

		private const int minimumInCoffin = 5;

		public override void Init(ConfigFile configs)
		{
			string name = "Inhabited Coffin";
			if (CheckItemEnabledConfig(name, "Void", configs))
			{
				Sprite inhabitedCoffinSprite = UltAssets.InhabitedCoffinSprite;
				GameObject inhabitedCoffinPrefab = UltAssets.InhabitedCoffinPrefab;
				ItemTag[] array = new ItemTag[3];
				RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
				item = CreateItemDef("INHABITEDCOFFIN", name, "Breaks at the start of the next stage. Contains void items. <style=cIsVoid>Corrupts all Corroding Vaults</style>.", "At the start of each stage, this item will <style=cIsUtility>break</style> and gives <style=cIsUtility>5</style> random void items. <style=cIsUtility>Affected by luck</style>. <style=cIsVoid>Corrupts all Corroding Vaults</style>.", "Something lives inside this coffin. That coffin is deeper than you think.", (ItemTier)8, inhabitedCoffinSprite, inhabitedCoffinPrefab, (ItemTag[])(object)array, CorrodingVault.item);
			}
		}

		protected override void Hooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			Stage.BeginServer += new hook_BeginServer(Stage_BeginServer);
		}

		private void Stage_BeginServer(orig_BeginServer orig, Stage self)
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Expected O, but got Unknown
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!NetworkServer.active)
			{
				Log.Debug("Running on Client... return...");
				return;
			}
			foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList)
			{
				if (!Object.op_Implicit((Object)(object)readOnlyInstances.inventory))
				{
					continue;
				}
				int itemCount = readOnlyInstances.inventory.GetItemCount(item.itemIndex);
				if (itemCount > 0)
				{
					readOnlyInstances.inventory.RemoveItem(item, 1);
					readOnlyInstances.inventory.GiveItem(InhabitedCoffinConsumed.item, 1);
					List<PickupIndex>[] array = new List<PickupIndex>[4]
					{
						Run.instance.availableVoidTier1DropList,
						Run.instance.availableVoidTier2DropList,
						Run.instance.availableVoidTier3DropList,
						Run.instance.availableVoidBossDropList
					};
					int num = array[0].Count + array[1].Count + array[2].Count + array[3].Count;
					Log.Debug("All Void Items Length: " + num);
					int num2;
					if (Util.CheckRoll(80f, readOnlyInstances.luck, (CharacterMaster)null))
					{
						num2 = 5;
					}
					else
					{
						readOnlyInstances.inventory.GiveItem(item, 1);
						GenericPickupController.SendPickupMessage(readOnlyInstances, PickupCatalog.itemIndexToPickupIndex[item.itemIndex]);
						num2 = 4;
					}
					Xoroshiro128Plus val = new Xoroshiro128Plus(Run.instance.stageRng.nextUlong);
					for (int i = 0; i < num2; i++)
					{
						int index = val.RangeInt(0, num);
						PickupIndex voidItem = getVoidItem(array, index);
						readOnlyInstances.inventory.GiveItem(PickupCatalog.GetPickupDef(voidItem).itemIndex, 1);
						GenericPickupController.SendPickupMessage(readOnlyInstances, voidItem);
					}
				}
			}
		}

		private PickupIndex getVoidItem(List<PickupIndex>[] items, int index)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < items.Length; i++)
			{
				if (index >= items[i].Count)
				{
					index -= items[i].Count;
					continue;
				}
				return items[i][index];
			}
			return PickupIndex.none;
		}
	}
	public class JealousFoe : ItemBase
	{
		public enum EyePhase
		{
			collecting,
			consuming,
			cooldown
		}

		public class JealousFoeBehaviour : ItemBehavior
		{
			private EyePhase _currentPhase = EyePhase.collecting;

			public float eyePhaseStopwatch = float.PositiveInfinity;

			public float currentTimer = 6f;

			private GameObject FakeFoe;

			public void SetCollectingPhase()
			{
				if (_currentPhase == EyePhase.cooldown)
				{
					Log.Debug(" ! ! ! ! ! ! Phase Set ! ! Coll Lecting");
					_currentPhase = EyePhase.collecting;
				}
			}

			public void SetConsumingPhase()
			{
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0054: Unknown result type (might be due to invalid IL or missing references)
				if (_currentPhase == EyePhase.collecting)
				{
					Log.Debug(" ! ! ! ! ! ! Phase Set ! ! conSUME");
					_currentPhase = EyePhase.consuming;
					int buffCount = base.body.GetBuffCount(EyeDrowsyBuff.buff);
					base.body.SetBuffCount(EyeDrowsyBuff.buff.buffIndex, 0);
					base.body.SetBuffCount(EyeAwakeBuff.buff.buffIndex, buffCount);
					Util.PlaySound("Play_affix_void_bug_infect", ((Component)base.body).gameObject);
				}
			}

			public void SetCooldownPhase()
			{
				if (_currentPhase == EyePhase.consuming)
				{
					Log.Debug(" ! ! ! ! ! ! Phase Set ! ! c o o l down");
					_currentPhase = EyePhase.cooldown;
					eyePhaseStopwatch = float.PositiveInfinity;
					base.body.AddTimedBuff(EyeSleepyBuff.buff, 6f);
				}
			}

			public void GotPickup()
			{
				if (_currentPhase == EyePhase.collecting)
				{
					if (eyePhaseStopwatch == float.PositiveInfinity)
					{
						eyePhaseStopwatch = Run.instance.time;
						currentTimer = 6f;
					}
					if ((float)base.body.GetBuffCount(EyeDrowsyBuff.buff) < (float)base.stack * 3f)
					{
						base.body.AddBuff(EyeDrowsyBuff.buff);
						Util.PlaySound("Play_UI_arenaMode_voidCollapse_select", ((Component)base.body).gameObject);
					}
				}
			}

			public void FixedUpdate()
			{
				if (Run.instance.time > eyePhaseStopwatch + currentTimer)
				{
					CheckTimer();
				}
			}

			private void CheckTimer()
			{
				if (_currentPhase == EyePhase.collecting)
				{
					eyePhaseStopwatch = Run.instance.time;
					currentTimer = 8f / (float)(base.stack + 1);
					SetConsumingPhase();
					base.body.RemoveBuff(EyeAwakeBuff.buff);
					ActivateDeath();
				}
				else if (_currentPhase == EyePhase.consuming)
				{
					eyePhaseStopwatch = Run.instance.time;
					base.body.RemoveBuff(EyeAwakeBuff.buff);
					ActivateDeath();
				}
				else
				{
					Log.Warning("##########  Uh oh, Jealous Foe is not supposed to be here...");
				}
			}

			private void ActivateDeath()
			{
				//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0103: Unknown result type (might be due to invalid IL or missing references)
				//IL_0114: Unknown result type (might be due to invalid IL or missing references)
				//IL_0125: Unknown result type (might be due to invalid IL or missing references)
				//IL_0136: 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_0142: Unknown result type (might be due to invalid IL or missing references)
				//IL_0147: Unknown result type (might be due to invalid IL or missing references)
				//IL_0152: Unknown result type (might be due to invalid IL or missing references)
				//IL_0154: Unknown result type (might be due to invalid IL or missing references)
				//IL_0159: Unknown result type (might be due to invalid IL or missing references)
				//IL_015b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0161: Expected O, but got Unknown
				//IL_016f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0175: Expected O, but got Unknown
				//IL_0181: Unknown result type (might be due to invalid IL or missing references)
				//IL_0186: 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_0198: Unknown result type (might be due to invalid IL or missing references)
				//IL_0199: Unknown result type (might be due to invalid IL or missing references)
				//IL_019e: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a4: Expected O, but got Unknown
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_002a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0053: Unknown result type (might be due to invalid IL or missing references)
				if (!Object.op_Implicit((Object)(object)FakeFoe))
				{
					FakeFoe = Object.Instantiate<GameObject>(fmpPrefab, base.body.footPosition, Quaternion.identity);
					FakeFoe.transform.localScale = new Vector3(0f, 0f, 0f);
					Object.Destroy((Object)(object)FakeFoe.GetComponent<DestroyOnTimer>());
					Object.Destroy((Object)(object)FakeFoe.GetComponent<DeathProjectile>());
					Object.Destroy((Object)(object)FakeFoe.GetComponent<ApplyTorqueOnStart>());
					Object.Destroy((Object)(object)FakeFoe.GetComponent<ProjectileDeployToOwner>());
					Object.Destroy((Object)(object)FakeFoe.GetComponent<Deployable>());
					Object.Destroy((Object)(object)FakeFoe.GetComponent<ProjectileStickOnImpact>());
					Object.Destroy((Object)(object)FakeFoe.GetComponent<ProjectileController>());
				}
				FakeFoe.transform.position = base.body.footPosition;
				HealthComponent component = FakeFoe.GetComponent<HealthComponent>();
				DamageInfo val = new DamageInfo
				{
					attacker = ((Component)base.body).gameObject,
					crit = base.body.RollCrit(),
					damage = base.body.baseDamage,
					position = base.body.footPosition,
					procCoefficient = 0f,
					damageType = (DamageType)0,
					damageColorIndex = (DamageColorIndex)3
				};
				DamageReport val2 = new DamageReport(val, component, val.damage, component.combinedHealth);
				GlobalEventManager.instance.OnCharacterDeath(val2);
				EffectData val3 = new EffectData
				{
					origin = base.body.corePosition,
					rotation = Quaternion.identity
				};
				EffectManager.SpawnEffect(fmpEffectPrefab, val3, false);
				Util.PlaySound("Play_voidman_idle_twitch", ((Component)base.body).gameObject);
			}

			public void OnAwake()
			{
			}

			public void OnDisable()
			{
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)base.body))
				{
					base.body.SetBuffCount(EyeDrowsyBuff.buff.buffIndex, 0);
					base.body.SetBuffCount(EyeAwakeBuff.buff.buffIndex, 0);
					base.body.ClearTimedBuffs(EyeSleepyBuff.buff.buffIndex);
				}
			}

			public void OnDestroy()
			{
				Object.Destroy((Object)(object)FakeFoe);
			}
		}

		public static ItemDef item;

		public static ItemDef transformItem;

		public const float collectTime = 6f;

		public const float consumeBaseTime = 4f;

		public const float cooldownTime = 6f;

		public const float maxBuffsPerStack = 3f;

		public static readonly GameObject fmpEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/DeathProjectile/DeathProjectileTickEffect.prefab").WaitForCompletion();

		public static readonly GameObject fmpPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/DeathProjectile/DeathProjectile.prefab").WaitForCompletion();

		public override void Init(ConfigFile configs)
		{
			string name = "Jealous Foe";
			if (CheckItemEnabledConfig(name, "Void", configs))
			{
				item = CreateItemDef("JEALOUSFOE", name, "Trigger On-Kill effects after grabbing pickups. <style=cIsVoid>Corrupts all Toy Robots</style>.", "Gain stacks upon grabbing pickups</style>. Maximum cap of 3</style> (+3 per stack)</style>. Trigger an <style=cIsDamage>On-Kill</style> effect per stack every <style=cIsUtility>4s</style> (-30% per stack)</style>. Recharges every <style=cIsUtility>6</style> seconds. <style=cIsVoid>Corrupts all Toy Robots</style>.", "Look at it Jubilat. It just jubilant like some jealous jello jelly.", (ItemTier)6, UltAssets.JubilantFoeSprite, UltAssets.JubilantFoePrefab, (ItemTag[])(object)new ItemTag[2]
				{
					(ItemTag)3,
					(ItemTag)6
				}, ToyRobot.item);
			}
		}

		protected 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
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			HealthPickup.OnTriggerStay += new hook_OnTriggerStay(HealthPickup_OnTriggerStay);
			AmmoPickup.OnTriggerStay += new hook_OnTriggerStay(AmmoPickup_OnTriggerStay);
			BuffPickup.OnTriggerStay += new hook_OnTriggerStay(BuffPickup_OnTriggerStay);
			MoneyPickup.OnTriggerStay += new hook_OnTriggerStay(MoneyPickup_OnTriggerStay);
			CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged);
		}

		private void HealthPickup_OnTriggerStay(orig_OnTriggerStay orig, HealthPickup self, Collider other)
		{
			orig.Invoke(self, other);
			GotPickup(other);
		}

		private void AmmoPickup_OnTriggerStay(orig_OnTriggerStay orig, AmmoPickup self, Collider other)
		{
			orig.Invoke(self, other);
			GotPickup(other);
		}

		private void BuffPickup_OnTriggerStay(orig_OnTriggerStay orig, BuffPickup self, Collider other)
		{
			orig.Invoke(self, other);
			GotPickup(other);
		}

		private void MoneyPickup_OnTriggerStay(orig_OnTriggerStay orig, MoneyPickup self, Collider other)
		{
			orig.Invoke(self, other);
			GotPickup(other);
		}

		private void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory))
			{
				self.AddItemBehavior<JealousFoeBehaviour>(self.inventory.GetItemCount(item));
			}
		}

		private void GotPickup(Collider other)
		{
			CharacterBody component = ((Component)other).GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory))
			{
				int itemCount = component.inventory.GetItemCount(item);
				if (itemCount > 0 && NetworkServer.active)
				{
					((Component)component).GetComponent<JealousFoeBehaviour>().GotPickup();
				}
			}
		}
	}
	public class QuantumPeel : ItemBase
	{
		public static ItemDef item;

		public static ItemDef transformItem;

		public const float peelSpeedMultiplier = 4f;

		public const int maxPeelStack = 20;

		public override void Init(ConfigFile configs)
		{
			string name = "Quantum Peel";
			if (CheckItemEnabledConfig(name, "Void", configs))
			{
				item = CreateItemDef("QUANTUMPEEL", name, "Gain speed and jump power when damaged. <style=cIsVoid>Corrupts all Viral Smogs</style>.", "Gain up to <style=cIsUtility>400%</style> <style=cStack>(+400% per stack)</style> <style=cIsUtility>movement speed</style> and upto <style=cIsUtility>100%</style> <style=cStack>(+100% per stack)</style> <style=cIsUtility>jump power</style> when <style=cIsHealth>missing health</style>. <style=cIsVoid>Corrupts all Viral Smogs</style>.", "This Tape is so slippery! And it just seems endless...\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nWait did you name it Quantum Peel because you wanted a banana item but you added too many food items?\nShhh! They'll never know as long as they never read the description...", (ItemTier)8, UltAssets.QuantumPeelSprite, UltAssets.QuantumPeelPrefab, (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }, ViralSmog.item);
			}
		}

		protected 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
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			HealthComponent.Heal += new hook_Heal(HealthComponent_Heal);
			HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
		}

		private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			orig.Invoke(self, damageInfo);
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body.inventory) && Object.op_Implicit((Object)(object)self.body.inventory))
			{
				int itemCount = self.body.inventory.GetItemCount(item);
				if (itemCount > 0)
				{
					self.body.statsDirty = true;
				}
			}
		}

		private float HealthComponent_Heal(orig_Heal orig, HealthComponent self, float amount, ProcChainMask procChainMask, bool nonRegen)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			float result = orig.Invoke(self, amount, procChainMask, nonRegen);
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body.inventory) && Object.op_Implicit((Object)(object)self.body.inventory))
			{
				int itemCount = self.body.inventory.GetItemCount(item);
				if (itemCount > 0)
				{
					self.body.statsDirty = true;
				}
			}
			return result;
		}

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			if (!Object.op_Implicit((Object)(object)sender) || !Object.op_Implicit((Object)(object)sender.inventory) || !Object.op_Implicit((Object)(object)sender.characterMotor))
			{
				return;
			}
			int itemCount = sender.inventory.GetItemCount(item);
			if (itemCount > 0)
			{
				float num = 1f - sender.healthComponent.combinedHealthFraction;
				if (num < 0f)
				{
					num = 0f;
				}
				float num2 = num * num * 4f * (float)itemCount;
				args.moveSpeedMultAdd += num2;
				args.jumpPowerMultAdd += num;
			}
		}
	}
	public class RottenBones : ItemBase
	{
		public class RottenBonesVoidBehavior : ItemBehavior
		{
			private int _intervalsPassed = 0;

			public int IntervalsPassed
			{
				get
				{
					return _intervalsPassed;
				}
				set
				{
					_intervalsPassed = value;
					if (_intervalsPassed > 0)
					{
						ApplyRot(base.body, _intervalsPassed);
						if (_intervalsPassed >= 3)
						{
							Log.Debug("Pass rot Time Interval But Behavior!");
							((Behaviour)this).enabled = false;
						}
					}
				}
			}

			private void FixedUpdate()
			{
				float time = Run.instance.time;
				while (time > Ultitems.stageStartTime + 180f * (float)(_intervalsPassed + 1) && _intervalsPassed < 3)
				{
					IntervalsPassed++;
				}
			}
		}

		public static ItemDef item;

		public static ItemDef transformItem;

		public const int rotsPerItem = 3;

		public const float rottingBuffMultiplier = 15f;

		public const float rotTimeInterval = 180f;

		public override void Init(ConfigFile configs)
		{
			string name = "Rotten Bones";
			if (CheckItemEnabledConfig(name, "Void", configs))
			{
				item = CreateItemDef("ROTTENBONES", name, "Deal more damage over time. <style=cIsVoid>Corrupts all Birthday Candles</style>.", "Increase damage by <style=cIsDamage>15%</style> <style=cStack>(+15% per stack)</style> damage for every 3 minutes</style> passed in a stage, up to a max of <style=cIsDamage>3</style> stacks. <style=cIsVoid>Corrupts all Birthday Candles</style>.", "The bitter aftertaste is just the spoilage", (ItemTier)7, UltAssets.RottenBonesSprite, UltAssets.RottenBonesPrefab, (ItemTag[])(object)new ItemTag[2]
				{
					(ItemTag)3,
					(ItemTag)20
				}, BirthdayCandles.item);
			}
		}

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

		private void CharacterBody_onBodyStartGlobal(CharacterBody self)
		{
			if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory))
			{
				self.AddItemBehavior<RottenBonesVoidBehavior>(self.inventory.GetItemCount(item));
			}
		}

		private void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self)
		{
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)self.inventory))
			{
				return;
			}
			if (self.inventory.GetItemCount(item) > 0)
			{
				if (Run.instance.time < Ultitems.stageStartTime + 540f)
				{
					RottenBonesVoidBehavior rottenBonesVoidBehavior = self.AddItemBehavior<RottenBonesVoidBehavior>(self.inventory.GetItemCount(item));
					ApplyRot(self, rottenBonesVoidBehavior.IntervalsPassed);
				}
				else
				{
					ApplyRot(self, 3);
				}
			}
			else
			{
				self.SetBuffCount(RottingBuff.buff.buffIndex, 0);
			}
		}

		private static void ApplyRot(CharacterBody player, int intervals)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			int itemCount = player.inventory.GetItemCount(item);
			int num = itemCount * intervals;
			if (player.GetBuffCount(RottingBuff.buff) < num)
			{
				player.SetBuffCount(RottingBuff.buff.buffIndex, num);
			}
		}
	}
	public class ZorsePill : ItemBase
	{
		public static ItemDef item;

		public static ItemDef transformItem;

		private const float percentPerStack = 20f;

		public const float duration = 3f;

		public override void Init(ConfigFile configs)
		{
			string name = "ZorsePill";
			if (CheckItemEnabledConfig(name, "Void", configs))
			{
				item = CreateItemDef("ZORSEPILL", name, "Starve enemies on hit to deal delayed damage. <style=cIsVoid>Corrupts all HMTs</style>.", "Starve an enemy for <style=cIsDamage>20%</style> <style=cStack>(+20% per stack)</style> of TOTAL damage. Status duration <style=cIsDamage>resets</style> when reapplied. <style=cIsVoid>Corrupts all HMTs</style>.", "Get this diet pill now! Eat one and it cut's your weight down. Disclaimer: the microbes inside are definitly not eating you from the inside out.", (ItemTier)7, UltAssets.ZorsePillSprite, UltAssets.ZorsePillPrefab, (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }, HMT.item);
			}
		}

		protected override void Hooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			DamageReport.ctor += new hook_ctor(DamageReport_ctor);
		}

		private void DamageReport_ctor(orig_ctor orig, DamageReport self, DamageInfo damageInfo, HealthComponent victim, float damageDealt, float combinedHealthBeforeDamage)
		{
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Invalid comparison between Unknown and I4
			orig.Invoke(self, damageInfo, victim, damageDealt, combinedHealthBeforeDamage);
			try
			{
				GameObject gameObject = ((Component)victim.body).gameObject;
				if (Object.op_Implicit((Object)(object)gameObject) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent<CharacterBody>()) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent<CharacterBody>().inventory) && !damageInfo.rejected && (int)damageInfo.damageType != 67108864)
				{
					CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
					int itemCount = component.inventory.GetItemCount(item);
					if (itemCount > 0)
					{
						InflictDotInfo val = default(InflictDotInfo);
						val.victimObject = gameObject;
						val.attackerObject = damageInfo.attacker;
						val.dotIndex = ZorseStarvingBuff.index;
						val.duration = 3f;
						val.damageMultiplier = damageDealt / component.damage * (float)itemCount * 20f / 100f;
						val.maxStacksFromAttacker = null;
						InflictDotInfo val2 = val;
						DotController.InflictDot(ref val2);
					}
				}
			}
			catch (NullReferenceException)
			{
				Log.Debug(" oh...  Zorse Pill had an expected null error");
			}
		}
	}
}
namespace UltitemsCyan.Items.Untiered
{
	public class CorrodingVaultConsumed : ItemBase
	{
		public static ItemDef item;

		public override void Init(ConfigFile configs)
		{
			Sprite corrodingVaultConsumedSprite = UltAssets.CorrodingVaultConsumedSprite;
			GameObject corrodingVaultConsumedPrefab = UltAssets.CorrodingVaultConsumedPrefab;
			ItemTag[] array = new ItemTag[3];
			RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			item = CreateItemDef("CORRODINGVAULTCONSUMED", "Corroding Vault (Corroded)", "It can't protect anything anymore...", "DESCRIPTION It can't protect anything anymore...", "Rusted Rusted Rusted", (ItemTier)5, corrodingVaultConsumedSprite, corrodingVaultConsumedPrefab, (ItemTag[])(object)array);
		}

		protected override void Hooks()
		{
		}
	}
	public class GreySolvent : ItemBase
	{
		public static ItemDef item;

		public override void Init(ConfigFile configs)
		{
			item = CreateItemDef("GREYSOLVENT", "Grey Solvent", "Everything returns...", "DESCRIPTION Everything returns...", "So a Universal Solute just turns other things into Universal Solvents?\nI guess that makes sense... becasue if there is a universal solute, then everything else desolves it.\nSo then everything else is a universal solvent for the universal solute", (ItemTier)5, UltAssets.UniversalSolventSprite, UltAssets.UniversalSolventPrefab, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)3,
				(ItemTag)4
			});
		}

		protected override void Hooks()
		{
		}
	}
	public class InhabitedCoffinConsumed : ItemBase
	{
		public static ItemDef item;

		public override void Init(ConfigFile configs)
		{
			Sprite inhabitedCoffinConsumedSprite = UltAssets.InhabitedCoffinConsumedSprite;
			GameObject inhabitedCoffinConsumedPrefab = UltAssets.InhabitedCoffinConsumedPrefab;
			ItemTag[] array = new ItemTag[3];
			RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			item = CreateItemDef("INHABITEDCOFFINCONSUMED", "Inhabited Coffin (Vaccant)", "It has been let loose...", "DESCRIPTION It has been let loose...", "Watch Out!", (ItemTier)5, inhabitedCoffinConsumedSprite, inhabitedCoffinConsumedPrefab, (ItemTag[])(object)array);
		}

		protected override void Hooks()
		{
		}
	}
	public class SilverThreadConsumed : ItemBase
	{
		public static ItemDef item;

		public override void Init(ConfigFile configs)
		{
			item = CreateItemDef("SILVERTHREADCONSUMED", "Silver Thread (Snapped)", "Proof of death", "DESCRIPTION Proof of death", "This is a garbage death zone. How did you get here?", (ItemTier)5, UltAssets.SilverThreadConsumedSprite, UltAssets.SilverThreadConsumedPrefab, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)3,
				(ItemTag)4
			});
		}

		protected override void Hooks()
		{
		}
	}
	public class SuesMandiblesConsumed : ItemBase
	{
		public static ItemDef item;

		public override void Init(ConfigFile configs)
		{
			Sprite suesMandiblesConsumedSprite = UltAssets.SuesMandiblesConsumedSprite;
			GameObject suesMandiblesConsumedPrefab = UltAssets.SuesMandiblesConsumedPrefab;
			ItemTag[] array = new ItemTag[3];
			RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			item = CreateItemDef("SUESMANDIBLESCONSUMED", "Sue's Mandibles (Consumed)", "Resting in pieces", "DESCRIPTION Resting in pieces", "I don't know sue", (ItemTier)5, suesMandiblesConsumedSprite, suesMandiblesConsumedPrefab, (ItemTag[])(object)array);
		}

		protected override void Hooks()
		{
		}
	}
}
namespace UltitemsCyan.Items.Tier3
{
	public class CorrodingVault : ItemBase
	{
		public static ItemDef item;

		private const int quantityInVault = 15;

		public override void Init(ConfigFile configs)
		{
			string name = "Corroding Vault";
			if (CheckItemEnabledConfig(name, "Red", configs))
			{
				Sprite corrodingVaultSprite = UltAssets.CorrodingVaultSprite;
				GameObject corrodingVaultPrefab = UltAssets.CorrodingVaultPrefab;
				ItemTag[] array = new ItemTag[3];
				RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
				item = CreateItemDef("CORRODINGVAULT", name, "Breaks at the start of the next stage. Contains white items.", "At the start of each stage, this item will <style=cIsUtility>break</style> and gives <style=cIsUtility>15</style> unique white items", "This vault is sturdy, but over time the rust will just crack it open", (ItemTier)2, corrodingVaultSprite, corrodingVaultPrefab, (ItemTag[])(object)array);
			}
		}

		protected override void Hooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			Stage.BeginServer += new hook_BeginServer(Stage_BeginServer);
		}

		private void Stage_BeginServer(orig_BeginServer orig, Stage self)
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Expected O, but got Unknown
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!NetworkServer.active)
			{
				Log.Debug("Running on Client... return...");
				return;
			}
			foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList)
			{
				if (!Object.op_Implicit((Object)(object)readOnlyInstances.inventory))
				{
					continue;
				}
				int itemCount = readOnlyInstances.inventory.GetItemCount(item.itemIndex);
				if (itemCount <= 0)
				{
					continue;
				}
				readOnlyInstances.inventory.RemoveItem(item, 1);
				readOnlyInstances.inventory.GiveItem(CorrodingVaultConsumed.item, 1);
				PickupIndex[] array = (PickupIndex[])(object)new PickupIndex[Run.instance.availableTier1DropList.Count];
				Run.instance.availableTier1DropList.CopyTo(array);
				int num = array.Length;
				Xoroshiro128Plus val = new Xoroshiro128Plus(Run.instance.stageRng.nextUlong);
				for (int i = 0; i < 15; i++)
				{
					int num2 = val.RangeInt(0, num);
					ItemIndex itemIndex = PickupCatalog.GetPickupDef(array[num2]).itemIndex;
					readOnlyInstances.inventory.GiveItem(itemIndex, 1);
					GenericPickupController.SendPickupMessage(readOnlyInstances, array[num2]);
					array[num2] = array[num - 1];
					num--;
					if (num == 0)
					{
						Log.Debug("Ran out of white items...   Resetting Pool");
						num = array.Length;
						Run.instance.availableTier1DropList.CopyTo(array);
					}
				}
			}
		}
	}
	public class Grapevine : ItemBase
	{
		public static ItemDef item;

		private static GameObject GrapeOrbPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Tooth/HealPack.prefab").WaitForCompletion();

		private static GameObject GrapeEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/HealthOrbEffect.prefab").WaitForCompletion();

		private const float baseGrapeDropChance = 50f;

		private const float stackGrapeDropChance = 25f;

		public const float grapeBlockChance = 85f;

		public const int maxGrapes = 20;

		public override void Init(ConfigFile configs)
		{
			string name = "Grapevine";
			if (CheckItemEnabledConfig(name, "Red", configs))
			{
				item = CreateItemDef("GRAPEVINE", name, "Chance on kill to drop grapes that block damage.", "<style=cIsHealing>50%</style> <style=cStack>(+25% per stack)</style> chance on kill to grow a grape. <style=cIsHealing>85%</style> to <style=cIsHealing>block</style> incomming damage per grape. Block chance is <style=cIsUtility>unaffected by luck</style>.", "If you close your eyes, you can pretend their eyeballs", (ItemTier)2, UltAssets.GrapevineSprite, UltAssets.GrapevinePrefab, (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 });
			}
		}

		protected 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.OnCharacterDeath += new hook_OnCharacterDeath(GlobalEventManager_OnCharacterDeath);
		}

		private void GlobalEventManager_OnCharacterDeath(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport)
		{
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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)
			orig.Invoke(self, damageReport);
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)damageReport.attacker) && Object.op_Implicit((Object)(object)damageReport.attackerBody) && Object.op_Implicit((Object)(object)damageReport.attackerBody.inventory))
			{
				CharacterBody attackerBody = damageReport.attackerBody;
				CharacterBody victimBody = damageReport.victimBody;
				int itemCount = attackerBody.inventory.GetItemCount(item);
				if (itemCount > 0 && Util.CheckRoll(50f + 24f * (float)itemCount, attackerBody.master.luck, (CharacterMaster)null))
				{
					Log.Warning("Dropping grape from " + ((Object)victimBody).name);
					SpawnOrb(victimBody.transform.position, victimBody.transform.rotation, TeamComponent.GetObjectTeam(((Component)attackerBody).gameObject), itemCount);
				}
			}
		}

		public static void SpawnOrb(Vector3 position, Quaternion rotation, TeamIndex teamIndex, int itemCount)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(GrapeOrbPrefab);
			if (Object.op_Implicit((Object)(object)val))
			{
			}
			val.transform.position = position;
			val.transform.rotation = rotation;
			val.GetComponent<TeamFilter>().teamIndex = teamIndex;
			VelocityRandomOnStart component = val.GetComponent<VelocityRandomOnStart>();
			component.maxSpeed = 20f;
			component.minSpeed = 15f;
			component.directionMode = (DirectionMode)2;
			component.coneAngle = 1f;
			HealthPickup componentInChildren = val.GetComponentInChildren<HealthPickup>();
			componentInChildren.alive = false;
			GrapePickup grapePickup = ((Component)componentInChildren).gameObject.AddComponent<GrapePickup>();
			grapePickup.baseObject = val;
			grapePickup.teamFilter = val.GetComponent<TeamFilter>();
			grapePickup.pickupEffect = GrapeEffect;
			val.GetComponent<Rigidbody>().useGravity = true;
			val.transform.localScale = Vector3.one * 2.5f;
			NetworkServer.Spawn(val);
		}
	}
	public class GrapePickup : MonoBehaviour
	{
		private int maxGrapes = 20;

		private BuffDef buffDef = SlipperyGrapeBuff.buff;

		public GameObject baseObject;

		public TeamFilter teamFilter;

		public GameObject pickupEffect;

		private bool alive = true;

		private void OnTriggerStay(Collider other)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && alive && TeamComponent.GetObjectTeam(((Component)other).gameObject) == teamFilter.teamIndex)
			{
				CharacterBody component = ((Component)other).GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)component) && component.GetBuffCount(buffDef) < maxGrapes)
				{
					component.AddBuff(buffDef);
				}
				Object.Destroy((Object)(object)baseObject);
			}
		}
	}
	public class PigsSpork : ItemBase
	{
		public class SporkBleedBehavior : ItemBehavior
		{
			private List<CharacterBody> _inflictors = new List<CharacterBody>();

			public void AddInflictor(CharacterBody inflictor)
			{
				Log.Debug("Adding " + ((Object)inflictor).name + " to inflictors");
				if (!_inflictors.Contains(inflictor))
				{
					_inflictors.Add(inflictor);
				}
			}

			public CharacterBody[] GetInflictors()
			{
				Log.Debug("In Inflictor get method");
				return _inflictors.ToArray();
			}

			public void OnDestroy()
			{
				Log.Warning(" , Spork Bleed ended...");
				_inflictors.Clear();
			}
		}

		public static ItemDef item;

		public const float sporkBleedChance = 200f;

		public const float sporkBaseDuration = 12f;

		private static GameObject willOWisp = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ExplodeOnDeath/WilloWispDelay.prefab").WaitForCompletion();

		private static GameObject sporkBlastEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/BleedOnHitAndExplode/BleedOnHitAndExplode_Explosion.prefab").WaitForCompletion();

		public const float sporkBlastRadius = 32f;

		private const float bleedHealing = 3f;

		public override void Init(ConfigFile configs)
		{
			if (CheckItemEnabledConfig("Pigs Spork", "Red", configs))
			{
				Sprite pigsSporkSprite = UltAssets.PigsSporkSprite;
				GameObject pigsSporkPrefab = UltAssets.PigsSporkPrefab;
				ItemTag[] array = new ItemTag[3];
				RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
				item = CreateItemDef("PIGSSPORK", "Pig's Spork", "Bleeds heal you. When at low health explode and gain 200% chance to bleed enemies.", "Bleed damage <style=cIsHealing>heals</style> for <style=cIsHealing>3</style> <style=cStack>(+3 per stack)</style> <style=cIsHealing>health</style>. When taking damage to below <style=cIsHealth>25% health</style> <style=cIsHealth>hemorrhage</style> all enemies within <style=cIsDamage>32m</style> and gain <style=cIsDamage>200%</style> chance to <style=cIsDamage>bleed</style> for <style=cIsDamage>12s</style> <style=cStack>(+12 per stack)</style>.", "There once was a pet named porky\nA cute and chubby pig\n\nBut the farmer broke his fork\nAnd used the spoon to dig\n\nSo he made a Sporky Spig\n", (ItemTier)2, pigsSporkSprite, pigsSporkPrefab, (ItemTag[])(object)array);
			}
		}

		protected 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
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			DotController.EvaluateDotStacksForType += new hook_EvaluateDotStacksForType(DotController_EvaluateDotStacksForType);
			DotController.InflictDot_refInflictDotInfo += new hook_InflictDot_refInflictDotInfo(DotController_InflictDot_refInflictDotInfo);
			DotController.OnDotStackRemovedServer += new hook_OnDotStackRemovedServer(DotController_OnDotStackRemovedServer);
			GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(GlobalEventManager_OnHitEnemy);
			HealthComponent.UpdateLastHitTime += new hook_UpdateLastHitTime(HealthComponent_UpdateLastHitTime);
		}

		private void HealthComponent_UpdateLastHitTime(orig_UpdateLastHitTime orig, HealthComponent self, float damageValue, Vector3 damagePosition, bool damageIsSilent, GameObject attacker)
		{
			//IL_018f: 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_0088: 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_00dc: 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_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Expected I4, but got Unknown
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected I4, but got Unknown
			//IL_0165: Expected O, but got Unknown
			if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.inventory))
			{
				CharacterBody body = self.body;
				int itemCount = body.inventory.GetItemCount(item);
				if (itemCount > 0 && self.isHealthLow)
				{
					GameObject val = Object.Instantiate<GameObject>(willOWisp, body.corePosition, Quaternion.identity);
					DelayBlast component = val.GetComponent<DelayBlast>();
					component.position = body.corePosition;
					component.attacker = attacker;
					component.inflictor = ((Component)body).gameObject;
					component.baseDamage = body.damage;
					component.baseForce = 1000f;
					component.radius = 32f;
					component.maxTimer = 0.1f;
					component.falloffModel = (FalloffModel)0;
					component.damageColorIndex = (DamageColorIndex)8;
					component.damageType = (DamageType)134348800;
					component.crit = true;
					component.procCoefficient = 1f;
					component.explosionEffect = sporkBlastEffect;
					component.hasSpawnedDelayEffect = true;
					component.teamFilter = new TeamFilter
					{
						teamIndexInternal = (int)body.teamComponent.teamIndex,
						defaultTeam = (TeamIndex)(-1),
						teamIndex = body.teamComponent.teamIndex,
						NetworkteamIndexInternal = (int)body.teamComponent.teamIndex
					};
					body.AddTimedBuff(SporkBleedBuff.buff, 12f * (float)itemCount);
					Util.PlaySound("Play_item_void_bleedOnHit_start", ((Component)body).gameObject);
				}
			}
			orig.Invoke(self, damageValue, damagePosition, damageIsSilent, attacker);
		}

		private void DotController_OnDotStackRemovedServer(orig_OnDotStackRemovedServer orig, DotController self, object dotStack)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, dotStack);
			DotIndex dotIndex = ((DotStack)dotStack).dotIndex;
			if ((int)dotIndex == 0 && Object.op_Implicit((Object)(object)self.victimBody) && (Object)(object)((Component)self.victimBody).GetComponent<SporkBleedBehavior>() != (Object)null)
			{
				self.victimBody.AddItemBehavior<SporkBleedBehavior>(0);
			}
		}

		private void GlobalEventManager_OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			orig.Invoke(self, damageInfo, victim);
			try
			{
				if (!Object.op_Implicit((Object)(object)damageInfo.attacker))
				{
					return;
				}
				CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
				if (component.inventory.GetItemCount(item) <= 0 || !Object.op_Implicit((Object)(object)victim) || !Object.op_Implicit((Object)(object)victim.GetComponent<CharacterBody>()))
				{
					return;
				}
				CharacterBody component2 = victim.GetComponent<CharacterBody>();
				if (component2.HasBuff(Buffs.Bleeding))
				{
					SporkBleedBehavior sporkBleedBehavior = component2.AddItemBehavior<SporkBleedBehavior>(1);
					sporkBleedBehavior.AddInflictor(component);
					if (component.HasBuff(SporkBleedBuff.buff))
					{
						Util.PlaySound("Play_item_void_bleedOnHit_start", ((Component)component).gameObject);
					}
				}
			}
			catch
			{
				Log.Warning("Spork On Hit Expected Error");
			}
		}

		private void DotController_InflictDot_refInflictDotInfo(orig_InflictDot_refInflictDotInfo orig, ref InflictDotInfo inflictDotInfo)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Invalid comparison between Unknown and I4
			orig.Invoke(ref inflictDotInfo);
			string[] obj = new string[6]
			{
				"Dot Controller Spork: ",
				((object)(DotIndex)(ref inflictDotInfo.dotIndex)).ToString(),
				" = ",
				null,
				null,
				null
			};
			DotIndex val = (DotIndex)0;
			obj[3] = ((object)(DotIndex)(ref val)).ToString();
			obj[4] = " | ";
			val = (DotIndex)6;
			obj[5] = ((object)(DotIndex)(ref val)).ToString();
			Log.Debug(string.Concat(obj));
			val = inflictDotInfo.dotIndex;
			if (((int)val == 0 || (int)val == 6) ? true : false)
			{
				CharacterBody component = inflictDotInfo.attackerObject.GetComponent<CharacterBody>();
				if (component.inventory.GetItemCount(item) > 0)
				{
					CharacterBody val2 = (Object.op_Implicit((Object)(object)inflictDotInfo.victimObject) ? inflictDotInfo.victimObject.GetComponent<CharacterBody>() : null);
					SporkBleedBehavior sporkBleedBehavior = val2.AddItemBehavior<SporkBleedBehavior>(1);
					sporkBleedBehavior.AddInflictor(component);
				}
			}
		}

		private void DotController_EvaluateDotStacksForType(orig_EvaluateDotStacksForType orig, DotController self, DotIndex dotIndex, float dt, out int remainingActive)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Invalid comparison between Unknown and I4
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			bool flag = Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.victimObject) && Object.op_Implicit((Object)(object)self.victimBody);
			bool flag2 = flag;
			if (flag2)
			{
				bool flag3 = (((int)dotIndex == 0 || (int)dotIndex == 6) ? true : false);
				flag2 = flag3;
			}
			if (flag2)
			{
				Log.Debug("Evaluating...");
				SporkBleedBehavior component = self.victimObject.GetComponent<SporkBleedBehavior>();
				if (Object.op_Implicit((Object)(object)component))
				{
					CharacterBody[] inflictors = component.GetInflictors();
					CharacterBody[] array = inflictors;
					foreach (CharacterBody val in array)
					{
						int itemCount = val.inventory.GetItemCount(item);
						if (itemCount > 0)
						{
							val.healthComponent.Heal(3f * (float)itemCount, default(ProcChainMask), true);
						}
					}
				}
				Log.Debug("Has inflictors?");
			}
			orig.Invoke(self, dotIndex, dt, ref remainingActive);
			Log.Debug(" ? but How inflictors");
		}
	}
	public class RockyTaffy : ItemBase
	{
		public class RockyTaffyBehaviour : ItemBehavior
		{
			public HealthComponent healthComponent;

			private bool _hasShield = true;

			public bool HasShield
			{
				get
				{
					return _hasShield;
				}
				set
				{
					if (_hasShield != value)
					{
						_hasShield = value;
						Log.Debug(_hasShield + " > Sticky Taffy Dirty Stats (has shield changed)");
						base.body.statsDirty = true;
					}
				}
			}

			public void FixedUpdate()
			{
				if (Object.op_Implicit((Object)(object)healthComponent))
				{
					HasShield = healthComponent.shield > 0f;
				}
			}

			public void Start()
			{
				healthComponent = ((Component)this).GetComponent<HealthComponent>();
			}

			public void OnDestroy()
			{
				HasShield = true;
			}
		}

		public static ItemDef item;

		private const float shieldPercent = 40f;

		public static GameObject CaptainBodyArmorBlockEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Junk/Captain/CaptainBodyArmorBlockEffect.prefab").WaitForCompletion();

		public override void Init(ConfigFile configs)
		{
			string name = "Rocky Taffy";
			if (CheckItemEnabledConfig(name, "Red", configs))
			{
				item = CreateItemDef("ROCKYTAFFY", name, "Gain a recharging shield. Gain a stable barrier without your shield.", "Gain a <style=cIsHealing>shield</style> equal to <style=cIsHealing>40%</style> <style=cStack>(+40% per stack)</style> of your maximum health. On losing your shield, gain a <style=cIsHealing>stable barrier</style> for 100% of your <style=cIsHealing>max shield</style>. No barrier decay without a shield.", "This vault is sturdy, but over time the rust will just crack it open", (ItemTier)2, UltAssets.RockyTaffySprite, UltAssets.RockyTaffyPrefab, (ItemTag[])(object)new ItemTag[2]
				{
					(ItemTag)3,
					(ItemTag)2
				});
			}
		}

		protected 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
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
			HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged);
		}

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory))
			{
				int itemCount = sender.inventory.GetItemCount(item);
				if (itemCount > 0)
				{
					args.baseShieldAdd += sender.healthComponent.fullHealth * (0.4f * (float)itemCount);
				}
			}
		}

		private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			bool flag = true;
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.inventory))
			{
				int itemCount = self.body.inventory.GetItemCount(item);
				if (itemCount > 0)
				{
					flag = false;
					bool flag2 = self.shield > 0f;
					orig.Invoke(self, damageInfo);
					bool flag3 = self.shield > 0f;
					if (flag2 && !flag3)
					{
						Log.Debug("Taffy Shield lost! Gain Barrier");
						Util.PlaySound("Play_voidDevastator_m2_chargeUp", ((Component)self.body).gameObject);
						self.AddBarrier(self.fullShield);
					}
				}
			}
			if (flag)
			{
				orig.Invoke(self, damageInfo);
			}
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)self.inventory))
			{
				return;
			}
			int itemCount = self.inventory.GetItemCount(item);
			if (itemCount > 0)
			{
				if (self.healthComponent.shield <= 0f)
				{
					self.barrierDecayRate = 0f;
				}
				Log.Debug("After Barrier Decay: " + self.barrierDecayRate);
			}
		}

		private void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory))
			{
				self.AddItemBehavior<RockyTaffyBehaviour>(self.inventory.GetItemCount(item));
			}
		}
	}
	public class SuesMandibles : ItemBase
	{
		public static ItemDef item;

		private const float effectDuration = 30f;

		public override void Init(ConfigFile configs)
		{
			if (CheckItemEnabledConfig("Sues Mandibles", "Red", configs))
			{
				item = CreateItemDef("SUESMANDIBLES", "Sue's Mandibles", "Endure a killing blow then gain invulnerability and disable healing for 30s. Consumed on use.", "<style=cIsUtility>Upon a killing blow</style>, this item will be <style=cIsUtility>consumed</style> and you'll <style=cIsHealing>live on 1 health</style> with <style=cIsHealing>30 seconds</style> of <style=cIsHealing>invulnerability</style> and <style=cIsHealth>disabled healing</style>.", "Last Stand", (ItemTier)2, UltAssets.SuesMandiblesSprite, UltAssets.SuesMandiblesPrefab, (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 });
			}
		}

		protected 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_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageInfo);
			CharacterBody body = self.body;
			if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory) && Object.op_Implicit((Object)(object)self) && !self.alive && self.health <= 0f)
			{
				int itemCount = body.inventory.GetItemCount(item);
				if (itemCount > 0)
				{
					Log.Warning(" ! ! ! Killing Blow ! ! ! ");
					Log.Debug("S Combined: " + self.combinedHealth + " FullCombined: " + self.fullCombinedHealth + " Damage: " + damageInfo.damage + " Alive? " + self.alive);
					self.health = 1f;
					body.inventory.RemoveItem(item, 1);
					body.inventory.GiveItem(SuesMandiblesConsumed.item, 1);
					body.AddTimedBuffAuthority(Buffs.Immune.buffIndex, 30f);
					body.AddTimedBuffAuthority(Buffs.HealingDisabled.buffIndex, 30f);
					Util.PlaySound("Play_item_proc_ghostOnKill", ((Component)body).gameObject);
					Util.PlaySound("Play_item_proc_ghostOnKill", ((Component)body).gameObject);
					Util.PlaySound("Play_item_proc_phasing", ((Component)body).gameObject);
					Util.PlaySound("Play_item_proc_phasing", ((Component)body).gameObject);
					Util.PlaySound("Play_elite_haunt_ghost_convert", ((Component)body).gameObject);
				}
			}
		}
	}
	public class ViralSmog : ItemBase
	{
		public static ItemDef item;

		private const float speedPerStackStatus = 25f;

		public override void Init(ConfigFile configs)
		{
			string name = "Viral Smog";
			if (CheckItemEnabledConfig(name, "Red", configs))
			{
				item = CreateItemDef("VIRALSMOG", name, "Increase speed per unique status effect.", "Increases <style=cIsUtility>movement speed</style> by <style=cIsUtility>25%</style> <style=cStack>(+25% per stack)</style> per <style=cIsDamage>unique status</style> you have.", "Illness", (ItemTier)2, UltAssets.ViralSmogSprite, UltAssets.ViralSmogPrefab, (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 });
			}
		}

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

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			if (!Object.op_Implicit((Object)(object)sender) || !Object.op_Implicit((Object)(object)sender.inventory))
			{
				return;
			}
			int itemCount = sender.inventory.GetItemCount(item);
			if (itemCount <= 0)
			{
				return;
			}
			int activeBuffsListCount = sender.activeBuffsListCount;
			BuffIndex[] activeBuffsList = sender.activeBuffsList;
			int num = activeBuffsListCount;
			for (int i = 0; i < activeBuffsListCount; i++)
			{
				BuffDef buffDef = BuffCatalog.GetBuffDef(activeBuffsList[i]);
				if (buffDef.isCooldown)
				{
					num--;
				}
			}
			if (activeBuffsListCount > 0)
			{
				args.moveSpeedMultAdd += 0.25f * (float)num * (float)itemCount;
			}
		}
	}
}
namespace UltitemsCyan.Items.Tier2
{
	public class BirthdayCandles : ItemBase
	{
		public static ItemDef item;

		private const float birthdayDuration = 300f;

		public const float birthdayBuffMultiplier = 32f;

		public override void Init(ConfigFile configs)
		{
			string name = "Birthday Candles";
			if (CheckItemEnabledConfig(name, "Green", configs))
			{
				item = CreateItemDef("BIRTHDAYCANDLES", name, "Temporarily deal extra damage after pickup and at the start of each stage.", "Increase damage by <style=cIsDamage>32%</style> <style=cStack>(+32% per stack)</style> for<style=cIsUtility>5 minutes</style>after pickup and after the start of each stage.", "I don't know what to get you for your birthday...", (ItemTier)1, UltAssets.BirthdayCandleSprite, UltAssets.BirthdayCandlePrefab, (ItemTag[])(object)new ItemTag[2]
				{
					(ItemTag)1,
					(ItemTag)20
				});
			}
		}

		protected 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_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged);
			CharacterBody.onBodyStartGlobal += CharacterBody_onBodyStartGlobal;
			Inventory.GiveItem_ItemIndex_int += new hook_GiveItem_ItemIndex_int(Inventory_GiveItem_ItemIndex_int);
		}

		private void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self)
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory) && self.inventory.GetItemCount(item) < 1)
			{
				self.SetBuffCount(BirthdayBuff.buff.buffIndex, 0);
			}
		}

		protected void CharacterBody_onBodyStartGlobal(CharacterBody self)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory))
			{
				int itemCount = self.inventory.GetItemCount(item.itemIndex);
				if (itemCount > 0)
				{
					Log.Debug("Birthday Candles On Body Start Global for " + self.GetUserName() + " | Candles: " + itemCount);
					ApplyBirthday(self, itemCount, itemCount);
				}
			}
		}

		protected void Inventory_GiveItem_ItemIndex_int(orig_GiveItem_ItemIndex_int orig, Inventory self, ItemIndex itemIndex, int count)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, itemIndex, count);
			if (Object.op_Implicit((Object)(object)self) && itemIndex == item.itemIndex)
			{
				Log.Debug("Give Birthday Candles");
				CharacterBody val = CharacterBody.readOnlyInstancesList.ToList().Find((CharacterBody body) => (Object)(object)body.inventory == (Object)(object)self);
				if (!Object.op_Implicit((Object)(object)val))
				{
					Log.Warning("Null Player has Birthday");
				}
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.inventory) && val.inventory.GetItemCount(RottenBones.item) <= 0)
				{
					ApplyBirthday(val, count, self.GetItemCount(item.itemIndex));
				}
			}
		}

		protected void ApplyBirthday(CharacterBody recipient, int count, int max)
		{
			for (int i = 0; i < count; i++)
			{
				recipient.AddTimedBuff(BirthdayBuff.buff, 300f, max);
			}
			Util.PlaySound("Play_item_proc_igniteOnKill", ((Component)recipient).gameObject);
		}
	}
	public class DegreeScissors : ItemBase
	{
		public static ItemDef item;

		private const int consumedPerScissor = 2;

		private const int scrapsPerConsumed = 2;

		public override void Init(ConfigFile configs)
		{
			string name = "1000 Degree Scissors";
			if (CheckItemEnabledConfig(name, "Green", configs))
			{
				Sprite degreeScissorsSprite = UltAssets.DegreeScissorsSprite;
				GameObject degreeScissorsPrefab = UltAssets.DegreeScissorsPrefab;
				ItemTag[] array = new ItemTag[3];
				RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
				item = CreateItemDef("DEGREESCISSORS", name, "Melts two consumed items into scraps. Otherwise melts itself.", "At the start of each stage, <style=cIsUtility>melts</style> two <style=cIsUtility>consumed</style> items into <style=cIsUtility>2 common scraps</style> each. If no scissor is used, then it <style=cIsUtility>melts</style> itself.", "What's Youtube?", (ItemTier)1, degreeScissorsSprite, degreeScissorsPrefab, (ItemTag[])(object)array);
			}
		}

		protected override void Hooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			Stage.BeginServer += new hook_BeginServer(Stage_BeginServer);
		}

		private void Stage_BeginServer(orig_BeginServer orig, Stage self)
		{
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			Log.Debug(" / / / Into Server Begin");
			orig.Invoke(self);
			Log.Debug(" / / / Out the Server Begin");
			if (!NetworkServer.active)
			{
				Log.Debug("Running on Client... return...");
				return;
			}
			foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList)
			{
				if (Object.op_Implicit((Object)(object)readOnlyInstances.inventory))
				{
					int num = readOnlyInstances.inventory.GetItemCount(item.itemIndex) * 2;
					if (num > 0)
					{
						Log.Warning("Scissors on body start global..." + ((Object)readOnlyInstances).name);
						List<ItemIndex> itemAcquisitionOrder = readOnlyInstances.inventory.itemAcquisitionOrder;
						List<ItemDef> untieredItems = getUntieredItems(itemAcquisitionOrder);
						MeltItems(readOnlyInstances, untieredItems, num);
					}
				}
			}
		}

		private void Run_BeginStage(orig_BeginStage orig, Run self)
		{
			Log.Debug(" . . . In Beginin Stage");
			orig.Invoke(self);
			Log.Debug(" . . . Outing the Begin Stage");
		}

		private List<ItemDef> getUntieredItems(List<ItemIndex> list)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			List<ItemDef> list2 = new List<ItemDef>();
			foreach (ItemIndex item in list)
			{
				ItemDef itemDef = ItemCatalog.GetItemDef(item);