Decompiled source of SimulacrumNormalStages v1.1.1

SimulacrumNormalStages.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.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HG.Reflection;
using IL.RoR2;
using InLobbyConfig;
using InLobbyConfig.Fields;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using RoR2;
using RoR2.ExpansionManagement;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SimulacrumNormalStages")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+9ddc3c571d238e773a452ea9236a778ffc02579a")]
[assembly: AssemblyProduct("SimulacrumNormalStages")]
[assembly: AssemblyTitle("SimulacrumNormalStages")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 SimulacrumNormalStages
{
	public class BepConfig
	{
		public static ConfigEntry<bool> PlaceVoidEradicators;

		public static ConfigEntry<bool> PlaceNewtAltars;

		public static ConfigEntry<bool> PlaceHallowedShrine;

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

		public static void Init()
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Expected O, but got Unknown
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Expected O, but got Unknown
			ConfigFile config = ((BaseUnityPlugin)SimulacrumNormalStages.instance).Config;
			Enabled = config.Bind<bool>("Main", "Enabled", true, "Enable Mod");
			PlaceVoidEradicators = config.Bind<bool>("Main", "Place Void Eradicators", false, new ConfigDescription("Places Void Eradicators - a shrine to erase items from the run.", (AcceptableValueBase)null, Array.Empty<object>()));
			PlaceNewtAltars = config.Bind<bool>("Main", "Place Newt Altars", false, new ConfigDescription("Places Newt Altars - in order to access the Bazaar Between Time.", (AcceptableValueBase)null, Array.Empty<object>()));
			PlaceHallowedShrine = config.Bind<bool>("Main", "Place Hallowed Shrine", false, new ConfigDescription("Places a Hallowed Shrine near the safe ward once each stage's last wave is beaten - to turn Hexes into Hallowed items. Only with Hallowed Concepts enabled.", (AcceptableValueBase)null, Array.Empty<object>()));
			ConfigDefinition val = new ConfigDefinition("Main", "Place Void Eradictors");
			if (config.Bind<bool>(val, false, (ConfigDescription)null).Value)
			{
				PlaceVoidEradicators.Value = true;
			}
			config.Remove(val);
			config.Save();
			if (ModCompatibilityInLobbyConfig.enabled)
			{
				ModCompatibilityInLobbyConfig.CreateFromBepInExConfigFile(config, "Simulacrum Normal Stages");
			}
		}
	}
	internal static class Log
	{
		internal static ManualLogSource _logSource;

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

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

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

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

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

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

		internal static void LogWarning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	public static class ModCompatibilityInLobbyConfig
	{
		private static bool? _enabled;

		public static bool enabled
		{
			get
			{
				if (!_enabled.HasValue)
				{
					_enabled = Chainloader.PluginInfos.ContainsKey("com.KingEnderBrine.InLobbyConfig");
				}
				return _enabled.Value;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void CreateFromBepInExConfigFile(ConfigFile config, string displayName)
		{
			ModConfigCatalog.Add(ConfigFieldUtilities.CreateFromBepInExConfigFile(config, displayName));
		}
	}
	[BepInPlugin("Def.SimulacrumNormalStages", "SimulacrumNormalStages", "1.1.1")]
	public class SimulacrumNormalStages : BaseUnityPlugin
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_OnPrePopulateSceneServer <0>__RemoveSpawnPointsAndMonsters;

			public static Action<SceneDirector, DirectorCardCategorySelection> <1>__AddAndRemoveInteractables;

			public static hook_IsAvailable <2>__Allow_Earlier_Spawns;

			public static hook_Start <3>__DoReality;

			public static hook_OnEnable <4>__CombatDirector_OnEnable;

			public static hook_PickNextStageScene <5>__ChooseRealityStages;

			public static hook_Start <6>__Run_Start;

			public static hook_OnStartServer <7>__ArenaMissionController_OnStartServer;

			public static hook_Start <8>__VoidStageMissionController_Start;

			public static Action<GameObject> <9>__Destroy;
		}

		public const string PluginGUID = "Def.SimulacrumNormalStages";

		public const string PluginAuthor = "Def";

		public const string PluginName = "SimulacrumNormalStages";

		public const string PluginVersion = "1.1.1";

		public static SimulacrumNormalStages instance;

		public static SceneCollection realityDestinations = ScriptableObject.CreateInstance<SceneCollection>();

		public static List<SceneDef> visitedScenes = new List<SceneDef>();

		public static bool shouldAttemptToSpawnShopPortal = false;

		private static bool pickingStartingStage = false;

		public AsyncOperationHandle<SpawnCard> iscShopPortal;

		public AsyncOperationHandle<SpawnCard> iscHallowedShrine;

		public AsyncOperationHandle<GameObject> hallowedShrineSpawnEffect;

		public static Func<bool> skipHallowedShrine;

		public static Predicate<DirectorCard> trimmer = SimulacrumTrimmer;

		private const string ConceptReliquary = "iscHollowChest";

		private const string VoidSeed = "VoidCamp";

		private static readonly HashSet<string> HallowedConceptsInteractables = new HashSet<string>
		{
			"iscChampRushExitPortal", "iscChampRushPortal", "iscShrineCatastrophe", "iscShrineCombatPoison", "iscBetterHallowedShrine", "iscHallowedShrine", "iscShrineCompulsion", "iscShrineCompulsionRare", "iscChest1StealthedQuest", "iscHauntedVendingMachine",
			"iscShrineRestackQuest", "iscShrineDeath", "iscShrineDread", "iscChest1SadObjective", "iscTrialCategoryChest2Damage", "iscTrialCategoryChestDamage", "iscTrialTripleShop", "iscTrialTripleShopLarge", "iscTrialPortalEntry", "iscTrialPortalEntryDanger",
			"iscTrialPortalExit", "iscWakeGrave", "iscWakeGrave_Turret", "iscPeaceFlower", "iscSignalFlare", "iscWake", "iscWakePage", "iscWakeStop", "iscWarpGate", "iscChestCamp"
		};

		public static PluginInfo PInfo { get; private set; }

		public void Awake()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			PInfo = ((BaseUnityPlugin)this).Info;
			instance = this;
			Log.Init(((BaseUnityPlugin)this).Logger);
			BepConfig.Init();
			iscShopPortal = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/Base/PortalShop/iscShopPortal.asset");
			iscHallowedShrine = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/DLC4/iscHallowedShrine.asset");
			hallowedShrineSpawnEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC4/ProvUltPulseCurseBurstVFX.prefab");
		}

		private void OnEnable()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Expected O, but got Unknown
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Expected O, but got Unknown
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Expected O, but got Unknown
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Expected O, but got Unknown
			//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_00b4: Expected O, but got Unknown
			//IL_00e9: 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_00f4: Expected O, but got Unknown
			//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_0114: Expected O, but got Unknown
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Expected O, but got Unknown
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Expected O, but got Unknown
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Expected O, but got Unknown
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Expected O, but got Unknown
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Expected O, but got Unknown
			VoidStageMissionController.OnEnable += new Manipulator(VoidStageMissionController_OnEnable);
			VoidStageMissionController.Start += new Manipulator(VoidStageMissionController_Start);
			InfiniteTowerRun.OnPrePopulateSceneServer += new Manipulator(InfiniteTowerRun_OnPrePopulateSceneServer);
			Run.AdvanceStage += new Manipulator(Run_AdvanceStage);
			PortalStatueBehavior.GrantPortalEntry += new hook_GrantPortalEntry(PortalStatueBehavior_GrantPortalEntry);
			InfiniteTowerRun.OnWaveAllEnemiesDefeatedServer += new hook_OnWaveAllEnemiesDefeatedServer(InfiniteTowerRun_OnWaveAllEnemiesDefeatedServer);
			AccessCodesMissionController.OnStartServer += new Manipulator(AccessCodesMissionController_OnStartServer);
			ConduitCanyonController.DisableSector2 += new Manipulator(ConduitCanyonController_DisableSector2);
			SceneDirector.PopulateScene += new hook_PopulateScene(SceneDirector_PopulateScene);
			object obj = <>O.<0>__RemoveSpawnPointsAndMonsters;
			if (obj == null)
			{
				hook_OnPrePopulateSceneServer val = RemoveSpawnPointsAndMonsters;
				<>O.<0>__RemoveSpawnPointsAndMonsters = val;
				obj = (object)val;
			}
			InfiniteTowerRun.OnPrePopulateSceneServer += (hook_OnPrePopulateSceneServer)obj;
			SceneDirector.onGenerateInteractableCardSelection += AddAndRemoveInteractables;
			object obj2 = <>O.<2>__Allow_Earlier_Spawns;
			if (obj2 == null)
			{
				hook_IsAvailable val2 = Allow_Earlier_Spawns;
				<>O.<2>__Allow_Earlier_Spawns = val2;
				obj2 = (object)val2;
			}
			DirectorCard.IsAvailable += (hook_IsAvailable)obj2;
			object obj3 = <>O.<3>__DoReality;
			if (obj3 == null)
			{
				hook_Start val3 = DoReality;
				<>O.<3>__DoReality = val3;
				obj3 = (object)val3;
			}
			SceneDirector.Start += (hook_Start)obj3;
			object obj4 = <>O.<4>__CombatDirector_OnEnable;
			if (obj4 == null)
			{
				hook_OnEnable val4 = CombatDirector_OnEnable;
				<>O.<4>__CombatDirector_OnEnable = val4;
				obj4 = (object)val4;
			}
			CombatDirector.OnEnable += (hook_OnEnable)obj4;
			object obj5 = <>O.<5>__ChooseRealityStages;
			if (obj5 == null)
			{
				hook_PickNextStageScene val5 = ChooseRealityStages;
				<>O.<5>__ChooseRealityStages = val5;
				obj5 = (object)val5;
			}
			Run.PickNextStageScene += (hook_PickNextStageScene)obj5;
			object obj6 = <>O.<6>__Run_Start;
			if (obj6 == null)
			{
				hook_Start val6 = Run_Start;
				<>O.<6>__Run_Start = val6;
				obj6 = (object)val6;
			}
			Run.Start += (hook_Start)obj6;
			object obj7 = <>O.<7>__ArenaMissionController_OnStartServer;
			if (obj7 == null)
			{
				hook_OnStartServer val7 = ArenaMissionController_OnStartServer;
				<>O.<7>__ArenaMissionController_OnStartServer = val7;
				obj7 = (object)val7;
			}
			ArenaMissionController.OnStartServer += (hook_OnStartServer)obj7;
			object obj8 = <>O.<8>__VoidStageMissionController_Start;
			if (obj8 == null)
			{
				hook_Start val8 = VoidStageMissionController_Start;
				<>O.<8>__VoidStageMissionController_Start = val8;
				obj8 = (object)val8;
			}
			VoidStageMissionController.Start += (hook_Start)obj8;
		}

		private void OnDisable()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Expected O, but got Unknown
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Expected O, but got Unknown
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Expected O, but got Unknown
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Expected O, but got Unknown
			//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_00b4: Expected O, but got Unknown
			//IL_00e9: 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_00f4: Expected O, but got Unknown
			//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_0114: Expected O, but got Unknown
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Expected O, but got Unknown
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Expected O, but got Unknown
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Expected O, but got Unknown
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Expected O, but got Unknown
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Expected O, but got Unknown
			VoidStageMissionController.OnEnable -= new Manipulator(VoidStageMissionController_OnEnable);
			VoidStageMissionController.Start -= new Manipulator(VoidStageMissionController_Start);
			InfiniteTowerRun.OnPrePopulateSceneServer -= new Manipulator(InfiniteTowerRun_OnPrePopulateSceneServer);
			Run.AdvanceStage -= new Manipulator(Run_AdvanceStage);
			PortalStatueBehavior.GrantPortalEntry -= new hook_GrantPortalEntry(PortalStatueBehavior_GrantPortalEntry);
			InfiniteTowerRun.OnWaveAllEnemiesDefeatedServer -= new hook_OnWaveAllEnemiesDefeatedServer(InfiniteTowerRun_OnWaveAllEnemiesDefeatedServer);
			AccessCodesMissionController.OnStartServer -= new Manipulator(AccessCodesMissionController_OnStartServer);
			ConduitCanyonController.DisableSector2 -= new Manipulator(ConduitCanyonController_DisableSector2);
			SceneDirector.PopulateScene -= new hook_PopulateScene(SceneDirector_PopulateScene);
			object obj = <>O.<0>__RemoveSpawnPointsAndMonsters;
			if (obj == null)
			{
				hook_OnPrePopulateSceneServer val = RemoveSpawnPointsAndMonsters;
				<>O.<0>__RemoveSpawnPointsAndMonsters = val;
				obj = (object)val;
			}
			InfiniteTowerRun.OnPrePopulateSceneServer -= (hook_OnPrePopulateSceneServer)obj;
			SceneDirector.onGenerateInteractableCardSelection -= AddAndRemoveInteractables;
			object obj2 = <>O.<2>__Allow_Earlier_Spawns;
			if (obj2 == null)
			{
				hook_IsAvailable val2 = Allow_Earlier_Spawns;
				<>O.<2>__Allow_Earlier_Spawns = val2;
				obj2 = (object)val2;
			}
			DirectorCard.IsAvailable -= (hook_IsAvailable)obj2;
			object obj3 = <>O.<3>__DoReality;
			if (obj3 == null)
			{
				hook_Start val3 = DoReality;
				<>O.<3>__DoReality = val3;
				obj3 = (object)val3;
			}
			SceneDirector.Start -= (hook_Start)obj3;
			object obj4 = <>O.<4>__CombatDirector_OnEnable;
			if (obj4 == null)
			{
				hook_OnEnable val4 = CombatDirector_OnEnable;
				<>O.<4>__CombatDirector_OnEnable = val4;
				obj4 = (object)val4;
			}
			CombatDirector.OnEnable -= (hook_OnEnable)obj4;
			object obj5 = <>O.<5>__ChooseRealityStages;
			if (obj5 == null)
			{
				hook_PickNextStageScene val5 = ChooseRealityStages;
				<>O.<5>__ChooseRealityStages = val5;
				obj5 = (object)val5;
			}
			Run.PickNextStageScene -= (hook_PickNextStageScene)obj5;
			object obj6 = <>O.<6>__Run_Start;
			if (obj6 == null)
			{
				hook_Start val6 = Run_Start;
				<>O.<6>__Run_Start = val6;
				obj6 = (object)val6;
			}
			Run.Start -= (hook_Start)obj6;
			object obj7 = <>O.<7>__ArenaMissionController_OnStartServer;
			if (obj7 == null)
			{
				hook_OnStartServer val7 = ArenaMissionController_OnStartServer;
				<>O.<7>__ArenaMissionController_OnStartServer = val7;
				obj7 = (object)val7;
			}
			ArenaMissionController.OnStartServer -= (hook_OnStartServer)obj7;
			object obj8 = <>O.<8>__VoidStageMissionController_Start;
			if (obj8 == null)
			{
				hook_Start val8 = VoidStageMissionController_Start;
				<>O.<8>__VoidStageMissionController_Start = val8;
				obj8 = (object)val8;
			}
			VoidStageMissionController.Start -= (hook_Start)obj8;
		}

		private void ConduitCanyonController_DisableSector2(ILContext il)
		{
			ReturnImmediately(il, delegate(ConduitCanyonController self)
			{
				if (((object)Run.instance).GetType() == typeof(InfiniteTowerRun))
				{
					((Behaviour)self).enabled = false;
					return true;
				}
				return false;
			});
		}

		private void AccessCodesMissionController_OnStartServer(ILContext il)
		{
			ReturnImmediately(il, delegate(AccessCodesMissionController self)
			{
				//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_002e: 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)
				if (((object)Run.instance).GetType() == typeof(InfiniteTowerRun))
				{
					AccessCodesNodeData[] nodes = self.nodes;
					foreach (AccessCodesNodeData val in nodes)
					{
						if (Object.op_Implicit((Object)(object)val.node))
						{
							Object.Destroy((Object)(object)val.node);
						}
					}
					Object.Destroy((Object)(object)((Component)self).gameObject);
					return true;
				}
				return false;
			});
		}

		private void SceneDirector_PopulateScene(orig_PopulateScene orig, SceneDirector self)
		{
			if (((object)Run.instance).GetType() == typeof(InfiniteTowerRun))
			{
				List<GameObject> list = new List<GameObject>();
				foreach (ShrineCombatTroopBehavior instances in InstanceTracker.GetInstancesList<ShrineCombatTroopBehavior>())
				{
					if ((Object)(object)instances != (Object)null && ((Object)((Component)instances).gameObject).name.StartsWith("ShrineCombatCollective"))
					{
						list.Add(((Component)instances).gameObject);
					}
				}
				list.ForEach((Action<GameObject>)Object.Destroy);
			}
			orig.Invoke(self);
			if (!(((object)Run.instance).GetType() == typeof(InfiniteTowerRun)))
			{
				return;
			}
			List<GameObject> list2 = new List<GameObject>();
			foreach (GenericObjectiveProvider instances2 in InstanceTracker.GetInstancesList<GenericObjectiveProvider>())
			{
				if ((Object)(object)instances2 != (Object)null)
				{
					list2.Add(((Component)instances2).gameObject);
				}
			}
			foreach (PowerPedestal instances3 in InstanceTracker.GetInstancesList<PowerPedestal>())
			{
				if ((Object)(object)instances3 != (Object)null)
				{
					instances3.SetComplete(true);
					instances3.CallRpcInteractResult(true);
				}
			}
			foreach (TeleporterInteraction instances4 in InstanceTracker.GetInstancesList<TeleporterInteraction>())
			{
				if ((Object)(object)instances4 != (Object)null)
				{
					list2.Add(((Component)instances4).gameObject);
				}
			}
			list2.ForEach((Action<GameObject>)Object.Destroy);
		}

		private void PlaceHallowedShrine(InfiniteTowerRun infiniteTowerRun)
		{
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: 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)
			//IL_00b1: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Expected O, but got Unknown
			if (NetworkServer.active && BepConfig.Enabled.Value && BepConfig.PlaceHallowedShrine.Value && !IsCurrentMapInBazaar() && (skipHallowedShrine == null || !skipHallowedShrine()) && !((Object)(object)DLC4Content.DLC4 == (Object)null) && Run.instance.IsExpansionEnabled(DLC4Content.DLC4) && !((Object)(object)infiniteTowerRun.safeWardController == (Object)null) && !((Object)(object)Object.FindObjectOfType<HallowingShrineSplitBase>() != (Object)null))
			{
				Transform transform = ((Component)infiniteTowerRun.safeWardController).transform;
				GameObject val = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(iscHallowedShrine.WaitForCompletion(), new DirectorPlacementRule
				{
					minDistance = 10f,
					maxDistance = 40f,
					placementMode = (PlacementMode)1,
					position = transform.position,
					spawnOnTarget = transform
				}, Run.instance.stageRng));
				if ((Object)(object)val != (Object)null)
				{
					EffectManager.SpawnEffect(hallowedShrineSpawnEffect.WaitForCompletion(), new EffectData
					{
						origin = val.transform.position,
						scale = 6f
					}, true);
				}
			}
		}

		private void InfiniteTowerRun_OnWaveAllEnemiesDefeatedServer(orig_OnWaveAllEnemiesDefeatedServer orig, InfiniteTowerRun self, InfiniteTowerWaveController wc)
		{
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: 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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Expected O, but got Unknown
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Expected O, but got Unknown
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Expected O, but got Unknown
			orig.Invoke(self, wc);
			if (BepConfig.Enabled.Value && self.IsStageTransitionWave())
			{
				PlaceHallowedShrine(self);
				if (shouldAttemptToSpawnShopPortal && (Object)(object)self.safeWardController != (Object)null && (Object)(object)DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(iscShopPortal.WaitForCompletion(), new DirectorPlacementRule
				{
					minDistance = 0f,
					maxDistance = 30f,
					placementMode = (PlacementMode)1,
					position = ((Component)self.safeWardController).transform.position,
					spawnOnTarget = ((Component)self.safeWardController).transform
				}, self.safeWardRng)) != (Object)null)
				{
					Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
					{
						baseToken = "PORTAL_SHOP_OPEN"
					});
				}
				shouldAttemptToSpawnShopPortal = false;
			}
		}

		private void PortalStatueBehavior_GrantPortalEntry(orig_GrantPortalEntry orig, PortalStatueBehavior self)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			if ((int)self.portalType == 0)
			{
				shouldAttemptToSpawnShopPortal = true;
			}
			orig.Invoke(self);
		}

		private void Run_AdvanceStage(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			ILLabel val2 = val.DefineLabel();
			val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallvirt<Stage>(x, "CompleteServer")
			});
			val.EmitDelegate<Func<bool>>((Func<bool>)(() => SceneCatalog.GetSceneDefForCurrentScene().baseSceneName == "arena" && ((object)Run.instance).GetType() == typeof(InfiniteTowerRun)));
			val.Emit(OpCodes.Brtrue, (object)val2);
			val.GotoNext(new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
				(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<Run>(x, "stageClearCount")
			});
			val.MarkLabel(val2);
		}

		private void ReturnImmediately<T>(ILContext il, Func<T, bool> funcWhetherToReturnImmediately)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: 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_002e: 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)
			ILLabel val = il.DefineLabel();
			ILCursor val2 = new ILCursor(il);
			val2.Emit(OpCodes.Ldarg_0);
			val2.EmitDelegate<Func<T, bool>>(funcWhetherToReturnImmediately);
			val2.Emit(OpCodes.Brfalse, (object)val);
			val2.Emit(OpCodes.Ret);
			val2.MarkLabel(val);
		}

		private void VoidStageMissionController_OnEnable(ILContext il)
		{
			ReturnImmediately(il, delegate(VoidStageMissionController self)
			{
				if (((object)Run.instance).GetType() == typeof(InfiniteTowerRun))
				{
					((Behaviour)self).enabled = false;
					return true;
				}
				return false;
			});
		}

		private void VoidStageMissionController_Start(ILContext il)
		{
			ReturnImmediately(il, delegate(VoidStageMissionController self)
			{
				if (((object)Run.instance).GetType() == typeof(InfiniteTowerRun))
				{
					if (Object.op_Implicit((Object)(object)self.deepVoidPortalObjectiveProvider))
					{
						((Behaviour)self.deepVoidPortalObjectiveProvider).enabled = false;
					}
					return true;
				}
				return false;
			});
		}

		private static bool IsCurrentMapInBazaar()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			Scene activeScene = SceneManager.GetActiveScene();
			return ((Scene)(ref activeScene)).name == "bazaar";
		}

		private void InfiniteTowerRun_OnPrePopulateSceneServer(ILContext il)
		{
			ReturnImmediately(il, delegate(InfiniteTowerRun self)
			{
				if (IsCurrentMapInBazaar())
				{
					self.PerformStageCleanUp();
					return true;
				}
				return false;
			});
		}

		private static void ArenaMissionController_OnStartServer(orig_OnStartServer orig, ArenaMissionController self)
		{
			if (((object)Run.instance).GetType() == typeof(InfiniteTowerRun))
			{
				GameObject val = GameObject.Find("/PortalArena");
				if (Object.op_Implicit((Object)(object)val))
				{
					Object.Destroy((Object)(object)val);
				}
				Object.Destroy((Object)(object)((Component)self).gameObject);
			}
			else
			{
				orig.Invoke(self);
			}
		}

		public unsafe static void DoDestinations()
		{
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			List<SceneEntry> list = new List<SceneEntry>();
			for (int i = 0; i < SceneCatalog.allStageSceneDefs.Length; i++)
			{
				SceneDef val = (SceneDef)Unsafe.Read<object>((void*)SceneCatalog.allStageSceneDefs[i]);
				if (IsRealityStage(val))
				{
					float weight = 1f;
					switch (val.cachedName)
					{
					case "blackbeach":
					case "lakesnight":
					case "blackbeach2":
					case "golemplains":
					case "habitatfall":
					case "golemplains2":
					case "ironalluvium":
					case "villagenight":
					case "habitat":
					case "village":
					case "lakes":
					case "ironalluvium2":
						weight = 0.5f;
						break;
					}
					SceneEntry val2 = new SceneEntry
					{
						sceneDef = val
					};
					((SceneEntry)(ref val2)).weight = weight;
					SceneEntry item = val2;
					list.Add(item);
				}
			}
			realityDestinations._sceneEntries = list.ToArray();
		}

		private static bool IsRealityStage(SceneDef sceneDef)
		{
			switch (sceneDef.cachedName)
			{
			case "conduitcanyon":
			case "habitat":
			case "helminthroost":
				return true;
			default:
				if (sceneDef.validForRandomSelection)
				{
					return sceneDef.hasAnyDestinations;
				}
				return false;
			}
		}

		private static void Run_Start(orig_Start orig, Run self)
		{
			shouldAttemptToSpawnShopPortal = false;
			if (((object)Run.instance).GetType() == typeof(InfiniteTowerRun) && BepConfig.Enabled.Value)
			{
				DoDestinations();
				self.startingSceneGroup = realityDestinations;
				visitedScenes.Clear();
			}
			pickingStartingStage = true;
			try
			{
				orig.Invoke(self);
			}
			finally
			{
				pickingStartingStage = false;
			}
		}

		private static void CombatDirector_OnEnable(orig_OnEnable orig, CombatDirector self)
		{
			orig.Invoke(self);
			if (NetworkServer.active && BepConfig.Enabled.Value && Run.instance is InfiniteTowerRun && (Object)(object)((Component)self).GetComponentInParent<InfiniteTowerWaveController>() == (Object)null)
			{
				((Behaviour)self).enabled = false;
			}
		}

		private static void DoReality(orig_Start orig, SceneDirector self)
		{
			orig.Invoke(self);
			if (BepConfig.Enabled.Value && !(((object)Run.instance).GetType() != typeof(InfiniteTowerRun)))
			{
				CombatDirector[] components = ((Component)self).gameObject.GetComponents<CombatDirector>();
				for (int i = 0; i < components.Length; i++)
				{
					((Behaviour)components[i]).enabled = false;
				}
				if (NetworkServer.active && !BepConfig.PlaceNewtAltars.Value)
				{
					RemoveNewtAltars(BepConfig.PlaceVoidEradicators.Value);
				}
				PortalDialerButtonController[] array = Object.FindObjectsOfType(typeof(PortalDialerButtonController)) as PortalDialerButtonController[];
				for (int j = 0; j < array.Length; j++)
				{
					NetworkServer.Destroy(((Component)array[j]).gameObject);
				}
				PortalDialerController[] array2 = Object.FindObjectsOfType(typeof(PortalDialerController)) as PortalDialerController[];
				for (int k = 0; k < array2.Length; k++)
				{
					NetworkServer.Destroy(((Component)array2[k]).gameObject);
				}
			}
		}

		private static void RemoveNewtAltars(bool placeVoidEradicators)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: 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_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = (placeVoidEradicators ? Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSuppressor/VoidSuppressor.prefab").WaitForCompletion() : null);
			HashSet<GameObject> hashSet = new HashSet<GameObject>();
			PortalStatueBehavior[] array = Object.FindObjectsOfType<PortalStatueBehavior>(true);
			foreach (PortalStatueBehavior val2 in array)
			{
				if ((int)val2.portalType == 0)
				{
					Transform transform = ((Component)val2).transform;
					if (Object.op_Implicit((Object)(object)val) && (!Object.op_Implicit((Object)(object)transform.parent) || ((Component)transform.parent).gameObject.activeInHierarchy))
					{
						GameObject obj = Object.Instantiate<GameObject>(val, transform.TransformPoint(new Vector3(0f, -1.38f, 0f)), transform.rotation);
						PurchaseInteraction component = obj.GetComponent<PurchaseInteraction>();
						component.costType = (CostTypeIndex)0;
						component.cost = 0;
						NetworkServer.Spawn(obj);
					}
					hashSet.Add(((Component)val2).gameObject);
					NetworkServer.Destroy(((Component)val2).gameObject);
				}
			}
			SceneObjectToggleGroup[] array2 = Object.FindObjectsOfType<SceneObjectToggleGroup>(true);
			foreach (SceneObjectToggleGroup val3 in array2)
			{
				for (int j = 0; j < val3.allToggleableObjects.Length; j++)
				{
					if (val3.activations[j] && hashSet.Contains(val3.allToggleableObjects[j]))
					{
						val3.activations[j] = false;
						((NetworkBehaviour)val3).SetDirtyBit(1u);
					}
				}
			}
		}

		private static void VoidStageMissionController_Start(orig_Start orig, VoidStageMissionController self)
		{
			if (((object)Run.instance).GetType() == typeof(InfiniteTowerRun))
			{
				self.batteryCount = 0;
			}
			orig.Invoke(self);
		}

		private static void ChooseRealityStages(orig_PickNextStageScene orig, Run self, WeightedSelection<SceneDef> choices)
		{
			//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_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_00ce: Unknown result type (might be due to invalid IL or missing references)
			if (((object)Run.instance).GetType() == typeof(InfiniteTowerRun) && BepConfig.Enabled.Value && !pickingStartingStage)
			{
				if (visitedScenes.Count > 10)
				{
					visitedScenes.Clear();
					DoDestinations();
				}
				if (realityDestinations.sceneEntries.Length == 0)
				{
					DoDestinations();
				}
				if (realityDestinations.sceneEntries.Length > 0)
				{
					MarkVisited(SceneCatalog.mostRecentSceneDef);
					WeightedSelection<SceneDef> val = new WeightedSelection<SceneDef>(24);
					realityDestinations.AddToWeightedSelection(val, (Func<SceneDef, bool>)self.CanPickStage);
					self.nextStageScene = val.Evaluate(self.nextStageRng.nextNormalizedFloat);
					MarkVisited(self.nextStageScene);
				}
				else
				{
					SceneDef[] array = ((IEnumerable<SceneDef>)(object)SceneCatalog.allStageSceneDefs).Where(RealityValidSceneDefs).ToArray();
					self.nextStageScene = self.nextStageRng.NextElementUniform<SceneDef>(array);
				}
			}
			else
			{
				orig.Invoke(self, choices);
			}
		}

		private static void MarkVisited(SceneDef sceneDef)
		{
			if (visitedScenes.Contains(sceneDef))
			{
				return;
			}
			for (int i = 0; i < realityDestinations._sceneEntries.Length; i++)
			{
				if ((Object)(object)realityDestinations._sceneEntries[i].sceneDef == (Object)(object)sceneDef)
				{
					((SceneEntry)(ref realityDestinations._sceneEntries[i])).weight = 0f;
					visitedScenes.Add(sceneDef);
					break;
				}
			}
		}

		private static bool RealityValidSceneDefs(SceneDef sceneDef)
		{
			if (visitedScenes.Contains(sceneDef))
			{
				return false;
			}
			return IsRealityStage(sceneDef);
		}

		private static bool Allow_Earlier_Spawns(orig_IsAvailable orig, DirectorCard self)
		{
			int minimumStageCompletions = self.minimumStageCompletions;
			if (minimumStageCompletions > 2 && BepConfig.Enabled.Value && ((object)Run.instance)?.GetType() == typeof(InfiniteTowerRun))
			{
				self.minimumStageCompletions = 2;
				try
				{
					return orig.Invoke(self);
				}
				finally
				{
					self.minimumStageCompletions = minimumStageCompletions;
				}
			}
			return orig.Invoke(self);
		}

		private static void RemoveSpawnPointsAndMonsters(orig_OnPrePopulateSceneServer orig, InfiniteTowerRun self, SceneDirector sceneDirector)
		{
			if (((object)Run.instance).GetType() == typeof(InfiniteTowerRun) && BepConfig.Enabled.Value)
			{
				sceneDirector.teleporterSpawnCard = null;
				sceneDirector.monsterCredit = 0;
				if (!IsCurrentMapInBazaar())
				{
					sceneDirector.RemoveAllExistingSpawnPoints();
				}
			}
			orig.Invoke(self, sceneDirector);
		}

		private static void AddAndRemoveInteractables(SceneDirector arg1, DirectorCardCategorySelection dccs)
		{
			//IL_005a: 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_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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Expected O, but got Unknown
			//IL_0080: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Expected O, but got Unknown
			//IL_00a7: 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)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: 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_00ce: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: 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_00de: 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_00f5: Expected O, but got Unknown
			if (!(((object)Run.instance).GetType() == typeof(InfiniteTowerRun)) || !BepConfig.Enabled.Value)
			{
				return;
			}
			int num = dccs.FindCategoryIndexByName("Void Stuff");
			if (num != -1)
			{
				dccs.categories[num].selectionWeight *= 3f;
				DirectorCard val = new DirectorCard
				{
					spawnCard = Addressables.LoadAssetAsync<SpawnCard>((object)"5448ccdc4b91bd244a1631d60d24298d").WaitForCompletion(),
					selectionWeight = 1
				};
				DirectorCard val2 = new DirectorCard
				{
					spawnCard = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/DLC1/VoidTriple/iscVoidTriple.asset").WaitForCompletion(),
					selectionWeight = 15
				};
				DirectorCard val3 = new DirectorCard
				{
					spawnCard = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/DLC1/VoidSuppressor/iscVoidSuppressor.asset").WaitForCompletion(),
					selectionWeight = 15
				};
				DirectorCard val4 = new DirectorCard
				{
					spawnCard = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/DLC1/VoidCoinBarrel/iscVoidCoinBarrel.asset").WaitForCompletion(),
					selectionWeight = 6
				};
				dccs.AddCard(num, val4);
				dccs.AddCard(num, val);
				if (BepConfig.PlaceVoidEradicators.Value)
				{
					dccs.AddCard(num, val3);
				}
				dccs.AddCard(num, val2);
			}
			dccs.RemoveCardsThatFailFilter(trimmer);
		}

		public static bool SimulacrumTrimmer(DirectorCard card)
		{
			SpawnCard spawnCard = card.GetSpawnCard();
			GameObject val = (Object.op_Implicit((Object)(object)spawnCard) ? spawnCard.prefab : null);
			if (!Object.op_Implicit((Object)(object)val))
			{
				return true;
			}
			InteractableSpawnCard val2 = (InteractableSpawnCard)(object)((spawnCard is InteractableSpawnCard) ? spawnCard : null);
			if (val2 != null && val2.skipSpawnWhenDevotionArtifactEnabled && !RunArtifactManager.instance.IsArtifactEnabled(Artifacts.Devotion))
			{
				return false;
			}
			if (((Object)val).name == "VoidCamp")
			{
				return false;
			}
			ExpansionRequirementComponent component = val.GetComponent<ExpansionRequirementComponent>();
			if (((Object)spawnCard).name != "iscHollowChest" && (HallowedConceptsInteractables.Contains(((Object)spawnCard).name) || ((Object)(object)component != (Object)null && (Object)(object)component.requiredExpansion != (Object)null && (Object)(object)component.requiredExpansion == (Object)(object)DLC4Content.DLC4)))
			{
				return false;
			}
			return !(Object.op_Implicit((Object)(object)val.GetComponent<ShrineCombatBehavior>()) | Object.op_Implicit((Object)(object)val.GetComponent<HalcyoniteShrineInteractable>()) | Object.op_Implicit((Object)(object)val.GetComponent<OutsideInteractableLocker>()) | Object.op_Implicit((Object)(object)val.GetComponent<ShrineBossBehavior>()) | Object.op_Implicit((Object)(object)val.GetComponent<SeerStationController>()) | Object.op_Implicit((Object)(object)val.GetComponent<PortalStatueBehavior>()));
		}
	}
}