Decompiled source of TheJMod v1.0.3

plugins/TheJMod/ExamplePlugin.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using On.RoR2;
using R2API;
using RoR2;
using RoR2.Navigation;
using RoR2.Projectile;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using VoidItemAPI;

[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("ExamplePlugin")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ExamplePlugin")]
[assembly: AssemblyTitle("ExamplePlugin")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace ExamplePlugin
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Fezon.TheJMod", "TheJMod", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class ExamplePlugin : BaseUnityPlugin
	{
		private class EquipmentSession
		{
			public CharacterBody body;

			public float startHealth;

			public uint soundEventId;

			public bool interrupted;

			public uint playingSoundId;

			public float soundDuration;

			public bool soundDurationReceived;
		}

		public const string PluginGUID = "Fezon.TheJMod";

		public const string PluginAuthor = "Fezon";

		public const string PluginName = "TheJMod";

		public const string PluginVersion = "1.0.0";

		internal static ExamplePlugin instance;

		private static ItemDef myItemDef;

		public static ItemDef JunarItemDef;

		public static ItemDef VoidItemDef;

		private static bool registered = false;

		private static Dictionary<CharacterMaster, int> lastGrantedIntervals = new Dictionary<CharacterMaster, int>();

		private static EquipmentDef jEquipmentDef;

		private static bool equipmentActive;

		public static GameObject nullifierDeathBombProjectile;

		public static GameObject voidJailerDeathBombProjectile;

		public static GameObject voidMegaCrabDeathBombProjectile;

		private static Inventory monsterTeamInventory;

		private const string monsterInventoryPrefabPath = "Prefabs/NetworkedObjects/MonsterTeamGainsItemsArtifactInventory";

		private static EquipmentSession activeSession;

		public void Awake()
		{
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Expected O, but got Unknown
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Expected O, but got Unknown
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Expected O, but got Unknown
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Expected O, but got Unknown
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: 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_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_0349: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Expected O, but got Unknown
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0367: Expected O, but got Unknown
			//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03af: Expected O, but got Unknown
			//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c1: Expected O, but got Unknown
			instance = this;
			Log.Init(((BaseUnityPlugin)this).Logger);
			myItemDef = ScriptableObject.CreateInstance<ItemDef>();
			JunarItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)myItemDef).name = "LETTER_J_NAME";
			myItemDef.nameToken = "LETTER_J_NAME";
			myItemDef.pickupToken = "LETTER_J_PICKUP";
			myItemDef.descriptionToken = "LETTER_J_DESC";
			myItemDef.loreToken = "LETTER_J_LORE";
			((Object)JunarItemDef).name = "LUNAR_J_NAME";
			JunarItemDef.nameToken = "LUNAR_J_NAME";
			JunarItemDef.pickupToken = "LUNAR_J_PICKUP";
			JunarItemDef.descriptionToken = "LUNAR_J_DESC";
			JunarItemDef.loreToken = "LUNAR_J_LORE";
			myItemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)"RoR2/Base/Common/Tier3Def.asset").WaitForCompletion();
			JunarItemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)"RoR2/Base/Common/Tier3Def.asset").WaitForCompletion();
			JunarItemDef.tier = Addressables.LoadAssetAsync<ItemTier>((object)"RoR2/Base/Common/LunarTierDef.asset").WaitForCompletion();
			JunarItemDef.deprecatedTier = Addressables.LoadAssetAsync<ItemTier>((object)"RoR2/Base/Common/LunarTierDef.asset").WaitForCompletion();
			JunarItemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)"RoR2/Base/Common/LunarTierDef.asset").WaitForCompletion();
			myItemDef.pickupIconSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion();
			myItemDef.pickupModelPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mystery/PickupMystery.prefab").WaitForCompletion();
			JunarItemDef.pickupIconSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion();
			JunarItemDef.pickupModelPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mystery/PickupMystery.prefab").WaitForCompletion();
			myItemDef.canRemove = true;
			myItemDef.hidden = false;
			JunarItemDef.canRemove = true;
			JunarItemDef.hidden = false;
			ItemAPI.Add(new CustomItem(myItemDef, new ItemDisplayRuleDict((ItemDisplayRule[])null)));
			ItemAPI.Add(new CustomItem(JunarItemDef, new ItemDisplayRuleDict((ItemDisplayRule[])null)));
			GlobalEventManager.onServerDamageDealt += OnServerDamageDealt;
			nullifierDeathBombProjectile = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Nullifier/NullifierDeathBombProjectile.prefab").WaitForCompletion();
			voidJailerDeathBombProjectile = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidJailer/VoidJailerDeathBombProjectile.prefab").WaitForCompletion();
			voidMegaCrabDeathBombProjectile = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/VoidMegaCrabDeathBombProjectile.prefab").WaitForCompletion();
			Sprite pickupIconSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion();
			GameObject pickupModelPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mystery/PickupMystery.prefab").WaitForCompletion();
			jEquipmentDef = ScriptableObject.CreateInstance<EquipmentDef>();
			((Object)jEquipmentDef).name = "ELLIS_CAP_NAME";
			jEquipmentDef.nameToken = "ELLIS_CAP_NAME";
			jEquipmentDef.pickupToken = "ELLIS_CAP_PICKUP";
			jEquipmentDef.descriptionToken = "ELLIS_CAP_DESC";
			jEquipmentDef.loreToken = "ELLIS_CAP_LORE";
			jEquipmentDef.cooldown = 60f;
			jEquipmentDef.canDrop = true;
			jEquipmentDef.enigmaCompatible = false;
			jEquipmentDef.isBoss = false;
			jEquipmentDef.isLunar = true;
			jEquipmentDef.pickupIconSprite = pickupIconSprite;
			jEquipmentDef.pickupModelPrefab = pickupModelPrefab;
			CustomEquipment val = new CustomEquipment(jEquipmentDef, (ItemDisplayRuleDict)null);
			ItemAPI.Add(val);
			EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(OnPerformEquipment);
			GlobalEventManager.onServerDamageDealt += OnEquipmentDamageTaken;
			Run.onRunStartGlobal += OnRunStart;
			Run.onRunDestroyGlobal += OnRunDestroy;
			Run.FixedUpdate += new hook_FixedUpdate(Run_FixedUpdate);
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(ApplyMoveSpeedPenalty);
			SpawnCard.onSpawnedServerGlobal += OnServerCardSpawnedGlobal;
			Run.onRunDestroyGlobal += delegate
			{
				lastGrantedIntervals.Clear();
			};
			Run.onRunStartGlobal += RegisterCorruptionsOnce;
			CreateVoidItem();
			GlobalEventManager.onCharacterDeathGlobal += OnCharacterDeath;
		}

		private GameObject GetWeightedDeathBomb()
		{
			int num = 100;
			int num2 = Random.Range(0, num);
			if (num2 < 70)
			{
				return nullifierDeathBombProjectile;
			}
			num2 -= 70;
			if (num2 < 25)
			{
				return voidJailerDeathBombProjectile;
			}
			return voidMegaCrabDeathBombProjectile;
		}

		private void OnServerDamageDealt(DamageReport report)
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			if (report == null || !Object.op_Implicit((Object)(object)report.attackerBody))
			{
				return;
			}
			CharacterBody attackerBody = report.attackerBody;
			if (!Object.op_Implicit((Object)(object)attackerBody.inventory))
			{
				return;
			}
			int itemCount = attackerBody.inventory.GetItemCount(myItemDef.itemIndex);
			if (itemCount <= 0 || !report.damageInfo.crit)
			{
				return;
			}
			float num = 1f + 1f * (float)itemCount;
			attackerBody.AddTimedBuff(Buffs.Cloak, num);
			float num2 = 0.5f + 0.5f * (float)itemCount;
			if (Util.CheckRoll(num2, attackerBody.master))
			{
				GameObject weightedDeathBomb = GetWeightedDeathBomb();
				if (Object.op_Implicit((Object)(object)weightedDeathBomb))
				{
					Vector3 corePosition = report.victimBody.corePosition;
					FireProjectileInfo val = default(FireProjectileInfo);
					val.projectilePrefab = weightedDeathBomb;
					val.position = corePosition;
					val.rotation = Quaternion.identity;
					val.owner = ((Component)attackerBody).gameObject;
					val.damage = attackerBody.damage * (1f + 0.5f * (float)itemCount);
					val.damageColorIndex = (DamageColorIndex)9;
					val.crit = false;
					FireProjectileInfo val2 = val;
					ProjectileManager.instance.FireProjectile(val2);
				}
			}
		}

		private bool OnPerformEquipment(orig_PerformEquipmentAction orig, EquipmentSlot slot, EquipmentDef equipmentDef)
		{
			if ((Object)(object)equipmentDef == (Object)(object)jEquipmentDef)
			{
				if (!NetworkServer.active)
				{
					return true;
				}
				if (equipmentActive)
				{
					return true;
				}
				ActivateMyEquipment(slot);
				return true;
			}
			return orig.Invoke(slot, equipmentDef);
		}

		private void ActivateMyEquipment(EquipmentSlot slot)
		{
			CharacterBody characterBody = slot.characterBody;
			if (!((Object)(object)characterBody == (Object)null) && !((Object)(object)characterBody.healthComponent == (Object)null) && activeSession == null)
			{
				((MonoBehaviour)instance).StartCoroutine(EquipmentRoutine(characterBody));
			}
		}

		private IEnumerator EquipmentRoutine(CharacterBody body)
		{
			if (!((Object)(object)body == (Object)null) && !((Object)(object)body.healthComponent == (Object)null))
			{
				equipmentActive = true;
				EquipmentSession session = (activeSession = new EquipmentSession
				{
					body = body,
					startHealth = body.healthComponent.combinedHealth,
					soundEventId = 0u,
					interrupted = false,
					playingSoundId = 0u,
					soundDuration = -1f,
					soundDurationReceived = false
				});
				session.playingSoundId = AkSoundEngine.PostEvent(656844745u, ((Component)body).gameObject, 8u, new EventCallback(OnAkDurationCallback), (object)session);
				float waited = 0f;
				while (!session.soundDurationReceived && waited < 1f && !session.interrupted && body.healthComponent.alive)
				{
					waited += Time.fixedDeltaTime;
					yield return (object)new WaitForFixedUpdate();
				}
				if (!session.soundDurationReceived || session.soundDuration <= 0f)
				{
					session.soundDuration = 3f;
				}
				float elapsed = 0f;
				while (elapsed < session.soundDuration && !session.interrupted && body.healthComponent.alive)
				{
					elapsed += Time.fixedDeltaTime;
					yield return (object)new WaitForFixedUpdate();
				}
				if (session.interrupted)
				{
					activeSession = null;
					equipmentActive = false;
				}
				else
				{
					TriggerSuccess(body);
					activeSession = null;
					equipmentActive = false;
				}
			}
		}

		private static void OnAkDurationCallback(object cookie, AkCallbackType type, AkCallbackInfo info)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			if ((int)type == 8 && cookie is EquipmentSession equipmentSession)
			{
				AkDurationCallbackInfo val = (AkDurationCallbackInfo)(object)((info is AkDurationCallbackInfo) ? info : null);
				if (val != null)
				{
					equipmentSession.soundDuration = val.fDuration / 1000f;
					equipmentSession.soundDurationReceived = true;
				}
			}
		}

		private static void OnEquipmentDamageTaken(DamageReport report)
		{
			if (activeSession == null || report == null || (Object)(object)report.victimBody == (Object)null || (Object)(object)report.victimBody != (Object)(object)activeSession.body)
			{
				return;
			}
			HealthComponent healthComponent = report.victimBody.healthComponent;
			if (!((Object)(object)healthComponent == (Object)null))
			{
				float num = activeSession.startHealth - healthComponent.combinedHealth;
				float num2 = healthComponent.fullCombinedHealth * 0.1f;
				if (num >= num2 && !activeSession.interrupted)
				{
					AkSoundEngine.PostEvent(1630964891u, ((Component)activeSession.body).gameObject);
					activeSession.interrupted = true;
				}
			}
		}

		private void TriggerSuccess(CharacterBody caller)
		{
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: 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_00dd: 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_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Expected O, but got Unknown
			if ((Object)(object)caller == (Object)null)
			{
				return;
			}
			float damage = caller.damage * 10f;
			List<CharacterBody> list = new List<CharacterBody>();
			foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList)
			{
				if (!((Object)(object)readOnlyInstances == (Object)null) && !((Object)(object)readOnlyInstances.teamComponent == (Object)null) && readOnlyInstances.teamComponent.teamIndex != caller.teamComponent.teamIndex && !((Object)(object)readOnlyInstances.healthComponent == (Object)null) && readOnlyInstances.healthComponent.alive)
				{
					DamageInfo val = new DamageInfo
					{
						attacker = ((Component)caller).gameObject,
						damage = damage,
						crit = false,
						position = readOnlyInstances.corePosition,
						damageType = DamageTypeCombo.op_Implicit((DamageType)2),
						damageColorIndex = (DamageColorIndex)3
					};
					readOnlyInstances.healthComponent.TakeDamage(val);
					if (readOnlyInstances.healthComponent.alive)
					{
						list.Add(readOnlyInstances);
					}
				}
			}
			if (list.Count <= 0)
			{
				return;
			}
			Inventory orCreateMonsterTeamInventory = GetOrCreateMonsterTeamInventory();
			if ((Object)(object)orCreateMonsterTeamInventory == (Object)null)
			{
				Log.Warning("Could not find or create monster team inventory to grant items.");
				return;
			}
			foreach (CharacterBody item in list)
			{
				bool chooseVoid = Random.value < 0.5f;
				GrantRandomMonsterTeamItem(orCreateMonsterTeamInventory, chooseVoid);
			}
		}

		private Inventory GetOrCreateMonsterTeamInventory()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Invalid comparison between Unknown and I4
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Expected O, but got Unknown
			if (Object.op_Implicit((Object)(object)monsterTeamInventory))
			{
				return monsterTeamInventory;
			}
			Inventory[] array = Object.FindObjectsOfType<Inventory>();
			Inventory[] array2 = array;
			foreach (Inventory val in array2)
			{
				if (Object.op_Implicit((Object)(object)val))
				{
					TeamFilter component = ((Component)val).GetComponent<TeamFilter>();
					if ((Object)(object)component != (Object)null && (int)component.teamIndex == 2)
					{
						monsterTeamInventory = val;
						return monsterTeamInventory;
					}
				}
			}
			try
			{
				GameObject val2 = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/MonsterTeamGainsItemsArtifactInventory");
				if ((Object)(object)val2 != (Object)null)
				{
					GameObject val3 = Object.Instantiate<GameObject>(val2);
					monsterTeamInventory = val3.GetComponent<Inventory>();
					TeamFilter component2 = val3.GetComponent<TeamFilter>();
					if (Object.op_Implicit((Object)(object)component2))
					{
						component2.teamIndex = (TeamIndex)2;
					}
					if (NetworkServer.active)
					{
						NetworkServer.Spawn(val3);
					}
					else
					{
						Log.Warning("GetOrCreateMonsterTeamInventory called on non-server; spawned inventory won't be networked.");
					}
					return monsterTeamInventory;
				}
				GameObject val4 = new GameObject("JMod_MonsterTeamInventory");
				monsterTeamInventory = val4.AddComponent<Inventory>();
				TeamFilter val5 = val4.AddComponent<TeamFilter>();
				val5.teamIndex = (TeamIndex)2;
				if (NetworkServer.active)
				{
					NetworkServer.Spawn(val4);
				}
				else
				{
					Log.Warning("Created monster team inventory locally (not networked).");
				}
				return monsterTeamInventory;
			}
			catch (Exception ex)
			{
				Log.Warning("Exception while creating monster team inventory: " + ex);
				return null;
			}
		}

		private void GrantRandomMonsterTeamItem(Inventory monsterInventory, bool chooseVoid)
		{
			//IL_0026: 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_0151: 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_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Invalid comparison between Unknown and I4
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)monsterInventory == (Object)null)
			{
				return;
			}
			List<ItemIndex> list = new List<ItemIndex>();
			int itemCount = ItemCatalog.itemCount;
			for (int i = 0; i < itemCount; i++)
			{
				ItemIndex val = (ItemIndex)i;
				ItemDef itemDef = ItemCatalog.GetItemDef(val);
				if ((Object)(object)itemDef == (Object)null)
				{
					continue;
				}
				try
				{
					if (!chooseVoid)
					{
						if ((int)itemDef.deprecatedTier == 3)
						{
							list.Add(val);
						}
						continue;
					}
					string text = itemDef.nameToken ?? "";
					string text2 = itemDef.pickupToken ?? "";
					string text3 = ((Object)itemDef).name ?? "";
					if (text.IndexOf("VOID", StringComparison.OrdinalIgnoreCase) >= 0 || text2.IndexOf("VOID", StringComparison.OrdinalIgnoreCase) >= 0 || text3.IndexOf("Void", StringComparison.OrdinalIgnoreCase) >= 0)
					{
						list.Add(val);
					}
				}
				catch
				{
				}
			}
			if (list.Count > 0)
			{
				ItemIndex val2 = list[Random.Range(0, list.Count)];
				monsterInventory.GiveItem(val2, 1);
			}
			else
			{
				Log.Warning("Could not find a random Lunar/Void item—falling back to LunarDagger.");
				monsterInventory.GiveItem(Items.LunarDagger.itemIndex, 1);
			}
		}

		private void OnRunStart(Run run)
		{
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Expected O, but got Unknown
			if (!NetworkServer.active)
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)monsterTeamInventory))
			{
				NetworkServer.Destroy(((Component)monsterTeamInventory).gameObject);
				monsterTeamInventory = null;
			}
			GameObject val = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/MonsterTeamGainsItemsArtifactInventory");
			if ((Object)(object)val != (Object)null)
			{
				GameObject val2 = Object.Instantiate<GameObject>(val);
				Inventory component = val2.GetComponent<Inventory>();
				TeamFilter component2 = val2.GetComponent<TeamFilter>();
				if ((Object)(object)component != (Object)null)
				{
					monsterTeamInventory = component;
					if ((Object)(object)component2 != (Object)null)
					{
						component2.teamIndex = (TeamIndex)2;
					}
					NetworkServer.Spawn(val2);
					Log.Info("JMod: Created networked monster team inventory from prefab.");
					return;
				}
				Object.Destroy((Object)(object)val2);
			}
			GameObject val3 = new GameObject("JMod_MonsterTeamInventory");
			monsterTeamInventory = val3.AddComponent<Inventory>();
			TeamFilter val4 = val3.AddComponent<TeamFilter>();
			val4.teamIndex = (TeamIndex)2;
			if (NetworkServer.active)
			{
				NetworkServer.Spawn(val3);
				Log.Info("JMod: Created fallback networked monster team inventory.");
			}
			else
			{
				Log.Warning("JMod: Created local monster team inventory but NetworkServer not active. This won't be networked.");
			}
		}

		private void OnRunDestroy(Run run)
		{
			if (Object.op_Implicit((Object)(object)monsterTeamInventory))
			{
				if (NetworkServer.active)
				{
					NetworkServer.Destroy(((Component)monsterTeamInventory).gameObject);
				}
				else
				{
					Object.Destroy((Object)(object)((Component)monsterTeamInventory).gameObject);
				}
				monsterTeamInventory = null;
			}
		}

		private static void OnServerCardSpawnedGlobal(SpawnResult spawnResult)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Invalid comparison between Unknown and I4
			if ((Object)(object)monsterTeamInventory == (Object)null || (Object)(object)spawnResult.spawnedInstance == (Object)null)
			{
				return;
			}
			CharacterMaster component = spawnResult.spawnedInstance.GetComponent<CharacterMaster>();
			if ((Object)(object)component == (Object)null || (int)component.teamIndex != 2 || (Object)(object)component.inventory == (Object)null)
			{
				return;
			}
			try
			{
				component.inventory.AddItemsFrom(monsterTeamInventory);
			}
			catch (Exception ex)
			{
				Log.Warning("JMod: Failed to AddItemsFrom monsterTeamInventory: " + ex);
			}
		}

		private static void Run_FixedUpdate(orig_FixedUpdate orig, Run self)
		{
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!NetworkServer.active)
			{
				return;
			}
			float runStopwatch = self.GetRunStopwatch();
			int num = Mathf.FloorToInt(runStopwatch / 120f);
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				CharacterMaster master = instance.master;
				if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory))
				{
					continue;
				}
				int itemCount = master.inventory.GetItemCount(JunarItemDef);
				if (itemCount > 0)
				{
					if (!lastGrantedIntervals.TryGetValue(master, out var value))
					{
						value = 0;
					}
					if (num > value)
					{
						int num2 = num - value;
						int num3 = num2 * itemCount;
						master.inventory.GiveItem(Items.ExtraLife.itemIndex, num3);
						lastGrantedIntervals[master] = num;
					}
				}
			}
		}

		private static void ApplyMoveSpeedPenalty(CharacterBody body, StatHookEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)body.inventory))
			{
				int itemCount = body.inventory.GetItemCount(JunarItemDef);
				if (itemCount > 0)
				{
					float num = 0.25f + 0.1f * (float)itemCount;
					args.moveSpeedMultAdd -= num;
				}
			}
		}

		private void RegisterCorruptionsOnce(Run run)
		{
			if (!registered)
			{
				registered = true;
				RegisterTier2Corruptions();
			}
		}

		private void RegisterTier2Corruptions()
		{
			//IL_0012: 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)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Invalid comparison between Unknown and I4
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Invalid comparison between Unknown and I4
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Invalid comparison between Unknown and I4
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Invalid comparison between Unknown and I4
			int itemCount = ItemCatalog.itemCount;
			int num = 0;
			for (int i = 0; i < itemCount; i++)
			{
				ItemIndex val = (ItemIndex)i;
				ItemDef itemDef = ItemCatalog.GetItemDef(val);
				if ((Object)(object)itemDef == (Object)null)
				{
					continue;
				}
				try
				{
					if (!((Object)(object)itemDef == (Object)(object)VoidItemDef) && (int)itemDef.tier != 6 && (int)itemDef.tier != 7 && ((int)itemDef.tier == 1 || (int)itemDef.deprecatedTier == 1))
					{
						VoidTransformation.CreateTransformation(VoidItemDef, itemDef);
						num++;
					}
				}
				catch
				{
				}
			}
			((BaseUnityPlugin)this).Logger.LogInfo((object)$"[VoidGreenCorruptor] Registered {num} Tier2 corruptions.");
		}

		private void OnCharacterDeath(DamageReport report)
		{
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Invalid comparison between Unknown and I4
			if ((Object)(object)report?.victimBody == (Object)null)
			{
				return;
			}
			Inventory inventory = report.victimBody.inventory;
			if ((Object)(object)inventory == (Object)null)
			{
				return;
			}
			int itemCount = inventory.GetItemCount(VoidItemDef);
			if (itemCount <= 0)
			{
				return;
			}
			List<ItemDef> list = new List<ItemDef>();
			for (int i = 0; i < ItemCatalog.itemCount; i++)
			{
				ItemDef itemDef = ItemCatalog.GetItemDef((ItemIndex)i);
				if (!((Object)(object)itemDef == (Object)null) && (int)itemDef.tier == 2)
				{
					list.Add(itemDef);
				}
			}
			if (list.Count != 0)
			{
				for (int j = 0; j < itemCount; j++)
				{
					ItemDef val = list[Random.Range(0, list.Count)];
					inventory.GiveItem(val, 1);
				}
				Log.Info($"[VoidGreenCorrupter] Granted {itemCount} random Tier3 items on death.");
			}
		}

		private void CreateVoidItem()
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Expected O, but got Unknown
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Expected O, but got Unknown
			VoidItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)VoidItemDef).name = "ITEM_JOID_NAME";
			VoidItemDef.nameToken = "ITEM_JOID_NAME";
			VoidItemDef.pickupToken = "ITEM_JOID_PICKUP";
			VoidItemDef.descriptionToken = "ITEM_JOID_DESC";
			VoidItemDef.loreToken = "ITEM_JOID_LORE";
			VoidItemDef.tier = (ItemTier)8;
			VoidItemDef.deprecatedTier = (ItemTier)8;
			VoidItemDef.canRemove = true;
			VoidItemDef.pickupIconSprite = LegacyResourcesAPI.Load<Sprite>("Textures/MiscIcons/texMysteryIcon");
			VoidItemDef.pickupModelPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/PickupModels/PickupMystery");
			ItemAPI.Add(new CustomItem(VoidItemDef, new ItemDisplayRuleDict((ItemDisplayRule[])null)));
		}

		private void Update()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown((KeyCode)283) && PlayerCharacterMasterController.instances.Count > 0)
			{
				Transform transform = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform;
				Log.Info($"Player pressed F2. Spawning our custom item at coordinates {transform.position}");
				PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(myItemDef.itemIndex), transform.position, transform.forward * 20f);
			}
		}

		private void OnDestroy()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			EquipmentSlot.PerformEquipmentAction -= new hook_PerformEquipmentAction(OnPerformEquipment);
			GlobalEventManager.onServerDamageDealt -= OnServerDamageDealt;
			GlobalEventManager.onServerDamageDealt -= OnEquipmentDamageTaken;
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

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

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

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

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

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

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

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
}
namespace MoreElites
{
	public abstract class EliteBase<T> : EliteBase where T : EliteBase<T>
	{
		public static T instance { get; private set; }

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

		public BuffDef EliteBuff;

		public EliteDef EliteDefinition;

		public abstract string EliteName { get; }

		public abstract string EliteAffixDesc { get; }

		public abstract Color EliteColor { get; }

		public abstract float EliteHealthMult { get; }

		public abstract float EliteDamageMult { get; }

		public abstract float EliteAffixDropChance { get; }

		public abstract Material EliteAffixMaterial { get; }

		public abstract Texture2D EliteRamp { get; }

		public abstract Sprite EliteIcon { get; }

		public abstract Sprite EliteAspectIcon { get; }

		public abstract GameObject EliteCrown { get; }

		public abstract void Init(ConfigFile config);

		public virtual void CreateConfig(ConfigFile config)
		{
		}

		protected virtual void CreateLang()
		{
			LanguageAPI.Add("ELITE_NUX_" + EliteName.ToUpper() + "_NAME", EliteName);
			LanguageAPI.Add("ELITE_NUX_MODIFIER_" + EliteName.ToUpper(), EliteName + " {0}");
			LanguageAPI.Add("ELITE_NUX_EQUIPMENT_AFFIX_" + EliteName.ToUpper() + "_NAME", EliteName + " Aspect");
			LanguageAPI.Add("ELITE_NUX_AFFIX_" + EliteName.ToUpper() + "_DESCRIPTION", EliteName + " Aspect");
		}

		protected void AddRamp()
		{
			EliteRamp.AddRamp(EliteDefinition, EliteRamp);
		}

		protected void AddContent()
		{
			ContentAddition.AddEliteDef(EliteDefinition);
			ContentAddition.AddBuffDef(EliteBuff);
			ContentAddition.AddEquipmentDef(EliteEquip);
		}

		protected void AddCrown()
		{
			ItemDisplays itemDisplays = new ItemDisplays();
		}

		protected void CreateBuff()
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			EliteBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)EliteBuff).name = "Elite" + EliteName + "Buff";
			EliteBuff.canStack = false;
			EliteBuff.isCooldown = false;
			EliteBuff.isDebuff = false;
			EliteBuff.buffColor = EliteColor;
			EliteBuff.iconSprite = EliteIcon;
			((Object)EliteBuff).name = ((Object)EliteBuff).name;
		}

		protected void CreateEquip()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			EliteEquip = ScriptableObject.CreateInstance<EquipmentDef>();
			EliteEquip.appearsInMultiPlayer = true;
			EliteEquip.appearsInSinglePlayer = true;
			EliteEquip.canBeRandomlyTriggered = false;
			EliteEquip.canDrop = false;
			EliteEquip.colorIndex = (ColorIndex)5;
			EliteEquip.cooldown = 0f;
			EliteEquip.isLunar = false;
			EliteEquip.isBoss = false;
			EliteEquip.passiveBuffDef = EliteBuff;
			EliteEquip.dropOnDeathChance = EliteAffixDropChance;
			EliteEquip.enigmaCompatible = false;
			EliteEquip.pickupIconSprite = EliteIcon;
			EliteEquip.pickupModelPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteFire/PickupEliteFire.prefab").WaitForCompletion(), "PickupAffixEmpowering", false);
			Renderer[] componentsInChildren = EliteEquip.pickupModelPrefab.GetComponentsInChildren<Renderer>();
			foreach (Renderer val in componentsInChildren)
			{
				val.material = EliteAffixMaterial;
			}
			EliteEquip.nameToken = "ELITE_NUX_EQUIPMENT_AFFIX_" + EliteName.ToUpper() + "_NAME";
			((Object)EliteEquip).name = "Affix" + EliteName;
			EliteEquip.pickupToken = "Aspect of " + EliteName;
			EliteEquip.descriptionToken = EliteAffixDesc;
			EliteEquip.loreToken = "";
		}

		protected void CreateElite()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			EliteDefinition = ScriptableObject.CreateInstance<EliteDef>();
			EliteDefinition.color = Color32.op_Implicit(EliteColor);
			EliteDefinition.eliteEquipmentDef = EliteEquip;
			EliteDefinition.modifierToken = "ELITE_NUX_MODIFIER_" + EliteName.ToUpper();
			((Object)EliteDefinition).name = EliteName;
			EliteDefinition.healthBoostCoefficient = EliteHealthMult;
			EliteDefinition.damageBoostCoefficient = EliteDamageMult;
			EliteBuff.eliteDef = EliteDefinition;
			((Object)EliteDefinition).name = EliteName;
		}

		public virtual void Hooks()
		{
		}
	}
	public class Empowering
	{
		public static Color AffixEmpoweringColor = new Color(1f, 0.5f, 0f);

		public static EquipmentDef AffixEmpoweringEquipment;

		public static BuffDef AffixEmpoweringBuff;

		public static EliteDef AffixEmpoweringElite;

		public static float healthMult = 4f;

		public static float damageMult = 2f;

		public static float affixDropChance = 0.00025f;

		private static GameObject EmpoweringWard = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteHaunted/AffixHauntedWard.prefab").WaitForCompletion(), "EmpoweringWard");

		private static Material empoweringMat = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/WardOnLevel/matWarbannerBuffRing.mat").WaitForCompletion();

		private static Texture2D eliteRamp = Addressables.LoadAssetAsync<Texture2D>((object)"RoR2/Base/Common/ColorRamps/texRampMagmaWorm.png").WaitForCompletion();

		private static Sprite eliteIcon = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/EliteIce/texBuffAffixWhite.tif").WaitForCompletion();

		private static Sprite aspectIcon = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/EliteEarth/texAffixEarthIcon.png").WaitForCompletion();

		public Empowering()
		{
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Expected O, but got Unknown
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Expected O, but got Unknown
			((Renderer)((Component)EmpoweringWard.transform.GetChild(0).GetChild(0)).GetComponent<MeshRenderer>()).material = empoweringMat;
			AddLanguageTokens();
			SetupBuff();
			SetupEquipment();
			SetupElite();
			AddContent();
			EliteRamp.AddRamp(AffixEmpoweringElite, eliteRamp);
			CharacterBody.OnBuffFirstStackGained += new hook_OnBuffFirstStackGained(CharacterBody_OnBuffFirstStackGained);
			CharacterBody.OnBuffFinalStackLost += new hook_OnBuffFinalStackLost(CharacterBody_OnBuffFinalStackLost);
			CombatDirector.Init += new hook_Init(CombatDirector_Init);
		}

		private void CombatDirector_Init(orig_Init orig)
		{
			orig.Invoke();
			if (EliteAPI.VanillaEliteTiers.Length > 2)
			{
				EliteTierDef val = EliteAPI.VanillaEliteTiers[2];
				List<EliteDef> list = val.eliteTypes.ToList();
				AffixEmpoweringElite.healthBoostCoefficient = 2.5f;
				AffixEmpoweringElite.damageBoostCoefficient = 1.5f;
				list.Add(AffixEmpoweringElite);
				val.eliteTypes = list.ToArray();
			}
			if (EliteAPI.VanillaEliteTiers.Length > 1)
			{
				EliteTierDef val2 = EliteAPI.VanillaEliteTiers[1];
				List<EliteDef> list2 = val2.eliteTypes.ToList();
				AffixEmpoweringElite.healthBoostCoefficient = 4f;
				AffixEmpoweringElite.damageBoostCoefficient = 2f;
				list2.Add(AffixEmpoweringElite);
				val2.eliteTypes = list2.ToArray();
			}
		}

		private void CharacterBody_OnBuffFirstStackGained(orig_OnBuffFirstStackGained orig, CharacterBody self, BuffDef buffDef)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, buffDef);
			if ((Object)(object)buffDef == (Object)(object)AffixEmpoweringBuff)
			{
				GameObject val = Object.Instantiate<GameObject>(EmpoweringWard);
				BuffWard component = val.GetComponent<BuffWard>();
				val.GetComponent<TeamFilter>().teamIndex = self.teamComponent.teamIndex;
				component.buffDef = Buffs.Warbanner;
				component.Networkradius = 25f + self.radius;
				val.GetComponent<NetworkedBodyAttachment>().AttachToGameObjectAndSpawn(((Component)self).gameObject, (string)null);
				Object.Destroy((Object)(object)val.GetComponent<AkEvent>());
				Object.Destroy((Object)(object)val.GetComponent<AkEvent>());
				Object.Destroy((Object)(object)val.GetComponent<AkGameObj>());
			}
		}

		private void CharacterBody_OnBuffFinalStackLost(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef)
		{
			orig.Invoke(self, buffDef);
			if ((Object)(object)buffDef == (Object)(object)AffixEmpoweringBuff)
			{
				BuffWard componentInChildren = ((Component)self).gameObject.GetComponentInChildren<BuffWard>();
				Object.Destroy((Object)(object)componentInChildren);
			}
		}

		private void AddContent()
		{
			ContentAddition.AddEliteDef(AffixEmpoweringElite);
			ContentAddition.AddBuffDef(AffixEmpoweringBuff);
			ContentAddition.AddEquipmentDef(AffixEmpoweringEquipment);
		}

		private void SetupBuff()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			AffixEmpoweringBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)AffixEmpoweringBuff).name = "EliteEmpoweringBuff";
			AffixEmpoweringBuff.canStack = false;
			AffixEmpoweringBuff.isCooldown = false;
			AffixEmpoweringBuff.isDebuff = false;
			AffixEmpoweringBuff.buffColor = AffixEmpoweringColor;
			AffixEmpoweringBuff.iconSprite = eliteIcon;
			((Object)AffixEmpoweringBuff).name = ((Object)AffixEmpoweringBuff).name;
		}

		private void SetupEquipment()
		{
			//IL_003d: 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)
			AffixEmpoweringEquipment = ScriptableObject.CreateInstance<EquipmentDef>();
			AffixEmpoweringEquipment.appearsInMultiPlayer = true;
			AffixEmpoweringEquipment.appearsInSinglePlayer = true;
			AffixEmpoweringEquipment.canBeRandomlyTriggered = false;
			AffixEmpoweringEquipment.canDrop = false;
			AffixEmpoweringEquipment.colorIndex = (ColorIndex)5;
			AffixEmpoweringEquipment.cooldown = 0f;
			AffixEmpoweringEquipment.isLunar = false;
			AffixEmpoweringEquipment.isBoss = false;
			AffixEmpoweringEquipment.passiveBuffDef = AffixEmpoweringBuff;
			AffixEmpoweringEquipment.dropOnDeathChance = affixDropChance;
			AffixEmpoweringEquipment.enigmaCompatible = false;
			AffixEmpoweringEquipment.pickupIconSprite = aspectIcon;
			AffixEmpoweringEquipment.pickupModelPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteFire/PickupEliteFire.prefab").WaitForCompletion(), "PickupAffixEmpowering", false);
			Renderer[] componentsInChildren = AffixEmpoweringEquipment.pickupModelPrefab.GetComponentsInChildren<Renderer>();
			foreach (Renderer val in componentsInChildren)
			{
				val.material = empoweringMat;
			}
			AffixEmpoweringEquipment.nameToken = "EQUIPMENT_AFFIX_EMPOWERING_NAME";
			((Object)AffixEmpoweringEquipment).name = "AffixEmpowering";
			AffixEmpoweringEquipment.pickupToken = "Aspect of Empowering";
			AffixEmpoweringEquipment.descriptionToken = "Buffed move/atk speed of allies";
			AffixEmpoweringEquipment.loreToken = "";
		}

		private void SetupElite()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			AffixEmpoweringElite = ScriptableObject.CreateInstance<EliteDef>();
			AffixEmpoweringElite.color = Color32.op_Implicit(AffixEmpoweringColor);
			AffixEmpoweringElite.eliteEquipmentDef = AffixEmpoweringEquipment;
			AffixEmpoweringElite.modifierToken = "ELITE_MODIFIER_EMPOWERING";
			((Object)AffixEmpoweringElite).name = "EliteEmpowering";
			AffixEmpoweringElite.healthBoostCoefficient = healthMult;
			AffixEmpoweringElite.damageBoostCoefficient = damageMult;
			AffixEmpoweringBuff.eliteDef = AffixEmpoweringElite;
			((Object)AffixEmpoweringElite).name = "EliteEmpowering";
		}

		private void AddLanguageTokens()
		{
			LanguageAPI.Add("ELITE_MODIFIER_EMPOWERING", "Empowering {0}");
			LanguageAPI.Add("EQUIPMENT_AFFIX_EMPOWERING_NAME", "Empowering Aspect");
		}
	}
	public class Frenzied
	{
		public class FrenziedTeleportController : MonoBehaviour
		{
			private float fireTimer;

			private float fireInterval = 10f;

			private GameObject blinkPrefab = blinkEffect;

			private CharacterBody body;

			private Vector3 blinkDestination = Vector3.zero;

			private Vector3 blinkStart = Vector3.zero;

			private float shortBlinkDistance = 25f;

			private float blinkDistance = 50f;

			private void Awake()
			{
				body = ((Component)this).gameObject.GetComponent<CharacterBody>();
			}

			private void FixedUpdate()
			{
				//IL_0085: Unknown result type (might be due to invalid IL or missing references)
				//IL_008b: Unknown result type (might be due to invalid IL or missing references)
				if (body.isPlayerControlled)
				{
					return;
				}
				fireTimer += Time.fixedDeltaTime;
				if (!((double)fireTimer < (double)fireInterval) && (!Object.op_Implicit((Object)(object)body.healthComponent) || body.healthComponent.alive))
				{
					fireTimer %= 1f;
					CalculateBlinkDestination();
					if (!(blinkStart == blinkDestination))
					{
						((MonoBehaviour)this).StartCoroutine(Teleport());
					}
				}
			}

			public IEnumerator Teleport()
			{
				Util.PlaySound("Play_parent_teleport", ((Component)this).gameObject);
				CreateBlinkEffect(Util.GetCorePosition(((Component)this).gameObject));
				TeleportHelper.TeleportBody(body, blinkDestination);
				yield return (object)new WaitForSeconds(0.33f);
				CreateBlinkEffect(Util.GetCorePosition(((Component)this).gameObject));
			}

			private void CreateBlinkEffect(Vector3 origin)
			{
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_003d: 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_005b: Expected O, but got Unknown
				if (Object.op_Implicit((Object)(object)blinkPrefab))
				{
					EffectManager.SpawnEffect(blinkPrefab, new EffectData
					{
						rotation = Util.QuaternionSafeLookRotation(blinkDestination - blinkStart),
						origin = origin,
						scale = body.radius
					}, false);
				}
			}

			private void CalculateBlinkDestination()
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: 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_001f: 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)
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: Expected O, but got Unknown
				//IL_0065: Unknown result type (might be due to invalid IL or missing references)
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_0089: Unknown result type (might be due to invalid IL or missing references)
				//IL_008e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f1: 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_0101: Unknown result type (might be due to invalid IL or missing references)
				//IL_0106: Unknown result type (might be due to invalid IL or missing references)
				//IL_010f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0113: Unknown result type (might be due to invalid IL or missing references)
				//IL_0118: Unknown result type (might be due to invalid IL or missing references)
				//IL_011d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0122: 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)
				//IL_0164: Unknown result type (might be due to invalid IL or missing references)
				//IL_0169: Unknown result type (might be due to invalid IL or missing references)
				//IL_0175: Unknown result type (might be due to invalid IL or missing references)
				//IL_017a: Unknown result type (might be due to invalid IL or missing references)
				//IL_014c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0157: Unknown result type (might be due to invalid IL or missing references)
				//IL_015c: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01da: Unknown result type (might be due to invalid IL or missing references)
				//IL_01db: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0203: Unknown result type (might be due to invalid IL or missing references)
				//IL_020e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0219: Unknown result type (might be due to invalid IL or missing references)
				//IL_021e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0223: Unknown result type (might be due to invalid IL or missing references)
				//IL_0228: 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)
				Vector3 val = Vector3.zero;
				Ray val2 = (Object.op_Implicit((Object)(object)body.inputBank) ? new Ray(body.inputBank.aimOrigin, body.inputBank.aimDirection) : new Ray(((Component)this).transform.position, ((Component)this).transform.forward));
				BullseyeSearch val3 = new BullseyeSearch();
				val3.searchOrigin = ((Ray)(ref val2)).origin;
				val3.searchDirection = ((Ray)(ref val2)).direction;
				val3.maxDistanceFilter = blinkDistance;
				val3.teamMaskFilter = TeamMask.allButNeutral;
				val3.filterByLoS = false;
				((TeamMask)(ref val3.teamMaskFilter)).RemoveTeam(TeamComponent.GetObjectTeam(((Component)this).gameObject));
				val3.sortMode = (SortMode)2;
				val3.RefreshCandidates();
				HurtBox val4 = val3.GetResults().FirstOrDefault();
				if (Object.op_Implicit((Object)(object)val4) && !body.isPlayerControlled)
				{
					Vector3 val5 = ((Component)val4).transform.position - ((Component)this).transform.position;
					float num = 15f;
					val = val5 + Vector2.op_Implicit(num * Random.insideUnitCircle);
				}
				else if (Object.op_Implicit((Object)(object)body.inputBank))
				{
					val = body.inputBank.moveVector * shortBlinkDistance;
				}
				blinkDestination = ((Component)this).transform.position;
				blinkStart = ((Component)this).transform.position;
				NodeGraph val6 = (body.isFlying ? SceneInfo.instance.airNodes : SceneInfo.instance.groundNodes);
				if (((Object)body).name == "MinorConstructBody(Clone)")
				{
					val6 = SceneInfo.instance.groundNodes;
				}
				val6.GetNodePosition(val6.FindClosestNode(((Component)this).transform.position + val, body.hullClassification, float.PositiveInfinity), ref blinkDestination);
				blinkDestination += ((Component)this).transform.position - body.footPosition;
				if (Object.op_Implicit((Object)(object)body.characterDirection))
				{
					body.characterDirection.forward = val;
				}
			}
		}

		public static Color AffixFrenziedColor = Color.yellow;

		public static Color AffixFrenziedLightColor = Color.yellow;

		public static EquipmentDef AffixFrenziedEquipment;

		public static BuffDef AffixFrenziedBuff;

		public static EliteDef AffixFrenziedElite;

		public static float healthMult = 4f;

		public static float damageMult = 2f;

		public static float affixDropChance = 0.00025f;

		private static Material warbannerMat = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/WardOnLevel/matWarbannerSphereIndicator.mat").WaitForCompletion();

		private static GameObject blinkEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Junk/Treebot/SonicBoomEffect.prefab").WaitForCompletion();

		private static GameObject blinkEffect2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSuppressor/SuppressorRetreatToShellEffect.prefab").WaitForCompletion();

		private static Material FrenziedMat = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/WardOnLevel/matWarbannerBuffRing.mat").WaitForCompletion();

		private static Texture2D eliteRamp = Addressables.LoadAssetAsync<Texture2D>((object)"RoR2/Base/Common/ColorRamps/texRampWarbanner2.png").WaitForCompletion();

		private static Sprite eliteIcon = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/EliteIce/texBuffAffixWhite.tif").WaitForCompletion();

		private static Sprite aspectIcon = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/EliteEarth/texAffixEarthIcon.png").WaitForCompletion();

		public Frenzied()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Expected O, but got Unknown
			AddLanguageTokens();
			SetupBuff();
			SetupEquipment();
			SetupElite();
			AddContent();
			EliteRamp.AddRamp(AffixFrenziedElite, eliteRamp);
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(Frenzy);
			CharacterBody.OnBuffFirstStackGained += new hook_OnBuffFirstStackGained(CharacterBody_OnBuffFirstStackGained);
			CharacterBody.OnBuffFinalStackLost += new hook_OnBuffFinalStackLost(CharacterBody_OnBuffFinalStackLost);
			CombatDirector.Init += new hook_Init(CombatDirector_Init);
			EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(EquipmentSlot_PerformEquipmentAction);
		}

		private bool EquipmentSlot_PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef)
		{
			bool flag = orig.Invoke(self, equipmentDef);
			if (!flag && (Object)(object)equipmentDef == (Object)(object)AffixFrenziedEquipment)
			{
				CharacterBody characterBody = self.characterBody;
				if (Object.op_Implicit((Object)(object)characterBody) && characterBody.isPlayerControlled && Object.op_Implicit((Object)(object)Run.instance))
				{
					Xoroshiro128Plus spawnRng = Run.instance.spawnRng;
					FrenziedTeleportController component = ((Component)characterBody).GetComponent<FrenziedTeleportController>();
					if (Object.op_Implicit((Object)(object)component))
					{
						((MonoBehaviour)self).StartCoroutine(component.Teleport());
					}
				}
				flag = true;
			}
			return flag;
		}

		private void CombatDirector_Init(orig_Init orig)
		{
			orig.Invoke();
			if (EliteAPI.VanillaEliteTiers.Length > 2)
			{
				EliteTierDef val = EliteAPI.VanillaEliteTiers[2];
				List<EliteDef> list = val.eliteTypes.ToList();
				AffixFrenziedElite.healthBoostCoefficient = 2.5f;
				AffixFrenziedElite.damageBoostCoefficient = 1.5f;
				list.Add(AffixFrenziedElite);
				val.eliteTypes = list.ToArray();
			}
			if (EliteAPI.VanillaEliteTiers.Length > 1)
			{
				EliteTierDef val2 = EliteAPI.VanillaEliteTiers[1];
				List<EliteDef> list2 = val2.eliteTypes.ToList();
				AffixFrenziedElite.healthBoostCoefficient = 4f;
				AffixFrenziedElite.damageBoostCoefficient = 2f;
				list2.Add(AffixFrenziedElite);
				val2.eliteTypes = list2.ToArray();
			}
		}

		private void Frenzy(CharacterBody sender, StatHookEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory) && sender.HasBuff(AffixFrenziedBuff))
			{
				args.baseMoveSpeedAdd += 2f;
				args.attackSpeedMultAdd += 0.5f;
			}
		}

		private void CharacterBody_OnBuffFirstStackGained(orig_OnBuffFirstStackGained orig, CharacterBody self, BuffDef buffDef)
		{
			orig.Invoke(self, buffDef);
			if ((Object)(object)buffDef == (Object)(object)AffixFrenziedBuff)
			{
				((Component)self).gameObject.AddComponent<FrenziedTeleportController>();
			}
		}

		private void CharacterBody_OnBuffFinalStackLost(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef)
		{
			orig.Invoke(self, buffDef);
			if ((Object)(object)buffDef == (Object)(object)AffixFrenziedBuff)
			{
				Object.Destroy((Object)(object)((Component)self).gameObject.GetComponent<FrenziedTeleportController>());
			}
		}

		private void AddContent()
		{
			ContentAddition.AddEliteDef(AffixFrenziedElite);
			ContentAddition.AddBuffDef(AffixFrenziedBuff);
			ContentAddition.AddEquipmentDef(AffixFrenziedEquipment);
		}

		private void SetupBuff()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			AffixFrenziedBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)AffixFrenziedBuff).name = "EliteFrenziedBuff";
			AffixFrenziedBuff.canStack = false;
			AffixFrenziedBuff.isCooldown = false;
			AffixFrenziedBuff.isDebuff = false;
			AffixFrenziedBuff.buffColor = AffixFrenziedLightColor;
			((Object)AffixFrenziedBuff).name = ((Object)AffixFrenziedBuff).name;
			AffixFrenziedBuff.iconSprite = eliteIcon;
			((Object)AffixFrenziedBuff).name = ((Object)AffixFrenziedBuff).name;
		}

		private void SetupEquipment()
		{
			//IL_003d: 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)
			AffixFrenziedEquipment = ScriptableObject.CreateInstance<EquipmentDef>();
			AffixFrenziedEquipment.appearsInMultiPlayer = true;
			AffixFrenziedEquipment.appearsInSinglePlayer = true;
			AffixFrenziedEquipment.canBeRandomlyTriggered = false;
			AffixFrenziedEquipment.canDrop = false;
			AffixFrenziedEquipment.colorIndex = (ColorIndex)5;
			AffixFrenziedEquipment.cooldown = 10f;
			AffixFrenziedEquipment.isLunar = false;
			AffixFrenziedEquipment.isBoss = false;
			AffixFrenziedEquipment.passiveBuffDef = AffixFrenziedBuff;
			AffixFrenziedEquipment.dropOnDeathChance = affixDropChance;
			AffixFrenziedEquipment.enigmaCompatible = false;
			AffixFrenziedEquipment.pickupIconSprite = aspectIcon;
			AffixFrenziedEquipment.pickupModelPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteFire/PickupEliteFire.prefab").WaitForCompletion(), "PickupAffixFrenzied", false);
			Renderer[] componentsInChildren = AffixFrenziedEquipment.pickupModelPrefab.GetComponentsInChildren<Renderer>();
			foreach (Renderer val in componentsInChildren)
			{
				val.material = warbannerMat;
			}
			AffixFrenziedEquipment.nameToken = "EQUIPMENT_AFFIX_Frenzied_NAME";
			((Object)AffixFrenziedEquipment).name = "AffixFrenziedNuxlar";
			AffixFrenziedEquipment.pickupToken = "Aspect of Frenzy";
			AffixFrenziedEquipment.descriptionToken = "Buffed move/atk speed";
			AffixFrenziedEquipment.loreToken = "";
		}

		private void SetupElite()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			AffixFrenziedElite = ScriptableObject.CreateInstance<EliteDef>();
			AffixFrenziedElite.color = Color32.op_Implicit(AffixFrenziedLightColor);
			AffixFrenziedElite.eliteEquipmentDef = AffixFrenziedEquipment;
			AffixFrenziedElite.modifierToken = "ELITE_MODIFIER_Frenzied";
			((Object)AffixFrenziedElite).name = "EliteFrenzied";
			((Object)AffixFrenziedElite).name = "EliteFrenzied";
			AffixFrenziedElite.healthBoostCoefficient = healthMult;
			AffixFrenziedElite.damageBoostCoefficient = damageMult;
			AffixFrenziedBuff.eliteDef = AffixFrenziedElite;
		}

		private void AddLanguageTokens()
		{
			LanguageAPI.Add("ELITE_MODIFIER_Frenzied", "Frenzied {0}");
			LanguageAPI.Add("EQUIPMENT_AFFIX_Frenzied_NAME", "Frenzied Aspect");
		}
	}
	public class Volatile
	{
		public class VolatileMissileController : MonoBehaviour
		{
			private float fireTimer;

			private float fireInterval = 3f;

			private float normalBaseDamage = 12f;

			private float normalLevelDamage = 2.4f;

			private float championBaseDamage = 18f;

			private float championLevelDamage = 3.6f;

			private CharacterBody body;

			private void Awake()
			{
				body = ((Component)this).gameObject.GetComponent<CharacterBody>();
			}

			private void FixedUpdate()
			{
				//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
				fireTimer += Time.fixedDeltaTime;
				if (!((double)fireTimer < (double)fireInterval))
				{
					fireTimer %= 1f;
					RecalculateInterval();
					if (!Object.op_Implicit((Object)(object)body.healthComponent) || body.healthComponent.alive)
					{
						float num = ((!body.isChampion) ? (normalBaseDamage + normalLevelDamage * body.level) : (championBaseDamage + championLevelDamage * body.level));
						MissileUtils.FireMissile(body.corePosition, body, default(ProcChainMask), (GameObject)null, num, Util.CheckRoll(body.crit, body.master), VolatileProjectile, (DamageColorIndex)3, false);
					}
				}
			}

			private void RecalculateInterval()
			{
				fireInterval = Random.Range(1, 6);
			}
		}

		public static Color AffixVolatileColor = Color.red;

		public static EquipmentDef AffixVolatileEquipment;

		public static BuffDef AffixVolatileBuff;

		public static EliteDef AffixVolatileElite;

		public static float healthMult = 4f;

		public static float damageMult = 2f;

		public static float affixDropChance = 0.00025f;

		private static GameObject VolatileProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/MissileProjectile.prefab").WaitForCompletion(), "AffixVolatileNuxProjectile");

		private static GameObject VolatileProjectileGhost = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/MissileGhost.prefab").WaitForCompletion(), "AffixVolatileNuxProjectileGhost");

		private static Material VolatileMat = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/MagmaWorm/matMagmaWormFireball.mat").WaitForCompletion();

		private static Material projectileFlare = Addressables.LoadAssetAsync<Material>((object)"RoR2/Junk/Bandit/matThermiteFlare.mat").WaitForCompletion();

		private static Material projectileTrail = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/MagmaWorm/matMagmaWormFireballTrail.mat").WaitForCompletion();

		private static Texture2D eliteRamp = Addressables.LoadAssetAsync<Texture2D>((object)"RoR2/DLC1/Common/ColorRamps/texRampStrongerBurn.png").WaitForCompletion();

		private static Sprite eliteIcon = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/EliteIce/texBuffAffixWhite.tif").WaitForCompletion();

		private static Sprite aspectIcon = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/EliteEarth/texAffixEarthIcon.png").WaitForCompletion();

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

		public Volatile()
		{
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Expected O, but got Unknown
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Expected O, but got Unknown
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Expected O, but got Unknown
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Expected O, but got Unknown
			((Renderer)((Component)VolatileProjectileGhost.transform.GetChild(0)).GetComponent<TrailRenderer>()).sharedMaterial = projectileTrail;
			((Renderer)((Component)VolatileProjectileGhost.transform.GetChild(1)).GetComponent<ParticleSystemRenderer>()).sharedMaterial = projectileFlare;
			((Renderer)((Component)VolatileProjectileGhost.transform.GetChild(2)).GetComponent<MeshRenderer>()).sharedMaterial = VolatileMat;
			((Component)VolatileProjectileGhost.transform.GetChild(3)).GetComponent<Light>().color = AffixVolatileColor;
			VolatileProjectile.GetComponent<ProjectileController>().ghostPrefab = VolatileProjectileGhost;
			MissileController component = VolatileProjectile.GetComponent<MissileController>();
			component.acceleration = 2f;
			component.deathTimer = 10f;
			component.maxVelocity = 20f;
			component.turbulence = 6f;
			ContentAddition.AddProjectile(VolatileProjectile);
			AddLanguageTokens();
			SetupBuff();
			SetupEquipment();
			SetupElite();
			AddContent();
			EliteRamp.AddRamp(AffixVolatileElite, eliteRamp);
			GlobalEventManager.OnHitAll += new hook_OnHitAll(AddBehemoExplosion);
			CharacterBody.OnBuffFirstStackGained += new hook_OnBuffFirstStackGained(CharacterBody_OnBuffFirstStackGained);
			CharacterBody.OnBuffFinalStackLost += new hook_OnBuffFinalStackLost(CharacterBody_OnBuffFinalStackLost);
			CombatDirector.Init += new hook_Init(CombatDirector_Init);
		}

		private void AddBehemoExplosion(orig_OnHitAll orig, GlobalEventManager self, DamageInfo damageInfo, GameObject hitObject)
		{
			//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_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Expected O, but got Unknown
			//IL_00db: 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_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Expected O, but got Unknown
			//IL_0125: 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_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageInfo, hitObject);
			if ((double)damageInfo.procCoefficient != 0.0 && !damageInfo.rejected && Object.op_Implicit((Object)(object)damageInfo.attacker))
			{
				CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)component) && component.HasBuff(AffixVolatileBuff))
				{
					float num = 4f * damageInfo.procCoefficient;
					float num2 = 0.25f;
					float baseDamage = Util.OnHitProcDamage(damageInfo.damage, component.damage, num2);
					EffectManager.SpawnEffect(behemoExplosion, new EffectData
					{
						origin = damageInfo.position,
						scale = num,
						rotation = Util.QuaternionSafeLookRotation(damageInfo.force)
					}, true);
					BlastAttack val = new BlastAttack
					{
						position = damageInfo.position,
						baseDamage = baseDamage,
						baseForce = 0f,
						radius = num,
						attacker = damageInfo.attacker,
						inflictor = null
					};
					val.teamIndex = TeamComponent.GetObjectTeam(val.attacker);
					val.crit = damageInfo.crit;
					val.procChainMask = damageInfo.procChainMask;
					val.procCoefficient = 0f;
					val.damageColorIndex = (DamageColorIndex)3;
					val.falloffModel = (FalloffModel)0;
					val.damageType = damageInfo.damageType;
					val.Fire();
				}
			}
		}

		private void CombatDirector_Init(orig_Init orig)
		{
			orig.Invoke();
			if (EliteAPI.VanillaEliteTiers.Length > 2)
			{
				EliteTierDef val = EliteAPI.VanillaEliteTiers[2];
				List<EliteDef> list = val.eliteTypes.ToList();
				AffixVolatileElite.healthBoostCoefficient = 2.5f;
				AffixVolatileElite.damageBoostCoefficient = 1.5f;
				list.Add(AffixVolatileElite);
				val.eliteTypes = list.ToArray();
			}
			if (EliteAPI.VanillaEliteTiers.Length > 1)
			{
				EliteTierDef val2 = EliteAPI.VanillaEliteTiers[1];
				List<EliteDef> list2 = val2.eliteTypes.ToList();
				AffixVolatileElite.healthBoostCoefficient = 4f;
				AffixVolatileElite.damageBoostCoefficient = 2f;
				list2.Add(AffixVolatileElite);
				val2.eliteTypes = list2.ToArray();
			}
		}

		private void CharacterBody_OnBuffFirstStackGained(orig_OnBuffFirstStackGained orig, CharacterBody self, BuffDef buffDef)
		{
			orig.Invoke(self, buffDef);
			if ((Object)(object)buffDef == (Object)(object)AffixVolatileBuff)
			{
				((Component)self).gameObject.AddComponent<VolatileMissileController>();
			}
		}

		private void CharacterBody_OnBuffFinalStackLost(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef)
		{
			orig.Invoke(self, buffDef);
			if ((Object)(object)buffDef == (Object)(object)AffixVolatileBuff)
			{
				Object.Destroy((Object)(object)((Component)self).gameObject.GetComponent<VolatileMissileController>());
			}
		}

		private void AddContent()
		{
			ContentAddition.AddEliteDef(AffixVolatileElite);
			ContentAddition.AddBuffDef(AffixVolatileBuff);
			ContentAddition.AddEquipmentDef(AffixVolatileEquipment);
		}

		private void SetupBuff()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			AffixVolatileBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)AffixVolatileBuff).name = "AffixVolatileBuff";
			AffixVolatileBuff.canStack = false;
			AffixVolatileBuff.isCooldown = false;
			AffixVolatileBuff.isDebuff = false;
			AffixVolatileBuff.buffColor = AffixVolatileColor;
			AffixVolatileBuff.iconSprite = eliteIcon;
			((Object)AffixVolatileBuff).name = ((Object)AffixVolatileBuff).name;
		}

		private void SetupEquipment()
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			AffixVolatileEquipment = ScriptableObject.CreateInstance<EquipmentDef>();
			AffixVolatileEquipment.appearsInMultiPlayer = true;
			AffixVolatileEquipment.appearsInSinglePlayer = true;
			AffixVolatileEquipment.canBeRandomlyTriggered = false;
			AffixVolatileEquipment.canDrop = false;
			AffixVolatileEquipment.colorIndex = (ColorIndex)5;
			AffixVolatileEquipment.cooldown = 0f;
			AffixVolatileEquipment.isLunar = false;
			AffixVolatileEquipment.isBoss = false;
			AffixVolatileEquipment.passiveBuffDef = AffixVolatileBuff;
			AffixVolatileEquipment.dropOnDeathChance = affixDropChance * 0.01f;
			AffixVolatileEquipment.enigmaCompatible = false;
			AffixVolatileEquipment.pickupIconSprite = aspectIcon;
			AffixVolatileEquipment.pickupModelPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteFire/PickupEliteFire.prefab").WaitForCompletion(), "PickupAffixVolatile", false);
			Renderer[] componentsInChildren = AffixVolatileEquipment.pickupModelPrefab.GetComponentsInChildren<Renderer>();
			foreach (Renderer val in componentsInChildren)
			{
				val.material = VolatileMat;
			}
			AffixVolatileEquipment.nameToken = "EQUIPMENT_AFFIX_Volatile_NAME";
			((Object)AffixVolatileEquipment).name = "AffixVolatile";
			AffixVolatileEquipment.pickupToken = "Aspect of Volatile";
			AffixVolatileEquipment.descriptionToken = "All attacks explode and periodically fire missiles.";
			AffixVolatileEquipment.loreToken = "";
		}

		private void SetupElite()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			AffixVolatileElite = ScriptableObject.CreateInstance<EliteDef>();
			AffixVolatileElite.color = Color32.op_Implicit(AffixVolatileColor);
			AffixVolatileElite.eliteEquipmentDef = AffixVolatileEquipment;
			AffixVolatileElite.modifierToken = "ELITE_MODIFIER_Volatile";
			((Object)AffixVolatileElite).name = "EliteVolatile";
			AffixVolatileElite.healthBoostCoefficient = healthMult;
			AffixVolatileElite.damageBoostCoefficient = damageMult;
			AffixVolatileBuff.eliteDef = AffixVolatileElite;
			((Object)AffixVolatileElite).name = "EliteVolatile";
		}

		private void AddLanguageTokens()
		{
			LanguageAPI.Add("ELITE_MODIFIER_Volatile", "Volatile {0}");
			LanguageAPI.Add("EQUIPMENT_AFFIX_Volatile_NAME", "Volatile Aspect");
		}
	}
	public class ItemDisplays
	{
		public GameObject ItemBodyModelPrefab;

		public static RendererInfo[] ItemDisplaySetup(GameObject obj, bool debugmode = false)
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
			List<Renderer> list = new List<Renderer>();
			MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>();
			if (componentsInChildren.Length != 0)
			{
				list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren);
			}
			SkinnedMeshRenderer[] componentsInChildren2 = obj.GetComponentsInChildren<SkinnedMeshRenderer>();
			if (componentsInChildren2.Length != 0)
			{
				list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren2);
			}
			RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[list.Count];
			for (int i = 0; i < list.Count; i++)
			{
				array[i] = new RendererInfo
				{
					defaultMaterial = ((list[i] is SkinnedMeshRenderer) ? list[i].sharedMaterial : list[i].material),
					renderer = list[i],
					defaultShadowCastingMode = (ShadowCastingMode)1,
					ignoreOverlays = false
				};
			}
			return array;
		}

		public ItemDisplayRuleDict CreateItemDisplayRules(GameObject prefab, Material material)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: 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)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02af: Unknown result type (might be due to invalid IL or missing references)
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: 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_031e: Unknown result type (might be due to invalid IL or missing references)
			//IL_031f: Unknown result type (might be due to invalid IL or missing references)
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0343: Unknown result type (might be due to invalid IL or missing references)
			//IL_0372: Unknown result type (might be due to invalid IL or missing references)
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			//IL_038d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0392: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0406: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0421: Unknown result type (might be due to invalid IL or missing references)
			//IL_0426: Unknown result type (might be due to invalid IL or missing references)
			//IL_043c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0441: Unknown result type (might be due to invalid IL or missing references)
			//IL_0446: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Unknown result type (might be due to invalid IL or missing references)
			//IL_0462: Unknown result type (might be due to invalid IL or missing references)
			//IL_046b: Unknown result type (might be due to invalid IL or missing references)
			//IL_049a: Unknown result type (might be due to invalid IL or missing references)
			//IL_049f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04da: Unknown result type (might be due to invalid IL or missing references)
			//IL_04db: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_052e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0533: Unknown result type (might be due to invalid IL or missing references)
			//IL_0549: Unknown result type (might be due to invalid IL or missing references)
			//IL_054e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0564: Unknown result type (might be due to invalid IL or missing references)
			//IL_0569: Unknown result type (might be due to invalid IL or missing references)
			//IL_056e: Unknown result type (might be due to invalid IL or missing references)
			//IL_056f: Unknown result type (might be due to invalid IL or missing references)
			//IL_058a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0593: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0602: Unknown result type (might be due to invalid IL or missing references)
			//IL_0603: Unknown result type (might be due to invalid IL or missing references)
			//IL_061e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0627: Unknown result type (might be due to invalid IL or missing references)
			//IL_0656: Unknown result type (might be due to invalid IL or missing references)
			//IL_065b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0671: Unknown result type (might be due to invalid IL or missing references)
			//IL_0676: Unknown result type (might be due to invalid IL or missing references)
			//IL_068c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0691: Unknown result type (might be due to invalid IL or missing references)
			//IL_0696: Unknown result type (might be due to invalid IL or missing references)
			//IL_0697: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0705: Unknown result type (might be due to invalid IL or missing references)
			//IL_070a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0720: Unknown result type (might be due to invalid IL or missing references)
			//IL_0725: Unknown result type (might be due to invalid IL or missing references)
			//IL_072a: Unknown result type (might be due to invalid IL or missing references)
			//IL_072b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0746: Unknown result type (might be due to invalid IL or missing references)
			//IL_074f: Unknown result type (might be due to invalid IL or missing references)
			//IL_077e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0783: Unknown result type (might be due to invalid IL or missing references)
			//IL_0799: Unknown result type (might be due to invalid IL or missing references)
			//IL_079e: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07be: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_07da: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0812: Unknown result type (might be due to invalid IL or missing references)
			//IL_0817: Unknown result type (might be due to invalid IL or missing references)
			//IL_082d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0832: Unknown result type (might be due to invalid IL or missing references)
			//IL_0848: Unknown result type (might be due to invalid IL or missing references)
			//IL_084d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0852: Unknown result type (might be due to invalid IL or missing references)
			//IL_0853: Unknown result type (might be due to invalid IL or missing references)
			//IL_086e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0877: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0902: Unknown result type (might be due to invalid IL or missing references)
			//IL_090b: Unknown result type (might be due to invalid IL or missing references)
			//IL_093a: Unknown result type (might be due to invalid IL or missing references)
			//IL_093f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0955: Unknown result type (might be due to invalid IL or missing references)
			//IL_095a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0970: Unknown result type (might be due to invalid IL or missing references)
			//IL_0975: Unknown result type (might be due to invalid IL or missing references)
			//IL_097a: Unknown result type (might be due to invalid IL or missing references)
			//IL_097b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0996: Unknown result type (might be due to invalid IL or missing references)
			//IL_099f: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a04: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a09: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a0e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a33: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a62: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a67: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a7d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a82: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a98: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a9d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0abe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0afb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b11: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b16: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b2c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b31: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b36: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b37: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b52: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b8a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b8f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0baa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bc0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bc5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bcb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c1e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c23: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c39: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c54: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c59: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c5f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c7a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c83: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cb2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cb7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ccd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ced: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d0e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d17: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d46: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d4b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d61: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d66: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d7c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d81: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d86: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d87: Unknown result type (might be due to invalid IL or missing references)
			//IL_0da2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dab: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dda: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ddf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0df5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dfa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e10: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e15: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e1a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e1b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e36: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e3f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e6e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e89: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e8e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ea4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ea9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eaf: Unknown result type (might be due to invalid IL or missi

plugins/TheJMod/VoidItemAPI.dll

Decompiled a week ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using RoR2;
using RoR2.ExpansionManagement;
using RoR2.Items;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("VoidItemAPI")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("VoidItemAPI")]
[assembly: AssemblyTitle("VoidItemAPI")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace VoidItemAPI
{
	[BepInPlugin("com.RumblingJOSEPH.VoidItemAPI", "VoidItemAPI", "1.0.0")]
	[HarmonyPatch]
	public class VoidItemAPI : BaseUnityPlugin
	{
		public const string MODNAME = "VoidItemAPI";

		public const string MODVERSION = "1.0.0";

		public const string MODGUID = "com.RumblingJOSEPH.VoidItemAPI";

		public static VoidItemAPI instance;

		public ManualLogSource Logger;

		public List<CustomVoidEntry> entries;

		public List<VoidItemModification> modifications;

		public List<Pair> newTransformationTable;

		public Harmony harmony;

		public bool tooLate = false;

		public bool defsUsed = true;

		public static ItemTier[] VoidTiers;

		private void Awake()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			instance = this;
			instance.Logger = ((BaseUnityPlugin)this).Logger;
			instance.entries = new List<CustomVoidEntry>();
			instance.modifications = new List<VoidItemModification>();
			instance.harmony = new Harmony("com.RumblingJOSEPH.VoidItemAPI");
			new PatchClassProcessor(harmony, typeof(VoidItemAPI)).Patch();
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(ContagiousItemManager), "Init")]
		private static void InitializeTransformations()
		{
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			instance.newTransformationTable = ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem].ToList();
			instance.tooLate = true;
			if (instance.entries.Count <= 0 && instance.modifications.Count <= 0)
			{
				instance.Logger.LogWarning((object)"No void items in the entries and modifications list! Cancelling transformation.");
				return;
			}
			foreach (CustomVoidEntry entry in instance.entries)
			{
				if ((Object)(object)entry.VoidItem.requiredExpansion == (Object)null)
				{
					entry.VoidItem.requiredExpansion = ((IEnumerable<ExpansionDef>)(object)ExpansionCatalog.expansionDefs).FirstOrDefault((Func<ExpansionDef, bool>)((ExpansionDef x) => x.nameToken == "DLC1_NAME"));
				}
			}
			IEnumerable<CustomVoidEntry> enumerable = instance.entries.Where((CustomVoidEntry x) => x.transformType == CustomVoidEntry.TransformType.Def);
			IEnumerable<CustomVoidEntry> enumerable2 = instance.entries.Where((CustomVoidEntry x) => x.transformType == CustomVoidEntry.TransformType.Name);
			foreach (CustomVoidEntry item in enumerable)
			{
				instance.newTransformationTable.Add(new Pair
				{
					itemDef1 = item.TransformedItem,
					itemDef2 = item.VoidItem
				});
				instance.Logger.LogMessage((object)("Successfully created a transformation for " + ((Object)item.VoidItem).name + "!"));
			}
			foreach (CustomVoidEntry item2 in enumerable2)
			{
				ItemDef val = ValidateItemString(item2.TransformedItemName);
				if (!ValidateItem(val))
				{
					instance.Logger.LogError((object)("Failed to create a transformation for " + ((Object)item2.VoidItem).name + " on transformation name " + item2.TransformedItemName + "."));
				}
				else
				{
					instance.newTransformationTable.Add(new Pair
					{
						itemDef1 = val,
						itemDef2 = item2.VoidItem
					});
					instance.Logger.LogMessage((object)("Successfully created a transformation for " + ((Object)item2.VoidItem).name + "!"));
				}
			}
			ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = instance.newTransformationTable.ToArray();
			IEnumerable<VoidItemModification> enumerable3 = instance.modifications.Where((VoidItemModification x) => x.transformType == CustomVoidEntry.TransformType.Def);
			IEnumerable<VoidItemModification> enumerable4 = instance.modifications.Where((VoidItemModification x) => x.transformType == CustomVoidEntry.TransformType.Name);
			foreach (VoidItemModification item3 in enumerable3)
			{
				if (item3.modification == VoidItemModification.ModificationType.Modify)
				{
					ChangeTransformation(item3);
				}
				else
				{
					RemoveTransformation(item3);
				}
			}
			foreach (VoidItemModification item4 in enumerable4)
			{
				ItemDef val2 = ValidateItemString(item4.VoidItemName);
				ItemDef val3 = ValidateItemString(item4.CurrentTransformedItemName);
				ItemDef newTransformation = null;
				if (item4.modification == VoidItemModification.ModificationType.Modify)
				{
					newTransformation = ValidateItemString(item4.NewTransformationName);
				}
				if (!ValidateItem(val2) || !ValidateItem(val3))
				{
					instance.Logger.LogError((object)("Issue modifying transformation for " + item4.VoidItemName + ". Aborting this modification."));
				}
				else if (item4.modification == VoidItemModification.ModificationType.Modify)
				{
					ChangeTransformation(new VoidItemModification(val2, val3, newTransformation, item4.modification));
				}
				else
				{
					RemoveTransformation(new VoidItemModification(val2, val3, newTransformation, item4.modification));
				}
			}
			ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = instance.newTransformationTable.ToArray();
		}

		public static bool ValidateItem(ItemDef? item)
		{
			if (!Object.op_Implicit((Object)(object)item))
			{
				return false;
			}
			if (string.IsNullOrEmpty(((Object)item).name) || string.IsNullOrEmpty(item.nameToken))
			{
				return false;
			}
			return true;
		}

		private static ItemDef ValidateItemString(string itemName)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			if (!ItemCatalog.itemNames.Contains(itemName))
			{
				instance.Logger.LogError((object)("The item catalog does not contain an item called: " + itemName + ". Aborting this transformation."));
				return null;
			}
			return ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex(itemName));
		}

		private static bool IsInTable(ItemDef def, ItemDef transformation, out Pair pair)
		{
			//IL_0004: 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_002b: Unknown result type (might be due to invalid IL or missing references)
			pair = new Pair
			{
				itemDef1 = transformation,
				itemDef2 = def
			};
			return instance.newTransformationTable.Contains(pair);
		}

		private static void ChangeTransformation(VoidItemModification mod)
		{
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			if (!IsInTable(mod.VoidItem, mod.CurrentTransformedItem, out var pair))
			{
				instance.Logger.LogError((object)("Transformation between " + ((Object)mod.VoidItem).name + " and " + ((Object)mod.CurrentTransformedItem).name + " does not exist in the transformation table. Aborting modification."));
			}
			else
			{
				instance.newTransformationTable.Remove(pair);
				instance.newTransformationTable.Add(new Pair
				{
					itemDef1 = mod.NewTransformation,
					itemDef2 = mod.VoidItem
				});
				instance.Logger.LogMessage((object)("Transformation registered for " + ((Object)mod.VoidItem).name + " is now " + ((Object)mod.NewTransformation).name + "."));
			}
		}

		private static void RemoveTransformation(VoidItemModification mod)
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			if (!IsInTable(mod.VoidItem, mod.CurrentTransformedItem, out var pair))
			{
				instance.Logger.LogError((object)("Transformation between " + ((Object)mod.VoidItem).name + " and " + ((Object)mod.CurrentTransformedItem).name + " does not exist in the transformation table. Aborting removal."));
			}
			else
			{
				instance.newTransformationTable.Remove(pair);
				instance.Logger.LogMessage((object)("Transformation between " + ((Object)mod.VoidItem).name + " and " + ((Object)mod.CurrentTransformedItem).name + " has been successfully removed."));
			}
		}

		static VoidItemAPI()
		{
			ItemTier[] array = new ItemTier[4];
			RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			VoidTiers = (ItemTier[])(object)array;
		}
	}
	public class CustomVoidEntry
	{
		public enum TransformType
		{
			Def,
			Name
		}

		public ItemDef VoidItem { get; set; }

		public ItemDef TransformedItem { get; set; }

		public string TransformedItemName { get; set; }

		public TransformType transformType { get; set; }

		public CustomVoidEntry(ItemDef VoidItem, ItemDef TransformedItem)
		{
			this.VoidItem = VoidItem;
			this.TransformedItem = TransformedItem;
			transformType = TransformType.Def;
		}

		public CustomVoidEntry(ItemDef VoidItem, string TransformedItemName)
		{
			this.VoidItem = VoidItem;
			this.TransformedItemName = TransformedItemName;
			transformType = TransformType.Name;
		}
	}
	public class VoidItemModification
	{
		public enum ModificationType
		{
			Modify,
			Remove
		}

		public ItemDef VoidItem;

		public ItemDef CurrentTransformedItem;

		public ItemDef NewTransformation;

		public string VoidItemName;

		public string CurrentTransformedItemName;

		public string NewTransformationName;

		public ModificationType modification;

		public CustomVoidEntry.TransformType transformType;

		public VoidItemModification(ItemDef VoidItem, ItemDef CurrentTransformedItem, ItemDef? NewTransformation, ModificationType modification)
		{
			this.VoidItem = VoidItem;
			this.CurrentTransformedItem = CurrentTransformedItem;
			if (modification == ModificationType.Modify)
			{
				this.NewTransformation = NewTransformation;
			}
			this.modification = modification;
			transformType = CustomVoidEntry.TransformType.Def;
		}

		public VoidItemModification(string VoidItemName, string CurrentTransformedItemName, string? NewTransformationName, ModificationType modification)
		{
			this.VoidItemName = VoidItemName;
			this.CurrentTransformedItemName = CurrentTransformedItemName;
			if (modification == ModificationType.Modify)
			{
				this.NewTransformationName = NewTransformationName;
			}
			this.modification = modification;
			transformType = CustomVoidEntry.TransformType.Name;
		}
	}
	public static class VoidTransformation
	{
		public static void CreateTransformation(ItemDef? VoidItem, ItemDef? TransformedItem)
		{
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			if (!VoidItemAPI.ValidateItem(VoidItem))
			{
				VoidItemAPI.instance.Logger.LogError((object)"Void item is not a valid item. Did you call CreateTransformation too early?");
				return;
			}
			if (!VoidItemAPI.ValidateItem(TransformedItem))
			{
				VoidItemAPI.instance.Logger.LogError((object)("Transformed item is either not valid or you called CreateTransformation too early. Initialization cancelled for void item: " + ((Object)VoidItem).name + "."));
				return;
			}
			if (VoidItemAPI.instance.tooLate)
			{
				VoidItemAPI.instance.Logger.LogError((object)("CreateTransformation has been called too late for void item: " + ((Object)VoidItem).name + "."));
				return;
			}
			if (!VoidItemAPI.VoidTiers.Contains(VoidItem.tier))
			{
				VoidItemAPI.instance.Logger.LogWarning((object)(((Object)VoidItem).name + "'s item tier is not set to a void tier. Was this intentional?"));
			}
			VoidItemAPI.instance.entries.Add(new CustomVoidEntry(VoidItem, TransformedItem));
		}

		public static void CreateTransformation(ItemDef? VoidItem, ItemDef[]? TransformedItems)
		{
			if (TransformedItems.Length == 0)
			{
				VoidItemAPI.instance.Logger.LogError((object)"Sent in an empty array to CreateTransformation! Not initializing void item.");
				return;
			}
			foreach (ItemDef transformedItem in TransformedItems)
			{
				CreateTransformation(VoidItem, transformedItem);
			}
		}

		public static void CreateTransformation(ItemDef? VoidItem, string TransformedItemName)
		{
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			if (!VoidItemAPI.ValidateItem(VoidItem))
			{
				VoidItemAPI.instance.Logger.LogError((object)"Void item is not a valid item. Did you call CreateTransformation too early?");
				return;
			}
			if (string.IsNullOrEmpty(TransformedItemName))
			{
				VoidItemAPI.instance.Logger.LogError((object)("TransformedItemName is either null or empty. Initialization cancelled for void item: " + ((Object)VoidItem).name + "."));
				return;
			}
			if (VoidItemAPI.instance.tooLate)
			{
				VoidItemAPI.instance.Logger.LogError((object)("CreateTransformation has been called too late for void item: " + ((Object)VoidItem).name + "."));
				return;
			}
			if (!VoidItemAPI.VoidTiers.Contains(VoidItem.tier))
			{
				VoidItemAPI.instance.Logger.LogWarning((object)(((Object)VoidItem).name + "'s item tier is not set to a void tier. Was this intentional?"));
			}
			VoidItemAPI.instance.entries.Add(new CustomVoidEntry(VoidItem, TransformedItemName));
		}

		public static void CreateTransformation(ItemDef? VoidItem, string[] TransformedItemNames)
		{
			if (TransformedItemNames.Length == 0)
			{
				VoidItemAPI.instance.Logger.LogError((object)"Sent in an empty array to CreateTransformation! Not initializing void item.");
				return;
			}
			foreach (string transformedItemName in TransformedItemNames)
			{
				CreateTransformation(VoidItem, transformedItemName);
			}
		}

		public static void ModifyTransformation(ItemDef? VoidItem, ItemDef? CurrentTransformedItem, ItemDef? NewTransformation, VoidItemModification.ModificationType modification)
		{
			if (!VoidItemAPI.ValidateItem(VoidItem))
			{
				VoidItemAPI.instance.Logger.LogError((object)"Void item ItemDef sent to ModifyTransformation is not valid. You are most likely calling the method too early. Aborting modification.");
			}
			else if (!VoidItemAPI.ValidateItem(CurrentTransformedItem))
			{
				VoidItemAPI.instance.Logger.LogError((object)("The current item transformation sent to ModifyTransformation for " + ((Object)VoidItem).name + " is not valid. Aborting modification."));
			}
			else if (VoidItemAPI.instance.tooLate)
			{
				VoidItemAPI.instance.Logger.LogError((object)("ModifyTransformation was called too late for " + ((Object)VoidItem).name + ", aborting modification."));
			}
			else if (modification == VoidItemModification.ModificationType.Modify)
			{
				if (!VoidItemAPI.ValidateItem(NewTransformation))
				{
					VoidItemAPI.instance.Logger.LogError((object)("Modification type for void item " + ((Object)VoidItem).name + " is set to modify, yet the new ItemDef transformation is not valid. Aborting modification."));
				}
				else
				{
					VoidItemAPI.instance.modifications.Add(new VoidItemModification(VoidItem, CurrentTransformedItem, NewTransformation, modification));
				}
			}
			else
			{
				VoidItemAPI.instance.modifications.Add(new VoidItemModification(VoidItem, CurrentTransformedItem, null, modification));
			}
		}

		public static void ModifyTransformation(string VoidItemName, string CurrentTransformedItemName, string NewTransformationName, VoidItemModification.ModificationType modification)
		{
			if (string.IsNullOrEmpty(VoidItemName))
			{
				VoidItemAPI.instance.Logger.LogError((object)"Void item name sent into ModifyTransformation is null or empty. Aborting modification.");
			}
			else if (string.IsNullOrEmpty(CurrentTransformedItemName))
			{
				VoidItemAPI.instance.Logger.LogError((object)("Current Transformed Item Name sent in for " + VoidItemName + " is null or empty. Aborting modification."));
			}
			else if (VoidItemAPI.instance.tooLate)
			{
				VoidItemAPI.instance.Logger.LogError((object)("ModifyTransformation for " + VoidItemName + " was called too late, aborting modification."));
			}
			else if (modification == VoidItemModification.ModificationType.Modify)
			{
				if (string.IsNullOrEmpty(NewTransformationName))
				{
					VoidItemAPI.instance.Logger.LogError((object)("Modification type for " + VoidItemName + " is set to Modify, yet the new transformation name is null. Aborting modification."));
				}
				else
				{
					VoidItemAPI.instance.modifications.Add(new VoidItemModification(VoidItemName, CurrentTransformedItemName, NewTransformationName, modification));
				}
			}
			else
			{
				VoidItemAPI.instance.modifications.Add(new VoidItemModification(VoidItemName, CurrentTransformedItemName, null, modification));
			}
		}
	}
}