Decompiled source of Bosses Drop Items v1.3.2

BossesDropItems.dll

Decompiled 7 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using ArtifactOfPotential;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using On.RoR2;
using RoR2;
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("BossesDropItems")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+ddf73bc04a4afbe06ab0a58ae4f8e9676a13fb5f")]
[assembly: AssemblyProduct("BossesDropItems")]
[assembly: AssemblyTitle("BossesDropItems")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace BossesDropItems
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Moffein.BossesDropItems", "Bosses Drop Items", "1.3.2")]
	public class BossesDropItems : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_Init <>9__24_0;

			public static hook_LoadGameModes <>9__24_1;

			public static hook_DropRewards <>9__24_2;

			public static hook_TakeDamage <>9__24_3;

			internal void <Awake>b__24_0(orig_Init orig)
			{
				//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_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0021: Unknown result type (might be due to invalid IL or missing references)
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: 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_003f: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke();
				LunarGolemBodyIndex = BodyCatalog.FindBodyIndex("LunarGolemBody");
				LunarExploderBodyIndex = BodyCatalog.FindBodyIndex("LunarExploderBody");
				LunarWispBodyIndex = BodyCatalog.FindBodyIndex("LunarWispBody");
				ElectricWormBodyIndex = BodyCatalog.FindBodyIndex("ElectricWormBody");
			}

			internal void <Awake>b__24_1(orig_LoadGameModes orig)
			{
				//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)
				orig.Invoke();
				SimulacrumIndex = GameModeCatalog.FindGameModeIndex("InfiniteTowerRun");
			}

			internal void <Awake>b__24_2(orig_DropRewards orig, BossGroup self)
			{
				if (self.forceTier3Reward)
				{
					orig.Invoke(self);
				}
			}

			internal void <Awake>b__24_3(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
			{
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_0173: Unknown result type (might be due to invalid IL or missing references)
				//IL_0160: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00eb: Invalid comparison between Unknown and I4
				//IL_0178: Unknown result type (might be due to invalid IL or missing references)
				//IL_0180: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0104: Unknown result type (might be due to invalid IL or missing references)
				//IL_0109: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0116: Unknown result type (might be due to invalid IL or missing references)
				//IL_011b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0128: Unknown result type (might be due to invalid IL or missing references)
				//IL_012d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0229: Unknown result type (might be due to invalid IL or missing references)
				//IL_022e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0282: Unknown result type (might be due to invalid IL or missing references)
				bool alive = self.alive;
				bool flag = Object.op_Implicit((Object)(object)self.body) && self.body.isBoss;
				bool flag2 = !sacrificeOnly || RunArtifactManager.instance.IsArtifactEnabled(Artifacts.Sacrifice.artifactIndex);
				orig.Invoke(self, damageInfo);
				if (!(NetworkServer.active && flag2 && alive) || self.alive || !Object.op_Implicit((Object)(object)((Component)self).gameObject) || !Object.op_Implicit((Object)(object)self.body) || (!self.body.isChampion && (!(!self.body.isChampion && flag) || !hordeDropsItems || Run.instance.gameModeIndex == SimulacrumIndex)) || !Object.op_Implicit((Object)(object)self.body.teamComponent) || (int)self.body.teamComponent.teamIndex != 2 || (flag && !teleBossDropsItems) || (!lunarChimerasDropItems && (self.body.bodyIndex == LunarWispBodyIndex || self.body.bodyIndex == LunarGolemBodyIndex || self.body.bodyIndex == LunarExploderBodyIndex)))
				{
					return;
				}
				DeathRewards component = ((Component)self).gameObject.GetComponent<DeathRewards>();
				PickupIndex bossPickup = (Object.op_Implicit((Object)(object)component) ? PickupCatalog.FindPickupIndex(component.bossPickup.pickupName) : PickupIndex.none);
				DropItem(self.body, bossPickup, guaranteeTeleGreen && flag && self.body.isChampion, 0f);
				if ((self.body.isChampion && self.body.isElite) || self.body.bodyIndex == ElectricWormBodyIndex)
				{
					int num = 0;
					if (Object.op_Implicit((Object)(object)self.body.master))
					{
						num += Mathf.RoundToInt((float)self.body.master.inventory.GetItemCount(Items.BoostHp) / 10f);
					}
					if (self.body.bodyIndex == ElectricWormBodyIndex)
					{
						num += overloadingWormBonus;
					}
					if (self.body.isElite)
					{
						num = Math.Max(num, minEliteBossDrops);
					}
					num = Math.Min(maxExtraDrops, num);
					for (int i = 0; i < num; i++)
					{
						DropItem(self.body, bossPickup, guaranteeTeleGreen && flag && self.body.isChampion, 15f);
					}
				}
			}
		}

		public static float blankChance = 0f;

		public static float whiteChance = 60f;

		public static float greenChance = 30f;

		public static float redChance = 3f;

		public static float yellowChance = 7f;

		public static int minEliteBossDrops = 3;

		public static int maxExtraDrops = 7;

		public static bool guaranteeTeleGreen = true;

		public static bool teleBossDropsItems = true;

		public static bool hordeDropsItems = true;

		public static bool lunarChimerasDropItems = false;

		public static bool enableTeleDrops = true;

		public static bool sacrificeOnly = false;

		public static int overloadingWormBonus = 4;

		public static bool artifactPotentialLoaded = false;

		private static BodyIndex LunarGolemBodyIndex;

		private static BodyIndex LunarWispBodyIndex;

		private static BodyIndex LunarExploderBodyIndex;

		private static BodyIndex ElectricWormBodyIndex;

		private static GameModeIndex SimulacrumIndex;

		public static PickupDropTable tier1Drops = Addressables.LoadAssetAsync<PickupDropTable>((object)"RoR2/Base/Common/dtTier1Item.asset").WaitForCompletion();

		public static PickupDropTable tier2Drops = Addressables.LoadAssetAsync<PickupDropTable>((object)"RoR2/Base/Common/dtTier2Item.asset").WaitForCompletion();

		public static PickupDropTable tier3Drops = Addressables.LoadAssetAsync<PickupDropTable>((object)"RoR2/Base/Common/dtTier3Item.asset").WaitForCompletion();

		public static GameObject potentialPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/OptionPickup/OptionPickup.prefab").WaitForCompletion();

		public void Awake()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			//IL_0040: Expected O, but got Unknown
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			//IL_0075: Expected O, but got Unknown
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Expected O, but got Unknown
			//IL_00aa: Expected O, but got Unknown
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Expected O, but got Unknown
			//IL_00df: Expected O, but got Unknown
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Expected O, but got Unknown
			//IL_0114: Expected O, but got Unknown
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Expected O, but got Unknown
			//IL_0149: Expected O, but got Unknown
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Expected O, but got Unknown
			//IL_017e: Expected O, but got Unknown
			//IL_0198: 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_01b3: Expected O, but got Unknown
			//IL_01b3: Expected O, but got Unknown
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Expected O, but got Unknown
			//IL_01e8: Expected O, but got Unknown
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Expected O, but got Unknown
			//IL_0221: Expected O, but got Unknown
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Expected O, but got Unknown
			//IL_025a: Expected O, but got Unknown
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_0293: Expected O, but got Unknown
			//IL_0293: Expected O, but got Unknown
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Expected O, but got Unknown
			//IL_02cc: Expected O, but got Unknown
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0305: Expected O, but got Unknown
			//IL_0305: Expected O, but got Unknown
			//IL_0323: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: Expected O, but got Unknown
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0353: Expected O, but got Unknown
			//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ab: Expected O, but got Unknown
			//IL_037a: Unknown result type (might be due to invalid IL or missing references)
			//IL_037f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0385: Expected O, but got Unknown
			artifactPotentialLoaded = Chainloader.PluginInfos.ContainsKey("zombieseatflesh7.ArtifactOfPotential");
			sacrificeOnly = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("Drop Settings", "Sacrifice Only"), false, new ConfigDescription("Only drop items if the Artifact of Sacrifice is enabled.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			enableTeleDrops = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("Drop Settings", "Enable Teleporter Drops"), true, new ConfigDescription("Teleporters drop items for all players when all bosses are killed.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			teleBossDropsItems = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("Drop Settings", "Teleporter Bosses Drop Items"), false, new ConfigDescription("Allows Teleporter Bosses to drop items when killed.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			hordeDropsItems = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("Drop Settings", "Horde of Many Drops Items"), false, new ConfigDescription("Allows Horde of Many Bosses to drop items when killed.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			guaranteeTeleGreen = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("Drop Settings", "Guaranteed Green from Tele Bosses"), false, new ConfigDescription("Guarantees that Teleporter Bosses will drop only Green-tier items or better. Does not apply to Horde of Many.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			maxExtraDrops = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("Drop Settings", "Max Extra Drops"), 0, new ConfigDescription("Maximum amount of extra items Elite Bosses can drop. Regular Elite Bosses will attempt to drop 3 extra items, while Tier 2 Elite Bosses will attempt to drop 17.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			minEliteBossDrops = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("Drop Settings", "Min Extra Elite Boss Drops"), 0, new ConfigDescription("Minimum amount of extra items Elite Bosses can drop.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			overloadingWormBonus = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("Drop Settings", "Overloading Worm Extra Boss Drops"), 0, new ConfigDescription("Extra item drops from Overloading Worms.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			lunarChimerasDropItems = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("Drop Settings", "Lunar Chimeras Drop Items"), false, new ConfigDescription("Makes Lunar Chimeras able to drop items when they show up as bosses during Mitchell Phase 2.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			blankChance = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Item Tier Settings", "Blank Chance"), 0f, new ConfigDescription("Chance for bosses to drop no items.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			whiteChance = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Item Tier Settings", "White Chance"), 60f, new ConfigDescription("Chance for bosses to drop a white item.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			greenChance = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Item Tier Settings", "Green Chance"), 30f, new ConfigDescription("Chance for bosses to drop a green item.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			redChance = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Item Tier Settings", "Red Chance"), 3f, new ConfigDescription("Chance for bosses to drop a red item.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			yellowChance = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Item Tier Settings", "Yellow Chance"), 7f, new ConfigDescription("Chance for bosses to drop their corresponding boss item if they have one.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			object obj = <>c.<>9__24_0;
			if (obj == null)
			{
				hook_Init val = delegate(orig_Init orig)
				{
					//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_001c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0021: Unknown result type (might be due to invalid IL or missing references)
					//IL_002b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0030: 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_003f: Unknown result type (might be due to invalid IL or missing references)
					orig.Invoke();
					LunarGolemBodyIndex = BodyCatalog.FindBodyIndex("LunarGolemBody");
					LunarExploderBodyIndex = BodyCatalog.FindBodyIndex("LunarExploderBody");
					LunarWispBodyIndex = BodyCatalog.FindBodyIndex("LunarWispBody");
					ElectricWormBodyIndex = BodyCatalog.FindBodyIndex("ElectricWormBody");
				};
				<>c.<>9__24_0 = val;
				obj = (object)val;
			}
			BodyCatalog.Init += (hook_Init)obj;
			object obj2 = <>c.<>9__24_1;
			if (obj2 == null)
			{
				hook_LoadGameModes val2 = delegate(orig_LoadGameModes orig)
				{
					//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)
					orig.Invoke();
					SimulacrumIndex = GameModeCatalog.FindGameModeIndex("InfiniteTowerRun");
				};
				<>c.<>9__24_1 = val2;
				obj2 = (object)val2;
			}
			GameModeCatalog.LoadGameModes += (hook_LoadGameModes)obj2;
			if (!enableTeleDrops)
			{
				object obj3 = <>c.<>9__24_2;
				if (obj3 == null)
				{
					hook_DropRewards val3 = delegate(orig_DropRewards orig, BossGroup self)
					{
						if (self.forceTier3Reward)
						{
							orig.Invoke(self);
						}
					};
					<>c.<>9__24_2 = val3;
					obj3 = (object)val3;
				}
				BossGroup.DropRewards += (hook_DropRewards)obj3;
			}
			object obj4 = <>c.<>9__24_3;
			if (obj4 == null)
			{
				hook_TakeDamage val4 = delegate(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
				{
					//IL_0035: Unknown result type (might be due to invalid IL or missing references)
					//IL_0173: Unknown result type (might be due to invalid IL or missing references)
					//IL_0160: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
					//IL_00eb: Invalid comparison between Unknown and I4
					//IL_0178: Unknown result type (might be due to invalid IL or missing references)
					//IL_0180: Unknown result type (might be due to invalid IL or missing references)
					//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
					//IL_0104: Unknown result type (might be due to invalid IL or missing references)
					//IL_0109: Unknown result type (might be due to invalid IL or missing references)
					//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
					//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
					//IL_0116: Unknown result type (might be due to invalid IL or missing references)
					//IL_011b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0128: Unknown result type (might be due to invalid IL or missing references)
					//IL_012d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0229: Unknown result type (might be due to invalid IL or missing references)
					//IL_022e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0282: Unknown result type (might be due to invalid IL or missing references)
					bool alive = self.alive;
					bool flag = Object.op_Implicit((Object)(object)self.body) && self.body.isBoss;
					bool flag2 = !sacrificeOnly || RunArtifactManager.instance.IsArtifactEnabled(Artifacts.Sacrifice.artifactIndex);
					orig.Invoke(self, damageInfo);
					if (NetworkServer.active && flag2 && alive && !self.alive && Object.op_Implicit((Object)(object)((Component)self).gameObject) && Object.op_Implicit((Object)(object)self.body) && (self.body.isChampion || (!self.body.isChampion && flag && hordeDropsItems && Run.instance.gameModeIndex != SimulacrumIndex)) && Object.op_Implicit((Object)(object)self.body.teamComponent) && (int)self.body.teamComponent.teamIndex == 2 && (!flag || teleBossDropsItems) && (lunarChimerasDropItems || (self.body.bodyIndex != LunarWispBodyIndex && self.body.bodyIndex != LunarGolemBodyIndex && self.body.bodyIndex != LunarExploderBodyIndex)))
					{
						DeathRewards component = ((Component)self).gameObject.GetComponent<DeathRewards>();
						PickupIndex bossPickup = (Object.op_Implicit((Object)(object)component) ? PickupCatalog.FindPickupIndex(component.bossPickup.pickupName) : PickupIndex.none);
						DropItem(self.body, bossPickup, guaranteeTeleGreen && flag && self.body.isChampion, 0f);
						if ((self.body.isChampion && self.body.isElite) || self.body.bodyIndex == ElectricWormBodyIndex)
						{
							int num = 0;
							if (Object.op_Implicit((Object)(object)self.body.master))
							{
								num += Mathf.RoundToInt((float)self.body.master.inventory.GetItemCount(Items.BoostHp) / 10f);
							}
							if (self.body.bodyIndex == ElectricWormBodyIndex)
							{
								num += overloadingWormBonus;
							}
							if (self.body.isElite)
							{
								num = Math.Max(num, minEliteBossDrops);
							}
							num = Math.Min(maxExtraDrops, num);
							for (int i = 0; i < num; i++)
							{
								DropItem(self.body, bossPickup, guaranteeTeleGreen && flag && self.body.isChampion, 15f);
							}
						}
					}
				};
				<>c.<>9__24_3 = val4;
				obj4 = (object)val4;
			}
			HealthComponent.TakeDamage += (hook_TakeDamage)obj4;
		}

		private static void DropItem(CharacterBody victimBody, PickupIndex bossPickup, bool greenMinimum, float randomOffset)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Invalid comparison between Unknown and I4
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Invalid comparison between Unknown and I4
			//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			ItemTier val = (ItemTier)5;
			float num = whiteChance + greenChance + redChance + yellowChance + blankChance;
			if (!greenMinimum && Util.CheckRoll(100f * blankChance / num, 0f, (CharacterMaster)null))
			{
				return;
			}
			num -= blankChance;
			List<PickupIndex> list;
			if (!greenMinimum && Util.CheckRoll(100f * whiteChance / num, 0f, (CharacterMaster)null))
			{
				list = Run.instance.availableTier1DropList;
				val = (ItemTier)0;
			}
			else
			{
				num -= whiteChance;
				if (Util.CheckRoll(100f * greenChance / num, 0f, (CharacterMaster)null))
				{
					list = Run.instance.availableTier2DropList;
					val = (ItemTier)1;
				}
				else
				{
					num -= greenChance;
					if (Util.CheckRoll(100f * redChance / num, 0f, (CharacterMaster)null))
					{
						list = Run.instance.availableTier3DropList;
						val = (ItemTier)2;
					}
					else if (bossPickup != PickupIndex.none)
					{
						list = new List<PickupIndex> { bossPickup };
						flag = true;
					}
					else
					{
						list = Run.instance.availableTier2DropList;
						val = (ItemTier)1;
					}
				}
			}
			int index = Run.instance.treasureRng.RangeInt(0, list.Count);
			PickupIndex val2 = list[index];
			if (flag || !IsPotentialArtifactActive())
			{
				PickupDropletController.CreatePickupDroplet(val2, victimBody.transform.position, new Vector3(Random.Range(0f, randomOffset), 20f, Random.Range(0f, randomOffset)));
				return;
			}
			ItemTier val3 = val;
			ItemTier val4 = val3;
			PickupDropTable val5 = (((int)val4 == 1) ? tier2Drops : (((int)val4 != 2) ? tier1Drops : tier3Drops));
			Option[] array = PickupPickerController.GenerateOptionsFromDropTable(3, val5, Run.instance.treasureRng);
			if (array.Length != 0)
			{
				bool flag2 = false;
				Option[] array2 = array;
				foreach (Option val6 in array2)
				{
					if (val6.pickupIndex == val2)
					{
						flag2 = true;
						break;
					}
				}
				if (!flag2)
				{
					array[0].pickupIndex = val2;
				}
				CreatePickupInfo val7 = default(CreatePickupInfo);
				val7.pickerOptions = array;
				val7.prefabOverride = potentialPrefab;
				val7.position = victimBody.transform.position;
				val7.rotation = Quaternion.identity;
				((CreatePickupInfo)(ref val7)).pickupIndex = PickupCatalog.FindPickupIndex(val);
				PickupDropletController.CreatePickupDroplet(val7, new Vector3(Random.Range(0f, randomOffset), 20f, Random.Range(0f, randomOffset)));
			}
			else
			{
				PickupDropletController.CreatePickupDroplet(val2, victimBody.transform.position, new Vector3(Random.Range(0f, randomOffset), 20f, Random.Range(0f, randomOffset)));
			}
		}

		public static bool IsPotentialArtifactActive()
		{
			bool result = false;
			if (artifactPotentialLoaded)
			{
				result = IsPotentialArtifactActiveInternal();
			}
			return result;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static bool IsPotentialArtifactActiveInternal()
		{
			return Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(PotentialArtifact.Potential);
		}
	}
}
namespace R2API.Utils
{
	[AttributeUsage(AttributeTargets.Assembly)]
	public class ManualNetworkRegistrationAttribute : Attribute
	{
	}
}