Decompiled source of ConsistentStageFeatures v1.4.0

ConsistentStageFeatures.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using Aetherium.Interactables;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using BulwarksHaunt;
using BulwarksHaunt.Items;
using ExtraChallengeShrines.Interactables;
using FRCSharp;
using HG;
using HarmonyLib;
using IL.RoR2;
using IL.RoR2.CharacterSpeech;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using ProperLoop;
using R2API;
using RoR2;
using RoR2.CharacterSpeech;
using RoR2.EntityLogic;
using RoR2.Navigation;
using Sandswept.Interactables;
using Sandswept.Interactables.Regular;
using ShrineOfRepair;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ConsistentStageFeatures")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+ca11be1746b8107d0dedafd1ce5cdc22ee7c93fc")]
[assembly: AssemblyProduct("ConsistentStageFeatures")]
[assembly: AssemblyTitle("ConsistentStageFeatures")]
[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 ConsistentStageFeatures
{
	[BepInPlugin("prodzpod.ConsistentStageFeatures", "ConsistentStageFeatures", "1.4.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[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
	{
		[HarmonyPatch(typeof(BatteryContainerInteraction), "OnInteractionBegin")]
		public class PatchBatteryInteraction
		{
			public static void Postfix(BatteryContainerInteraction __instance)
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				NetworkServer.Spawn(Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/ChestScanner"), ((Component)__instance).gameObject.transform.position, Quaternion.identity));
			}
		}

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

			public static hook_Awake <>9__75_0;

			public static hook_SetSwitch <>9__75_2;

			public static Action<Stage> <>9__75_3;

			public static Action<Stage> <>9__75_18;

			public static Action <>9__75_19;

			public static Action<Stage> <>9__75_20;

			public static Action<Stage> <>9__75_21;

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

			public static Func<CharacterBody, bool> <>9__75_31;

			public static Func<CharacterBody, bool> <>9__75_32;

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

			public static Func<CharacterBody, bool> <>9__75_35;

			public static Func<CharacterBody, bool> <>9__75_36;

			public static Action<Stage> <>9__75_26;

			public static Func<CharacterBody, bool> <>9__75_37;

			public static hook_BeginEncounter <>9__75_27;

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

			public static Func<uint, uint> <>9__75_39;

			public static Manipulator <>9__75_28;

			public static Action<TeleporterInteraction> <>9__75_13;

			public static Func<GameObject, bool> <>9__75_41;

			public static Action<Stage> <>9__75_14;

			public static Action<SceneDirector> <>9__75_17;

			public static Converter<string, string> <>9__76_0;

			public static Converter<string, string> <>9__76_2;

			public static Converter<string, string> <>9__76_3;

			public static Action<Stage> <>9__77_0;

			public static Action<DamageReport> <>9__77_1;

			public static Action<Stage> <>9__78_0;

			public static Func<ItemIndex, ItemDef> <>9__78_2;

			public static Func<EquipmentIndex, EquipmentDef> <>9__78_4;

			public static Action <>9__79_0;

			public static hook_GrantUnlock <>9__80_0;

			internal void <Awake>b__75_0(orig_Awake orig, SceneObjectToggleGroup self)
			{
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_00df: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
				if (self.toggleGroups.Length != 0)
				{
					GameObjectToggleGroup val = self.toggleGroups[self.toggleGroups.Length - 1];
					if (SceneCatalog.mostRecentSceneDef.cachedName == "frozenwall")
					{
						ref GameObject[] objects = ref val.objects;
						GameObject gameObject = ((Component)GameObject.Find("HOLDER: Preplaced Objects").transform.Find("NewtStatue, Guaranteed")).gameObject;
						ArrayUtils.ArrayAppend<GameObject>(ref objects, ref gameObject);
					}
					if (SceneCatalog.mostRecentSceneDef.cachedName == "blackbeach")
					{
						val.minEnabled = 1;
					}
					if (SceneCatalog.mostRecentSceneDef.cachedName == "goolake")
					{
						val.maxEnabled = AqueductButtonMax.Value;
						val.minEnabled = AqueductButtonMax.Value;
					}
					self.toggleGroups[self.toggleGroups.Length - 1] = val;
				}
				orig.Invoke(self);
			}

			internal void <Awake>b__75_2(orig_SetSwitch orig, PressurePlateController self, bool input)
			{
				if (input)
				{
					orig.Invoke(self, input);
				}
			}

			internal void <Awake>b__75_3(Stage stage)
			{
				if (stage.sceneDef.cachedName == "goolake")
				{
					((Component)GameObject.Find("HOLDER: Secret Ring Area Content").transform.Find("Entrance").Find("GLRuinGate")).GetComponent<Counter>().threshold = AqueductButtonMax.Value;
				}
			}

			internal void <Awake>b__75_18(Stage stage)
			{
				if (stage.sceneDef.cachedName == "slumberingsatellite")
				{
					((Component)GameObject.Find("World").transform.Find("Gated Areas").Find("GateGround0")).gameObject.SetActive(true);
				}
			}

			internal void <Awake>b__75_19()
			{
				//IL_001a: 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_0027: 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_005b: 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_0086: Unknown result type (might be due to invalid IL or missing references)
				//IL_008c: Unknown result type (might be due to invalid IL or missing references)
				SpawnGuaranteed("voidstage", (SpawnCard)(object)ShrineCrown.spawnCard, new Vector3(-222.1664f, 39.7891f, 52.2902f));
				SpawnGuaranteed("voidstage", (SpawnCard)(object)ShrineEye.spawnCard, new Vector3(-228.3628f, 39.7893f, 73.1713f), new Vector3(0f, 302.7731f, 0f));
				SpawnGuaranteed("voidstage", (SpawnCard)(object)ShrineRock.spawnCard, new Vector3(-208.5046f, 40.0891f, 80.1995f));
			}

			internal void <Awake>b__75_20(Stage stage)
			{
				if (stage.sceneDef.cachedName == "slumberingsatellite")
				{
					((Component)GameObject.Find("World").transform.Find("Gated Areas").Find("GateGround4")).gameObject.SetActive(true);
					((Component)GameObject.Find("World").transform.Find("Gated Areas").Find("GateGround5")).gameObject.SetActive(true);
				}
			}

			internal void <Awake>b__75_21(Stage stage)
			{
				if (!(stage.sceneDef.cachedName == "moon2"))
				{
					return;
				}
				foreach (NetworkUser instances in NetworkUser.instancesList)
				{
					if (instances.master.inventory.GetItemCountEffective(Items.BulwarksHaunt_Sword) > 0 || instances.master.inventory.GetItemCountEffective(Items.BulwarksHaunt_SwordUnleashed) > 0)
					{
						((Component)GameObject.Find("HOLDER: Gameplay Space").transform.Find("HOLDER: STATIC MESH").Find("Quadrant 5: Blood Arena").Find("Arena Weapons")
							.Find("mdlBrotherSword (3)")).gameObject.SetActive(false);
					}
				}
			}

			internal bool <Awake>b__75_29(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<BrotherSpeechDriver>(x, "SendReponseFromPool");
			}

			internal bool <Awake>b__75_31(CharacterBody x)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				return x.bodyIndex == BrotherSpeechDriver.hereticBodyIndex;
			}

			internal bool <Awake>b__75_32(CharacterBody x)
			{
				return x.inventory.GetItemCountEffective(Items.BulwarksHaunt_Sword) > 0 || x.inventory.GetItemCountEffective(Items.BulwarksHaunt_SwordUnleashed) > 0;
			}

			internal bool <Awake>b__75_33(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<BrotherSpeechDriver>(x, "SendReponseFromPool");
			}

			internal bool <Awake>b__75_35(CharacterBody x)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				return x.bodyIndex == BrotherSpeechDriver.hereticBodyIndex;
			}

			internal bool <Awake>b__75_36(CharacterBody x)
			{
				return x.inventory.GetItemCountEffective(Items.BulwarksHaunt_Sword) > 0 || x.inventory.GetItemCountEffective(Items.BulwarksHaunt_SwordUnleashed) > 0;
			}

			internal void <Awake>b__75_26(Stage _)
			{
				pissed = false;
			}

			internal void <Awake>b__75_27(orig_BeginEncounter orig, ScriptedCombatEncounter self)
			{
				orig.Invoke(self);
				if (!SceneCatalog.mostRecentSceneDef.cachedName.StartsWith("moon"))
				{
					return;
				}
				bool flag = CharacterBody.readOnlyInstancesList.Any((CharacterBody x) => x.inventory.GetItemCountEffective(Items.BulwarksHaunt_Sword) > 0 || x.inventory.GetItemCountEffective(Items.BulwarksHaunt_SwordUnleashed) > 0);
				pissed |= flag;
				if (!pissed)
				{
					return;
				}
				foreach (CharacterMaster members in self.combatSquad.membersList)
				{
					CharacterBody body = members.GetBody();
					body.baseMaxHealth *= 1f + SwordHealth.Value;
					body.levelMaxHealth *= 1f + SwordHealth.Value;
					body.baseDamage *= 1f + SwordDamage.Value;
					body.levelDamage *= 1f + SwordDamage.Value;
					body.baseMoveSpeed *= 1f + SwordSpeed.Value;
					body.levelMoveSpeed *= 1f + SwordSpeed.Value;
					body.baseArmor *= 1f + SwordArmor.Value;
					body.levelArmor *= 1f + SwordArmor.Value;
					body.baseAttackSpeed *= 1f + SwordAttackSpeed.Value;
					body.levelAttackSpeed *= 1f + SwordAttackSpeed.Value;
				}
			}

			internal bool <Awake>b__75_37(CharacterBody x)
			{
				return x.inventory.GetItemCountEffective(Items.BulwarksHaunt_Sword) > 0 || x.inventory.GetItemCountEffective(Items.BulwarksHaunt_SwordUnleashed) > 0;
			}

			internal void <Awake>b__75_28(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);
				val.GotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<NetworkUser>(x, "AwardLunarCoins")
				});
				val.EmitDelegate<Func<uint, uint>>((Func<uint, uint>)((uint orig) => (uint)(orig + (pissed ? SwordExtraLunar.Value : 0))));
			}

			internal bool <Awake>b__75_38(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<NetworkUser>(x, "AwardLunarCoins");
			}

			internal uint <Awake>b__75_39(uint orig)
			{
				return (uint)(orig + (pissed ? SwordExtraLunar.Value : 0));
			}

			internal void <Awake>b__75_13(TeleporterInteraction tp)
			{
				//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_00a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e0: Expected O, but got Unknown
				//IL_00db: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e5: Expected O, but got Unknown
				<>c__DisplayClass75_2 CS$<>8__locals0 = new <>c__DisplayClass75_2
				{
					isc = LegacyResourcesAPI.Load<SpawnCard>("SpawnCards/InteractableSpawnCard/iscVoidPortal")
				};
				if (StageCheck(10, loop: true) && !(tp.portalSpawners?.ToList()?.First((PortalSpawner x) => (Object)(object)x.portalSpawnCard == (Object)(object)CS$<>8__locals0.isc)?.willSpawn).GetValueOrDefault(true))
				{
					DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(CS$<>8__locals0.isc, new DirectorPlacementRule
					{
						minDistance = 1f,
						maxDistance = 25f,
						placementMode = (PlacementMode)1,
						position = ((Component)tp).transform.position,
						spawnOnTarget = ((Component)tp).transform
					}, Run.instance.stageRng));
				}
			}

			internal void <Awake>b__75_14(Stage stage)
			{
				<>c__DisplayClass75_3 <>c__DisplayClass75_ = new <>c__DisplayClass75_3();
				if (stage.sceneDef.cachedName != "goldshores")
				{
					return;
				}
				GameObject val = GameObject.Find("HOLDER: Preplaced Goodies");
				if ((Object)(object)val == (Object)null)
				{
					return;
				}
				<>c__DisplayClass75_.chests = new List<GameObject>
				{
					((Component)val.transform.Find("Chest1 - 1")).gameObject,
					((Component)val.transform.Find("Chest1 - 2")).gameObject,
					((Component)val.transform.Find("Chest1 - 3")).gameObject,
					((Component)val.transform.Find("Chest1 - 4")).gameObject
				};
				List<GameObject> list = (from x in Object.FindObjectsOfType<GameObject>()
					where ((Object)x).name == "mdlChest1"
					select x).ToList();
				for (int num = 4; num > GoldenCoastChests.Value; num--)
				{
					<>c__DisplayClass75_4 CS$<>8__locals0 = new <>c__DisplayClass75_4();
					CS$<>8__locals0.CS$<>8__locals1 = <>c__DisplayClass75_;
					CS$<>8__locals0.toRemove = Run.instance.runRNG.RangeInt(0, CS$<>8__locals0.CS$<>8__locals1.chests.Count);
					CS$<>8__locals0.CS$<>8__locals1.chests[CS$<>8__locals0.toRemove].SetActive(false);
					GameObject? obj = list.Find(delegate(GameObject x)
					{
						//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_0029: Unknown result type (might be due to invalid IL or missing references)
						Vector3 position = x.transform.position;
						return ((Vector3)(ref position)).Equals(CS$<>8__locals0.CS$<>8__locals1.chests[CS$<>8__locals0.toRemove].transform.position);
					});
					if (obj != null)
					{
						obj.SetActive(false);
					}
					CS$<>8__locals0.CS$<>8__locals1.chests.RemoveAt(CS$<>8__locals0.toRemove);
				}
			}

			internal bool <Awake>b__75_41(GameObject x)
			{
				return ((Object)x).name == "mdlChest1";
			}

			internal void <Awake>b__75_17(SceneDirector dir)
			{
				if (SceneCatalog.mostRecentSceneDef.cachedName == "arena")
				{
					dir.interactableCredit = 0;
				}
			}

			internal string <PatchStageChances>b__76_0(string x)
			{
				return x.Trim();
			}

			internal string <PatchStageChances>b__76_2(string x)
			{
				return x.Trim();
			}

			internal string <PatchStageChances>b__76_3(string x)
			{
				return x.Trim();
			}

			internal void <HackSkeletonForceSpawn>b__77_0(Stage stage)
			{
				GameObject obj = GameObject.Find("HOLDER: Hidden Altar Stuff");
				object obj2;
				if (obj == null)
				{
					obj2 = null;
				}
				else
				{
					Transform transform = obj.transform;
					if (transform == null)
					{
						obj2 = null;
					}
					else
					{
						Transform obj3 = transform.Find("AltarCenter");
						if (obj3 == null)
						{
							obj2 = null;
						}
						else
						{
							Transform obj4 = obj3.Find("AltarSkeletonBody");
							obj2 = ((obj4 != null) ? ((Component)obj4).gameObject : null);
						}
					}
				}
				GameObject val = (GameObject)obj2;
				if ((Object)(object)val != (Object)null)
				{
					GameObjectUnlockableFilter component = val.GetComponent<GameObjectUnlockableFilter>();
					component.forbiddenUnlockableDef = null;
					component.Networkactive = true;
					component.active = true;
					val.SetActive(true);
					Log.LogDebug((object)"*Bad to the Bone Riff*");
				}
			}

			internal void <HackSkeletonForceSpawn>b__77_1(DamageReport report)
			{
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: 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_0056: 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)
				object obj;
				if (report == null)
				{
					obj = null;
				}
				else
				{
					CharacterBody victimBody = report.victimBody;
					obj = ((victimBody != null) ? ((Object)victimBody).name : null);
				}
				if ((string?)obj == "AltarSkeletonBody")
				{
					UniquePickup val = default(UniquePickup);
					val.pickupIndex = Run.instance.treasureRng.NextElementUniform<PickupIndex>(Run.instance.availableVoidTier2DropList);
					PickupDropletController.CreatePickupDroplet(val, report.victimBody.corePosition, new Vector3(-15f, 13f, -20f), false);
				}
			}

			internal void <HandleHank>b__78_0(Stage _)
			{
				hanked = false;
			}

			internal ItemDef <HandleHank>b__78_2(ItemIndex x)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				return ItemCatalog.GetItemDef(x);
			}

			internal EquipmentDef <HandleHank>b__78_4(EquipmentIndex x)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				return EquipmentCatalog.GetEquipmentDef(x);
			}

			internal void <HandleShrineOfRepair>b__79_0()
			{
				InteractableSpawnCard normalShrineSpawnCard = ShrineOfRepairStuff.normalShrineSpawnCard;
				if (ShrineRepairOnStage5.Value)
				{
					SpawnRandomly(5, (SpawnCard)(object)normalShrineSpawnCard, loop: true);
				}
				if (RemoveRandomShrineRepair.Value)
				{
					normalShrineSpawnCard.maxSpawnsPerStage = 0;
				}
			}

			internal void <FHRadarScannerPatch>b__80_0(orig_GrantUnlock orig, RadiotowerTerminal self, Interactor interactor)
			{
				//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)
				orig.Invoke(self, interactor);
				if (SceneCatalog.mostRecentSceneDef.cachedName == "forgottenhaven")
				{
					NetworkServer.Spawn(Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/ChestScanner"), ((Component)self).gameObject.transform.position, Quaternion.identity));
				}
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass75_2
		{
			public SpawnCard isc;

			internal bool <Awake>b__40(PortalSpawner x)
			{
				return (Object)(object)x.portalSpawnCard == (Object)(object)isc;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass75_3
		{
			public List<GameObject> chests;
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass75_4
		{
			public int toRemove;

			public <>c__DisplayClass75_3 CS$<>8__locals1;

			internal bool <Awake>b__42(GameObject x)
			{
				//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_0029: Unknown result type (might be due to invalid IL or missing references)
				Vector3 position = x.transform.position;
				return ((Vector3)(ref position)).Equals(CS$<>8__locals1.chests[toRemove].transform.position);
			}
		}

		public const string PluginGUID = "prodzpod.ConsistentStageFeatures";

		public const string PluginAuthor = "prodzpod";

		public const string PluginName = "ConsistentStageFeatures";

		public const string PluginVersion = "1.4.0";

		public const string softdepAetherium = "com.KomradeSpectre.Aetherium";

		public const string softdepBulwarksHaunt = "com.themysticsword.bulwarkshaunt";

		public const string softdepFogboundLagoon = "JaceDaDorito.FBLStage";

		public const string softdepForgottenRelics = "PlasmaCore.ForgottenRelics";

		public const string softdepShrineOfRepair = "com.Viliger.ShrineOfRepair";

		public const string softdepProperLoop = "prodzpod.ProperLoop";

		public const string softdepSandswept = "com.TeamSandswept.Sandswept";

		public static ManualLogSource Log;

		public static Harmony Harmony;

		public static PluginInfo pluginInfo;

		public static ConfigFile Config;

		public static ConfigEntry<string> TimescaleOverwrite;

		public static ConfigEntry<string> StageChances;

		public static ConfigEntry<int> MaxVoidSeeds;

		public static ConfigEntry<bool> GuaranteedNewt;

		public static ConfigEntry<bool> BuffBrazierOnStage1;

		public static ConfigEntry<int> BuffBrazierCost;

		public static ConfigEntry<bool> RemoveRandomBuffBrazier;

		public static ConfigEntry<bool> RedPrinterOnSiphoned;

		public static ConfigEntry<bool> GreenPrinterOnPlains;

		public static ConfigEntry<bool> YellowPrinterOnRoost;

		public static ConfigEntry<bool> WhitePrintersOnFalls;

		public static ConfigEntry<bool> DroneAssemblyOnAbodes;

		public static ConfigEntry<bool> LunarBudOnStage2;

		public static ConfigEntry<bool> RemoveRandomLunarBud;

		public static ConfigEntry<bool> AqueductButtonNoRelease;

		public static ConfigEntry<int> AqueductButtonMax;

		public static ConfigEntry<bool> NKuhanaVoidGreen;

		public static ConfigEntry<bool> ShrineSacOnNest;

		public static ConfigEntry<bool> ShrineFutureOnAltar;

		public static ConfigEntry<bool> GoldShrineOnStage3;

		public static ConfigEntry<bool> DronesInRallypoint;

		public static ConfigEntry<bool> SpecialChestOnPools;

		public static ConfigEntry<bool> TempDispenserOnColony;

		public static ConfigEntry<bool> ShrineRuinOnAlluvium;

		public static ConfigEntry<bool> HankOffersDrink;

		public static ConfigEntry<bool> SpicyHank;

		public static ConfigEntry<bool> IllegalHank;

		public static ConfigEntry<bool> REXOnStage4;

		public static ConfigEntry<bool> DroneCombinerOnCrater;

		public static ConfigEntry<bool> ShrineRepairOnStage5;

		public static ConfigEntry<bool> ScrapperOnStage5;

		public static ConfigEntry<bool> RemoveRandomShrineRepair;

		public static ConfigEntry<bool> SageShrineOnMeadow;

		public static ConfigEntry<bool> SageShrineOnSatellite;

		public static ConfigEntry<bool> RemoveRandomSageShrine;

		public static ConfigEntry<bool> ChallengeShrineInReef;

		public static ConfigEntry<bool> BulwarkSwordOnSatellite;

		public static ConfigEntry<bool> BulwarkSwordOnReef;

		public static ConfigEntry<bool> ScrapperOnMoon;

		public static ConfigEntry<bool> RemoveRandomScrapper;

		public static ConfigEntry<bool> ObeliskOnMoon1;

		public static ConfigEntry<int> SwordExtraLunar;

		public static ConfigEntry<float> SwordHealth;

		public static ConfigEntry<float> SwordDamage;

		public static ConfigEntry<float> SwordSpeed;

		public static ConfigEntry<float> SwordArmor;

		public static ConfigEntry<float> SwordAttackSpeed;

		public static ConfigEntry<bool> FHTeleporterOnStage6;

		public static ConfigEntry<bool> RemoveRandomFHTeleporter;

		public static ConfigEntry<bool> VieldsOnStage7;

		public static ConfigEntry<bool> LocusOnStage10;

		public static ConfigEntry<int> GoldShrineCost;

		public static ConfigEntry<int> GoldenCoastChests;

		public static ConfigEntry<bool> GoldenCoastCombatShrine;

		public static ConfigEntry<bool> FHRadarScannerEffect;

		public static ConfigEntry<bool> HauntedWoodShrine;

		public static ConfigEntry<bool> VieldsNoLoot;

		public static bool hanked;

		public static bool pissed;

		private ConfigEntry<bool> MountainShrinesInSirens;

		public void Awake()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			//IL_0795: Unknown result type (might be due to invalid IL or missing references)
			//IL_079a: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07de: Expected O, but got Unknown
			//IL_082d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0841: Unknown result type (might be due to invalid IL or missing references)
			//IL_0876: Unknown result type (might be due to invalid IL or missing references)
			//IL_088a: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_090c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0930: Unknown result type (might be due to invalid IL or missing references)
			//IL_0944: Unknown result type (might be due to invalid IL or missing references)
			//IL_097d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0991: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a01: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a25: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a39: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a5d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a95: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ace: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b07: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b28: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b75: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b7c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b82: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0baa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bde: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c18: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c1f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c25: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c72: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c77: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c7d: Expected O, but got Unknown
			//IL_0d68: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d6d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d8d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0da1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dc2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dd6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e52: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e76: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e8a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ec2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ee7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f0c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f20: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f41: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f55: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f76: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f8a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fab: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fbf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fe0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ff4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1015: Unknown result type (might be due to invalid IL or missing references)
			//IL_1029: Unknown result type (might be due to invalid IL or missing references)
			//IL_1087: Unknown result type (might be due to invalid IL or missing references)
			//IL_109b: Unknown result type (might be due to invalid IL or missing references)
			//IL_10bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_10d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_1107: Unknown result type (might be due to invalid IL or missing references)
			//IL_111b: Unknown result type (might be due to invalid IL or missing references)
			//IL_113f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1153: Unknown result type (might be due to invalid IL or missing references)
			//IL_1178: Unknown result type (might be due to invalid IL or missing references)
			//IL_117d: Unknown result type (might be due to invalid IL or missing references)
			//IL_119d: Unknown result type (might be due to invalid IL or missing references)
			//IL_11b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_11d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_11e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_1310: Unknown result type (might be due to invalid IL or missing references)
			//IL_1324: Unknown result type (might be due to invalid IL or missing references)
			//IL_1348: Unknown result type (might be due to invalid IL or missing references)
			//IL_135c: Unknown result type (might be due to invalid IL or missing references)
			//IL_13e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_13e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_13f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_13fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_140d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1412: Unknown result type (might be due to invalid IL or missing references)
			//IL_1423: Unknown result type (might be due to invalid IL or missing references)
			//IL_1428: Unknown result type (might be due to invalid IL or missing references)
			//IL_1439: Unknown result type (might be due to invalid IL or missing references)
			//IL_143e: Unknown result type (might be due to invalid IL or missing references)
			//IL_145c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1461: Unknown result type (might be due to invalid IL or missing references)
			//IL_1472: Unknown result type (might be due to invalid IL or missing references)
			//IL_1477: Unknown result type (might be due to invalid IL or missing references)
			//IL_1488: Unknown result type (might be due to invalid IL or missing references)
			//IL_148d: Unknown result type (might be due to invalid IL or missing references)
			//IL_14ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_14b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_14c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_14c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_14d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_14dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_14ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_14f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_1503: Unknown result type (might be due to invalid IL or missing references)
			//IL_1508: Unknown result type (might be due to invalid IL or missing references)
			//IL_1526: Unknown result type (might be due to invalid IL or missing references)
			//IL_152b: Unknown result type (might be due to invalid IL or missing references)
			//IL_153c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1541: Unknown result type (might be due to invalid IL or missing references)
			//IL_1552: Unknown result type (might be due to invalid IL or missing references)
			//IL_1557: Unknown result type (might be due to invalid IL or missing references)
			//IL_1568: Unknown result type (might be due to invalid IL or missing references)
			//IL_156d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1581: Unknown result type (might be due to invalid IL or missing references)
			//IL_158b: Expected O, but got Unknown
			//IL_1594: Unknown result type (might be due to invalid IL or missing references)
			//IL_159e: Expected O, but got Unknown
			//IL_16a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_16ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_16ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_16c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_15d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_15dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_15e3: Expected O, but got Unknown
			//IL_15fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_1602: Unknown result type (might be due to invalid IL or missing references)
			//IL_1608: Expected O, but got Unknown
			//IL_17f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_180b: Unknown result type (might be due to invalid IL or missing references)
			//IL_182f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1843: Unknown result type (might be due to invalid IL or missing references)
			//IL_1867: Unknown result type (might be due to invalid IL or missing references)
			//IL_187b: Unknown result type (might be due to invalid IL or missing references)
			//IL_189f: Unknown result type (might be due to invalid IL or missing references)
			//IL_18a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_18ac: Unknown result type (might be due to invalid IL or missing references)
			pluginInfo = ((BaseUnityPlugin)this).Info;
			Harmony = new Harmony("prodzpod.ConsistentStageFeatures");
			Log = ((BaseUnityPlugin)this).Logger;
			Config = new ConfigFile(Path.Combine(Paths.ConfigPath, "prodzpod.ConsistentStageFeatures.cfg"), true);
			TimescaleOverwrite = Config.Bind<string>("General", "Timescale Unlocks", "forgottenhaven", "List of scenes and run time, separated by commas. By default, disables time stop for FH.");
			StageChances = Config.Bind<string>("General", "Stage Chances", "skymeadow - 3", "List of scenes and chance weight, separated by commas. by default makes sky meadow 3 times as likely so artifact grinding isnt godawful");
			MaxVoidSeeds = Config.Bind<int>("General", "Max Void Seeds", 1, "Number of Void Seeds that can be spawned at a single stage. Default is 3.");
			GuaranteedNewt = Config.Bind<bool>("General", "Guaranteed Newt Altar", true, "Guarantees 1 Newt shrine every stage.");
			BuffBrazierOnStage1 = Config.Bind<bool>("Stage 1", "Buff Brazier on Stage 1", true, "Guaranteed Buff Brazier on stage 1.");
			BuffBrazierCost = Config.Bind<int>("Stage 1", "Buff Brazier Cost", 50, "Buff brazier cost, scales with time.");
			RemoveRandomBuffBrazier = Config.Bind<bool>("Stage 1", "Remove Random Buff Brazier Spawns", true, "only the fixed spawn exists");
			RedPrinterOnSiphoned = Config.Bind<bool>("Stage 1", "Red Printer on Siphoned Forest", false, "make sure to balance printer before this");
			GreenPrinterOnPlains = Config.Bind<bool>("Stage 1", "Green Printer on Golem Plains", false, "make sure to balance printer before this");
			YellowPrinterOnRoost = Config.Bind<bool>("Stage 1", "Yellow Printer on Distant Roost", false, "make sure to balance printer before this");
			WhitePrintersOnFalls = Config.Bind<bool>("Stage 1", "3 White Printers on Viscous Falls", false, "make sure to balance printer before this");
			DroneAssemblyOnAbodes = Config.Bind<bool>("Stage 1", "Drone Assembly Station on Shattered Abodes", false, "epic unused content");
			LunarBudOnStage2 = Config.Bind<bool>("Stage 2", "Lunar bud on Stage 2", true, "Guaranteed Lunar bud on stage 2.");
			RemoveRandomLunarBud = Config.Bind<bool>("Stage 2", "Remove Random Lunar Bud Spawns", false, "only the fixed spawn exists");
			AqueductButtonNoRelease = Config.Bind<bool>("Stage 2", "Abandoned Aqueduct Pressure Plate Stays Pressed", false, "set to true when you're using difficulty mods, for solo players");
			AqueductButtonMax = Config.Bind<int>("Stage 2", "Abandoned Aqueduct Pressure Plate Max Buttons", 2, "max: 8");
			NKuhanaVoidGreen = Config.Bind<bool>("Stage 2", "N`kuhana Skeleton Drops Void Green", true, "i think you deserve it for going through Wetland Aspect");
			ShrineSacOnNest = Config.Bind<bool>("Stage 2", "3 Shrine of Sacrifices on Pretender`s Precipice", true, "its on the spikes");
			ShrineFutureOnAltar = Config.Bind<bool>("Stage 2", "Shrine of Future on Reformed Altar", true, "i made it and i still dk about the blue diamond");
			GoldShrineOnStage3 = Config.Bind<bool>("Stage 3", "Altar of Gold on Stage 3", true, "Guaranteed Altar of Gold on stage 3.");
			SpecialChestOnPools = Config.Bind<bool>("Stage 3", "Special Chests on Sulfur Pools", true, "Spawns 3 Cloaked Chests and 3 Lockboxes (1 of which will be encrusted if player has void, encrusted nerf kinda)");
			DronesInRallypoint = Config.Bind<bool>("Stage 3", "2 Bombardment Drones on Rallypoint Delta", true, "RIP betterdrones they never found it");
			TempDispenserOnColony = Config.Bind<bool>("Stage 3", "3 Temporary Item Dispenser on Treeborn Colony", true, "Spawns 3 Temporary Item Dispensers");
			ShrineRuinOnAlluvium = Config.Bind<bool>("Stage 3", "Shrine of Ruin on Iron Alluvium", true, "sand");
			HankOffersDrink = Config.Bind<bool>("Stage 3", "Hank Offers Drink", true, "Talking to Hank will result in a random drink.");
			SpicyHank = Config.Bind<bool>("Stage 3", "GALSONE", false, "Hank offers GALSONE (per multiple requests)");
			IllegalHank = Config.Bind<bool>("Stage 3", "Hank doesnt care for laws", false, "Hank will bypass ContentDisabler and the likes");
			REXOnStage4 = Config.Bind<bool>("Stage 4", "REX on Stage 4", true, "Guaranteed Fuel Array usage");
			MountainShrinesInSirens = Config.Bind<bool>("Stage 4", "Mountain Shrines on Siren`s Call", true, "lol");
			DroneCombinerOnCrater = Config.Bind<bool>("Stage 4", "Drone Combiner Station on Repurposed Crater", true, "g");
			ShrineRepairOnStage5 = Config.Bind<bool>("Stage 5", "Shrine of Repair on Stage 5", true, "Guaranteed Shrine of Repair on stage 5.");
			ScrapperOnStage5 = Config.Bind<bool>("Stage 5", "Scrapper on Stage 5", false, "Guaranteed Scrapper on stage 5.");
			RemoveRandomShrineRepair = Config.Bind<bool>("Stage 5", "Remove Random Shrine of Repair Spawns", false, "only the fixed spawn exists");
			SageShrineOnMeadow = Config.Bind<bool>("Stage 5", "Sage`s Shrine on Sky Meadow", false, "shmrez is weird fr fr");
			SageShrineOnSatellite = Config.Bind<bool>("Stage 5", "Sage`s Shrine on Slumbering Satellite", true, "makes it fixed");
			RemoveRandomSageShrine = Config.Bind<bool>("Stage 5", "Remove Random Sage`s Shrine Spawns", true, "only the fixed spawn exists");
			ChallengeShrineInReef = Config.Bind<bool>("Stage 5", "Extra Challenge Shrines on Sunken Tombs", true, "plugging myself is so easy");
			BulwarkSwordOnSatellite = Config.Bind<bool>("Stage 5", "Bulwark Sword on Slumbering Satellite", true, "haunted is no longer rng");
			BulwarkSwordOnReef = Config.Bind<bool>("Stage 5", "Bulwark Sword on Desolate Sunken Tombs", true, "haunted is no still rng actually because there is a broken sword in helminth");
			ScrapperOnMoon = Config.Bind<bool>("Commencement", "Scrapper on Moon", false, "Scrapper on the Moon. Use it if you have scrappers rebalanced.");
			RemoveRandomScrapper = Config.Bind<bool>("Commencement", "Remove Random Scrapper Spawns", false, "only the fixed spawn exists");
			SwordExtraLunar = Config.Bind<int>("Commencement", "Extra Lunar Coin with Crystalline Blade", 10, "Extra lunar coin reward for winning with the Crystalline Blade.");
			SwordHealth = Config.Bind<float>("Commencement", "Mithrix Health Multiplier with Crystalline Blade", 0f, "Stat buffs for Mithrix with Crystalline Blade. Multiplicative.");
			SwordDamage = Config.Bind<float>("Commencement", "Mithrix Damage Multiplier with Crystalline Blade", 0f, "Stat buffs for Mithrix with Crystalline Blade. Multiplicative.");
			SwordSpeed = Config.Bind<float>("Commencement", "Mithrix Speed Bonus with Crystalline Blade", 0.2f, "Stat buffs for Mithrix with Crystalline Blade. Multiplicative.");
			SwordArmor = Config.Bind<float>("Commencement", "Mithrix Armor Bonus with Crystalline Blade", 0f, "Stat buffs for Mithrix with Crystalline Blade. Multiplicative.");
			SwordAttackSpeed = Config.Bind<float>("Commencement", "Mithrix Attack Speed Multiplier with Crystalline Blade", 0.2f, "Stat buffs for Mithrix with Crystalline Blade. Multiplicative.");
			FHTeleporterOnStage6 = Config.Bind<bool>("Looping", "Shattered Teleporter on Stage 6", true, "Guaranteed Shattered Teleporters on stage 6.");
			RemoveRandomFHTeleporter = Config.Bind<bool>("Looping", "Remove Random Shattered Teleporter Spawns", false, "only the fixed spawn exists");
			VieldsOnStage7 = Config.Bind<bool>("Looping", "Null Portal on Stage 7", false, "Guaranteed Null Portal on stage 7.");
			LocusOnStage10 = Config.Bind<bool>("Looping", "Void Portal on Stage 10", true, "Guaranteed Void Portal on stage 10.");
			GoldShrineCost = Config.Bind<int>("Hidden Realm", "Altar of Gold Cost", 100, "Scales with time, vanilla is 200 (8 chests)");
			GoldenCoastChests = Config.Bind<int>("Hidden Realm", "Altar of Gold Chests", 2, "Max: 4");
			GoldenCoastCombatShrine = Config.Bind<bool>("Hidden Realm", "Guaranteed Combat Shrines in Golden Coast", true, "money printer");
			FHRadarScannerEffect = Config.Bind<bool>("Hidden Realm", "Forgotten Haven Log and Cell Radar Scanner effect", true, "The purchasable logbook entry & putting in cells in the central portal triggers a Radar Scanner effect around it.");
			HauntedWoodShrine = Config.Bind<bool>("Hidden Realm", "Shrine of the Woods on Bulwark`s Haunt", true, "No regen?");
			VieldsNoLoot = Config.Bind<bool>("Hidden Realm", "Void Fields No Chests", true, "It already gives 9 items including a red bruh");
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(PatchStageChances));
			if (MaxVoidSeeds.Value != 3)
			{
				Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC1/VoidCamp/iscVoidCamp.asset").WaitForCompletion().maxSpawnsPerStage = MaxVoidSeeds.Value;
			}
			if (GuaranteedNewt.Value)
			{
				object obj = <>c.<>9__75_0;
				if (obj == null)
				{
					hook_Awake val = delegate(orig_Awake orig, SceneObjectToggleGroup self)
					{
						//IL_0023: Unknown result type (might be due to invalid IL or missing references)
						//IL_0028: Unknown result type (might be due to invalid IL or missing references)
						//IL_00df: Unknown result type (might be due to invalid IL or missing references)
						//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
						if (self.toggleGroups.Length != 0)
						{
							GameObjectToggleGroup val9 = self.toggleGroups[self.toggleGroups.Length - 1];
							if (SceneCatalog.mostRecentSceneDef.cachedName == "frozenwall")
							{
								ref GameObject[] objects = ref val9.objects;
								GameObject gameObject = ((Component)GameObject.Find("HOLDER: Preplaced Objects").transform.Find("NewtStatue, Guaranteed")).gameObject;
								ArrayUtils.ArrayAppend<GameObject>(ref objects, ref gameObject);
							}
							if (SceneCatalog.mostRecentSceneDef.cachedName == "blackbeach")
							{
								val9.minEnabled = 1;
							}
							if (SceneCatalog.mostRecentSceneDef.cachedName == "goolake")
							{
								val9.maxEnabled = AqueductButtonMax.Value;
								val9.minEnabled = AqueductButtonMax.Value;
							}
							self.toggleGroups[self.toggleGroups.Length - 1] = val9;
						}
						orig.Invoke(self);
					};
					<>c.<>9__75_0 = val;
					obj = (object)val;
				}
				SceneObjectToggleGroup.Awake += (hook_Awake)obj;
			}
			if (Mods("com.KomradeSpectre.Aetherium"))
			{
				checkBuffBrazier();
			}
			if (RedPrinterOnSiphoned.Value)
			{
				SpawnGuaranteed("snowyforest", "SpawnCards/InteractableSpawnCard/iscDuplicatorMilitary", new Vector3(-65.7508f, 80.6369f, -186.9797f), new Vector3(5.6833f, 33.3465f, 2.9875f));
			}
			if (GreenPrinterOnPlains.Value)
			{
				SpawnGuaranteed("golemplains", "SpawnCards/InteractableSpawnCard/iscDuplicatorLarge", new Vector3(-196.3943f, -138.4122f, 39.6045f), new Vector3(17.3021f, 93.9709f, 347.3439f));
				SpawnGuaranteed("golemplains2", "SpawnCards/InteractableSpawnCard/iscDuplicatorLarge", new Vector3(-217.0215f, 40.3993f, -29.7606f), new Vector3(25.4828f, 230.3522f, 347.7884f));
			}
			if (YellowPrinterOnRoost.Value)
			{
				SpawnGuaranteed("blackbeach", "SpawnCards/InteractableSpawnCard/iscDuplicatorWild", new Vector3(203.9892f, -122.2774f, -105.9803f), new Vector3(45.3964f, 71.6722f, 7.0832f));
				SpawnGuaranteed("blackbeach2", "SpawnCards/InteractableSpawnCard/iscDuplicatorWild", new Vector3(-137.3705f, 46.7941f, -97.3107f), new Vector3(15.839f, 115.0119f, 10.6805f));
			}
			if (WhitePrintersOnFalls.Value)
			{
				SpawnGuaranteed("lakes", "SpawnCards/InteractableSpawnCard/iscDuplicator", new Vector3(167.37f, 77.05f, -18.47f), new Vector3(5f, 225f, 358f));
				SpawnGuaranteed("lakes", "SpawnCards/InteractableSpawnCard/iscDuplicator", new Vector3(170.36f, 77.13f, -10.62f), new Vector3(32f, 225f, 342f));
				SpawnGuaranteed("lakes", "SpawnCards/InteractableSpawnCard/iscDuplicator", new Vector3(171.95f, 80.05f, -12.75f), new Vector3(35f, 223f, 342f));
				SpawnGuaranteed("lakesnight", "SpawnCards/InteractableSpawnCard/iscDuplicator", new Vector3(167.37f, 77.05f, -18.47f), new Vector3(5f, 225f, 358f));
				SpawnGuaranteed("lakesnight", "SpawnCards/InteractableSpawnCard/iscDuplicator", new Vector3(170.36f, 77.13f, -10.62f), new Vector3(32f, 225f, 342f));
				SpawnGuaranteed("lakesnight", "SpawnCards/InteractableSpawnCard/iscDuplicator", new Vector3(171.95f, 80.05f, -12.75f), new Vector3(35f, 223f, 342f));
			}
			if (DroneAssemblyOnAbodes.Value)
			{
				InteractableSpawnCard spawnCard = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC3/DroneAssemblyStation/iscDroneAssemblyStation.asset").WaitForCompletion();
				SpawnGuaranteed("village", (SpawnCard)(object)spawnCard, new Vector3(146.78f, 40.98f, 119.38f), new Vector3(0f, 90f, 0f));
				SpawnGuaranteed("villagenight", (SpawnCard)(object)spawnCard, new Vector3(146.78f, 40.98f, 119.38f), new Vector3(0f, 90f, 0f));
			}
			if (LunarBudOnStage2.Value)
			{
				SpawnGuaranteed("goolake", "SpawnCards/InteractableSpawnCard/iscLunarChest", new Vector3(285.1561f, -62.09442f, -193.2947f));
				SpawnGuaranteed("ancientloft", "SpawnCards/InteractableSpawnCard/iscLunarChest", new Vector3(-70.1913f, 80.87519f, 221.0971f));
				SpawnGuaranteed("foggyswamp", "SpawnCards/InteractableSpawnCard/iscLunarChest", new Vector3(-121.8996f, -126.0044f, -235.4447f));
				if (Mods("PlasmaCore.ForgottenRelics"))
				{
					SpawnGuaranteed("drybasin", "SpawnCards/InteractableSpawnCard/iscLunarChest", new Vector3(-228.2513f, 75.6862f, -86.5036f));
				}
			}
			if (RemoveRandomLunarBud.Value)
			{
				LegacyResourcesAPI.Load<InteractableSpawnCard>("SpawnCards/InteractableSpawnCard/iscLunarChest").maxSpawnsPerStage = 0;
			}
			if (AqueductButtonNoRelease.Value)
			{
				object obj2 = <>c.<>9__75_2;
				if (obj2 == null)
				{
					hook_SetSwitch val2 = delegate(orig_SetSwitch orig, PressurePlateController self, bool input)
					{
						if (input)
						{
							orig.Invoke(self, input);
						}
					};
					<>c.<>9__75_2 = val2;
					obj2 = (object)val2;
				}
				PressurePlateController.SetSwitch += (hook_SetSwitch)obj2;
			}
			if (AqueductButtonMax.Value != 2)
			{
				Stage.onStageStartGlobal += delegate(Stage stage)
				{
					if (stage.sceneDef.cachedName == "goolake")
					{
						((Component)GameObject.Find("HOLDER: Secret Ring Area Content").transform.Find("Entrance").Find("GLRuinGate")).GetComponent<Counter>().threshold = AqueductButtonMax.Value;
					}
				};
			}
			if (NKuhanaVoidGreen.Value)
			{
				HackSkeletonForceSpawn();
			}
			if (ShrineSacOnNest.Value && Mods("com.TeamSandswept.Sandswept"))
			{
				sandsweep();
			}
			if (ShrineFutureOnAltar.Value && Mods("com.TeamSandswept.Sandswept"))
			{
				sandsweep2();
			}
			if (GoldShrineOnStage3.Value)
			{
				SpawnRandomly(3, "SpawnCards/InteractableSpawnCard/iscShrineGoldshoresAccess", loop: true);
			}
			if (DronesInRallypoint.Value)
			{
				InteractableSpawnCard spawnCard2 = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC3/Drones/iscBrokenBombardmentDrone.asset").WaitForCompletion();
				SpawnGuaranteed("frozenwall", (SpawnCard)(object)spawnCard2, new Vector3(55.2139f, 110.3825f, 81.2108f), new Vector3(25.6394f, 358.1392f, 19.5398f));
				SpawnGuaranteed("frozenwall", (SpawnCard)(object)spawnCard2, new Vector3(60.8511f, 111.615f, 79.4217f), new Vector3(53.5153f, 198.3919f, 329.8275f));
			}
			if (ShrineRuinOnAlluvium.Value && Mods("com.TeamSandswept.Sandswept"))
			{
				sandsweep3();
			}
			if (SpecialChestOnPools.Value)
			{
				SpawnGuaranteed("sulfurpools", "SpawnCards/InteractableSpawnCard/iscChest1Stealthed", new Vector3(-0.1489f, -11.2628f, -58.985f), new Vector3(332.4133f, 147.7081f, 333.2504f));
				SpawnGuaranteed("sulfurpools", "SpawnCards/InteractableSpawnCard/iscLockbox", new Vector3(22.7433f, -5.3875f, -236.629f), new Vector3(20.4497f, 16.1306f, 5.5421f));
				SpawnGuaranteed("sulfurpools", "SpawnCards/InteractableSpawnCard/iscLockbox", new Vector3(-160.0294f, 7.244f, 122.3465f), new Vector3(27.0561f, 87.8281f, 352.8062f));
			}
			if (TempDispenserOnColony.Value)
			{
				InteractableSpawnCard spawnCard3 = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC3/TemporaryItemsDistributor/iscTemporaryItemsShop.asset").WaitForCompletion();
				SpawnGuaranteed("habitat", (SpawnCard)(object)spawnCard3, new Vector3(14.2481f, 25.6211f, -176.5436f), new Vector3(0f, 0f, 0f));
				SpawnGuaranteed("habitat", (SpawnCard)(object)spawnCard3, new Vector3(-15.8177f, 25.6102f, -167.1288f), new Vector3(0f, 40f, 0f));
				SpawnGuaranteed("habitat", (SpawnCard)(object)spawnCard3, new Vector3(-30.0604f, 25.6226f, -136.5387f), new Vector3(0f, 80f, 0f));
				SpawnGuaranteed("habitatfall", (SpawnCard)(object)spawnCard3, new Vector3(14.2481f, 25.6211f, -176.5436f), new Vector3(0f, 0f, 0f));
				SpawnGuaranteed("habitatfall", (SpawnCard)(object)spawnCard3, new Vector3(-15.8177f, 25.6102f, -167.1288f), new Vector3(0f, 40f, 0f));
				SpawnGuaranteed("habitatfall", (SpawnCard)(object)spawnCard3, new Vector3(-30.0604f, 25.6226f, -136.5387f), new Vector3(0f, 80f, 0f));
			}
			if (Mods("JaceDaDorito.FBLStage"))
			{
				HandleHank();
			}
			if (REXOnStage4.Value)
			{
				GameObject obj3 = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/TreebotUnlockInteractable");
				SpawnGuaranteed("rootjungle", obj3, new Vector3(-134.6807f, 76.389f, -240.2231f), new Vector3(19.8134f, 35.7062f, 2.9408f));
				SpawnGuaranteed("shipgraveyard", obj3, new Vector3(188.8096f, 95.1875f, -93.8135f), new Vector3(349.2507f, 204.2245f, 8.077f));
			}
			if (MountainShrinesInSirens.Value)
			{
				SpawnGuaranteed("shipgraveyard", "SpawnCards/InteractableSpawnCard/iscShrineBoss", new Vector3(-112.4888f, -28.4255f, -24.0116f), new Vector3(4.9546f, 195.4476f, 5.7509f));
				SpawnGuaranteed("shipgraveyard", "SpawnCards/InteractableSpawnCard/iscShrineBoss", new Vector3(-90.4575f, -30.8145f, -52.1998f), new Vector3(353.2658f, 286.8359f, 352.891f));
			}
			if (DroneCombinerOnCrater.Value)
			{
				InteractableSpawnCard spawnCard4 = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC3/DroneCombinerStation/iscDroneCombinerStation.asset").WaitForCompletion();
				SpawnGuaranteed("repurposedcrater", (SpawnCard)(object)spawnCard4, new Vector3(-250.5519f, 121.0383f, 12.8023f), new Vector3(0f, 340.961f, 0f));
				SpawnGuaranteed("repurposedcrater", (SpawnCard)(object)spawnCard4, new Vector3(-242.3186f, 121.0383f, 57.3302f), new Vector3(0f, 253.0387f, 0f));
			}
			if (Mods("com.Viliger.ShrineOfRepair"))
			{
				HandleShrineOfRepair();
			}
			if (ScrapperOnStage5.Value)
			{
				SpawnRandomly(5, "SpawnCards/InteractableSpawnCard/iscScrapper", loop: true);
			}
			if (Mods("PlasmaCore.ForgottenRelics"))
			{
				checkSageShrine();
			}
			if (ChallengeShrineInReef.Value && Mods("com.groovesalad.DesolateReef", "com.themysticsword.extrachallengeshrines"))
			{
				checkShrines();
			}
			if (Mods("PlasmaCore.ForgottenRelics", "com.themysticsword.bulwarkshaunt"))
			{
				checkBulwark();
			}
			if (Mods("com.groovesalad.DesolateReef", "com.themysticsword.bulwarkshaunt") && BulwarkSwordOnSatellite.Value)
			{
				checkBulwark2();
			}
			if (ScrapperOnMoon.Value)
			{
				SpawnGuaranteed("moon", "SpawnCards/InteractableSpawnCard/iscScrapper", new Vector3(804.2821f, 287.1601f, 214.5148f), new Vector3(351.5653f, 249.8895f, 10.3f));
				SpawnGuaranteed("moon2", "SpawnCards/InteractableSpawnCard/iscScrapper", new Vector3(17.2254f, -190.6997f, -307.0245f), new Vector3(1.2947f, 87.988f, 16.1012f));
			}
			if (RemoveRandomScrapper.Value)
			{
				LegacyResourcesAPI.Load<InteractableSpawnCard>("SpawnCards/InteractableSpawnCard/iscScrapper").maxSpawnsPerStage = 0;
			}
			if (Chainloader.PluginInfos.ContainsKey("com.themysticsword.bulwarkshaunt"))
			{
				Stage.onStageStartGlobal += delegate(Stage stage)
				{
					if (stage.sceneDef.cachedName == "moon2")
					{
						foreach (NetworkUser instances in NetworkUser.instancesList)
						{
							if (instances.master.inventory.GetItemCountEffective(Items.BulwarksHaunt_Sword) > 0 || instances.master.inventory.GetItemCountEffective(Items.BulwarksHaunt_SwordUnleashed) > 0)
							{
								((Component)GameObject.Find("HOLDER: Gameplay Space").transform.Find("HOLDER: STATIC MESH").Find("Quadrant 5: Blood Arena").Find("Arena Weapons")
									.Find("mdlBrotherSword (3)")).gameObject.SetActive(false);
							}
						}
					}
				};
				SpeechInfo[] seeSword = (SpeechInfo[])(object)new SpeechInfo[5]
				{
					see("sword_1", "The blade..."),
					see("sword_2", "Brother...?"),
					see("sword_3", "You ask for death."),
					see("sword_4", "That was your last mistake."),
					see("sword_5", "You are not him.")
				};
				SpeechInfo[] seeSwordHeretic = (SpeechInfo[])(object)new SpeechInfo[3]
				{
					see("sword_heretic_1", "You survived."),
					see("sword_heretic_2", "The job will be finished."),
					see("sword_heretic_3", "Nowhere to run, Heretic.")
				};
				SpeechInfo[] killSword = (SpeechInfo[])(object)new SpeechInfo[5]
				{
					kill("sword_1", "You are unworthy."),
					kill("sword_2", "You are not him."),
					kill("sword_3", "Arrogant vermin."),
					kill("sword_4", "Nothing but forgery."),
					kill("sword_5", "Your tantrum ends here.")
				};
				SpeechInfo[] killSwordHurt = (SpeechInfo[])(object)new SpeechInfo[4]
				{
					kill("sword_hurt_1", "THIS IS HOW YOU WIELD."),
					kill("sword_hurt_2", "INFERIOR."),
					kill("sword_hurt_3", "THIS IS NOT YOURS."),
					kill("sword_hurt_4", "NEVER DARE AGAIN.")
				};
				BrotherSpeechDriver.DoInitialSightResponse += (Manipulator)delegate(ILContext il)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Expected O, but got Unknown
					//IL_0038: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val8 = new ILCursor(il);
					val8.GotoNext(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<BrotherSpeechDriver>(x, "SendReponseFromPool")
					});
					val8.Emit(OpCodes.Ldarg_0);
					val8.EmitDelegate<Func<SpeechInfo[], BrotherSpeechDriver, SpeechInfo[]>>((Func<SpeechInfo[], BrotherSpeechDriver, SpeechInfo[]>)delegate(SpeechInfo[] orig, BrotherSpeechDriver self)
					{
						bool flag4 = CharacterBody.readOnlyInstancesList.Any((CharacterBody x) => x.bodyIndex == BrotherSpeechDriver.hereticBodyIndex);
						return (CharacterBody.readOnlyInstancesList.Any((CharacterBody x) => x.inventory.GetItemCountEffective(Items.BulwarksHaunt_Sword) > 0 || x.inventory.GetItemCountEffective(Items.BulwarksHaunt_SwordUnleashed) > 0) && !((Object)self).name.StartsWith("BrotherHurt")) ? (flag4 ? seeSwordHeretic : seeSword) : orig;
					});
				};
				BrotherSpeechDriver.OnBodyKill += (Manipulator)delegate(ILContext il)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Expected O, but got Unknown
					//IL_0038: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val7 = new ILCursor(il);
					val7.GotoNext(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<BrotherSpeechDriver>(x, "SendReponseFromPool")
					});
					val7.Emit(OpCodes.Ldarg_0);
					val7.EmitDelegate<Func<SpeechInfo[], BrotherSpeechDriver, SpeechInfo[]>>((Func<SpeechInfo[], BrotherSpeechDriver, SpeechInfo[]>)delegate(SpeechInfo[] orig, BrotherSpeechDriver self)
					{
						bool flag2 = CharacterBody.readOnlyInstancesList.Any((CharacterBody x) => x.bodyIndex == BrotherSpeechDriver.hereticBodyIndex);
						bool flag3 = CharacterBody.readOnlyInstancesList.Any((CharacterBody x) => x.inventory.GetItemCountEffective(Items.BulwarksHaunt_Sword) > 0 || x.inventory.GetItemCountEffective(Items.BulwarksHaunt_SwordUnleashed) > 0);
						if (flag2)
						{
							return orig;
						}
						return flag3 ? (((Object)self).name.StartsWith("BrotherHurt") ? killSwordHurt : killSword) : orig;
					});
				};
				Stage.onStageStartGlobal += delegate
				{
					pissed = false;
				};
				object obj4 = <>c.<>9__75_27;
				if (obj4 == null)
				{
					hook_BeginEncounter val3 = delegate(orig_BeginEncounter orig, ScriptedCombatEncounter self)
					{
						orig.Invoke(self);
						if (SceneCatalog.mostRecentSceneDef.cachedName.StartsWith("moon"))
						{
							bool flag = CharacterBody.readOnlyInstancesList.Any((CharacterBody x) => x.inventory.GetItemCountEffective(Items.BulwarksHaunt_Sword) > 0 || x.inventory.GetItemCountEffective(Items.BulwarksHaunt_SwordUnleashed) > 0);
							pissed |= flag;
							if (pissed)
							{
								foreach (CharacterMaster members in self.combatSquad.membersList)
								{
									CharacterBody body = members.GetBody();
									body.baseMaxHealth *= 1f + SwordHealth.Value;
									body.levelMaxHealth *= 1f + SwordHealth.Value;
									body.baseDamage *= 1f + SwordDamage.Value;
									body.levelDamage *= 1f + SwordDamage.Value;
									body.baseMoveSpeed *= 1f + SwordSpeed.Value;
									body.levelMoveSpeed *= 1f + SwordSpeed.Value;
									body.baseArmor *= 1f + SwordArmor.Value;
									body.levelArmor *= 1f + SwordArmor.Value;
									body.baseAttackSpeed *= 1f + SwordAttackSpeed.Value;
									body.levelAttackSpeed *= 1f + SwordAttackSpeed.Value;
								}
							}
						}
					};
					<>c.<>9__75_27 = val3;
					obj4 = (object)val3;
				}
				ScriptedCombatEncounter.BeginEncounter += (hook_BeginEncounter)obj4;
				object obj5 = <>c.<>9__75_28;
				if (obj5 == null)
				{
					Manipulator val4 = 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 val6 = new ILCursor(il);
						val6.GotoNext(new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<NetworkUser>(x, "AwardLunarCoins")
						});
						val6.EmitDelegate<Func<uint, uint>>((Func<uint, uint>)((uint orig) => (uint)(orig + (pissed ? SwordExtraLunar.Value : 0))));
					};
					<>c.<>9__75_28 = val4;
					obj5 = (object)val4;
				}
				Run.BeginGameOver += (Manipulator)obj5;
			}
			if (Mods("PlasmaCore.ForgottenRelics"))
			{
				checkTeleporter();
			}
			if (Mods("PlasmaCore.ForgottenRelics"))
			{
				Harmony.PatchAll(typeof(PatchFRInteractables));
			}
			InteractableSpawnCard iscNullPortal = ScriptableObject.CreateInstance<InteractableSpawnCard>();
			((Object)iscNullPortal).name = "iscSpecialVoidFieldPortal";
			((SpawnCard)iscNullPortal).prefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/PortalArena");
			((SpawnCard)iscNullPortal).sendOverNetwork = true;
			((SpawnCard)iscNullPortal).hullSize = (HullClassification)1;
			((SpawnCard)iscNullPortal).nodeGraphType = (GraphType)0;
			((SpawnCard)iscNullPortal).requiredFlags = (NodeFlags)0;
			((SpawnCard)iscNullPortal).forbiddenFlags = (NodeFlags)0;
			((SpawnCard)iscNullPortal).directorCreditCost = 999999;
			((SpawnCard)iscNullPortal).occupyPosition = true;
			iscNullPortal.orientToFloor = false;
			iscNullPortal.skipSpawnWhenSacrificeArtifactEnabled = false;
			iscNullPortal.maxSpawnsPerStage = 0;
			if (VieldsOnStage7.Value)
			{
				TeleporterInteraction.onTeleporterChargedGlobal += delegate(TeleporterInteraction tp)
				{
					//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_0027: Unknown result type (might be due to invalid IL or missing references)
					//IL_0032: Unknown result type (might be due to invalid IL or missing references)
					//IL_0034: Unknown result type (might be due to invalid IL or missing references)
					//IL_0039: Unknown result type (might be due to invalid IL or missing references)
					//IL_0040: Unknown result type (might be due to invalid IL or missing references)
					//IL_0045: 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_0065: Expected O, but got Unknown
					//IL_0060: Unknown result type (might be due to invalid IL or missing references)
					//IL_006a: Expected O, but got Unknown
					if (StageCheck(7, loop: true))
					{
						DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest((SpawnCard)(object)iscNullPortal, new DirectorPlacementRule
						{
							minDistance = 1f,
							maxDistance = 25f,
							placementMode = (PlacementMode)1,
							position = ((Component)tp).transform.position,
							spawnOnTarget = ((Component)tp).transform
						}, Run.instance.stageRng));
					}
				};
			}
			if (LocusOnStage10.Value)
			{
				TeleporterInteraction.onTeleporterChargedGlobal += delegate(TeleporterInteraction tp)
				{
					//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_00a2: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
					//IL_00af: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
					//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e0: Expected O, but got Unknown
					//IL_00db: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e5: Expected O, but got Unknown
					SpawnCard isc = LegacyResourcesAPI.Load<SpawnCard>("SpawnCards/InteractableSpawnCard/iscVoidPortal");
					if (StageCheck(10, loop: true) && !(tp.portalSpawners?.ToList()?.First((PortalSpawner x) => (Object)(object)x.portalSpawnCard == (Object)(object)isc)?.willSpawn).GetValueOrDefault(true))
					{
						DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(isc, new DirectorPlacementRule
						{
							minDistance = 1f,
							maxDistance = 25f,
							placementMode = (PlacementMode)1,
							position = ((Component)tp).transform.position,
							spawnOnTarget = ((Component)tp).transform
						}, Run.instance.stageRng));
					}
				};
			}
			if (GoldShrineCost.Value != 200)
			{
				LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/Shrines/ShrineGoldshoresAccess").GetComponent<PurchaseInteraction>().cost = 100;
			}
			if (GoldenCoastChests.Value < 4)
			{
				Stage.onStageStartGlobal += delegate(Stage stage)
				{
					if (!(stage.sceneDef.cachedName != "goldshores"))
					{
						GameObject val5 = GameObject.Find("HOLDER: Preplaced Goodies");
						if (!((Object)(object)val5 == (Object)null))
						{
							List<GameObject> chests = new List<GameObject>
							{
								((Component)val5.transform.Find("Chest1 - 1")).gameObject,
								((Component)val5.transform.Find("Chest1 - 2")).gameObject,
								((Component)val5.transform.Find("Chest1 - 3")).gameObject,
								((Component)val5.transform.Find("Chest1 - 4")).gameObject
							};
							List<GameObject> list = (from x in Object.FindObjectsOfType<GameObject>()
								where ((Object)x).name == "mdlChest1"
								select x).ToList();
							for (int num = 4; num > GoldenCoastChests.Value; num--)
							{
								int toRemove = Run.instance.runRNG.RangeInt(0, chests.Count);
								chests[toRemove].SetActive(false);
								GameObject? obj6 = list.Find(delegate(GameObject x)
								{
									//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_0029: Unknown result type (might be due to invalid IL or missing references)
									Vector3 position = x.transform.position;
									return ((Vector3)(ref position)).Equals(chests[toRemove].transform.position);
								});
								if (obj6 != null)
								{
									obj6.SetActive(false);
								}
								chests.RemoveAt(toRemove);
							}
						}
					}
				};
			}
			if (GoldenCoastCombatShrine.Value)
			{
				SpawnGuaranteed("goldshores", "SpawnCards/InteractableSpawnCard/iscShrineCombat", new Vector3(-73.98104f, -6.325237f, 82.57056f), new Vector3(0f, 200.0384f, 0f));
				SpawnGuaranteed("goldshores", "SpawnCards/InteractableSpawnCard/iscShrineCombat", new Vector3(75.62061f, -8.77954f, 116.1982f), new Vector3(0f, 281.339f, 0f));
				SpawnGuaranteed("goldshores", "SpawnCards/InteractableSpawnCard/iscShrineCombat", new Vector3(-5.5166f, -9.3453f, -60.1567f), new Vector3(0f, 338.058f, 0f));
				SpawnGuaranteed("goldshores", "SpawnCards/InteractableSpawnCard/iscShrineBlood", new Vector3(-9.266755f, 69.01228f, -66.08608f));
			}
			if (Mods("PlasmaCore.ForgottenRelics"))
			{
				checkRadar();
			}
			if (Mods("com.themysticsword.bulwarkshaunt"))
			{
				checkWoods();
			}
			if (!VieldsNoLoot.Value)
			{
				return;
			}
			SceneDirector.onPrePopulateSceneServer += delegate(SceneDirector dir)
			{
				if (SceneCatalog.mostRecentSceneDef.cachedName == "arena")
				{
					dir.interactableCredit = 0;
				}
			};
			static void checkBuffBrazier()
			{
				if (!((Object)(object)BuffBrazier.InteractableSpawnCard == (Object)null))
				{
					if (BuffBrazierCost.Value != 25)
					{
						BuffBrazier.InteractableBodyModelPrefab.GetComponent<PurchaseInteraction>().cost = BuffBrazierCost.Value;
					}
					if (BuffBrazierOnStage1.Value)
					{
						SpawnRandomly(1, (SpawnCard)(object)BuffBrazier.InteractableSpawnCard);
					}
					if (RemoveRandomBuffBrazier.Value)
					{
						BuffBrazier.InteractableSpawnCard.maxSpawnsPerStage = 0;
					}
				}
			}
			static void checkBulwark()
			{
				//IL_0038: 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)
				if (!VF2ConfigManager.disableSlumberingSatellite.Value)
				{
					if (BulwarkSwordOnSatellite.Value)
					{
						SpawnGuaranteed("slumberingsatellite", Sword.swordObjPrefab, new Vector3(-157.3885f, 69.9324f, 154.4549f), new Vector3(344.073f, 60.7323f, 1.596f));
					}
					Stage.onStageStartGlobal += delegate(Stage stage)
					{
						if (stage.sceneDef.cachedName == "slumberingsatellite")
						{
							((Component)GameObject.Find("World").transform.Find("Gated Areas").Find("GateGround4")).gameObject.SetActive(true);
							((Component)GameObject.Find("World").transform.Find("Gated Areas").Find("GateGround5")).gameObject.SetActive(true);
						}
					};
				}
			}
			static void checkBulwark2()
			{
				//IL_0028: 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)
				if (BulwarkSwordOnSatellite.Value)
				{
					SpawnGuaranteed("voidstage", Sword.swordObjPrefab, new Vector3(-36.08f, 95.8711f, -55.5216f), new Vector3(337.4228f, 194.8307f, 0f));
				}
			}
			static void checkRadar()
			{
				if (!VF2ConfigManager.disableForgottenHaven.Value && FHRadarScannerEffect.Value)
				{
					FHRadarScannerPatch();
				}
			}
			static void checkSageShrine()
			{
				//IL_003b: 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_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_0095: Unknown result type (might be due to invalid IL or missing references)
				if (!VF2ConfigManager.disableSagesShrine.Value)
				{
					if (SageShrineOnMeadow.Value)
					{
						SpawnGuaranteed("skymeadow", (SpawnCard)(object)VF2ContentPackProvider.iscSagesShrine, new Vector3(-146.0359f, 144.0454f, 181.8587f), new Vector3(322.3633f, 139.1794f, 21.4546f));
					}
					if (SageShrineOnSatellite.Value)
					{
						SpawnGuaranteed("slumberingsatellite", (SpawnCard)(object)VF2ContentPackProvider.iscSagesShrine, new Vector3(70.5048f, 108.5265f, -323.2408f), new Vector3(11.9998f, 144.8941f, 337.7272f));
					}
					Stage.onStageStartGlobal += delegate(Stage stage)
					{
						if (stage.sceneDef.cachedName == "slumberingsatellite")
						{
							((Component)GameObject.Find("World").transform.Find("Gated Areas").Find("GateGround0")).gameObject.SetActive(true);
						}
					};
				}
			}
			static void checkShrines()
			{
				RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate
				{
					//IL_001a: 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_0027: 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_005b: 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_0086: Unknown result type (might be due to invalid IL or missing references)
					//IL_008c: Unknown result type (might be due to invalid IL or missing references)
					SpawnGuaranteed("voidstage", (SpawnCard)(object)ShrineCrown.spawnCard, new Vector3(-222.1664f, 39.7891f, 52.2902f));
					SpawnGuaranteed("voidstage", (SpawnCard)(object)ShrineEye.spawnCard, new Vector3(-228.3628f, 39.7893f, 73.1713f), new Vector3(0f, 302.7731f, 0f));
					SpawnGuaranteed("voidstage", (SpawnCard)(object)ShrineRock.spawnCard, new Vector3(-208.5046f, 40.0891f, 80.1995f));
				});
			}
			static void checkTeleporter()
			{
				if (!VF2ConfigManager.disableForgottenHaven.Value && FHTeleporterOnStage6.Value)
				{
					SpawnRandomly(6, (SpawnCard)(object)VF2ContentPackProvider.iscLooseRelic, loop: true);
					SpawnRandomly(6, (SpawnCard)(object)VF2ContentPackProvider.iscShatteredTeleporter, loop: true);
				}
			}
			static void checkWoods()
			{
				//IL_0028: 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)
				if (HauntedWoodShrine.Value)
				{
					SpawnGuaranteed("BulwarksHaunt_GhostWave", "SpawnCards/InteractableSpawnCard/iscShrineHealing", new Vector3(31.1182f, 62.9546f, -29.4124f), new Vector3(350.209f, 1.7844f, 350.0595f));
				}
			}
			static SpeechInfo kill(string id, string txt)
			{
				//IL_001a: 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_0064: 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)
				LanguageAPI.Add("BROTHER_KILL_" + id.ToUpper(), txt);
				SpeechInfo result = default(SpeechInfo);
				result.token = "BROTHER_KILL_" + id.ToUpper();
				result.duration = 1f;
				result.maxWait = 0.1f;
				result.mustPlay = true;
				result.priority = 10f;
				return result;
			}
			static void sandsweep()
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0070: Unknown result type (might be due to invalid IL or missing references)
				//IL_0099: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
				SpawnGuaranteed("nest", (SpawnCard)(object)((InteractableBase)InteractableBase<ShrineOfSacrifice>.Instance).interactableSpawnCard, new Vector3(-92.1372f, 178.6755f, 98.9633f), new Vector3(27.8571f, 81.1678f, 327.1132f));
				SpawnGuaranteed("nest", (SpawnCard)(object)((InteractableBase)InteractableBase<ShrineOfSacrifice>.Instance).interactableSpawnCard, new Vector3(-168.9947f, 113.1349f, 135.2753f), new Vector3(320.8246f, 325.649f, 9.8716f));
				SpawnGuaranteed("nest", (SpawnCard)(object)((InteractableBase)InteractableBase<ShrineOfSacrifice>.Instance).interactableSpawnCard, new Vector3(-185.045f, 244.1564f, 40.2286f), new Vector3(324.0448f, 302.1264f, 0f));
			}
			static void sandsweep2()
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				SpawnGuaranteed("lemuriantemple", (SpawnCard)(object)((InteractableBase)InteractableBase<ShrineOfTheFuture>.Instance).interactableSpawnCard, new Vector3(-9.1602f, 22.8145f, -174.1507f), new Vector3(0f, 110f, 0f));
			}
			static void sandsweep3()
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0070: Unknown result type (might be due to invalid IL or missing references)
				SpawnGuaranteed("ironalluvium", (SpawnCard)(object)((InteractableBase)InteractableBase<ShrineOfRuin>.Instance).interactableSpawnCard, new Vector3(208.9976f, 151.4559f, 12.1333f), new Vector3(309.2588f, 251.1624f, 284.5793f));
				SpawnGuaranteed("ironalluvium2", (SpawnCard)(object)((InteractableBase)InteractableBase<ShrineOfRuin>.Instance).interactableSpawnCard, new Vector3(208.9976f, 151.4559f, 12.1333f), new Vector3(309.2588f, 251.1624f, 284.5793f));
			}
			static SpeechInfo see(string id, string txt)
			{
				//IL_001a: 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_0064: 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)
				LanguageAPI.Add("BROTHER_SEE_" + id.ToUpper(), txt);
				SpeechInfo result2 = default(SpeechInfo);
				result2.token = "BROTHER_SEE_" + id.ToUpper();
				result2.duration = 2f;
				result2.maxWait = 0.5f;
				result2.mustPlay = true;
				result2.priority = 10000f;
				return result2;
			}
		}

		public static void PatchStageChances()
		{
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Expected O, but got Unknown
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			List<string> timescales = TimescaleOverwrite.Value.Split(',').ToList().ConvertAll((string x) => x.Trim());
			Run.ShouldUpdateRunStopwatch += (hook_ShouldUpdateRunStopwatch)delegate(orig_ShouldUpdateRunStopwatch orig, Run self)
			{
				if (self.livingPlayerCount <= 0)
				{
					return orig.Invoke(self);
				}
				bool flag = orig.Invoke(self);
				return timescales.Contains(SceneCatalog.mostRecentSceneDef.cachedName) ? (!flag) : flag;
			};
			Dictionary<string, float> dictionary = new Dictionary<string, float>();
			foreach (string item in StageChances.Value.Split(',').ToList().ConvertAll((string x) => x.Trim()))
			{
				List<string> list = item.Split('-').ToList().ConvertAll((string x) => x.Trim());
				if (list.Count == 2)
				{
					dictionary.Add(list[0], float.Parse(list[1]));
				}
			}
			string[] array = new string[5] { "sgStage1", "sgStage2", "sgStage3", "sgStage4", "sgStage5" };
			foreach (string text in array)
			{
				SceneCollection val = Addressables.LoadAssetAsync<SceneCollection>((object)("RoR2/Base/SceneGroups/" + text + ".asset")).WaitForCompletion();
				List<SceneEntry> list2 = new List<SceneEntry>(val._sceneEntries);
				for (int j = 0; j < list2.Count; j++)
				{
					if (dictionary.ContainsKey(list2[j].sceneDef.cachedName))
					{
						SceneEntry value = list2[j];
						((SceneEntry)(ref value)).weight = dictionary[list2[j].sceneDef.cachedName];
						list2[j] = value;
					}
				}
				val._sceneEntries = list2.ToArray();
			}
		}

		public static void HackSkeletonForceSpawn()
		{
			Stage.onStageStartGlobal += delegate
			{
				GameObject obj2 = GameObject.Find("HOLDER: Hidden Altar Stuff");
				object obj3;
				if (obj2 == null)
				{
					obj3 = null;
				}
				else
				{
					Transform transform = obj2.transform;
					if (transform == null)
					{
						obj3 = null;
					}
					else
					{
						Transform obj4 = transform.Find("AltarCenter");
						if (obj4 == null)
						{
							obj3 = null;
						}
						else
						{
							Transform obj5 = obj4.Find("AltarSkeletonBody");
							obj3 = ((obj5 != null) ? ((Component)obj5).gameObject : null);
						}
					}
				}
				GameObject val2 = (GameObject)obj3;
				if ((Object)(object)val2 != (Object)null)
				{
					GameObjectUnlockableFilter component = val2.GetComponent<GameObjectUnlockableFilter>();
					component.forbiddenUnlockableDef = null;
					component.Networkactive = true;
					component.active = true;
					val2.SetActive(true);
					Log.LogDebug((object)"*Bad to the Bone Riff*");
				}
			};
			GlobalEventManager.onCharacterDeathGlobal += delegate(DamageReport report)
			{
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: 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_0056: 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)
				object obj;
				if (report == null)
				{
					obj = null;
				}
				else
				{
					CharacterBody victimBody = report.victimBody;
					obj = ((victimBody != null) ? ((Object)victimBody).name : null);
				}
				if ((string?)obj == "AltarSkeletonBody")
				{
					UniquePickup val = default(UniquePickup);
					val.pickupIndex = Run.instance.treasureRng.NextElementUniform<PickupIndex>(Run.instance.availableVoidTier2DropList);
					PickupDropletController.CreatePickupDroplet(val, report.victimBody.corePosition, new Vector3(-15f, 13f, -20f), false);
				}
			};
		}

		public static void HandleHank()
		{
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Expected O, but got Unknown
			string[] items = new string[27]
			{
				"AttackSpeedAndMoveSpeed", "MysteriousVial", "Infusion", "HealingPotion", "SprintBonus", "MysticsItems_CoffeeBoostOnItemPickup", "ITEM_GOTCE_gd2", "ITEM_GOTCE_TubOfBart", "ItemDefSubmergingCistern", "ItemDefSeepingOcean",
				"SiphonOnLowHealth", "DropOfNecrosis", "SpatteredCollection", "Tonic", "Ketchup", "RandomEquipmentTrigger", "VV_ITEM_EHANCE_VIALS_ITEM", "MysticsItems_GateChalice", "EQUIPMENT_JAR_OF_RESHAPING", "VendingMachine",
				"ITEM_GOTCE_BottledCommand", "ITEM_GOTCE_BottledEnigma", "ITEM_GOTCE_BottledMetamorphosis", "ITEM_GOTCE_TubOfLard", "ITEM_GOTCE_DilutedFlask", "ITEM_GOTCE_FortifiedFlask", "ITEM_GOTCE_PaleAle"
			};
			string[] array = new string[7] { "PressurizedCanister", "IgniteOnKill", "ExplodeOnDeath", "EquipmentMagazineVoid", "EquipmentMagazine", "StrengthenBurn", "Molotov" };
			if (SpicyHank.Value)
			{
				items = CollectionExtensions.AddRangeToArray<string>(items, array);
			}
			if (!HankOffersDrink.Value)
			{
				return;
			}
			Stage.onStageStartGlobal += delegate
			{
				hanked = false;
			};
			PurchaseInteraction.OnInteractionBegin += (hook_OnInteractionBegin)delegate(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator)
			{
				//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fe: 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_0105: 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_0109: Unknown result type (might be due to invalid IL or missing references)
				//IL_0134: Expected I4, but got Unknown
				//IL_0137: 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_014e: Unknown result type (might be due to invalid IL or missing references)
				//IL_015a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0206: Unknown result type (might be due to invalid IL or missing references)
				//IL_020b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0210: 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_0289: Unknown result type (might be due to invalid IL or missing references)
				//IL_023c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0230: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_030e: 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_0344: Unknown result type (might be due to invalid IL or missing references)
				//IL_035f: Unknown result type (might be due to invalid IL or missing references)
				//IL_039a: Unknown result type (might be due to invalid IL or missing references)
				//IL_039f: Unknown result type (might be due to invalid IL or missing references)
				//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
				//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_03d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
				//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0401: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self, activator);
				if (((Object)((Component)self).gameObject).name == "BadToTheBone" && !hanked)
				{
					hanked = true;
					WeightedSelection<List<PickupIndex>> val = new WeightedSelection<List<PickupIndex>>(8);
					List<PickupIndex> list = new List<PickupIndex>();
					List<PickupIndex> list2 = new List<PickupIndex>();
					List<PickupIndex> list3 = new List<PickupIndex>();
					List<PickupIndex> list4 = new List<PickupIndex>();
					List<PickupIndex> list5 = new List<PickupIndex>();
					IEnumerable<ItemDef> source;
					if (!IllegalHank.Value)
					{
						source = from x in ((IEnumerable<ItemIndex>)Run.instance.availableItems).ToArray()
							select ItemCatalog.GetItemDef(x);
					}
					else
					{
						IEnumerable<ItemDef> enumerable = (IEnumerable<ItemDef>)(object)ItemCatalog.allItemDefs;
						source = enumerable;
					}
					foreach (ItemDef item3 in source.Where((ItemDef x) => items.Contains(((Object)x).name)))
					{
						PickupIndex item = PickupCatalog.FindPickupIndex(item3.itemIndex);
						ItemTier tier = item3.tier;
						ItemTier val2 = tier;
						switch ((int)val2)
						{
						case 0:
						case 6:
							list.Add(item);
							break;
						case 1:
						case 7:
							list2.Add(item);
							break;
						case 2:
						case 8:
							list3.Add(item);
							break;
						default:
							list4.Add(item);
							break;
						}
					}
					IEnumerable<EquipmentDef> source2;
					if (!IllegalHank.Value)
					{
						source2 = from x in ((IEnumerable<EquipmentIndex>)Run.instance.availableEquipment).ToArray()
							select EquipmentCatalog.GetEquipmentDef(x);
					}
					else
					{
						IEnumerable<EquipmentDef> equipmentDefs = EquipmentCatalog.equipmentDefs;
						source2 = equipmentDefs;
					}
					foreach (EquipmentDef item4 in source2.Where((EquipmentDef x) => items.Contains(((Object)x).name)))
					{
						PickupIndex item2 = PickupCatalog.FindPickupIndex(item4.equipmentIndex);
						if (!item4.isBoss && !item4.isLunar)
						{
							list5.Add(item2);
						}
						else
						{
							list4.Add(item2);
						}
					}
					if (list.Count > 0)
					{
						val.AddChoice(new ChoiceInfo<List<PickupIndex>>
						{
							value = list,
							weight = 1f
						});
					}
					if (list2.Count > 0)
					{
						val.AddChoice(new ChoiceInfo<List<PickupIndex>>
						{
							value = list2,
							weight = 0.5f
						});
					}
					if (list3.Count > 0)
					{
						val.AddChoice(new ChoiceInfo<List<PickupIndex>>
						{
							value = list3,
							weight = 0.1f
						});
					}
					if (list4.Count > 0)
					{
						val.AddChoice(new ChoiceInfo<List<PickupIndex>>
						{
							value = list4,
							weight = 0.3f
						});
					}
					if (list5.Count > 0)
					{
						val.AddChoice(new ChoiceInfo<List<PickupIndex>>
						{
							value = list5,
							weight = 0.5f
						});
					}
					if (val.Count != 0)
					{
						PickupIndex pickupIndex = Run.instance.treasureRng.NextElementUniform<PickupIndex>(val.Evaluate(Run.instance.treasureRng.nextNormalizedFloat));
						UniquePickup val3 = default(UniquePickup);
						val3.pickupIndex = pickupIndex;
						PickupDropletController.CreatePickupDroplet(val3, ((Component)self).gameObject.transform.position + Vector3.up * 1.5f, Vector3.up * 5f + ((Component)self).gameObject.transform.forward * 20f, false);
					}
				}
			};
		}

		public static void HandleShrineOfRepair()
		{
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate
			{
				InteractableSpawnCard normalShrineSpawnCard = ShrineOfRepairStuff.normalShrineSpawnCard;
				if (ShrineRepairOnStage5.Value)
				{
					SpawnRandomly(5, (SpawnCard)(object)normalShrineSpawnCard, loop: true);
				}
				if (RemoveRandomShrineRepair.Value)
				{
					normalShrineSpawnCard.maxSpawnsPerStage = 0;
				}
			});
		}

		public static void FHRadarScannerPatch()
		{
			//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_0020: Expected O, but got Unknown
			object obj = <>c.<>9__80_0;
			if (obj == null)
			{
				hook_GrantUnlock val = delegate(orig_GrantUnlock orig, RadiotowerTerminal self, Interactor interactor)
				{
					//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)
					orig.Invoke(self, interactor);
					if (SceneCatalog.mostRecentSceneDef.cachedName == "forgottenhaven")
					{
						NetworkServer.Spawn(Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/ChestScanner"), ((Component)self).gameObject.transform.position, Quaternion.identity));
					}
				};
				<>c.<>9__80_0 = val;
				obj = (object)val;
			}
			RadiotowerTerminal.GrantUnlock += (hook_GrantUnlock)obj;
			Harmony.PatchAll(typeof(PatchBatteryInteraction));
		}

		public static void SpawnGuaranteed(string scene, string dir, Vector3 pos, Vector3 rot = default(Vector3))
		{
			//IL_0008: 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)
			SpawnGuaranteed(scene, LegacyResourcesAPI.Load<SpawnCard>(dir), pos, rot);
		}

		public static void SpawnGuaranteed(string scene, SpawnCard spawnCard, Vector3 pos, Vector3 rot = default(Vector3))
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: 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)
			Stage.onStageStartGlobal += delegate(Stage self)
			{
				//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_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Expected O, but got Unknown
				//IL_0034: 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_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Expected O, but got Unknown
				//IL_005a: 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_0095: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Invalid comparison between Unknown and I4
				if (!(self.sceneDef.cachedName != scene))
				{
					DirectorPlacementRule val = new DirectorPlacementRule
					{
						placementMode = (PlacementMode)0
					};
					GameObject spawnedInstance = spawnCard.DoSpawn(pos, Quaternion.Euler(rot), new DirectorSpawnRequest(spawnCard, val, Run.instance.runRNG)).spawnedInstance;
					spawnedInstance.transform.eulerAngles = rot;
					if (Object.op_Implicit((Object)(object)spawnedInstance))
					{
						PurchaseInteraction component = spawnedInstance.GetComponent<PurchaseInteraction>();
						if (Object.op_Implicit((Object)(object)component) && (int)component.costType == 1)
						{
							component.Networkcost = Run.instance.GetDifficultyScaledCost(component.cost);
						}
					}
					NetworkServer.Spawn(spawnedInstance);
				}
			};
			Log.LogDebug((object)("Added a Guaranteed Spawn of " + ((Object)spawnCard.prefab).name + " at " + scene));
		}

		public static void SpawnGuaranteed(string scene, GameObject obj, Vector3 pos, Vector3 rot = default(Vector3))
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: 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)
			Stage.onStageStartGlobal += delegate(Stage self)
			{
				//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_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Expected O, but got Unknown
				//IL_0034: 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_0051: 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_0080: Invalid comparison between Unknown and I4
				if (!(self.sceneDef.cachedName != scene))
				{
					DirectorPlacementRule val = new DirectorPlacementRule
					{
						placementMode = (PlacementMode)0
					};
					GameObject val2 = Object.Instantiate<GameObject>(obj, pos, Quaternion.Euler(rot));
					val2.transform.eulerAngles = rot;
					if (Object.op_Implicit((Object)(object)val2))
					{
						PurchaseInteraction component = val2.GetComponent<PurchaseInteraction>();
						if (Object.op_Implicit((Object)(object)component) && (int)component.costType == 1)
						{
							component.Networkcost = Run.instance.GetDifficultyScaledCost(component.cost);
						}
					}
					NetworkServer.Spawn(val2);
				}
			};
			Log.LogDebug((object)("Added a Guaranteed Spawn of " + ((Object)obj).name + " at " + scene));
		}

		public static void SpawnRandomly(string scene, string dir)
		{
			SpawnRandomly(scene, LegacyResourcesAPI.Load<SpawnCard>(dir));
		}

		public static void SpawnRandomly(string scene, SpawnCard spawnCard)
		{
			SceneDirector.onPrePopulateSceneServer += delegate
			{
				if (!(SceneCatalog.mostRecentSceneDef.cachedName != scene))
				{
					SpawnRandomlyInternal(spawnCard);
				}
			};
			Log.LogDebug((object)("Added a Random Spawn of " + ((Object)spawnCard).name + " at " + scene));
		}

		public static void SpawnRandomly(int stage, string dir, bool loop = false)
		{
			SpawnRandomly(stage, LegacyResourcesAPI.Load<SpawnCard>(dir), loop);
		}

		public static void SpawnRandomly(int stage, SpawnCard spawnCard, bool loop = false)
		{
			SceneDirector.onPostPopulateSceneServer += delegate
			{
				if (StageCheck(stage, loop) && !((Object)(object)TeleporterInteraction.instance == (Object)null))
				{
					SpawnRandomlyInternal(spawnCard);
				}
			};
			Log.LogDebug((object)$"Added a Random Spawn of {((Object)spawnCard).name} at Stage {stage}");
		}

		private static void SpawnRandomlyInternal(SpawnCard spawnCard)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Invalid comparison between Unknown and I4
			DirectorPlacementRule val = new DirectorPlacementRule
			{
				placementMode = (PlacementMode)4
			};
			GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(spawnCard, val, Run.instance.runRNG));
			if (Object.op_Implicit((Object)(object)val2))
			{
				PurchaseInteraction component = val2.GetComponent<Purch