Decompiled source of ZetAspects v2.9.1

plugins/ZetAspects/ZetAspects.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using IL.RoR2;
using IL.RoR2.Stats;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour.HookGen;
using On.RoR2;
using On.RoR2.Items;
using On.RoR2.UI;
using On.RoR2.UI.LogBook;
using On.RoR2.UI.MainMenu;
using RoR2;
using RoR2.ContentManagement;
using RoR2.ExpansionManagement;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Stats;
using RoR2.UI;
using RoR2.UI.MainMenu;
using SimpleJSON;
using TMPro;
using TPDespair.ZetAspects.Compat;
using TPDespair.ZetAspects.Items;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Networking;
using UnityEngine.Rendering.PostProcessing;

[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.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("ZetAspects")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ZetAspects")]
[assembly: AssemblyTitle("ZetAspects")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace TPDespair.ZetAspects
{
	public static class AspectPacks
	{
		public static void Init()
		{
			AspectPack aspectPack = new AspectPack();
			aspectPack.identifier = "RiskOfRain";
			aspectPack.aspectDefs = new List<AspectDef>
			{
				new AspectDef
				{
					identifier = "ZetAspectWhite",
					FindEquipmentDef = () => Equipment.AffixWhite,
					itemName = "ZetAspectWhite",
					displayPriority = 2500,
					BaseIcon = () => Catalog.Sprites.AffixWhite,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectWhite.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixWhite = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixWhite = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectBlue",
					FindEquipmentDef = () => Equipment.AffixBlue,
					itemName = "ZetAspectBlue",
					displayPriority = 2501,
					BaseIcon = () => Catalog.Sprites.AffixBlue,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectBlue.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixBlue = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixBlue = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectRed",
					FindEquipmentDef = () => Equipment.AffixRed,
					itemName = "ZetAspectRed",
					displayPriority = 2502,
					BaseIcon = () => Catalog.Sprites.AffixRed,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectRed.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixRed = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixRed = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectHaunted",
					FindEquipmentDef = () => Equipment.AffixHaunted,
					itemName = "ZetAspectHaunted",
					displayPriority = 7500,
					BaseIcon = () => Catalog.Sprites.AffixHaunted,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectHaunted.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixHaunted = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixHaunted = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectPoison",
					FindEquipmentDef = () => Equipment.AffixPoison,
					itemName = "ZetAspectPoison",
					displayPriority = 7501,
					BaseIcon = () => Catalog.Sprites.AffixPoison,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectPoison.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixPoison = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixPoison = buffDef;
					},
					bodyBlacklist = new List<string> { "UrchinTurretBody", "AspectAbilitiesMalachiteUrchinOrbitalBody" }
				},
				new AspectDef
				{
					identifier = "ZetAspectLunar",
					FindEquipmentDef = () => Equipment.AffixLunar,
					itemName = "ZetAspectLunar",
					displayPriority = 7550,
					BaseIcon = () => Catalog.Sprites.AffixLunar,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectLunar.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixLunar = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixLunar = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectEarth",
					equipmentName = "EliteEarthEquipment",
					itemName = "ZetAspectEarth",
					displayPriority = 2525,
					BaseIcon = () => Catalog.Sprites.AffixEarth,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectEarth.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixEarth = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixEarth = buffDef;
					},
					bodyBlacklist = new List<string> { "AffixEarthHealerBody" }
				},
				new AspectDef
				{
					identifier = "ZetAspectVoid",
					equipmentName = "EliteVoidEquipment",
					itemName = "ZetAspectVoid",
					displayPriority = 12500,
					disableDisplayOnDeath = true,
					copyEquipmentPrefab = false,
					BaseIcon = () => Catalog.Sprites.AffixVoid,
					OutlineIcon = () => Configuration.AspectVoidContagiousItem.Value ? Catalog.Sprites.OutlineVoid : Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectVoid.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixVoid = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixVoid = buffDef;
					}
				}
			};
			aspectPack.PostInit = delegate
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: 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_0024: 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)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//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)
				Catalog.mithrixBodyIndex = BodyCatalog.FindBodyIndex("BrotherBody");
				Catalog.voidlingBodyIndex = BodyCatalog.FindBodyIndex("VoidRaidCrabBody");
				Catalog.artifactShellBodyIndex = BodyCatalog.FindBodyIndex("ArtifactShellBody");
				Catalog.goldenTitanBodyIndex = BodyCatalog.FindBodyIndex("TitanGoldBody");
				BuffDef affixHauntedRecipient = Buffs.AffixHauntedRecipient;
				affixHauntedRecipient.buffColor = Color.white;
				affixHauntedRecipient.iconSprite = Catalog.Sprites.HauntCloak;
			};
			AspectPackDefOf.RiskOfRain = aspectPack.Register();
			aspectPack = new AspectPack();
			aspectPack.identifier = "SpikeStrip";
			aspectPack.dependency = "com.groovesalad.GrooveSaladSpikestripContent";
			aspectPack.aspectDefs = new List<AspectDef>
			{
				new AspectDef
				{
					identifier = "ZetAspectPlated",
					equipmentName = "EQUIPMENT_AFFIXPLATED",
					itemName = "ZetAspectPlated",
					displayPriority = 3000,
					BaseIcon = () => Catalog.Sprites.AffixPlated,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectPlated.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixPlated = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixPlated = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectWarped",
					equipmentName = "EQUIPMENT_AFFIXWARPED",
					itemName = "ZetAspectWarped",
					displayPriority = 3001,
					BaseIcon = () => Catalog.Sprites.AffixWarped,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectWarped.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixWarped = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixWarped = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectVeiled",
					equipmentName = "EQUIPMENT_AFFIXVEILED",
					itemName = "ZetAspectVeiled",
					displayPriority = 3002,
					BaseIcon = () => Catalog.Sprites.AffixVeiled,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectVeiled.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixVeiled = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixVeiled = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectAragonite",
					equipmentName = "EQUIPMENT_AFFIXARAGONITE",
					itemName = "ZetAspectAragonite",
					displayPriority = 9000,
					BaseIcon = () => Catalog.Sprites.AffixAragonite,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectAragonite.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixAragonite = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixAragonite = buffDef;
					}
				}
			};
			AspectPackDefOf.SpikeStrip = aspectPack.Register();
			aspectPack = new AspectPack();
			aspectPack.identifier = "GoldenCoastPlus";
			aspectPack.CustomDependency = () => Catalog.PluginLoaded("com.Skell.GoldenCoastPlus") || Catalog.PluginLoaded("com.Phreel.GoldenCoastPlusRevived");
			aspectPack.aspectDefs = new List<AspectDef>
			{
				new AspectDef
				{
					identifier = "ZetAspectGold",
					equipmentName = "EliteGoldEquipment",
					itemName = "ZetAspectGold",
					displayPriority = 500,
					copyEquipmentPrefab = false,
					BaseIcon = () => Catalog.Sprites.AffixGold,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectGold.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixGold = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixGold = buffDef;
					}
				}
			};
			AspectPackDefOf.GoldenCoastPlus = aspectPack.Register();
			aspectPack = new AspectPack();
			aspectPack.identifier = "Aetherium";
			aspectPack.dependency = "com.KomradeSpectre.Aetherium";
			aspectPack.aspectDefs = new List<AspectDef>
			{
				new AspectDef
				{
					identifier = "ZetAspectSanguine",
					equipmentName = "AETHERIUM_ELITE_EQUIPMENT_AFFIX_SANGUINE",
					itemName = "ZetAspectSanguine",
					displayPriority = 7000,
					BaseIcon = () => Catalog.Sprites.AffixSanguine,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectSanguine.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixSanguine = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixSanguine = buffDef;
					}
				}
			};
			AspectPackDefOf.Aetherium = aspectPack.Register();
			aspectPack = new AspectPack();
			aspectPack.identifier = "Bubbet";
			aspectPack.dependency = "bubbet.bubbetsitems";
			aspectPack.aspectDefs = new List<AspectDef>
			{
				new AspectDef
				{
					identifier = "ZetAspectSepia",
					equipmentName = "EquipmentDefSepiaElite",
					itemName = "ZetAspectSepia",
					displayPriority = 750,
					copyEquipmentPrefab = false,
					BaseIcon = () => Catalog.Sprites.AffixSepia,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectSepia.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixSepia = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixSepia = buffDef;
					}
				}
			};
			aspectPack.PostInit = delegate
			{
				//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)
				BuffDef affixSepia = BuffDefOf.AffixSepia;
				if (Object.op_Implicit((Object)(object)affixSepia))
				{
					affixSepia.buffColor = Color.white;
					affixSepia.iconSprite = Catalog.Sprites.SepiaElite;
				}
			};
			AspectPackDefOf.Bubbet = aspectPack.Register();
			aspectPack = new AspectPack();
			aspectPack.identifier = "WarWisp";
			aspectPack.dependency = "com.PopcornFactory.WispMod";
			aspectPack.aspectDefs = new List<AspectDef>
			{
				new AspectDef
				{
					identifier = "ZetAspectNullifier",
					equipmentName = "WARFRAMEWISP_ELITE_EQUIPMENT_AFFIX_NULLIFIER",
					itemName = "ZetAspectNullifier",
					displayPriority = 6500,
					BaseIcon = () => Catalog.Sprites.AffixNullifier,
					OutlineIcon = () => Catalog.Sprites.OutlineNull,
					SetupTokens = ZetAspectNullifier.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixNullifier = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixNullifier = buffDef;
					}
				}
			};
			AspectPackDefOf.WarWisp = aspectPack.Register();
			aspectPack = new AspectPack();
			aspectPack.identifier = "Blighted";
			aspectPack.dependency = "com.Moffein.BlightedElites";
			aspectPack.alwaysValidate = true;
			aspectPack.aspectDefs = new List<AspectDef>
			{
				new AspectDef
				{
					identifier = "ZetAspectBlighted",
					equipmentName = "AffixBlightedMoffein",
					itemName = "ZetAspectBlighted",
					displayPriority = 15000,
					BaseIcon = () => Catalog.Sprites.AffixBlighted,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectBlighted.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixBlighted = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixBlighted = buffDef;
					}
				}
			};
			AspectPackDefOf.Blighted = aspectPack.Register();
			aspectPack = new AspectPack();
			aspectPack.identifier = "GOTCE";
			aspectPack.dependency = "com.TheBestAssociatedLargelyLudicrousSillyheadGroup.GOTCE";
			aspectPack.aspectDefs = new List<AspectDef>
			{
				new AspectDef
				{
					identifier = "ZetAspectBackup",
					equipmentName = "ELITE_EQUIPMENT_BACKUP",
					itemName = "ZetAspectBackup",
					displayPriority = 1000,
					BaseIcon = () => Catalog.Sprites.AffixBackup,
					OutlineIcon = () => Catalog.Sprites.OutlineCracked,
					SetupTokens = ZetAspectBackup.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixBackup = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixBackup = buffDef;
					}
				}
			};
			aspectPack.PostInit = delegate
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Invalid comparison between Unknown and I4
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				BuffIndex val5 = BuffCatalog.FindBuffIndex("Backuped");
				if ((int)val5 != -1)
				{
					BuffDefOf.BackupDebuff = BuffCatalog.GetBuffDef(val5);
				}
				BuffDef backupDebuff = BuffDefOf.BackupDebuff;
				if (Object.op_Implicit((Object)(object)backupDebuff))
				{
					backupDebuff.buffColor = Color.white;
					backupDebuff.iconSprite = Catalog.Sprites.BackupDebuff;
				}
			};
			AspectPackDefOf.GOTCE = aspectPack.Register();
			aspectPack = new AspectPack();
			aspectPack.identifier = "Thalasso";
			aspectPack.dependency = "com.jt_hehe.Thalassophobia";
			aspectPack.aspectDefs = new List<AspectDef>
			{
				new AspectDef
				{
					identifier = "ZetAspectPurity",
					equipmentName = "THALASSOPHOBIA_ELITE_EQUIPMENT_AFFIX_PURE",
					itemName = "ZetAspectPurity",
					displayPriority = 3500,
					copyEquipmentPrefab = false,
					BaseIcon = () => Catalog.Sprites.AffixPurity,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectPurity.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixPurity = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixPurity = buffDef;
					}
				}
			};
			AspectPackDefOf.Thalasso = aspectPack.Register();
			aspectPack = new AspectPack();
			aspectPack.identifier = "RisingTides";
			aspectPack.dependency = "com.themysticsword.risingtides";
			aspectPack.aspectDefs = new List<AspectDef>
			{
				new AspectDef
				{
					identifier = "ZetAspectBarrier",
					equipmentName = "RisingTides_AffixBarrier",
					itemName = "ZetAspectBarrier",
					displayPriority = 10250,
					BaseIcon = () => Catalog.Sprites.AffixBarrier,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectBarrier.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixBarrier = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixBarrier = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectBlackHole",
					equipmentName = "RisingTides_AffixBlackHole",
					itemName = "ZetAspectBlackHole",
					displayPriority = 10000,
					BaseIcon = () => Catalog.Sprites.AffixBlackHole,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectBlackHole.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixBlackHole = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixBlackHole = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectMoney",
					equipmentName = "RisingTides_AffixMoney",
					itemName = "ZetAspectMoney",
					displayPriority = 4501,
					BaseIcon = () => Catalog.Sprites.AffixMoney,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectMoney.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixMoney = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixMoney = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectNight",
					equipmentName = "RisingTides_AffixNight",
					itemName = "ZetAspectNight",
					displayPriority = 4500,
					BaseIcon = () => Catalog.Sprites.AffixNight,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectNight.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixNight = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixNight = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectWater",
					equipmentName = "RisingTides_AffixWater",
					itemName = "ZetAspectWater",
					displayPriority = 10001,
					BaseIcon = () => Catalog.Sprites.AffixWater,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectWater.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixWater = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixWater = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectRealgar",
					equipmentName = "RisingTides_AffixImpPlane",
					itemName = "ZetAspectRealgar",
					displayPriority = 10002,
					BaseIcon = () => Catalog.Sprites.AffixRealgar,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectRealgar.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixRealgar = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixRealgar = buffDef;
					}
				}
			};
			aspectPack.PostInit = delegate
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Invalid comparison between Unknown and I4
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: 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_002f: Invalid comparison between Unknown and I4
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				BuffIndex val4 = BuffCatalog.FindBuffIndex("RisingTides_NightSpeedBoost");
				if ((int)val4 != -1)
				{
					BuffDefOf.NightSpeed = BuffCatalog.GetBuffDef(val4);
				}
				val4 = BuffCatalog.FindBuffIndex("RisingTides_NightReducedVision");
				if ((int)val4 != -1)
				{
					BuffDefOf.NightBlind = BuffCatalog.GetBuffDef(val4);
				}
			};
			AspectPackDefOf.RisingTides = aspectPack.Register();
			aspectPack = new AspectPack();
			aspectPack.identifier = "NemRisingTides";
			aspectPack.dependency = "prodzpod.NemesisRisingTides";
			aspectPack.alwaysValidate = true;
			aspectPack.aspectDefs = new List<AspectDef>
			{
				new AspectDef
				{
					identifier = "ZetAspectBuffered",
					FindEquipmentDef = delegate
					{
						//IL_000c: Unknown result type (might be due to invalid IL or missing references)
						//IL_0011: Unknown result type (might be due to invalid IL or missing references)
						//IL_0012: Unknown result type (might be due to invalid IL or missing references)
						//IL_0014: Invalid comparison between Unknown and I4
						//IL_0028: Unknown result type (might be due to invalid IL or missing references)
						NemRisingTides.PrepareEquipmentCheck();
						EquipmentIndex val3 = EquipmentCatalog.FindEquipmentIndex("NemesisRisingTides_AffixBuffered");
						return ((int)val3 != -1 && NemRisingTides.GetBufferedEnabled()) ? EquipmentCatalog.GetEquipmentDef(val3) : null;
					},
					itemName = "ZetAspectBuffered",
					displayPriority = 4000,
					BaseIcon = () => Catalog.Sprites.AffixBuffered,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectBuffered.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixBuffered = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixBuffered = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectOppressive",
					FindEquipmentDef = delegate
					{
						//IL_000c: Unknown result type (might be due to invalid IL or missing references)
						//IL_0011: Unknown result type (might be due to invalid IL or missing references)
						//IL_0012: Unknown result type (might be due to invalid IL or missing references)
						//IL_0014: Invalid comparison between Unknown and I4
						//IL_0028: Unknown result type (might be due to invalid IL or missing references)
						NemRisingTides.PrepareEquipmentCheck();
						EquipmentIndex val2 = EquipmentCatalog.FindEquipmentIndex("NemesisRisingTides_AffixOppressive");
						return ((int)val2 != -1 && NemRisingTides.GetOppressiveEnabled()) ? EquipmentCatalog.GetEquipmentDef(val2) : null;
					},
					itemName = "ZetAspectOppressive",
					displayPriority = 11000,
					BaseIcon = () => Catalog.Sprites.AffixOppressive,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectOppressive.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixOppressive = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixOppressive = buffDef;
					}
				}
			};
			AspectPackDefOf.NemRisingTides = aspectPack.Register();
			aspectPack = new AspectPack();
			aspectPack.identifier = "MoreElites";
			aspectPack.dependency = "com.Nuxlar.MoreElites";
			aspectPack.aspectDefs = new List<AspectDef>
			{
				new AspectDef
				{
					identifier = "ZetAspectEmpowering",
					equipmentName = "AffixEmpowering",
					itemName = "ZetAspectEmpowering",
					displayPriority = 1501,
					BaseIcon = () => Catalog.Sprites.AffixBuffing,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectEmpowering.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixEmpowering = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixEmpowering = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectFrenzied",
					equipmentName = "AffixFrenziedNuxlar",
					itemName = "ZetAspectFrenzied",
					displayPriority = 1500,
					BaseIcon = () => Catalog.Sprites.AffixFrenzied,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectFrenzied.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixFrenzied = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixFrenzied = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectVolatile",
					equipmentName = "AffixVolatile",
					itemName = "ZetAspectVolatile",
					displayPriority = 1502,
					BaseIcon = () => Catalog.Sprites.AffixVolatile,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectVolatile.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixVolatile = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixVolatile = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectEcho",
					equipmentName = "AffixEcho",
					itemName = "ZetAspectEcho",
					displayPriority = 8000,
					BaseIcon = () => Catalog.Sprites.AffixEcho,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectEcho.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixEcho = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixEcho = buffDef;
					},
					AllowAffix = (CharacterBody body, Inventory inventory) => (Object)(object)inventory != (Object)null && inventory.GetItemCount(Catalog.summonedEcho) == 0,
					PreBuffGrant = delegate(CharacterBody body, Inventory inventory)
					{
						body.AddTimedBuff(BuffDefOf.ZetEchoPrimer, 0.1f);
						return false;
					}
				}
			};
			AspectPackDefOf.MoreElites = aspectPack.Register();
			aspectPack = new AspectPack();
			aspectPack.identifier = "EliteVariety";
			aspectPack.dependency = "com.themysticsword.elitevariety";
			aspectPack.aspectDefs = new List<AspectDef>
			{
				new AspectDef
				{
					identifier = "ZetAspectArmor",
					equipmentName = "EliteVariety_AffixArmored",
					itemName = "ZetAspectArmor",
					displayPriority = 5001,
					BaseIcon = () => Catalog.Sprites.AffixArmored,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectArmor.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixArmored = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixArmored = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectBanner",
					equipmentName = "EliteVariety_AffixBuffing",
					itemName = "ZetAspectBanner",
					displayPriority = 5100,
					BaseIcon = () => Catalog.Sprites.AffixBuffing,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectBanner.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixBuffing = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixBuffing = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectImpale",
					equipmentName = "EliteVariety_AffixImpPlane",
					itemName = "ZetAspectImpale",
					displayPriority = 9500,
					BaseIcon = () => Catalog.Sprites.AffixImpPlane,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectImpale.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixImpPlane = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixImpPlane = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectGolden",
					equipmentName = "EliteVariety_AffixPillaging",
					itemName = "ZetAspectGolden",
					displayPriority = 5000,
					BaseIcon = () => Catalog.Sprites.AffixPillaging,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectGolden.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixPillaging = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixPillaging = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectCyclone",
					equipmentName = "EliteVariety_AffixSandstorm",
					itemName = "ZetAspectCyclone",
					displayPriority = 5200,
					BaseIcon = () => Catalog.Sprites.AffixSandstorm,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectCyclone.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixSandstorm = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixSandstorm = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectTinker",
					equipmentName = "EliteVariety_AffixTinkerer",
					itemName = "ZetAspectTinker",
					displayPriority = 5250,
					BaseIcon = () => Catalog.Sprites.AffixTinkerer,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectTinker.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixTinkerer = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixTinkerer = buffDef;
					},
					bodyBlacklist = new List<string> { "EliteVariety_TinkererDroneBody" }
				}
			};
			aspectPack.PostInit = delegate
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: 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_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Invalid comparison between Unknown and I4
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				Catalog.tinkerDroneBodyIndex = BodyCatalog.FindBodyIndex("EliteVariety_TinkererDroneBody");
				BuffIndex val = BuffCatalog.FindBuffIndex("EliteVariety_SandstormBlind");
				if ((int)val != -1)
				{
					BuffDefOf.SandBlind = BuffCatalog.GetBuffDef(val);
				}
			};
			AspectPackDefOf.EliteVariety = aspectPack.Register();
			aspectPack = new AspectPack();
			aspectPack.identifier = "Augmentum";
			aspectPack.dependency = "com.BrandonRosa.Augmentum";
			aspectPack.alwaysValidate = true;
			aspectPack.aspectDefs = new List<AspectDef>
			{
				new AspectDef
				{
					identifier = "ZetAspectAdaptive",
					equipmentName = "BRANS_ELITE_EQUIPMENT_AFFIX_ADAPTIVE",
					itemName = "ZetAspectAdaptive",
					displayPriority = 6000,
					BaseIcon = () => Catalog.Sprites.AffixAdaptive,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectAdaptive.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixAdaptive = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixAdaptive = buffDef;
					}
				}
			};
			AspectPackDefOf.Augmentum = aspectPack.Register();
			aspectPack = new AspectPack();
			aspectPack.identifier = "Sandswept";
			aspectPack.dependency = "com.TeamSandswept.Sandswept";
			aspectPack.aspectDefs = new List<AspectDef>
			{
				new AspectDef
				{
					identifier = "ZetAspectMotivator",
					equipmentName = "ELITE_EQUIPMENT_MOTIVATING",
					itemName = "ZetAspectMotivator",
					displayPriority = 5750,
					BaseIcon = () => Catalog.Sprites.AffixMotivator,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectMotivator.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixMotivator = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixMotivator = buffDef;
					}
				},
				new AspectDef
				{
					identifier = "ZetAspectOsmium",
					equipmentName = "ELITE_EQUIPMENT_OSMIUM",
					itemName = "ZetAspectOsmium",
					displayPriority = 13000,
					BaseIcon = () => Catalog.Sprites.AffixOsmium,
					OutlineIcon = () => Catalog.Sprites.OutlineStandard,
					SetupTokens = ZetAspectOsmium.SetupTokens,
					RefEquipmentDef = delegate(EquipmentDef equipmentDef)
					{
						EquipDefOf.AffixOsmium = equipmentDef;
					},
					RefBuffDef = delegate(BuffDef buffDef)
					{
						BuffDefOf.AffixOsmium = buffDef;
					}
				}
			};
			AspectPackDefOf.Sandswept = aspectPack.Register();
		}
	}
	public enum PopState
	{
		None = 0,
		Equip = 1,
		Buff = 2,
		Item = 4,
		Replace = 8,
		Populated = 0x10
	}
	public static class FlagExt
	{
		public static void SetFlag(this ref PopState flag, PopState other)
		{
			flag |= other;
		}

		public static bool CheckFlag(this PopState flag, PopState other)
		{
			return (flag & other) != 0;
		}
	}
	public class AspectDef
	{
		public string identifier = "";

		public AspectPack pack;

		public EquipmentDef equipmentDef;

		public BuffDef buffDef;

		public ItemDef itemDef;

		public string equipmentName = "";

		public string buffName = "";

		public string itemName = "";

		public Func<EquipmentDef> FindEquipmentDef;

		public Func<BuffDef> FindBuffDef;

		public Func<ItemDef> FindItemDef;

		public Action<EquipmentDef> RefEquipmentDef;

		public Action<BuffDef> RefBuffDef;

		public Action<ItemDef> RefItemDef;

		public Func<Sprite> BaseIcon;

		public Func<Sprite> OutlineIcon;

		public bool copyEquipmentPrefab = true;

		public int displayPriority = 1;

		public bool disableDisplayOnDeath = false;

		public Action SetupTokens;

		public Action<AspectDef> PostInit;

		public List<string> bodyBlacklist = new List<string>();

		public List<BodyIndex> blacklistedIndexes = new List<BodyIndex>();

		public Func<CharacterBody, Inventory, bool> AllowAffix;

		public Func<CharacterBody, Inventory, bool> PreBuffGrant;

		public bool invalid = false;

		public ConfigEntry<float> DropWeight;

		public bool PackPopulated
		{
			get
			{
				if (pack != null)
				{
					return pack.Populated;
				}
				return false;
			}
		}

		public bool PackEnabled
		{
			get
			{
				if (pack != null)
				{
					return pack.Enabled;
				}
				return false;
			}
		}

		internal void CreateDropWeightConfig(ConfigFile config)
		{
			DropWeight = config.Bind<float>("0b-DropWeight", "aspectDropWeight" + identifier, 1f, "Drop chance multiplier for " + identifier);
		}
	}
	public class AspectPack
	{
		public string identifier = "";

		public string dependency = "";

		public List<string> dependencies = new List<string>();

		public Func<bool> CustomDependency = () => true;

		public bool alwaysValidate = false;

		public Action PostInit;

		private int _enabled = -1;

		private PopState PopState = PopState.None;

		public List<AspectDef> aspectDefs = new List<AspectDef>();

		public bool Enabled
		{
			get
			{
				if (_enabled == -1)
				{
					if (dependency == "")
					{
						if (dependencies.Count == 0)
						{
							_enabled = (CustomDependency() ? 1 : 0);
						}
						else
						{
							foreach (string dependency in dependencies)
							{
								if (!Catalog.PluginLoaded(dependency))
								{
									_enabled = 0;
									return false;
								}
							}
							_enabled = 1;
						}
					}
					else
					{
						_enabled = (Catalog.PluginLoaded(this.dependency) ? 1 : 0);
					}
				}
				return _enabled == 1;
			}
		}

		public bool Populated => PopState.CheckFlag(PopState.Populated);

		public AspectPack Register()
		{
			Catalog.aspectPacks.Add(this);
			foreach (AspectDef aspectDef in aspectDefs)
			{
				Catalog.aspectDefs.Add(aspectDef);
			}
			return this;
		}

		internal void Entrada()
		{
			if (Enabled)
			{
				AssignPack();
				PopulateEquipment();
				PopulateItems();
				ValidateDefs();
				DisableInactiveItems();
				ApplyIcons();
			}
			else if (alwaysValidate)
			{
				AssignPack();
				PopulateEquipment();
				PopulateItems();
				ValidateDefs();
				DisableInactiveItems();
			}
		}

		internal void Init()
		{
			if (Enabled)
			{
				PopulateEquipment();
				PopulateBuffs();
				PopulateItems();
				ValidateDefs();
				DisableInactiveItems();
				ResolveBlacklist();
				CopyExpansionReq();
				CopyModelPrefabs();
				ApplyIcons();
				EquipmentColor();
				SetupTokens();
				if (DropHooks.CanObtainEquipment())
				{
					EquipmentEntries(shown: true);
				}
				ItemEntries(DropHooks.CanObtainItem());
				FillEqualities();
				DoPostInit();
				PopState.SetFlag(PopState.Populated);
			}
			else if (alwaysValidate)
			{
				PopulateEquipment();
				PopulateItems();
				ValidateDefs();
				DisableInactiveItems();
			}
		}

		internal void Finale()
		{
			if (Populated)
			{
				ItemEntries(shown: true);
				EquipmentEntries(shown: false);
			}
		}

		private void AssignPack()
		{
			foreach (AspectDef aspectDef in aspectDefs)
			{
				aspectDef.pack = this;
			}
		}

		private void PopulateEquipment()
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Invalid comparison between Unknown and I4
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			if (PopState.CheckFlag(PopState.Equip))
			{
				return;
			}
			foreach (AspectDef aspectDef in aspectDefs)
			{
				EquipmentDef val = null;
				if (aspectDef.equipmentName != "")
				{
					EquipmentIndex val2 = EquipmentCatalog.FindEquipmentIndex(aspectDef.equipmentName);
					if ((int)val2 != -1)
					{
						val = EquipmentCatalog.GetEquipmentDef(val2);
					}
					if (!Object.op_Implicit((Object)(object)val))
					{
						Logger.Warn("Failed to find EquipmentDef named : " + aspectDef.equipmentName);
					}
				}
				if (!Object.op_Implicit((Object)(object)val))
				{
					val = aspectDef.FindEquipmentDef?.Invoke();
				}
				if (Object.op_Implicit((Object)(object)val))
				{
					aspectDef.equipmentDef = val;
					aspectDef.RefEquipmentDef?.Invoke(val);
				}
				if (!Object.op_Implicit((Object)(object)aspectDef.equipmentDef))
				{
					aspectDef.invalid = true;
					Logger.Warn("Failed to find EquipmentDef for : " + aspectDef.identifier);
				}
			}
			PopState.SetFlag(PopState.Equip);
		}

		private void PopulateBuffs()
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Invalid comparison between Unknown and I4
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			if (PopState.CheckFlag(PopState.Buff))
			{
				return;
			}
			foreach (AspectDef aspectDef in aspectDefs)
			{
				BuffDef val = null;
				if (aspectDef.buffName != "")
				{
					BuffIndex val2 = BuffCatalog.FindBuffIndex(aspectDef.buffName);
					if ((int)val2 != -1)
					{
						val = BuffCatalog.GetBuffDef(val2);
					}
					if (!Object.op_Implicit((Object)(object)val))
					{
						Logger.Warn("Failed to find BuffDef named : " + aspectDef.buffName);
					}
				}
				if (!Object.op_Implicit((Object)(object)val))
				{
					val = aspectDef.FindBuffDef?.Invoke();
				}
				if (!Object.op_Implicit((Object)(object)val) && (Object)(object)aspectDef.equipmentDef != (Object)null)
				{
					val = aspectDef.equipmentDef.passiveBuffDef;
				}
				if (Object.op_Implicit((Object)(object)val))
				{
					aspectDef.buffDef = val;
					aspectDef.RefBuffDef?.Invoke(val);
				}
				if (!Object.op_Implicit((Object)(object)aspectDef.buffDef))
				{
					aspectDef.invalid = true;
					Logger.Warn("Failed to find BuffDef for : " + aspectDef.identifier);
				}
			}
			PopState.SetFlag(PopState.Buff);
		}

		private void PopulateItems()
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Invalid comparison between Unknown and I4
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			if (PopState.CheckFlag(PopState.Item))
			{
				return;
			}
			foreach (AspectDef aspectDef in aspectDefs)
			{
				ItemDef val = null;
				if (aspectDef.itemName != "")
				{
					ItemIndex val2 = ItemCatalog.FindItemIndex(aspectDef.itemName);
					if ((int)val2 != -1)
					{
						val = ItemCatalog.GetItemDef(val2);
					}
					if (!Object.op_Implicit((Object)(object)val))
					{
						Logger.Warn("Failed to find BuffDef named : " + aspectDef.buffName);
					}
				}
				if (!Object.op_Implicit((Object)(object)val))
				{
					val = aspectDef.FindItemDef?.Invoke();
				}
				if (Object.op_Implicit((Object)(object)val))
				{
					aspectDef.itemDef = val;
					aspectDef.RefItemDef?.Invoke(val);
				}
				if (!Object.op_Implicit((Object)(object)aspectDef.itemDef))
				{
					aspectDef.invalid = true;
					Logger.Warn("Failed to find ItemDef for : " + aspectDef.identifier);
				}
			}
			PopState.SetFlag(PopState.Item);
		}

		private void ValidateDefs()
		{
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Invalid comparison between Unknown and I4
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Invalid comparison between Unknown and I4
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Invalid comparison between Unknown and I4
			if ((PopState & (PopState)7) == 0)
			{
				Logger.Warn("Tried to ValidateDefs of " + identifier + " but nothing is populated!");
				return;
			}
			foreach (AspectDef aspectDef in aspectDefs)
			{
				if (PopState.CheckFlag(PopState.Equip))
				{
					if (Object.op_Implicit((Object)(object)aspectDef.equipmentDef))
					{
						if ((int)aspectDef.equipmentDef.equipmentIndex == -1)
						{
							aspectDef.invalid = true;
							Logger.Warn(aspectDef.identifier + " : associated EquipmentIndex is [none]!");
						}
					}
					else
					{
						aspectDef.invalid = true;
						Logger.Warn(aspectDef.identifier + " : associated Equipment is null!");
					}
				}
				if (PopState.CheckFlag(PopState.Buff))
				{
					if (Object.op_Implicit((Object)(object)aspectDef.buffDef))
					{
						if ((int)aspectDef.buffDef.buffIndex == -1)
						{
							aspectDef.invalid = true;
							Logger.Warn(aspectDef.identifier + " : associated BuffIndex is [none]!");
						}
					}
					else
					{
						aspectDef.invalid = true;
						Logger.Warn(aspectDef.identifier + " : associated Buff is null!");
					}
				}
				if (!PopState.CheckFlag(PopState.Item))
				{
					continue;
				}
				if (Object.op_Implicit((Object)(object)aspectDef.itemDef))
				{
					if ((int)aspectDef.itemDef.itemIndex == -1)
					{
						aspectDef.invalid = true;
						Logger.Warn(aspectDef.identifier + " : associated ItemIndex is [none]!");
					}
				}
				else
				{
					aspectDef.invalid = true;
					Logger.Warn(aspectDef.identifier + " : associated Item is null!");
				}
			}
		}

		private void DisableInactiveItems()
		{
			foreach (AspectDef aspectDef in aspectDefs)
			{
				if (aspectDef.invalid)
				{
					DeactivateItem(aspectDef);
					aspectDef.RefEquipmentDef?.Invoke(null);
					aspectDef.RefBuffDef?.Invoke(null);
					aspectDef.RefItemDef?.Invoke(null);
				}
			}
		}

		private void ResolveBlacklist()
		{
			//IL_0047: 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)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Invalid comparison between Unknown and I4
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			foreach (AspectDef aspectDef in aspectDefs)
			{
				if (aspectDef.bodyBlacklist.Count <= 0)
				{
					continue;
				}
				foreach (string item in aspectDef.bodyBlacklist)
				{
					BodyIndex val = BodyCatalog.FindBodyIndex(item);
					if ((int)val != -1)
					{
						aspectDef.blacklistedIndexes.Add(val);
					}
				}
			}
		}

		private void CopyExpansionReq()
		{
			foreach (AspectDef aspectDef in aspectDefs)
			{
				CopyExpansion(aspectDef);
			}
		}

		private void CopyModelPrefabs()
		{
			foreach (AspectDef aspectDef in aspectDefs)
			{
				CopyModelPrefab(aspectDef);
			}
		}

		private void ApplyIcons()
		{
			if (PopState.CheckFlag(PopState.Replace))
			{
				return;
			}
			foreach (AspectDef aspectDef in aspectDefs)
			{
				SetupIcons(aspectDef);
			}
			PopState.SetFlag(PopState.Replace);
		}

		private void EquipmentColor()
		{
			foreach (AspectDef aspectDef in aspectDefs)
			{
				if (Object.op_Implicit((Object)(object)aspectDef.equipmentDef))
				{
					ColorEquipmentDroplet(aspectDef.equipmentDef);
				}
			}
		}

		private void SetupTokens()
		{
			foreach (AspectDef aspectDef in aspectDefs)
			{
				aspectDef.SetupTokens?.Invoke();
			}
		}

		internal void ItemEntries(bool shown)
		{
			foreach (AspectDef aspectDef in aspectDefs)
			{
				SetItemState(aspectDef, shown);
			}
		}

		internal void EquipmentEntries(bool shown)
		{
			foreach (AspectDef aspectDef in aspectDefs)
			{
				SetEquipmentState(aspectDef, shown);
			}
		}

		internal void FillEqualities()
		{
			if ((PopState & (PopState)7) == (PopState)7)
			{
				foreach (AspectDef aspectDef in aspectDefs)
				{
					if (!aspectDef.invalid)
					{
						CreateEquality(aspectDef);
					}
				}
				return;
			}
			Logger.Error("Tried to FillEqualities for : " + identifier + " but defs have not been fully validated!");
			Logger.Warn("---- PopState: " + PopState);
		}

		internal void DoPostInit()
		{
			foreach (AspectDef aspectDef in aspectDefs)
			{
				aspectDef.PostInit?.Invoke(aspectDef);
			}
			PostInit?.Invoke();
		}

		private static void DeactivateItem(AspectDef aspectDef)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			ItemDef itemDef = aspectDef.itemDef;
			if (!Object.op_Implicit((Object)(object)itemDef))
			{
				Logger.Warn("Tried to disable ItemDef of " + aspectDef.identifier + " but it is null!");
				return;
			}
			if (Catalog.disabledItemIndexes.Contains(itemDef.itemIndex))
			{
				Logger.Warn(((Object)itemDef).name + " : is already disabled!");
			}
			Logger.Warn("Deactivating : " + ((Object)itemDef).name);
			if ((Object)(object)itemDef._itemTierDef == (Object)(object)Catalog.BossItemTier && ItemCatalog.tier3ItemList.Contains(itemDef.itemIndex))
			{
				ItemCatalog.tier3ItemList.Remove(itemDef.itemIndex);
			}
			itemDef.tier = (ItemTier)5;
			Catalog.AssignDepricatedTier(itemDef, (ItemTier)5);
			itemDef.hidden = true;
			if (itemDef.DoesNotContainTag((ItemTag)9))
			{
				ItemTag[] array = itemDef.tags;
				int num = array.Length;
				Array.Resize(ref array, num + 1);
				array[num] = (ItemTag)9;
				itemDef.tags = array;
			}
			if (!Catalog.disabledItemIndexes.Contains(itemDef.itemIndex))
			{
				Catalog.disabledItemIndexes.Add(itemDef.itemIndex);
			}
		}

		private static void CopyExpansion(AspectDef aspectDef)
		{
			if (Object.op_Implicit((Object)(object)aspectDef.equipmentDef) && Object.op_Implicit((Object)(object)aspectDef.itemDef))
			{
				aspectDef.itemDef.requiredExpansion = aspectDef.equipmentDef.requiredExpansion;
				return;
			}
			Logger.Warn("Could not copy expansion requirement for " + aspectDef.identifier);
			LogNullInfo(aspectDef);
		}

		private static void CopyModelPrefab(AspectDef aspectDef)
		{
			if (Object.op_Implicit((Object)(object)aspectDef.equipmentDef) && Object.op_Implicit((Object)(object)aspectDef.itemDef))
			{
				if (aspectDef.copyEquipmentPrefab)
				{
					CopyEquipmentPrefab(aspectDef.itemDef, aspectDef.equipmentDef);
				}
				else
				{
					CopyItemPrefab(aspectDef.itemDef, aspectDef.equipmentDef);
				}
				return;
			}
			if (aspectDef.copyEquipmentPrefab)
			{
				Logger.Warn("Could not copy model prefab [EQUIP] --> [ITEM] for : " + aspectDef.identifier);
			}
			else
			{
				Logger.Warn("Could not copy model prefab [ITEM] --> [EQUIP] for : " + aspectDef.identifier);
			}
			LogNullInfo(aspectDef);
		}

		private static void LogNullInfo(AspectDef aspectDef)
		{
			if (!Object.op_Implicit((Object)(object)aspectDef.equipmentDef) && !Object.op_Implicit((Object)(object)aspectDef.itemDef))
			{
				Logger.Warn("---- EquipmentDef and ItemDef is null!");
			}
			else if (!Object.op_Implicit((Object)(object)aspectDef.itemDef))
			{
				Logger.Warn("---- ItemDef is null!");
			}
			else if (!Object.op_Implicit((Object)(object)aspectDef.itemDef))
			{
				Logger.Warn("---- EquipmentDef is null!");
			}
		}

		private static void CopyEquipmentPrefab(ItemDef itemDef, EquipmentDef equipDef)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			itemDef.pickupModelPrefab = equipDef.pickupModelPrefab;
			PickupDef pickupDef = PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex(itemDef.itemIndex));
			pickupDef.displayPrefab = equipDef.pickupModelPrefab;
		}

		private static void CopyItemPrefab(ItemDef itemDef, EquipmentDef equipDef)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			equipDef.pickupModelPrefab = itemDef.pickupModelPrefab;
			PickupDef pickupDef = PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex(equipDef.equipmentIndex));
			pickupDef.displayPrefab = itemDef.pickupModelPrefab;
		}

		private static void SetupIcons(AspectDef aspectDef)
		{
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: 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_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			Sprite val = ((aspectDef.BaseIcon != null) ? aspectDef.BaseIcon() : null);
			Sprite val2 = ((aspectDef.OutlineIcon != null) ? aspectDef.OutlineIcon() : null);
			if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val2))
			{
				EquipmentDef equipmentDef = aspectDef.equipmentDef;
				if (Object.op_Implicit((Object)(object)equipmentDef))
				{
					Color32 outlineColor = (aspectDef.equipmentDef.isLunar ? new Color32((byte)100, (byte)225, (byte)250, byte.MaxValue) : new Color32((byte)250, (byte)150, (byte)50, byte.MaxValue));
					equipmentDef.pickupIconSprite = Catalog.CreateAspectSprite(val, val2, outlineColor);
					PickupDef pickupDef = PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex(equipmentDef.equipmentIndex));
					pickupDef.iconSprite = equipmentDef.pickupIconSprite;
					pickupDef.iconTexture = (Texture)(object)equipmentDef.pickupIconSprite.texture;
				}
				ItemDef itemDef = aspectDef.itemDef;
				if (Object.op_Implicit((Object)(object)itemDef))
				{
					Color32 outlineColor2 = (Configuration.AspectRedTier.Value ? new Color32((byte)230, (byte)70, (byte)60, byte.MaxValue) : new Color32((byte)225, (byte)250, (byte)40, byte.MaxValue));
					if (Catalog.AsHighlander)
					{
						((Color32)(ref outlineColor2))..ctor((byte)225, (byte)220, (byte)165, byte.MaxValue);
					}
					if ((Object)(object)val2 == (Object)(object)Catalog.Sprites.OutlineVoid)
					{
						((Color32)(ref outlineColor2))..ctor(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
					}
					itemDef.pickupIconSprite = Catalog.CreateAspectSprite(val, val2, outlineColor2);
					PickupDef pickupDef2 = PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex(itemDef.itemIndex));
					pickupDef2.iconSprite = itemDef.pickupIconSprite;
					pickupDef2.iconTexture = (Texture)(object)itemDef.pickupIconSprite.texture;
				}
			}
			else
			{
				Logger.Warn("SetupIcons failed for : " + aspectDef.identifier);
				if ((Object)(object)val == (Object)null)
				{
					Logger.Warn("---- BaseSprite is null!");
				}
				if ((Object)(object)val2 == (Object)null)
				{
					Logger.Warn("---- OutlineSprite is null!");
				}
			}
		}

		private static void ColorEquipmentDroplet(EquipmentDef equipDef)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: 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)
			equipDef.isBoss = true;
			equipDef.colorIndex = (ColorIndex)24;
			PickupDef pickupDef = PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex(equipDef.equipmentIndex));
			pickupDef.isBoss = true;
			if (Object.op_Implicit((Object)(object)Catalog.BossDropletPrefab))
			{
				pickupDef.dropletDisplayPrefab = Catalog.BossDropletPrefab;
			}
			pickupDef.baseColor = new Color(0.9f, 0.7f, 0.75f);
			pickupDef.darkColor = new Color(0.9f, 0.7f, 0.75f);
		}

		private static void SetItemState(AspectDef aspectDef, bool shown)
		{
			//IL_003c: 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)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Invalid comparison between Unknown and I4
			ItemDef itemDef = aspectDef.itemDef;
			if (!Object.op_Implicit((Object)(object)itemDef))
			{
				Logger.Warn("Tried to set ItemState of " + aspectDef.identifier + " but it is null!");
				return;
			}
			if (!Catalog.aspectItemIndexes.Contains(itemDef.itemIndex))
			{
				Catalog.aspectItemIndexes.Add(itemDef.itemIndex);
			}
			if (itemDef.hidden)
			{
				return;
			}
			if ((Object)(object)itemDef == (Object)(object)ItemDefOf.ZetAspectVoid && Configuration.AspectVoidContagiousItem.Value)
			{
				if (!shown)
				{
					itemDef.tier = (ItemTier)5;
				}
				else
				{
					itemDef.tier = (ItemTier)(Configuration.AspectRedTier.Value ? 8 : 9);
				}
			}
			else if (!shown)
			{
				itemDef.tier = (ItemTier)5;
			}
			else
			{
				itemDef._itemTierDef = (Configuration.AspectRedTier.Value ? Catalog.RedItemTier : Catalog.BossItemTier);
			}
			if ((Catalog.AsHighlander && (int)Catalog.highlanderTier != 10 && (Object)(object)itemDef._itemTierDef == (Object)(object)Catalog.BossItemTier) || (Object)(object)itemDef._itemTierDef == (Object)(object)Catalog.RedItemTier)
			{
				itemDef._itemTierDef = Catalog.HighlanderItemTier;
			}
		}

		private static void SetEquipmentState(AspectDef aspectDef, bool canDrop)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			EquipmentDef equipmentDef = aspectDef.equipmentDef;
			if (!Object.op_Implicit((Object)(object)equipmentDef))
			{
				Logger.Warn("Tried to set EquipmentState of " + aspectDef.identifier + " but it is null!");
				return;
			}
			if (!Catalog.aspectEquipIndexes.Contains(equipmentDef.equipmentIndex))
			{
				Catalog.aspectEquipIndexes.Add(equipmentDef.equipmentIndex);
			}
			equipmentDef.canDrop = canDrop;
		}

		private static void CreateEquality(AspectDef aspectDef)
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: 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_0159: 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_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: 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_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			EquipmentDef equipmentDef = aspectDef.equipmentDef;
			BuffDef buffDef = aspectDef.buffDef;
			ItemDef itemDef = aspectDef.itemDef;
			string[] obj = new string[6]
			{
				"CreateEquality : ",
				Object.op_Implicit((Object)(object)equipmentDef) ? ((Object)equipmentDef).name : "null",
				" , ",
				null,
				null,
				null
			};
			object obj2;
			BuffIndex buffIndex;
			if (!Object.op_Implicit((Object)(object)buffDef))
			{
				obj2 = "null";
			}
			else
			{
				buffIndex = buffDef.buffIndex;
				obj2 = "[" + ((object)(BuffIndex)(ref buffIndex)).ToString() + "] " + ((Object)buffDef).name;
			}
			obj[3] = (string)obj2;
			obj[4] = " , ";
			obj[5] = (Object.op_Implicit((Object)(object)itemDef) ? ((Object)itemDef).name : "null");
			Logger.Info(string.Concat(obj));
			if (!Object.op_Implicit((Object)(object)itemDef))
			{
				Logger.Warn("CreateEquality called for : " + aspectDef.identifier + " but its associated item is null!");
			}
			else if (Catalog.disabledItemIndexes.Contains(itemDef.itemIndex))
			{
				Logger.Warn("CreateEquality called for disabled aspect : " + aspectDef.identifier);
			}
			else if (Object.op_Implicit((Object)(object)equipmentDef) && Object.op_Implicit((Object)(object)buffDef))
			{
				if (!Catalog.aspectBuffIndexes.Contains(buffDef.buffIndex))
				{
					Catalog.aspectBuffIndexes.Add(buffDef.buffIndex);
				}
				if (!Catalog.buffToAspect.ContainsKey(buffDef.buffIndex))
				{
					Catalog.buffToAspect.Add(buffDef.buffIndex, aspectDef);
				}
				else
				{
					buffIndex = buffDef.buffIndex;
					Logger.Warn("buffToAspect already contains key for : [" + ((object)(BuffIndex)(ref buffIndex)).ToString() + "] - " + ((Object)buffDef).name);
					Logger.Warn("---- associated aspect : " + aspectDef.identifier);
				}
				if (!Catalog.buffToItem.ContainsKey(buffDef.buffIndex))
				{
					Catalog.buffToItem.Add(buffDef.buffIndex, itemDef.itemIndex);
				}
				else
				{
					buffIndex = buffDef.buffIndex;
					Logger.Warn("buffToItem already contains key for : [" + ((object)(BuffIndex)(ref buffIndex)).ToString() + "] - " + ((Object)buffDef).name);
					Logger.Warn("---- current item : " + ((Object)itemDef).name);
					Logger.Warn("---- associated item : " + ((Object)ItemCatalog.GetItemDef(Catalog.buffToItem[buffDef.buffIndex])).name);
				}
				if (!Catalog.buffToEquip.ContainsKey(buffDef.buffIndex))
				{
					Catalog.buffToEquip.Add(buffDef.buffIndex, equipmentDef.equipmentIndex);
				}
				else
				{
					buffIndex = buffDef.buffIndex;
					Logger.Warn("buffToEquip already contains key for : [" + ((object)(BuffIndex)(ref buffIndex)).ToString() + "] - " + ((Object)buffDef).name);
					Logger.Warn("---- current equipment : " + ((Object)equipmentDef).name);
					Logger.Warn("---- associated equipment : " + ((Object)EquipmentCatalog.GetEquipmentDef(Catalog.buffToEquip[buffDef.buffIndex])).name);
				}
				if (!Catalog.equipToItem.ContainsKey(equipmentDef.equipmentIndex))
				{
					Catalog.equipToItem.Add(equipmentDef.equipmentIndex, itemDef.itemIndex);
					return;
				}
				Logger.Warn("equipToItem already contains key for : " + ((Object)equipmentDef).name);
				Logger.Warn("---- current item : " + ((Object)itemDef).name);
				Logger.Warn("---- associated item : " + ((Object)ItemCatalog.GetItemDef(Catalog.equipToItem[equipmentDef.equipmentIndex])).name);
			}
		}
	}
	public static class Catalog
	{
		public static class Sprites
		{
			public static Sprite OutlineStandard;

			public static Sprite OutlineVoid;

			public static Sprite OutlineNull;

			public static Sprite OutlineCracked;

			public static Sprite AffixUnknown;

			public static Sprite AffixWhite;

			public static Sprite AffixBlue;

			public static Sprite AffixRed;

			public static Sprite AffixHaunted;

			public static Sprite AffixPoison;

			public static Sprite AffixLunar;

			public static Sprite AffixEarth;

			public static Sprite AffixVoid;

			public static Sprite AffixPlated;

			public static Sprite AffixWarped;

			public static Sprite AffixVeiled;

			public static Sprite AffixAragonite;

			public static Sprite AffixGold;

			public static Sprite AffixSanguine;

			public static Sprite AffixSepia;

			public static Sprite SepiaElite;

			public static Sprite AffixNullifier;

			public static Sprite AffixBlighted;

			public static Sprite AffixBackup;

			public static Sprite BackupDebuff;

			public static Sprite AffixPurity;

			public static Sprite AffixBarrier;

			public static Sprite AffixBlackHole;

			public static Sprite AffixMoney;

			public static Sprite AffixNight;

			public static Sprite AffixWater;

			public static Sprite AffixRealgar;

			public static Sprite AffixBuffered;

			public static Sprite AffixOppressive;

			public static Sprite AffixBuffing;

			public static Sprite AffixFrenzied;

			public static Sprite AffixVolatile;

			public static Sprite AffixEcho;

			public static Sprite AffixArmored;

			public static Sprite AffixBuffing_EV;

			public static Sprite AffixImpPlane;

			public static Sprite AffixPillaging;

			public static Sprite AffixSandstorm;

			public static Sprite AffixTinkerer;

			public static Sprite AffixAdaptive;

			public static Sprite AffixMotivator;

			public static Sprite AffixOsmium;

			public static Sprite HauntCloak;

			public static Sprite ZetHeadHunter;

			public static Sprite ZetSapped;

			public static Sprite ZetShredded;

			public static Sprite ZetPoached;

			public static Sprite ZetSepiaBlind;

			public static Sprite ZetElusive;

			public static Sprite ZetWarped;

			public static void Load()
			{
				OutlineStandard = Assets.LoadAsset<Sprite>("Assets/Icons/texOutlineWhite.png");
				OutlineVoid = Assets.LoadAsset<Sprite>("Assets/Icons/texOutlineVoid.png");
				AffixUnknown = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixUnknown.png");
				AffixWhite = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixWhite.png");
				AffixBlue = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBlue.png");
				AffixRed = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixRed.png");
				AffixHaunted = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixHaunted.png");
				AffixPoison = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixPoison.png");
				AffixLunar = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixLunar.png");
				AffixEarth = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixEarth.png");
				AffixVoid = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixVoid.png");
				if (AspectPackDefOf.SpikeStrip.Enabled)
				{
					AffixPlated = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixPlated.png");
					AffixWarped = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixWarped.png");
					AffixVeiled = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixVeiled.png");
					AffixAragonite = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixAragonite.png");
					ZetElusive = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffElusive.png");
					ZetWarped = LegacyResourcesAPI.Load<BuffDef>("BuffDefs/Slow80").iconSprite;
				}
				if (AspectPackDefOf.GoldenCoastPlus.Enabled)
				{
					AffixGold = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixPillaging.png");
				}
				if (AspectPackDefOf.Aetherium.Enabled)
				{
					AffixSanguine = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixSanguine.png");
				}
				if (AspectPackDefOf.Bubbet.Enabled)
				{
					AffixSepia = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixSepia.png");
					SepiaElite = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffAffixSepia.png");
					ZetSepiaBlind = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffSepiaBlind.png");
				}
				if (AspectPackDefOf.WarWisp.Enabled)
				{
					OutlineNull = Assets.LoadAsset<Sprite>("Assets/Icons/texNullOutlineWhite.png");
					AffixNullifier = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixNullifier.png");
				}
				AffixBlighted = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBlighted.png");
				if (AspectPackDefOf.GOTCE.Enabled)
				{
					OutlineCracked = Assets.LoadAsset<Sprite>("Assets/Icons/texCrackedOutlineWhite.png");
					AffixBackup = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBackup.png");
					BackupDebuff = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffNoSecondary.png");
				}
				if (AspectPackDefOf.Thalasso.Enabled)
				{
					AffixPurity = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixPurity.png");
				}
				if (AspectPackDefOf.RisingTides.Enabled)
				{
					AffixBarrier = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBarrier.png");
					AffixBlackHole = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBlackHole.png");
					AffixMoney = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixArmored.png");
					AffixNight = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixNight.png");
					AffixWater = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixWater.png");
					AffixRealgar = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixImpPlane.png");
				}
				AffixBuffered = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBuffered.png");
				AffixOppressive = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixOppressive.png");
				if (AspectPackDefOf.MoreElites.Enabled)
				{
					AffixBuffing = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBuffing.png");
					AffixFrenzied = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixFrenzied.png");
					AffixVolatile = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixVolatile.png");
					AffixEcho = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixEcho.png");
				}
				if (AspectPackDefOf.EliteVariety.Enabled)
				{
					AffixArmored = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixArmored.png");
					AffixBuffing_EV = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBuffing.png");
					AffixImpPlane = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixImpPlane.png");
					AffixPillaging = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixPillaging.png");
					AffixSandstorm = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixSandstorm.png");
					AffixTinkerer = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixTinkerer.png");
				}
				if (AspectPackDefOf.Augmentum.Enabled)
				{
					AffixAdaptive = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixAdaptive.png");
				}
				if (AspectPackDefOf.Sandswept.Enabled)
				{
					AffixMotivator = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixMotivator.png");
					AffixOsmium = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixOsmium.png");
				}
				HauntCloak = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffHauntCloak.png");
				ZetHeadHunter = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffHeadHunter.png");
				ZetSapped = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffSapped.png");
				ZetShredded = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffShredded.png");
				ZetPoached = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffPoached.png");
			}
		}

		public static class Prefabs
		{
			public static GameObject AffixVoid;

			public static GameObject AffixSepia;

			public static GameObject AffixPure;

			public static GameObject AffixGold;

			public static void Load()
			{
				AffixVoid = Assets.LoadAsset<GameObject>("Assets/Prefabs/prefabAffixVoid.prefab");
				AffixVoid.AddComponent<ModelPanelParameters>();
				if (AspectPackDefOf.Bubbet.Enabled)
				{
					AffixSepia = Assets.LoadAsset<GameObject>("Assets/Prefabs/prefabAffixSepia.prefab");
					AffixSepia.AddComponent<ModelPanelParameters>();
				}
				if (AspectPackDefOf.Thalasso.Enabled)
				{
					AffixPure = Assets.LoadAsset<GameObject>("Assets/Prefabs/prefabAffixPure.prefab");
					AffixPure.AddComponent<ModelPanelParameters>();
				}
				if (AspectPackDefOf.GoldenCoastPlus.Enabled)
				{
					AffixGold = Assets.LoadAsset<GameObject>("Assets/Prefabs/prefabAffixGold.prefab");
					AffixGold.AddComponent<ModelPanelParameters>();
				}
			}
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_Init <>9__92_0;

			public static hook_RebuildPickupGroups <>9__94_0;

			public static hook_Init <>9__95_0;

			public static hook_BuildStaticData <>9__96_0;

			public static hook_OnEnter <>9__97_0;

			public static hook_CanSelectItemEntry <>9__98_0;

			public static hook_CanSelectEquipmentEntry <>9__99_0;

			internal void <SetupItemTransformations>b__92_0(orig_Init orig)
			{
				//IL_0030: 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)
				List<Pair> list = ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem].ToList();
				foreach (ItemDef transformableAspectItemDef in transformableAspectItemDefs)
				{
					list.Add(new Pair
					{
						itemDef1 = transformableAspectItemDef,
						itemDef2 = ItemDefOf.ZetAspectVoid
					});
					Logger.Info("Successfully added aspect transformation for " + ((Object)transformableAspectItemDef).name);
				}
				ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = list.ToArray();
				orig.Invoke();
			}

			internal void <OnTransmuteManagerInit>b__94_0(orig_RebuildPickupGroups orig)
			{
				try
				{
					PreInitValidation();
				}
				catch (Exception data)
				{
					Logger.Error(data);
				}
				orig.Invoke();
			}

			internal void <OnRuleCatalogInit>b__95_0(orig_Init orig)
			{
				try
				{
					PreInitValidation();
				}
				catch (Exception data)
				{
					Logger.Error(data);
				}
				orig.Invoke();
			}

			internal void <OnLogBookInit>b__96_0(orig_BuildStaticData orig)
			{
				try
				{
					SetupCatalog();
				}
				catch (Exception data)
				{
					Logger.Warn("Failed To Setup Catalog!");
					Logger.Error(data);
				}
				orig.Invoke();
			}

			internal void <OnMainMenuEnter>b__97_0(orig_OnEnter orig, BaseMainMenuScreen self, MainMenuController controller)
			{
				orig.Invoke(self, controller);
				try
				{
					OnMenuEnteredFirstTime();
				}
				catch (Exception data)
				{
					Logger.Error(data);
				}
			}

			internal bool <ItemEntrySelectableHook>b__98_0(orig_CanSelectItemEntry orig, ItemDef itemDef, Dictionary<ExpansionDef, bool> expAva)
			{
				//IL_000f: 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 (Object.op_Implicit((Object)(object)itemDef) && aspectItemIndexes.Contains(itemDef.itemIndex))
				{
					if (Configuration.LogbookHideItem.Value)
					{
						return false;
					}
					if (DropHooks.CanObtainItem() && HasRequiredExpansion(itemDef.requiredExpansion, expAva) && !disabledItemIndexes.Contains(itemDef.itemIndex))
					{
						return true;
					}
					return false;
				}
				return orig.Invoke(itemDef, expAva);
			}

			internal bool <EquipmentEntrySelectableHook>b__99_0(orig_CanSelectEquipmentEntry orig, EquipmentDef equipDef, Dictionary<ExpansionDef, bool> expAva)
			{
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004f: 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)
				//IL_0059: 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)
				if (Object.op_Implicit((Object)(object)equipDef) && aspectEquipIndexes.Contains(equipDef.equipmentIndex))
				{
					if (Configuration.LogbookHideEquipment.Value)
					{
						return false;
					}
					if (DropHooks.CanObtainEquipment() && HasRequiredExpansion(equipDef.requiredExpansion, expAva))
					{
						ItemIndex item = ItemizeEliteEquipment(equipDef.equipmentIndex);
						if (!disabledItemIndexes.Contains(item))
						{
							return true;
						}
					}
					return false;
				}
				return orig.Invoke(equipDef, expAva);
			}
		}

		public static AssetBundle Assets;

		public static bool menuVisited = false;

		public static bool setupComplete = false;

		public static bool setupIntermediate = false;

		public static bool setupCompat = false;

		public static BindingFlags Flags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;

		public static Dictionary<BuffIndex, ItemIndex> buffToItem = new Dictionary<BuffIndex, ItemIndex>();

		public static Dictionary<BuffIndex, EquipmentIndex> buffToEquip = new Dictionary<BuffIndex, EquipmentIndex>();

		public static Dictionary<EquipmentIndex, ItemIndex> equipToItem = new Dictionary<EquipmentIndex, ItemIndex>();

		public static List<ItemIndex> disabledItemIndexes = new List<ItemIndex>();

		public static List<ItemIndex> aspectItemIndexes = new List<ItemIndex>();

		public static List<BuffIndex> aspectBuffIndexes = new List<BuffIndex>();

		public static List<EquipmentIndex> aspectEquipIndexes = new List<EquipmentIndex>();

		public static List<ItemDef> transformableAspectItemDefs = new List<ItemDef>();

		public static List<AspectPack> aspectPacks = new List<AspectPack>();

		public static List<AspectDef> aspectDefs = new List<AspectDef>();

		public static Dictionary<BuffIndex, AspectDef> buffToAspect = new Dictionary<BuffIndex, AspectDef>();

		internal static ItemTierDef BossItemTier;

		internal static ItemTierDef RedItemTier;

		internal static GameObject WhiteAspectPrefab;

		internal static GameObject BossDropletPrefab;

		internal static GameObject LightningStakePrefab;

		internal static GameObject RejectTextPrefab;

		internal static GameObject CommandCubePrefab;

		internal static GameObject SmokeBombMiniPrefab;

		public static int barrierDecayMode = 0;

		public static bool lateHooksDone = false;

		public static bool appliedVoidBearFix = false;

		public static bool limitChillStacks = false;

		public static bool borboFrostBlade = false;

		public static bool shieldJump = false;

		public static bool aspectAbilities = false;

		public static bool immuneHealth = false;

		public static bool altIceActive = false;

		public static bool nemBarrier = false;

		public static bool dropWeightsAvailable = false;

		public static EffectDef RejectTextDef;

		public static ArtifactIndex diluvianArtifactIndex = (ArtifactIndex)(-1);

		public static BodyIndex mithrixBodyIndex = (BodyIndex)(-1);

		public static BodyIndex voidlingBodyIndex = (BodyIndex)(-1);

		public static BodyIndex artifactShellBodyIndex = (BodyIndex)(-1);

		public static BodyIndex goldenTitanBodyIndex = (BodyIndex)(-1);

		public static BodyIndex tinkerDroneBodyIndex = (BodyIndex)(-1);

		public static BuffIndex altSlow80 = (BuffIndex)(-1);

		public static BuffIndex antiGrav = (BuffIndex)(-1);

		public static BuffIndex rageAura = (BuffIndex)(-1);

		public static BuffIndex veiledBuffer = (BuffIndex)(-1);

		public static BuffIndex veiledCooldown = (BuffIndex)(-1);

		public static BuffIndex nullifierRecipient = (BuffIndex)(-1);

		public static BuffIndex waterInvuln = (BuffIndex)(-1);

		public static BuffIndex reactorInvuln = (BuffIndex)(-1);

		public static BuffIndex lampBuff = (BuffIndex)(-1);

		public static ItemIndex summonedEcho = (ItemIndex)(-1);

		public static ItemTier lunarVoidTier = (ItemTier)10;

		public static ItemTier highlanderTier = (ItemTier)10;

		public static DeployableSlot tinkerDeploySlot = (DeployableSlot)0;

		public static DotIndex impaleDotIndex = (DotIndex)(-1);

		private static ItemTierDef _HighlanderTier;

		private static int _HighlanderState = -1;

		public static bool ChillCanStack => Buffs.Slow80.canStack;

		public static ItemTierDef HighlanderItemTier
		{
			get
			{
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Invalid comparison between Unknown and I4
				//IL_0058: 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)
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)_HighlanderTier == (Object)null)
				{
					if ((int)highlanderTier == 10)
					{
						Logger.Warn("Checking ItemTierCatalog for : Highlander");
						ItemTierDef val = ItemTierCatalog.FindTierDef("Highlander");
						if (Object.op_Implicit((Object)(object)val))
						{
							Logger.Warn("ItemTierDef Highlander Found!");
							highlanderTier = val.tier;
						}
					}
					_HighlanderTier = ItemTierCatalog.GetItemTierDef(highlanderTier);
				}
				return _HighlanderTier;
			}
		}

		public static bool AsHighlander
		{
			get
			{
				if (_HighlanderState == -1)
				{
					Logger.Warn("Checking for mod : ZetAspectHighlander");
					if (PluginLoaded("prodzpod.ZetAspectHighlander"))
					{
						_HighlanderState = 1;
						Logger.Warn("ZetAspectHighlander Found!");
					}
					else
					{
						_HighlanderState = 0;
					}
				}
				return _HighlanderState == 1;
			}
		}

		public static Sprite CreateAspectSprite(Sprite baseSprite, Sprite outlineSprite)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			return CreateAspectSprite(baseSprite, outlineSprite, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue));
		}

		public static Sprite CreateAspectSprite(Sprite baseSprite, Sprite outlineSprite, Color32 outlineColor)
		{
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Expected O, but got Unknown
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			Color32[] pixels = baseSprite.texture.GetPixels32();
			Color32[] pixels2 = outlineSprite.texture.GetPixels32();
			for (int i = 0; i < pixels2.Length; i++)
			{
				if (pixels2[i].a > 11)
				{
					pixels2[i].r = (byte)(pixels2[i].r * outlineColor.r / 255);
					pixels2[i].g = (byte)(pixels2[i].g * outlineColor.g / 255);
					pixels2[i].b = (byte)(pixels2[i].b * outlineColor.b / 255);
					pixels2[i].a = (byte)(pixels2[i].a * outlineColor.a / 255);
					pixels[i] = pixels2[i];
				}
			}
			Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false);
			val.SetPixels32(pixels);
			val.Apply();
			return Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f), 25f);
		}

		public static ItemIndex GetAspectItemIndex(BuffIndex buffIndex)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_001b: 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)
			if (buffToItem.ContainsKey(buffIndex))
			{
				return buffToItem[buffIndex];
			}
			return (ItemIndex)(-1);
		}

		public static EquipmentIndex GetAspectEquipIndex(BuffIndex buffIndex)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_001b: 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)
			if (buffToEquip.ContainsKey(buffIndex))
			{
				return buffToEquip[buffIndex];
			}
			return (EquipmentIndex)(-1);
		}

		public static ItemIndex ItemizeEliteEquipment(EquipmentIndex equipIndex)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_001b: 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)
			if (equipToItem.ContainsKey(equipIndex))
			{
				return equipToItem[equipIndex];
			}
			return (ItemIndex)(-1);
		}

		public static AspectDef GetAspectDef(BuffIndex buffIndex)
		{
			//IL_0006: 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)
			if (buffToAspect.ContainsKey(buffIndex))
			{
				return buffToAspect[buffIndex];
			}
			return null;
		}

		public static float GetStackMagnitude(CharacterBody self, BuffDef buffDef)
		{
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			Inventory inventory = self.inventory;
			if (!Object.op_Implicit((Object)(object)inventory))
			{
				return 1f;
			}
			float num = CountAspectEquipment(inventory, buffDef);
			if (num > 0f && self.isPlayerControlled)
			{
				num *= Mathf.Max(1f, Configuration.AspectEquipmentEffect.Value);
			}
			num += (float)inventory.GetItemCount(GetAspectItemIndex(buffDef.buffIndex));
			return Mathf.Max(1f, num);
		}

		public static bool HasAspectItemOrEquipment(Inventory inventory, BuffDef buffDef)
		{
			if (CountAspectEquipment(inventory, buffDef) > 0)
			{
				return true;
			}
			if (HasAspectItem(inventory, buffDef))
			{
				return true;
			}
			return false;
		}

		public static bool HasAspectItemOrEquipment(Inventory inventory, BuffIndex buffIndex)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			if (CountAspectEquipment(inventory, buffIndex) > 0)
			{
				return true;
			}
			if (HasAspectItem(inventory, buffIndex))
			{
				return true;
			}
			return false;
		}

		public static bool HasAspectItemOrEquipment(Inventory inventory, ItemDef itemDef, EquipmentDef equipDef)
		{
			//IL_002a: 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: 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_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)
			if (Object.op_Implicit((Object)(object)itemDef) && inventory.GetItemCount(itemDef) > 0)
			{
				return true;
			}
			if (Object.op_Implicit((Object)(object)equipDef))
			{
				EquipmentIndex equipmentIndex = equipDef.equipmentIndex;
				if (inventory.currentEquipmentIndex == equipmentIndex)
				{
					return true;
				}
				if (inventory.alternateEquipmentIndex == equipmentIndex)
				{
					return true;
				}
			}
			return false;
		}

		public static int CountAspectEquipment(Inventory inventory, BuffDef buffDef)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return CountAspectEquipment(inventory, buffDef.buffIndex);
		}

		public static int CountAspectEquipment(Inventory inventory, BuffIndex buffIndex)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Invalid comparison between Unknown and I4
			//IL_0017: 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_002a: 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)
			EquipmentIndex aspectEquipIndex = GetAspectEquipIndex(buffIndex);
			if ((int)aspectEquipIndex == -1)
			{
				return 0;
			}
			int num = 0;
			if (inventory.currentEquipmentIndex == aspectEquipIndex)
			{
				num++;
			}
			if (inventory.alternateEquipmentIndex == aspectEquipIndex)
			{
				num++;
			}
			return num;
		}

		public static bool HasAspectItem(Inventory inventory, BuffDef buffDef)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return HasAspectItem(inventory, buffDef.buffIndex);
		}

		public static bool HasAspectItem(Inventory inventory, BuffIndex buffIndex)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Invalid comparison between Unknown and I4
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			ItemIndex aspectItemIndex = GetAspectItemIndex(buffIndex);
			if ((int)aspectItemIndex == -1)
			{
				return false;
			}
			if (inventory.GetItemCount(aspectItemIndex) > 0)
			{
				return true;
			}
			return false;
		}

		public static EliteDef GetEquipmentEliteDef(EquipmentDef equipDef)
		{
			if ((Object)(object)equipDef == (Object)null)
			{
				return null;
			}
			if ((Object)(object)equipDef.passiveBuffDef == (Object)null)
			{
				return null;
			}
			return equipDef.passiveBuffDef.eliteDef;
		}

		public static bool BodyAllowedAffix(CharacterBody body, AspectDef aspectDef)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: 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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			BodyIndex bodyIndex = body.bodyIndex;
			if (aspectDef.blacklistedIndexes.Count > 0)
			{
				foreach (BodyIndex blacklistedIndex in aspectDef.blacklistedIndexes)
				{
					if (bodyIndex == blacklistedIndex)
					{
						return false;
					}
				}
			}
			if (aspectDef.AllowAffix != null)
			{
				return aspectDef.AllowAffix(body, body.inventory);
			}
			return true;
		}

		public static bool BodyAllowedAffix(CharacterBody body, BuffDef buffDef)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			AspectDef aspectDef = GetAspectDef(buffDef.buffIndex);
			if (aspectDef != null)
			{
				return BodyAllowedAffix(body, aspectDef);
			}
			return false;
		}

		internal static void OnAwake()
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			RoR2Application.isModded = true;
			string text = "com.TPDespair.ZetAspects:2.9.1";
			NetworkModCompatibilityHelper.networkModList = NetworkModCompatibilityHelper.networkModList.Append(text);
			Logger.Info("Adding " + text + " to the networkModList.");
			ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(AddContentPackProvider);
			if (Configuration.AspectVoidContagiousItem.Value)
			{
				SetupItemTransformations();
			}
			SetupListeners();
			ItemEntrySelectableHook();
			EquipmentEntrySelectableHook();
		}

		private static void AddContentPackProvider(AddContentPackProviderDelegate addContentPackProvider)
		{
			addContentPackProvider.Invoke((IContentPackProvider)(object)new ZetAspectsContent());
		}

		internal static void OnContentLoadStart()
		{
			LoadAssets();
			LoadResources();
			Sprites.Load();
			Prefabs.Load();
			CreateBuffs();
			CreateItems();
		}

		private static void LoadAssets()
		{
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TPDespair.ZetAspects.zetaspectbundle");
			Assets = AssetBundle.LoadFromStream(stream);
		}

		private static void LoadResources()
		{
			BossItemTier = LegacyResourcesAPI.Load<ItemTierDef>("ItemTierDefs/BossTierDef");
			RedItemTier = LegacyResourcesAPI.Load<ItemTierDef>("ItemTierDefs/Tier3Def");
			WhiteAspectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/PickupModels/PickupAffixWhite");
			BossDropletPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/ItemPickups/BossOrb");
			LightningStakePrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/LightningStake");
			RejectTextPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/DamageRejected");
			CommandCubePrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/CommandCube");
			SmokeBombMiniPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/MuzzleFlashes/Bandit2SmokeBombMini");
		}

		private static void CreateBuffs()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
			((Object)val).name = "ZetHeadHunter";
			val.buffColor = new Color(0.5f, 0.5f, 0.35f);
			val.canStack = true;
			val.isDebuff = false;
			val.iconSprite = Sprites.ZetHeadHunter;
			BuffDefOf.ZetHeadHunter = val;
			ZetAspectsContent.buffDefs.Add(val);
			BuffDef val2 = ScriptableObject.CreateInstance<BuffDef>();
			((Object)val2).name = "ZetSapped";
			val2.buffColor = new Color(0.5f, 0.75f, 1f);
			val2.canStack = false;
			val2.isDebuff = true;
			val2.iconSprite = Sprites.ZetSapped;
			BuffDefOf.ZetSapped = val2;
			ZetAspectsContent.buffDefs.Add(val2);
			BuffDef val3 = ScriptableObject.CreateInstance<BuffDef>();
			((Object)val3).name = "ZetShredded";
			val3.buffColor = new Color(0.185f, 0.75f, 0.465f);
			val3.canStack = false;
			val3.isDebuff = true;
			val3.iconSprite = Sprites.ZetShredded;
			BuffDefOf.ZetShredded = val3;
			ZetAspectsContent.buffDefs.Add(val3);
			BuffDef val4 = ScriptableObject.CreateInstance<BuffDef>();
			((Object)val4).name = "ZetPoached";
			val4.buffColor = new Color(0.5f, 0.75f, 0.185f);
			val4.canStack = false;
			val4.isDebuff = true;
			val4.iconSprite = Sprites.ZetPoached;
			BuffDefOf.ZetPoached = val4;
			ZetAspectsContent.buffDefs.Add(val4);
			if (AspectPackDefOf.Bubbet.Enabled)
			{
				BuffDef val5 = ScriptableObject.CreateInstance<BuffDef>();
				((Object)val5).name = "ZetSepiaBlind";
				val5.buffColor = Color.white;
				val5.canStack = false;
				val5.isDebuff = true;
				val5.iconSprite = Sprites.ZetSepiaBlind;
				BuffDefOf.ZetSepiaBlind = val5;
				ZetAspectsContent.buffDefs.Add(val5);
			}
			if (AspectPackDefOf.SpikeStrip.Enabled)
			{
				BuffDef val6 = ScriptableObject.CreateInstance<BuffDef>();
				((Object)val6).name = "ZetElusive";
				val6.buffColor = new Color(0.185f, 0.465f, 0.75f);
				val6.canStack = true;
				val6.isDebuff = false;
				val6.iconSprite = Sprites.ZetElusive;
				BuffDefOf.ZetElusive = val6;
				ZetAspectsContent.buffDefs.Add(val6);
				BuffDef val7 = ScriptableObject.CreateInstance<BuffDef>();
				((Object)val7).name = "ZetWarped";
				val7.buffColor = new Color(0.65f, 0.5f, 0.75f);
				val7.canStack = false;
				val7.isDebuff = true;
				val7.iconSprite = Sprites.ZetWarped;
				BuffDefOf.ZetWarped = val7;
				ZetAspectsContent.buffDefs.Add(val7);
			}
			if (AspectPackDefOf.MoreElites.Enabled)
			{
				BuffDef val8 = ScriptableObject.CreateInstance<BuffDef>();
				((Object)val8).name = "ZetEchoPrimer";
				val8.buffColor = Color.white;
				val8.canStack = false;
				val8.isDebuff = false;
				val8.isHidden = true;
				val8.iconSprite = Sprites.ZetElusive;
				BuffDefOf.ZetEchoPrimer = val8;
				ZetAspectsContent.buffDefs.Add(val8);
			}
		}

		private static void CreateItems()
		{
			ItemDef val = ScriptableObject.CreateInstance<ItemDef>();
			((Object)val).name = "ZetAspectsDropCountTracker";
			AssignDepricatedTier(val, (ItemTier)5);
			val.AutoPopulateTokens();
			val.hidden = true;
			val.canRemove = false;
			ItemDefOf.ZetAspectsDropCountTracker = val;
			ZetAspectsContent.itemDefs.Add(val);
			ItemDef val2 = ScriptableObject.CreateInstance<ItemDef>();
			((Object)val2).name = "ZetAspectsUpdateInventory";
			AssignDepricatedTier(val2, (ItemTier)5);
			val2.AutoPopulateTokens();
			val2.hidden = true;
			val2.canRemove = false;
			ItemDefOf.ZetAspectsUpdateInventory = val2;
			ZetAspectsContent.itemDefs.Add(val2);
			ItemDef item = (ItemDefOf.ZetAspectWhite = ZetAspectWhite.DefineItem());
			ZetAspectsContent.itemDefs.Add(item);
			transformableAspectItemDefs.Add(item);
			ItemDef item2 = (ItemDefOf.ZetAspectBlue = ZetAspectBlue.DefineItem());
			ZetAspectsContent.itemDefs.Add(item2);
			transformableAspectItemDefs.Add(item2);
			ItemDef item3 = (ItemDefOf.ZetAspectRed = ZetAspectRed.DefineItem());
			ZetAspectsContent.itemDefs.Add(item3);
			transformableAspectItemDefs.Add(item3);
			ItemDef item4 = (ItemDefOf.ZetAspectHaunted = ZetAspectHaunted.DefineItem());
			ZetAspectsContent.itemDefs.Add(item4);
			transformableAspectItemDefs.Add(item4);
			ItemDef item5 = (ItemDefOf.ZetAspectPoison = ZetAspectPoison.DefineItem());
			ZetAspectsContent.itemDefs.Add(item5);
			transformableAspectItemDefs.Add(item5);
			ItemDef item6 = (ItemDefOf.ZetAspectLunar = ZetAspectLunar.DefineItem());
			ZetAspectsContent.itemDefs.Add(item6);
			transformableAspectItemDefs.Add(item6);
			ItemDef item7 = (ItemDefOf.ZetAspectEarth = ZetAspectEarth.DefineItem());
			ZetAspectsContent.itemDefs.Add(item7);
			transformableAspectItemDefs.Add(item7);
			ItemDef item8 = (ItemDefOf.ZetAspectVoid = ZetAspectVoid.DefineItem());
			ZetAspectsContent.itemDefs.Add(item8);
			if (AspectPackDefOf.SpikeStrip.Enabled)
			{
				ItemDef item9 = (ItemDefOf.ZetAspectPlated = ZetAspectPlated.DefineItem());
				ZetAspectsContent.itemDefs.Add(item9);
				transformableAspectItemDefs.Add(item9);
				ItemDef item10 = (ItemDefOf.ZetAspectWarped = ZetAspectWarped.DefineItem());
				ZetAspectsContent.itemDefs.Add(item10);
				transformableAspectItemDefs.Add(item10);
				ItemDef item11 = (ItemDefOf.ZetAspectVeiled = ZetAspectVeiled.DefineItem());
				ZetAspectsContent.itemDefs.Add(item11);
				transformableAspectItemDefs.Add(item11);
				ItemDef item12 = (ItemDefOf.Z