Decompiled source of BetterVoid v1.2.2

BetterVoid.dll

Decompiled 3 months 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.Configuration;
using BepInEx.Logging;
using BetterVoid.Enemies;
using BetterVoid.Interactables;
using BetterVoid.Items;
using EntityStates;
using EntityStates.Barrel;
using EntityStates.VoidCamp;
using IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.VoidCamp;
using On.RoR2;
using On.RoR2.UI;
using R2API;
using RoR2;
using RoR2.CharacterAI;
using RoR2.EntityLogic;
using RoR2.Items;
using RoR2.Projectile;
using RoR2.UI;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.UI;

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace BetterVoid
{
	[BepInPlugin("HIFU.BetterVoid", "BetterVoid", "1.2.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Main : BaseUnityPlugin
	{
		public const string PluginGUID = "HIFU.BetterVoid";

		public const string PluginAuthor = "HIFU";

		public const string PluginName = "BetterVoid";

		public const string PluginVersion = "1.2.1";

		public static ManualLogSource btsLogger;

		public static BuffDef uselessBuff;

		public static ConfigEntry<bool> enableCradleChanges { get; set; }

		public static ConfigEntry<float> cursePercent { get; set; }

		public static ConfigEntry<bool> destroyVoidCradleAfterTeleporter { get; set; }

		public static ConfigEntry<bool> destroyVoidPotentialAfterTeleporter { get; set; }

		public static ConfigEntry<int> choiceCount { get; set; }

		public static ConfigEntry<bool> alterPotentials { get; set; }

		public static ConfigEntry<bool> alterVoidSeeds { get; set; }

		public static ConfigEntry<bool> enableVoidInfestors { get; set; }

		public static ConfigEntry<int> voidInfestorCount { get; set; }

		public static ConfigEntry<int> voidSeedLimit { get; set; }

		public static ConfigEntry<float> voidSeedRadius { get; set; }

		public static ConfigEntry<bool> rebalanceSingularityBand { get; set; }

		public static ConfigEntry<bool> pluripotentLarvaDownside { get; set; }

		public static ConfigEntry<string> blacklistedItems { get; set; }

		public static ConfigEntry<bool> voidBarnacleTweaks { get; set; }

		public static ConfigEntry<bool> voidReaverTweaks { get; set; }

		public static ConfigEntry<bool> voidDevastatorTweaks { get; set; }

		public void Awake()
		{
			btsLogger = ((BaseUnityPlugin)this).Logger;
			enableCradleChanges = ((BaseUnityPlugin)this).Config.Bind<bool>("Void Cradle", "Enable Changes?", true, "");
			cursePercent = ((BaseUnityPlugin)this).Config.Bind<float>("Void Cradle", "Curse Percent", 0.1f, "Decimal.");
			destroyVoidCradleAfterTeleporter = ((BaseUnityPlugin)this).Config.Bind<bool>("Void Cradle", "Destroy Void Cradles after Teleporter?", true, "This is to prevent cheese");
			choiceCount = ((BaseUnityPlugin)this).Config.Bind<int>("Void Cradle", "Corruptible Max Choice Count", 3, "");
			enableVoidInfestors = ((BaseUnityPlugin)this).Config.Bind<bool>("Void Cradle", "Enable Void Infestor spawns?", true, "");
			voidInfestorCount = ((BaseUnityPlugin)this).Config.Bind<int>("Void Cradle", "Void Infestor Count", 2, "");
			alterPotentials = ((BaseUnityPlugin)this).Config.Bind<bool>("Void Potential", "Alter Void Potentials?", true, "This is to make acquiring void reds and void yellows easier, since you need the prerequisite to corrupt from the cradle now");
			destroyVoidPotentialAfterTeleporter = ((BaseUnityPlugin)this).Config.Bind<bool>("Void Potential", "Destroy Void Potentials after Teleporter?", true, "This is to prevent Eclipse cheese");
			alterVoidSeeds = ((BaseUnityPlugin)this).Config.Bind<bool>("Void Seed", "Alter Void Seeds?", true, "Makes Void Stalks less likely to appear in Void Seeds, and as a result, Void Cradles and Void Potentials are more likely to appear inside them");
			voidSeedLimit = ((BaseUnityPlugin)this).Config.Bind<int>("Void Seed", "Void Seed Spawn Limit Per Stage", 1, "");
			voidSeedRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Void Seed", "Radius", 70f, "Vanilla is 60");
			rebalanceSingularityBand = ((BaseUnityPlugin)this).Config.Bind<bool>("Items", "Rebalance Singularity Band?", true, "Makes Singularity Band do much more total damage and stack radius instead of damage");
			pluripotentLarvaDownside = ((BaseUnityPlugin)this).Config.Bind<bool>("Items", "Add a downside to Pluripotent Larva?", true, "Makes Pluripotent Larva reroll your white and green item stacks on pickup");
			blacklistedItems = ((BaseUnityPlugin)this).Config.Bind<string>("Items", "Blacklisted Items", "", "Takes the non-void counterparts of items and makes them uncorruptable, use DebugToolkits list_item command to see internal item names, separate each one with a comma and a space afterwards, e.g. ChainLightning, Missile");
			voidBarnacleTweaks = ((BaseUnityPlugin)this).Config.Bind<bool>("Enemies", "Change Void Barnacle Skills, Stats and AI?", true, "Currently removes Void Barnacle regen");
			voidReaverTweaks = ((BaseUnityPlugin)this).Config.Bind<bool>("Enemies", "Change Void Reaver Skills, Stats and AI?", true, "Currently makes Void Reavers follow you closely, and explode faster");
			voidDevastatorTweaks = ((BaseUnityPlugin)this).Config.Bind<bool>("Enemies", "Change Void Devastator Skills and AI?", true, "Currently makes Void Devastators explode faster");
			uselessBuff = ScriptableObject.CreateInstance<BuffDef>();
			uselessBuff.isDebuff = false;
			uselessBuff.isHidden = true;
			uselessBuff.canStack = false;
			uselessBuff.isCooldown = false;
			VoidPotential.Init();
			VoidSeed.Init();
			SingularityBand.Init();
			if (enableCradleChanges.Value)
			{
				VoidCradle.Init();
			}
			if (voidBarnacleTweaks.Value)
			{
				VoidBarnacle.Init();
			}
			if (voidReaverTweaks.Value)
			{
				VoidReaver.Init();
			}
			if (voidDevastatorTweaks.Value)
			{
				VoidDevastator.Init();
			}
		}
	}
}
namespace BetterVoid.Items
{
	public static class PluripotentLarva
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_GiveItem_ItemIndex_int <0>__Inventory_GiveItem_ItemIndex_int;
		}

		public static void Init()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			if (Main.pluripotentLarvaDownside.Value)
			{
				object obj = <>O.<0>__Inventory_GiveItem_ItemIndex_int;
				if (obj == null)
				{
					hook_GiveItem_ItemIndex_int val = Inventory_GiveItem_ItemIndex_int;
					<>O.<0>__Inventory_GiveItem_ItemIndex_int = val;
					obj = (object)val;
				}
				Inventory.GiveItem_ItemIndex_int += (hook_GiveItem_ItemIndex_int)obj;
				LanguageAPI.Add("ITEM_EXTRALIFEVOID_PICKUP", "Shuffle your inventory, and get a <style=cIsVoid>corrupted</style> extra life. Consumed on use. <style=cIsVoid>Corrupts all Dio's Best Friends.</style>.");
				LanguageAPI.Add("ITEM_EXTRALIFEVOID_DESC", "<style=cIsUtility>Shuffle your inventory</style>. <style=cIsUtility>Upon death</style>, this item will be <style=cIsUtility>consumed</style> and you will <style=cIsHealing>return to life</style> with <style=cIsHealing>3 seconds of invulnerability</style>, and all of your items that can be <style=cIsUtility>corrupted</style> will be. <style=cIsVoid>Corrupts all Dio's Best Friends</style>.");
				LanguageAPI.Add("PLURI_CORRUPTED", "<style=cWorldEvent>{0} has been... corrupted.</color>");
				LanguageAPI.Add("PLURI_CORRUPTED_2P", "<style=cWorldEvent>You have been... corrupted.</color>");
			}
		}

		public static void Inventory_GiveItem_ItemIndex_int(orig_GiveItem_ItemIndex_int orig, Inventory self, ItemIndex itemIndex, int count)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Invalid comparison between Unknown and I4
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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: Invalid comparison between Unknown and I4
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: 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_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Expected O, but got Unknown
			orig.Invoke(self, itemIndex, count);
			if (itemIndex != Items.ExtraLifeVoid.itemIndex)
			{
				return;
			}
			List<ItemIndex> list = new List<ItemIndex>();
			List<int> list2 = new List<int>();
			for (int i = 0; i < self.itemAcquisitionOrder.Count; i++)
			{
				ItemIndex val = self.itemAcquisitionOrder[i];
				ItemDef itemDef = ItemCatalog.GetItemDef(val);
				if ((int)itemDef.tier == 0 || (int)itemDef.deprecatedTier == 0 || (int)itemDef.tier == 1 || (int)itemDef.deprecatedTier == 1)
				{
					list.Add(val);
					list2.Add(self.GetItemCount(val));
				}
			}
			int num = list2.Count;
			while (num > 1)
			{
				num--;
				int index = Random.Range(0, num + 1);
				int value = list2[index];
				list2[index] = list2[num];
				list2[num] = value;
			}
			for (int j = 0; j < list.Count; j++)
			{
				ItemIndex val2 = list[j];
				int num2 = list2[j];
				self.RemoveItem(val2, self.GetItemCount(val2));
				self.GiveItem(val2, num2);
			}
			CharacterMaster component = ((Component)self).gameObject.GetComponent<CharacterMaster>();
			CharacterBody val3 = ((component != null) ? component.GetBody() : null);
			if (NetworkServer.active && Object.op_Implicit((Object)(object)val3) && val3.isPlayerControlled)
			{
				Chat.SendBroadcastChat((ChatMessageBase)new SubjectFormatChatMessage
				{
					subjectAsCharacterBody = val3,
					baseToken = "PLURI_CORRUPTED"
				});
			}
		}
	}
	public static class SingularityBand
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Action<DamageReport> <0>__GlobalEventManager_onServerDamageDealt;

			public static Manipulator <1>__GlobalEventManager_OnHitEnemy;
		}

		public static void Init()
		{
			//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)
			//IL_004c: Expected O, but got Unknown
			if (Main.rebalanceSingularityBand.Value)
			{
				GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
				object obj = <>O.<1>__GlobalEventManager_OnHitEnemy;
				if (obj == null)
				{
					Manipulator val = GlobalEventManager_OnHitEnemy;
					<>O.<1>__GlobalEventManager_OnHitEnemy = val;
					obj = (object)val;
				}
				GlobalEventManager.OnHitEnemy += (Manipulator)obj;
				LanguageAPI.Add("ITEM_ELEMENTALRINGVOID_DESC", "Hits that deal <style=cIsDamage>more than 400% damage</style> also fire a black hole that <style=cIsUtility>draws enemies within 12m <style=cStack>(+6m per stack)</style> into its center</style>. Lasts <style=cIsUtility>5</style> seconds before collapsing, dealing <style=cIsDamage>175%</style> TOTAL damage. Recharges every <style=cIsUtility>15</style> seconds. <style=cIsVoid>Corrupts all Runald's and Kjaro's Bands</style>.");
			}
		}

		public static void GlobalEventManager_OnHitEnemy(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "ElementalRingVoidReady")
			}))
			{
				val.Remove();
				val.Emit<Main>(OpCodes.Ldsfld, "uselessBuff");
			}
			else
			{
				Main.btsLogger.LogError((object)"Failed to apply Singularity Band Deletion hook");
			}
		}

		public static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
		{
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: 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_0257: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)damageReport.attacker))
			{
				return;
			}
			CharacterBody attackerBody = damageReport.attackerBody;
			if (!Object.op_Implicit((Object)(object)attackerBody))
			{
				return;
			}
			Inventory inventory = attackerBody.inventory;
			if (Object.op_Implicit((Object)(object)inventory) && damageReport.damageInfo.procCoefficient > 0f && !((ProcChainMask)(ref damageReport.damageInfo.procChainMask)).HasProc((ProcType)12) && damageReport.damageInfo.damage / damageReport.attackerBody.damage >= 4f && attackerBody.HasBuff(Buffs.ElementalRingVoidReady))
			{
				attackerBody.RemoveBuff(Buffs.ElementalRingVoidReady);
				for (int i = 1; (float)i <= 15f; i++)
				{
					attackerBody.AddTimedBuff(Buffs.ElementalRingVoidCooldown, (float)i);
				}
				ProcChainMask procChainMask = damageReport.damageInfo.procChainMask;
				((ProcChainMask)(ref procChainMask)).AddProc((ProcType)12);
				int itemCount = inventory.GetItemCount(Items.ElementalRingVoid);
				if (itemCount > 0)
				{
					GameObject val = LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/ElementalRingVoidBlackHole");
					RadialForce component = val.GetComponent<RadialForce>();
					ProjectileExplosion component2 = val.GetComponent<ProjectileExplosion>();
					float num = (12f + 6f * (float)(itemCount - 1)) / 15f;
					val.transform.localScale = new Vector3(num, num, num);
					component.radius = 12f + 6f * (float)(itemCount - 1);
					component2.blastRadius = 12f + 6f * (float)(itemCount - 1);
					float num2 = 1.75f;
					float damage = Util.OnHitProcDamage(damageReport.damageInfo.damage, attackerBody.damage, num2);
					ProjectileManager.instance.FireProjectile(new FireProjectileInfo
					{
						damage = damage,
						crit = damageReport.damageInfo.crit,
						damageColorIndex = (DamageColorIndex)9,
						position = damageReport.damageInfo.position,
						procChainMask = procChainMask,
						force = 6000f,
						owner = damageReport.damageInfo.attacker,
						projectilePrefab = val,
						rotation = Quaternion.identity,
						target = null
					});
				}
			}
		}
	}
}
namespace BetterVoid.Interactables
{
	public static class VoidCradle
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_SelectCard <0>__SceneDirector_SelectCard;
		}

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

			public static BuildCostStringDelegate <>9__4_4;

			public static IsAffordableDelegate <>9__4_5;

			public static PayCostDelegate <>9__4_6;

			public static hook_Init <>9__4_0;

			public static Func<Instruction, bool> <>9__4_7;

			public static Func<int, int> <>9__4_8;

			public static Manipulator <>9__4_1;

			public static hook_OnCreateButton <>9__4_2;

			public static hook_OnInteractionBegin <>9__4_3;

			internal void <Init>b__4_4(CostTypeDef def, BuildCostStringContext c)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				c.stringBuilder.Append("<style=cDeath>" + Main.cursePercent.Value * 100f + "% Curse</style>");
			}

			internal bool <Init>b__4_5(CostTypeDef def, IsAffordableContext c)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return HasAtLeastOneItem(((Component)c.activator).GetComponent<CharacterBody>().inventory);
			}

			internal void <Init>b__4_6(CostTypeDef def, PayCostContext c)
			{
			}

			internal void <Init>b__4_0(orig_Init orig)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke();
				CostTypeCatalog.Register(costTypeIndex, def);
			}

			internal void <Init>b__4_1(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val = new ILCursor(il);
				if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 15)
				}))
				{
					int index = val.Index;
					val.Index = index + 1;
					val.EmitDelegate<Func<int, int>>((Func<int, int>)((int c) => 20));
				}
				else
				{
					Main.btsLogger.LogError((object)"Failed to apply CostTypeCatalog IL hook");
				}
			}

			internal bool <Init>b__4_7(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdcI4(x, 15);
			}

			internal int <Init>b__4_8(int c)
			{
				return 20;
			}

			internal void <Init>b__4_2(orig_OnCreateButton orig, PickupPickerPanel self, int i, MPButton button)
			{
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_007f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0084: 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_0092: Unknown result type (might be due to invalid IL or missing references)
				//IL_0097: Unknown result type (might be due to invalid IL or missing references)
				//IL_009c: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self, i, button);
				if (((Object)((Component)self).gameObject).name.Contains("VoidChest"))
				{
					TooltipProvider val = ((Component)button).gameObject.AddComponent<TooltipProvider>();
					TooltipContent content = default(TooltipContent);
					ItemDef itemDef = ItemCatalog.GetItemDef(GetCorruption(((PickupIndex)(ref self.pickerController.options[i].pickupIndex)).itemIndex));
					if (Object.op_Implicit((Object)(object)itemDef))
					{
						content.bodyColor = Color32.op_Implicit(ColorCatalog.GetColor((ColorIndex)25));
						content.titleColor = Color32.op_Implicit(ColorCatalog.GetColor((ColorIndex)26));
						content.overrideTitleText = "Transmutes into: " + Language.GetString(itemDef.nameToken);
						content.bodyToken = itemDef.descriptionToken;
						content.titleToken = "gdfgdfgdfghgh";
						val.SetContent(content);
					}
				}
			}

			internal void <Init>b__4_3(orig_OnInteractionBegin orig, PickupPickerController self, Interactor interactor)
			{
				if (!((Object)((Component)self).gameObject).name.Contains("VoidChest"))
				{
					orig.Invoke(self, interactor);
				}
			}
		}

		public static CostTypeIndex costTypeIndex = (CostTypeIndex)19;

		public static CostTypeDef def;

		public static GameObject optionPanel;

		public static InteractableSpawnCard vradle;

		public static void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: 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_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: 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_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Expected O, but got Unknown
			//IL_02c0: 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_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Expected O, but got Unknown
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Expected O, but got Unknown
			//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e0: Expected O, but got Unknown
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Expected O, but got Unknown
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Expected O, but got Unknown
			//IL_0349: Unknown result type (might be due to invalid IL or missing references)
			//IL_034e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0354: Expected O, but got Unknown
			//IL_036a: Unknown result type (might be due to invalid IL or missing references)
			//IL_036f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0375: Expected O, but got Unknown
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0394: Unknown result type (might be due to invalid IL or missing references)
			//IL_039a: Expected O, but got Unknown
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidChest/VoidChest.prefab").WaitForCompletion();
			PurchaseInteraction component = val.GetComponent<PurchaseInteraction>();
			component.costType = costTypeIndex;
			component.cost = 0;
			component.contextToken = "WRB_VOIDCHEST_CONTEXT";
			Object.Destroy((Object)(object)val.GetComponent<ChestBehavior>());
			val.AddComponent<NetworkUIPromptController>();
			val.AddComponent<PickupIndexNetworker>();
			PickupPickerController val2 = val.AddComponent<PickupPickerController>();
			val2.cutoffDistance = 10f;
			optionPanel = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/OptionPickup/OptionPickerPanel.prefab").WaitForCompletion(), "VoidCradleOptionPicker", false);
			Transform val3 = optionPanel.transform.Find("MainPanel").Find("Juice").Find("BG, Colored");
			Transform val4 = val3.Find("BG, Colored Center");
			((Graphic)((Component)val3).GetComponent<Image>()).color = Color32.op_Implicit(new Color32((byte)237, (byte)127, (byte)205, byte.MaxValue));
			((Graphic)((Component)val4).GetComponent<Image>()).color = Color32.op_Implicit(new Color32((byte)237, (byte)127, (byte)205, byte.MaxValue));
			Transform val5 = optionPanel.transform.Find("MainPanel").Find("Juice").Find("Label");
			((TMP_Text)((Component)val5).GetComponent<HGTextMeshProUGUI>()).text = "Awaiting Transmutation...";
			val2.panelPrefab = optionPanel;
			LanguageAPI.Add("WRB_VOIDCHEST_CONTEXT", "Open?");
			val.AddComponent<CradleManager>();
			Transform child = val.transform.GetChild(3);
			CharacterSpawnCard spawnCard = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC1/EliteVoid/cscVoidInfestor.asset").WaitForCompletion();
			if (Main.destroyVoidCradleAfterTeleporter.Value)
			{
				val.AddComponent<FuckMinMaxers>();
			}
			if (!Main.enableVoidInfestors.Value)
			{
				Object.Destroy((Object)(object)val.GetComponent<ScriptedCombatEncounter>());
			}
			if (Main.enableVoidInfestors.Value)
			{
				ScriptedCombatEncounter component2 = val.GetComponent<ScriptedCombatEncounter>();
				Array.Resize(ref component2.spawns, Main.voidInfestorCount.Value);
				for (int j = 0; j < component2.spawns.Length; j++)
				{
					component2.spawns[j] = new SpawnInfo
					{
						cullChance = 0f,
						explicitSpawnPosition = child,
						spawnCard = (SpawnCard)(object)spawnCard
					};
				}
			}
			Object.Destroy((Object)(object)val.GetComponent<DelayedEvent>());
			vradle = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC1/VoidChest/iscVoidChest.asset").WaitForCompletion();
			CostTypeDef val6 = new CostTypeDef();
			object obj = <>c.<>9__4_4;
			if (obj == null)
			{
				BuildCostStringDelegate val7 = delegate(CostTypeDef def, BuildCostStringContext c)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					c.stringBuilder.Append("<style=cDeath>" + Main.cursePercent.Value * 100f + "% Curse</style>");
				};
				<>c.<>9__4_4 = val7;
				obj = (object)val7;
			}
			val6.buildCostString = (BuildCostStringDelegate)obj;
			object obj2 = <>c.<>9__4_5;
			if (obj2 == null)
			{
				IsAffordableDelegate val8 = (CostTypeDef def, IsAffordableContext c) => HasAtLeastOneItem(((Component)c.activator).GetComponent<CharacterBody>().inventory);
				<>c.<>9__4_5 = val8;
				obj2 = (object)val8;
			}
			val6.isAffordable = (IsAffordableDelegate)obj2;
			object obj3 = <>c.<>9__4_6;
			if (obj3 == null)
			{
				PayCostDelegate val9 = delegate
				{
				};
				<>c.<>9__4_6 = val9;
				obj3 = (object)val9;
			}
			val6.payCost = (PayCostDelegate)obj3;
			def = val6;
			object obj4 = <>c.<>9__4_0;
			if (obj4 == null)
			{
				hook_Init val10 = delegate(orig_Init orig)
				{
					//IL_0008: Unknown result type (might be due to invalid IL or missing references)
					orig.Invoke();
					CostTypeCatalog.Register(costTypeIndex, def);
				};
				<>c.<>9__4_0 = val10;
				obj4 = (object)val10;
			}
			CostTypeCatalog.Init += (hook_Init)obj4;
			object obj5 = <>c.<>9__4_1;
			if (obj5 == null)
			{
				Manipulator val11 = delegate(ILContext il)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Expected O, but got Unknown
					ILCursor val16 = new ILCursor(il);
					if (val16.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 15)
					}))
					{
						int index = val16.Index;
						val16.Index = index + 1;
						val16.EmitDelegate<Func<int, int>>((Func<int, int>)((int c) => 20));
					}
					else
					{
						Main.btsLogger.LogError((object)"Failed to apply CostTypeCatalog IL hook");
					}
				};
				<>c.<>9__4_1 = val11;
				obj5 = (object)val11;
			}
			CostTypeCatalog.Init += (Manipulator)obj5;
			object obj6 = <>c.<>9__4_2;
			if (obj6 == null)
			{
				hook_OnCreateButton val12 = delegate(orig_OnCreateButton orig, PickupPickerPanel self, int i, MPButton button)
				{
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0059: Unknown result type (might be due to invalid IL or missing references)
					//IL_005e: Unknown result type (might be due to invalid IL or missing references)
					//IL_007f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0084: 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_0092: Unknown result type (might be due to invalid IL or missing references)
					//IL_0097: Unknown result type (might be due to invalid IL or missing references)
					//IL_009c: Unknown result type (might be due to invalid IL or missing references)
					//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
					orig.Invoke(self, i, button);
					if (((Object)((Component)self).gameObject).name.Contains("VoidChest"))
					{
						TooltipProvider val15 = ((Component)button).gameObject.AddComponent<TooltipProvider>();
						TooltipContent content = default(TooltipContent);
						ItemDef itemDef = ItemCatalog.GetItemDef(GetCorruption(((PickupIndex)(ref self.pickerController.options[i].pickupIndex)).itemIndex));
						if (Object.op_Implicit((Object)(object)itemDef))
						{
							content.bodyColor = Color32.op_Implicit(ColorCatalog.GetColor((ColorIndex)25));
							content.titleColor = Color32.op_Implicit(ColorCatalog.GetColor((ColorIndex)26));
							content.overrideTitleText = "Transmutes into: " + Language.GetString(itemDef.nameToken);
							content.bodyToken = itemDef.descriptionToken;
							content.titleToken = "gdfgdfgdfghgh";
							val15.SetContent(content);
						}
					}
				};
				<>c.<>9__4_2 = val12;
				obj6 = (object)val12;
			}
			PickupPickerPanel.OnCreateButton += (hook_OnCreateButton)obj6;
			object obj7 = <>O.<0>__SceneDirector_SelectCard;
			if (obj7 == null)
			{
				hook_SelectCard val13 = SceneDirector_SelectCard;
				<>O.<0>__SceneDirector_SelectCard = val13;
				obj7 = (object)val13;
			}
			SceneDirector.SelectCard += (hook_SelectCard)obj7;
			object obj8 = <>c.<>9__4_3;
			if (obj8 == null)
			{
				hook_OnInteractionBegin val14 = delegate(orig_OnInteractionBegin orig, PickupPickerController self, Interactor interactor)
				{
					if (!((Object)((Component)self).gameObject).name.Contains("VoidChest"))
					{
						orig.Invoke(self, interactor);
					}
				};
				<>c.<>9__4_3 = val14;
				obj8 = (object)val14;
			}
			PickupPickerController.OnInteractionBegin += (hook_OnInteractionBegin)obj8;
		}

		public static DirectorCard SceneDirector_SelectCard(orig_SelectCard orig, SceneDirector self, WeightedSelection<DirectorCard> deck, int max)
		{
			DirectorCard val = null;
			for (int i = 0; i < 10; i++)
			{
				DirectorCard val2 = orig.Invoke(self, deck, max);
				if (val2 == null || !Object.op_Implicit((Object)(object)val2.spawnCard) || !((Object)(object)val2.spawnCard == (Object)(object)vradle) || !ShouldBlockCradles())
				{
					val = val2;
				}
			}
			return (val == null) ? orig.Invoke(self, deck, max) : val;
		}

		public static bool ShouldBlockCradles()
		{
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				if (Object.op_Implicit((Object)(object)instance.master) && HasAtLeastOneItem(instance.master.inventory))
				{
					return false;
				}
			}
			return true;
		}

		public static bool HasAtLeastOneItem(Inventory inventory)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			foreach (ItemIndex item in inventory.itemAcquisitionOrder)
			{
				if (IsCorruptible(item))
				{
					return true;
				}
			}
			return false;
		}

		public static bool IsCorruptible(ItemIndex index)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Invalid comparison between Unknown and I4
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Invalid comparison between Unknown and I4
			ItemDef itemDef = ItemCatalog.GetItemDef(index);
			if ((int)itemDef.tier == 4)
			{
				return false;
			}
			if (Main.blacklistedItems.Value.Contains(((Object)itemDef).name))
			{
				return false;
			}
			ItemIndex transformedItemIndex = ContagiousItemManager.GetTransformedItemIndex(index);
			return (int)transformedItemIndex != -1;
		}

		public static ItemIndex GetCorruption(ItemIndex index)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			return ContagiousItemManager.GetTransformedItemIndex(index);
		}
	}
	public class FuckMinMaxers : MonoBehaviour
	{
		public float timer;

		public float interval = 1f;

		public bool wasDisabled = false;

		public void FixedUpdate()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Invalid comparison between Unknown and I4
			//IL_0056: 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_0063: 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_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			timer += Time.fixedDeltaTime;
			if (timer >= interval)
			{
				TeleporterInteraction instance = TeleporterInteraction.instance;
				if (Object.op_Implicit((Object)(object)instance) && (int)instance.activationState == 3 && !wasDisabled)
				{
					EffectManager.SpawnEffect(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/ExplodeOnDeathVoid/ExplodeOnDeathVoidExplosionEffect.prefab").WaitForCompletion(), new EffectData
					{
						origin = ((Component)this).transform.position,
						scale = 3f
					}, true);
					((Component)this).gameObject.SetActive(false);
					wasDisabled = true;
				}
			}
		}
	}
	public class CradleManager : MonoBehaviour
	{
		public List<Option> options = new List<Option>();

		public bool hasSet = false;

		public ScriptedCombatEncounter scriptedCombatEncounter;

		public PurchaseInteraction interaction => ((Component)this).GetComponent<PurchaseInteraction>();

		public PickupPickerController controller => ((Component)this).GetComponent<PickupPickerController>();

		private void Start()
		{
			scriptedCombatEncounter = ((Component)this).GetComponent<ScriptedCombatEncounter>();
			((UnityEvent<Interactor>)(object)interaction.onPurchase).AddListener((UnityAction<Interactor>)OnPurchase);
			((UnityEvent<int>)(object)controller.onPickupSelected).AddListener((UnityAction<int>)Corrupt);
		}

		public void Corrupt(int i)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: 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_0069: 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_0110: Expected O, but got Unknown
			scriptedCombatEncounter.BeginEncounter();
			PickupIndex val = default(PickupIndex);
			((PickupIndex)(ref val))..ctor(i);
			ItemIndex itemIndex = ((PickupIndex)(ref val)).itemIndex;
			Interactor lastActivator = interaction.lastActivator;
			CharacterBody component = ((Component)lastActivator).GetComponent<CharacterBody>();
			int itemCount = component.inventory.GetItemCount(itemIndex);
			component.inventory.RemoveItem(itemIndex, itemCount);
			component.inventory.GiveItem(VoidCradle.GetCorruption(itemIndex), itemCount);
			CharacterMasterNotificationQueue.PushItemTransformNotification(component.master, itemIndex, VoidCradle.GetCorruption(itemIndex), (TransformationType)1);
			interaction.SetAvailable(false);
			float num = component.healthComponent.fullCombinedHealth * Main.cursePercent.Value;
			float num2 = Mathf.RoundToInt(num / component.healthComponent.fullCombinedHealth * 100f);
			controller.networkUIPromptController.SetParticipantMaster((CharacterMaster)null);
			for (int j = 0; (float)j < num2; j++)
			{
				component.AddBuff(Buffs.PermanentCurse);
			}
			EntityStateMachine component2 = ((Component)this).GetComponent<EntityStateMachine>();
			if (Object.op_Implicit((Object)(object)component2))
			{
				component2.SetNextState((EntityState)new Opening());
			}
		}

		public void OnPurchase(Interactor interactor)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: 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_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: 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_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Invalid comparison between Unknown and I4
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_014f: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)((Component)interactor).GetComponent<CharacterBody>()))
			{
				return;
			}
			CharacterBody component = ((Component)interactor).GetComponent<CharacterBody>();
			int num = 0;
			for (int i = 0; i < options.Count; i++)
			{
				Option item = options[i];
				if (component.inventory.GetItemCount(((PickupIndex)(ref item.pickupIndex)).itemIndex) <= 0)
				{
					options.Remove(item);
				}
			}
			if (options.Count == 0)
			{
				hasSet = false;
			}
			foreach (ItemIndex item2 in component.inventory.itemAcquisitionOrder.OrderBy((ItemIndex x) => Random.value))
			{
				if (!hasSet && VoidCradle.IsCorruptible(item2))
				{
					ItemDef itemDef = ItemCatalog.GetItemDef(item2);
					if ((int)itemDef.tier != 4 && num < Main.choiceCount.Value)
					{
						options.Add(new Option
						{
							pickupIndex = PickupCatalog.FindPickupIndex(item2),
							available = true
						});
						num++;
					}
				}
			}
			if (options.Count >= 1)
			{
				hasSet = true;
				controller.SetOptionsInternal(options.ToArray());
				controller.SetOptionsServer(options.ToArray());
				((UnityEvent<Interactor>)(object)controller.onServerInteractionBegin).Invoke(interactor);
				controller.networkUIPromptController.SetParticipantMasterFromInteractor(interactor);
			}
			interaction.SetAvailableTrue();
		}
	}
	public static class VoidPotential
	{
		public static void Init()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			if (Main.alterPotentials.Value)
			{
				BasicPickupDropTable val = Addressables.LoadAssetAsync<BasicPickupDropTable>((object)"RoR2/DLC1/VoidTriple/dtVoidTriple.asset").WaitForCompletion();
				val.tier1Weight = 0.14f;
				val.tier2Weight = 0.35f;
				val.tier3Weight = 0.01f;
				val.voidTier3Weight = 0.25f;
				val.voidBossWeight = 0.25f;
			}
			if (Main.destroyVoidPotentialAfterTeleporter.Value)
			{
				GameObject val2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidTriple/VoidTriple.prefab").WaitForCompletion();
				val2.AddComponent<FuckMinMaxers>();
			}
		}
	}
	public static class VoidSeed
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_OnEnter <0>__Idle_OnEnter;
		}

		public static GameObject positionIndicatorPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidCamp/VoidCampPositionIndicator.prefab").WaitForCompletion();

		public static void Init()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Expected O, but got Unknown
			if (Main.alterVoidSeeds.Value)
			{
				DirectorCardCategorySelection val = Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/VoidCamp/dccsVoidCampInteractables.asset").WaitForCompletion();
				DirectorCard val2 = val.categories[0].cards[1];
				val2.selectionWeight = 2;
			}
			InteractableSpawnCard val3 = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC1/VoidCamp/iscVoidCamp.asset").WaitForCompletion();
			val3.maxSpawnsPerStage = Main.voidSeedLimit.Value;
			GameObject val4 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidCamp/VoidCamp.prefab").WaitForCompletion();
			Transform transform = val4.transform;
			OutsideInteractableLocker component = val4.GetComponent<OutsideInteractableLocker>();
			component.radius = Main.voidSeedRadius.Value;
			PlayerSpawnInhibitor component2 = val4.GetComponent<PlayerSpawnInhibitor>();
			component2.radius = Main.voidSeedRadius.Value;
			Light component3 = ((Component)transform.GetChild(3)).GetComponent<Light>();
			component3.color = Color32.op_Implicit(new Color32((byte)119, (byte)58, (byte)150, byte.MaxValue));
			component3.intensity = 20f;
			component3.range = Main.voidSeedRadius.Value;
			((Component)component3).gameObject.SetActive(true);
			Transform child = transform.GetChild(4);
			child.localScale = Vector3.one * 2.08f * Main.voidSeedRadius.Value;
			Transform child2 = transform.GetChild(0);
			CampDirector component4 = ((Component)child2).GetComponent<CampDirector>();
			component4.campMaximumRadius = Main.voidSeedRadius.Value;
			SphereZone component5 = ((Component)child2).GetComponent<SphereZone>();
			component5.radius = Main.voidSeedRadius.Value;
			CombatDirector component6 = ((Component)child2).GetComponent<CombatDirector>();
			component6.maximumNumberToSpawnBeforeSkipping = 3;
			component6.creditMultiplier = 2.2f;
			Transform child3 = transform.GetChild(1);
			CampDirector component7 = ((Component)child3).GetComponent<CampDirector>();
			component7.campMaximumRadius = Main.voidSeedRadius.Value;
			component7.baseInteractableCredit = Convert.ToInt32(Main.voidSeedRadius.Value / 4f);
			Object.Destroy((Object)(object)val4.GetComponent<DelayedEvent>());
			object obj = <>O.<0>__Idle_OnEnter;
			if (obj == null)
			{
				hook_OnEnter val5 = Idle_OnEnter;
				<>O.<0>__Idle_OnEnter = val5;
				obj = (object)val5;
			}
			Idle.OnEnter += (hook_OnEnter)obj;
		}

		public static void Idle_OnEnter(orig_OnEnter orig, Idle self)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			PositionIndicator component = Object.Instantiate<GameObject>(positionIndicatorPrefab, ((EntityState)self).transform.position, Quaternion.identity).GetComponent<PositionIndicator>();
			component.targetTransform = ((EntityState)self).transform;
		}
	}
}
namespace BetterVoid.Enemies
{
	public static class VoidBarnacle
	{
		public static void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidBarnacle/VoidBarnacleBody.prefab").WaitForCompletion();
			CharacterBody component = val.GetComponent<CharacterBody>();
			component.baseRegen = 0f;
			component.levelRegen = 0f;
		}
	}
	public static class VoidDevastator
	{
		public static void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/VoidMegaCrabDeathBombProjectile.prefab").WaitForCompletion();
			ProjectileImpactExplosion component = val.GetComponent<ProjectileImpactExplosion>();
			component.lifetime = 3.5f;
		}
	}
	public static class VoidReaver
	{
		public static void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			GameObject master = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Nullifier/NullifierMaster.prefab").WaitForCompletion();
			GameObject body = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Nullifier/NullifierBody.prefab").WaitForCompletion();
			Tweak(master, body);
			GameObject master2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Nullifier/NullifierAllyMaster.prefab").WaitForCompletion();
			GameObject body2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Nullifier/NullifierAllyBody.prefab").WaitForCompletion();
			Tweak(master2, body2);
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Nullifier/NullifierDeathBombProjectile.prefab").WaitForCompletion();
			ProjectileImpactExplosion component = val.GetComponent<ProjectileImpactExplosion>();
			component.lifetime = 2.4f;
		}

		public static void Tweak(GameObject master, GameObject body)
		{
			//IL_0033: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
			AISkillDriver val = (from x in master.GetComponents<AISkillDriver>()
				where x.customName == "PanicFireWhenClose"
				select x).First();
			val.movementType = (MovementType)1;
			AISkillDriver val2 = (from x in master.GetComponents<AISkillDriver>()
				where x.customName == "FireAndStrafe"
				select x).First();
			val2.movementType = (MovementType)1;
			AISkillDriver val3 = (from x in master.GetComponents<AISkillDriver>()
				where x.customName == "FireAndChase"
				select x).First();
			val3.movementType = (MovementType)1;
			CharacterBody component = body.GetComponent<CharacterBody>();
			component.baseMoveSpeed = 17f;
		}
	}
}