Decompiled source of StageVariety v1.0.0

StagePermutations.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using HG;
using HG.Coroutines;
using HG.Reflection;
using Microsoft.CodeAnalysis;
using On.RoR2;
using RoR2;
using RoR2.ContentManagement;
using RoR2.Navigation;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("StagePermutations")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+04efc8624b4cc6840316b3ec84486b5411e3a5a6")]
[assembly: AssemblyProduct("StagePermutations")]
[assembly: AssemblyTitle("StagePermutations")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
[module: UnverifiableCode]
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 StagePermutations
{
	public class DisableOcclusionNearby : MonoBehaviour
	{
		public List<CameraRigController> cameraRigControllers = new List<CameraRigController>();

		public HashSet<CameraRigController> affectedCameraRigControllers = new HashSet<CameraRigController>();

		public float radius;

		public void OnEnable()
		{
			foreach (CameraRigController readOnlyInstances in CameraRigController.readOnlyInstancesList)
			{
				OnCameraEnableGlobal(readOnlyInstances);
			}
			CameraRigController.onCameraEnableGlobal += OnCameraEnableGlobal;
			CameraRigController.onCameraDisableGlobal += OnCameraDisableGlobal;
		}

		public void OnDisable()
		{
			CameraRigController.onCameraEnableGlobal -= OnCameraEnableGlobal;
			CameraRigController.onCameraDisableGlobal -= OnCameraDisableGlobal;
			cameraRigControllers.Clear();
			affectedCameraRigControllers.Clear();
		}

		public void Update()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			foreach (CameraRigController cameraRigController in cameraRigControllers)
			{
				Vector3 val = ((Component)cameraRigController).transform.position - ((Component)this).transform.position;
				if (((Vector3)(ref val)).sqrMagnitude <= radius * radius)
				{
					if (affectedCameraRigControllers.Add(cameraRigController) && Object.op_Implicit((Object)(object)cameraRigController.sceneCam))
					{
						cameraRigController.sceneCam.useOcclusionCulling = false;
					}
				}
				else if (affectedCameraRigControllers.Remove(cameraRigController) && Object.op_Implicit((Object)(object)cameraRigController.sceneCam))
				{
					cameraRigController.sceneCam.useOcclusionCulling = true;
				}
			}
		}

		private void OnCameraEnableGlobal(CameraRigController cameraRigController)
		{
			if (Object.op_Implicit((Object)(object)cameraRigController.sceneCam) && cameraRigController.sceneCam.useOcclusionCulling)
			{
				cameraRigControllers.Add(cameraRigController);
			}
		}

		private void OnCameraDisableGlobal(CameraRigController cameraRigController)
		{
			cameraRigControllers.Remove(cameraRigController);
		}
	}
	public abstract class PermutationBehaviour
	{
		public virtual SceneObjectToggleGroup FindToggleGroupController(Scene scene, IDictionary<string, GameObject> rootObjects)
		{
			if (rootObjects.TryGetValue("SceneInfo", out var value))
			{
				Transform obj = value.transform.Find("ToggleGroupController");
				if (obj == null)
				{
					return null;
				}
				return ((Component)obj).GetComponent<SceneObjectToggleGroup>();
			}
			return null;
		}

		public abstract void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController);

		protected static void Addressable<TObject>(object key, out TObject asset)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			asset = Addressables.LoadAssetAsync<TObject>(key).WaitForCompletion();
		}

		protected static TObject Addressable<TObject>(object key)
		{
			//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 Addressables.LoadAssetAsync<TObject>(key).WaitForCompletion();
		}

		protected static void AssignNodesToGate(NodeGraph nodeGraph, List<NodeIndex> nodes, string gateName)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_004d: Unknown result type (might be due to invalid IL or missing references)
			byte gateIndex = nodeGraph.RegisterGateName(gateName);
			foreach (NodeIndex node in nodes)
			{
				nodeGraph.nodes[node.nodeIndex].gateIndex = gateIndex;
				LinkIndex[] activeNodeLinks = nodeGraph.GetActiveNodeLinks(node);
				foreach (LinkIndex val in activeNodeLinks)
				{
					nodeGraph.links[val.linkIndex].gateIndex = gateIndex;
				}
			}
		}

		protected static void EnsureNodesInBounds(NodeGraph nodeGraph, List<NodeIndex> nodes, Bounds bounds)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = default(Vector3);
			for (int num = nodes.Count - 1; num >= 0; num--)
			{
				if (!nodeGraph.GetNodePosition(nodes[num], ref val) || !((Bounds)(ref bounds)).Contains(val))
				{
					nodes.RemoveAt(num);
				}
			}
		}
	}
	internal static class Prefab
	{
		private static readonly Transform _prefabParent;

		static Prefab()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			_prefabParent = new GameObject("groovesalad.StageVariety_Prefabs").transform;
			((Component)_prefabParent).gameObject.SetActive(false);
			Object.DontDestroyOnLoad((Object)(object)((Component)_prefabParent).gameObject);
			Util.IsPrefab += (hook_IsPrefab)((orig_IsPrefab orig, GameObject gameObject) => orig.Invoke(gameObject) || (Object)(object)gameObject.transform.parent == (Object)(object)_prefabParent);
		}

		public static GameObject Create(string name)
		{
			//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_0017: Expected O, but got Unknown
			GameObject val = new GameObject(name);
			val.transform.SetParent(_prefabParent);
			return val;
		}

		public static GameObject Create(string name, params Type[] components)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			GameObject val = new GameObject(name, components);
			val.transform.SetParent(_prefabParent);
			return val;
		}

		public static GameObject Clone(GameObject original, string name)
		{
			GameObject obj = Object.Instantiate<GameObject>(original, _prefabParent);
			((Object)obj).name = name;
			NetworkIdentity val = default(NetworkIdentity);
			if (obj.TryGetComponent<NetworkIdentity>(ref val))
			{
				((NetworkHash128)(ref val.m_AssetId)).Reset();
			}
			return obj;
		}
	}
	public class RegisterPermutationAttribute : SearchableAttribute
	{
		public string targetSceneName;

		public string configSection;

		public string name;

		public string description;

		public RegisterPermutationAttribute(string targetSceneName, string configSection, string name)
		{
			this.targetSceneName = targetSceneName;
			this.configSection = configSection;
			this.name = name;
		}
	}
	public class SetSceneObjectsActive : MonoBehaviour
	{
		public List<GameObject> objectsToActivate = new List<GameObject>();

		public List<GameObject> objectsToDeactivate = new List<GameObject>();

		public void OnEnable()
		{
			foreach (GameObject item in objectsToActivate)
			{
				if (item != null)
				{
					item.SetActive(true);
				}
			}
			foreach (GameObject item2 in objectsToDeactivate)
			{
				if (item2 != null)
				{
					item2.SetActive(false);
				}
			}
		}
	}
	public static class SharedExtensions
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool TryFind(this Transform transform, string n, out Transform child)
		{
			return Object.op_Implicit((Object)(object)(child = transform.Find(n)));
		}

		public static IEnumerable<Transform> AllChildren(this Transform transform)
		{
			for (int i = 0; i < transform.childCount; i++)
			{
				yield return transform.GetChild(i);
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static void AddComponent<T>(this GameObject gameObject, out T component) where T : Component
		{
			component = gameObject.AddComponent<T>();
		}
	}
	[BepInPlugin("groovesalad.StageVariety", "StageVariety", "1.0.0")]
	public class StagePermutationsProvider : BaseUnityPlugin, IContentPackProvider
	{
		public interface IStaticContent
		{
			IEnumerator LoadAsync(IProgress<float> progressReceiver);
		}

		public const string GUID = "groovesalad.StageVariety";

		public const string NAME = "StageVariety";

		public const string VERSION = "1.0.0";

		public AssetBundleCreateRequest assetBundleCreateRequest;

		public Dictionary<PermutationBehaviour, RegisterPermutationAttribute> permutations;

		public static ILookup<string, PermutationBehaviour> permutationsLookup;

		public string identifier => "groovesalad.StageVariety";

		public void Awake()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			ContentManager.collectContentPackProviders += (CollectContentPackProvidersDelegate)delegate(AddContentPackProviderDelegate add)
			{
				add.Invoke((IContentPackProvider)(object)this);
			};
			List<RegisterPermutationAttribute> list = new List<RegisterPermutationAttribute>();
			SearchableAttribute.GetInstances<RegisterPermutationAttribute>(list);
			permutations = list.Where(delegate(RegisterPermutationAttribute x)
			{
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				//IL_003e: Expected I4, but got O
				//IL_003e: Expected O, but got I4
				//IL_0039->IL0039: Incompatible stack types: I4 vs O
				//IL_0039->IL0039: Incompatible stack types: O vs I4
				//IL_0028->IL0039: Incompatible stack types: I4 vs O
				//IL_0028->IL0039: Incompatible stack types: O vs I4
				object obj = ((BaseUnityPlugin)this).Config;
				object obj2 = x.configSection;
				string text = "Enable " + x.name;
				int num = 1;
				if (x.description != null)
				{
					obj = (object)new ConfigDescription(x.description, (AcceptableValueBase)null, Array.Empty<object>());
					obj2 = num;
					num = (int)obj2;
				}
				else
				{
					obj = null;
					obj2 = num;
					num = (int)obj2;
				}
				return ((ConfigFile)obj).Bind<bool>((string)num, text, (byte)(int)obj2 != 0, (ConfigDescription)obj).Value;
			}).ToDictionary((RegisterPermutationAttribute x) => (PermutationBehaviour)Activator.CreateInstance((Type)((SearchableAttribute)x).target));
			permutationsLookup = permutations.ToLookup((KeyValuePair<PermutationBehaviour, RegisterPermutationAttribute> x) => x.Value.targetSceneName, (KeyValuePair<PermutationBehaviour, RegisterPermutationAttribute> x) => x.Key);
			SceneManager.sceneLoaded += OnSceneLoaded;
		}

		private void OnSceneLoaded(Scene newScene, LoadSceneMode loadSceneMode)
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			if (!permutationsLookup.Contains(((Scene)(ref newScene)).name))
			{
				return;
			}
			Dictionary<string, GameObject> dictionary = new Dictionary<string, GameObject>();
			GameObject[] rootGameObjects = ((Scene)(ref newScene)).GetRootGameObjects();
			foreach (GameObject val in rootGameObjects)
			{
				dictionary[((Object)val).name] = val;
			}
			foreach (PermutationBehaviour item in permutationsLookup[((Scene)(ref newScene)).name])
			{
				item.Apply(toggleGroupController: item.FindToggleGroupController(newScene, dictionary), scene: newScene, rootObjects: dictionary);
			}
		}

		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			ParallelProgressCoroutine parallelProgressCoroutine = new ParallelProgressCoroutine((IProgress<float>)new ReadableProgress<float>((Action<float>)args.ReportProgress));
			foreach (IStaticContent item in permutations.Keys.OfType<IStaticContent>())
			{
				ReadableProgress<float> val = new ReadableProgress<float>();
				parallelProgressCoroutine.Add(SafeCoroutineWrapper(item.LoadAsync((IProgress<float>)val)), val);
			}
			while (parallelProgressCoroutine.MoveNext())
			{
				yield return parallelProgressCoroutine.Current;
			}
			static IEnumerator SafeCoroutineWrapper(IEnumerator coroutine)
			{
				while (coroutine.MoveNext())
				{
					object current2 = coroutine.Current;
					if (!(current2 is IEnumerator inner))
					{
						AsyncOperation asyncOperation = (AsyncOperation)((current2 is AsyncOperation) ? current2 : null);
						if (asyncOperation != null)
						{
							while (!asyncOperation.isDone)
							{
								yield return null;
							}
						}
						else
						{
							yield return coroutine.Current;
						}
					}
					else
					{
						while (inner.MoveNext())
						{
							yield return inner.Current;
						}
					}
				}
			}
		}

		public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
		{
			yield break;
		}

		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			yield break;
		}
	}
}
namespace StagePermutations.wispgraveyard
{
	[RegisterPermutation("wispgraveyard", "Scorched Acres", "Lower Staircase Variation", description = "A lower staircase walkway on the top Scorched Acres platform will sometimes not appear")]
	public class LowerStaircase : PermutationBehaviour, StagePermutationsProvider.IStaticContent
	{
		private const string GATE_NAME = "LowerSpiralStaircase";

		public IEnumerator LoadAsync(IProgress<float> progressReceiver)
		{
			AsyncOperationHandle<NodeGraph> wispgraveyardGroundNodesNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/wispgraveyard/wispgraveyardGroundNodesNodegraph.asset");
			AsyncOperationHandle<NodeGraph> wispgraveyardAirNodesNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/wispgraveyard/wispgraveyardAirNodesNodegraph.asset");
			List<NodeIndex> dest = new List<NodeIndex>();
			Bounds[] array = new Bounds[2];
			Bounds val = default(Bounds);
			((Bounds)(ref val)).min = new Vector3(-91f, 42f, 186f);
			((Bounds)(ref val)).max = new Vector3(-63f, 75f, 261f);
			array[0] = val;
			val = default(Bounds);
			((Bounds)(ref val)).min = new Vector3(126f, 31f, 190f);
			((Bounds)(ref val)).max = new Vector3(158f, 75f, 291f);
			array[1] = val;
			Bounds[] array2 = (Bounds[])(object)array;
			Bounds val2 = default(Bounds);
			((Bounds)(ref val2)).min = new Vector3(-128f, 10f, 208f);
			((Bounds)(ref val2)).max = new Vector3(158f, 46f, 340f);
			val = val2;
			Bounds[] array3 = array2;
			int num = 0;
			Bounds[] array4 = (Bounds[])(object)new Bounds[1 + array3.Length];
			array4[num] = val;
			num++;
			Bounds[] array5 = array3;
			for (int i = 0; i < array5.Length; i++)
			{
				val2 = (array4[num] = array5[i]);
				num++;
			}
			Bounds[] groundBounds = array4;
			val2 = default(Bounds);
			((Bounds)(ref val2)).min = new Vector3(-128f, 20f, 208f);
			((Bounds)(ref val2)).max = new Vector3(158f, 56f, 340f);
			val = val2;
			array4 = array2;
			num = 0;
			array3 = (Bounds[])(object)new Bounds[1 + array4.Length];
			array3[num] = val;
			num++;
			array5 = array4;
			for (int i = 0; i < array5.Length; i++)
			{
				val2 = (array3[num] = array5[i]);
				num++;
			}
			Bounds[] airBounds = array3;
			yield return wispgraveyardGroundNodesNodegraph;
			NodeGraph result = wispgraveyardGroundNodesNodegraph.Result;
			array3 = groundBounds;
			for (num = 0; num < array3.Length; num++)
			{
				Bounds bounds = array3[num];
				result.blockMap.GetItemsInBounds(ref bounds, dest);
				PermutationBehaviour.EnsureNodesInBounds(result, dest, bounds);
				PermutationBehaviour.AssignNodesToGate(result, dest, "LowerSpiralStaircase");
				dest.Clear();
			}
			yield return wispgraveyardAirNodesNodegraph;
			NodeGraph result2 = wispgraveyardAirNodesNodegraph.Result;
			array3 = airBounds;
			for (num = 0; num < array3.Length; num++)
			{
				Bounds bounds2 = array3[num];
				result2.blockMap.GetItemsInBounds(ref bounds2, dest);
				PermutationBehaviour.EnsureNodesInBounds(result2, dest, bounds2);
				PermutationBehaviour.AssignNodesToGate(result2, dest, "LowerSpiralStaircase");
				dest.Clear();
			}
		}

		public override void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Unknown result type (might be due to invalid IL or missing references)
			//IL_036f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
			if (!rootObjects.TryGetValue("ENTIRE SCENE HOLDER", out var value) || !value.transform.TryFind("HOLDER: Temple Pieces", out var child))
			{
				return;
			}
			Transform child2 = child.GetChild(3);
			if (Object.op_Implicit((Object)(object)child2))
			{
				GameObject val = new GameObject("FSGiantRuinFrameCollisionDisabled");
				val.transform.position = new Vector3(12f, 61f, 230f);
				val.AddComponent<GateStateSetter>().gateToDisableWhenEnabled = "LowerSpiralStaircase";
				val.SetActive(false);
				val.AddComponent<SetSceneObjectsActive>(out SetSceneObjectsActive component);
				List<GameObject> objectsToDeactivate = component.objectsToDeactivate;
				Transform obj = child2.Find("WPPlatform2SpiralStairsCW");
				objectsToDeactivate.Add((obj != null) ? ((Component)obj).gameObject : null);
				List<GameObject> objectsToDeactivate2 = component.objectsToDeactivate;
				Transform obj2 = child2.Find("WPPlatform2SpiralStairsCCW");
				objectsToDeactivate2.Add((obj2 != null) ? ((Component)obj2).gameObject : null);
				List<GameObject> objectsToDeactivate3 = component.objectsToDeactivate;
				Transform obj3 = child2.Find("WPPlanter1Long (4)");
				objectsToDeactivate3.Add((obj3 != null) ? ((Component)obj3).gameObject : null);
				List<GameObject> objectsToDeactivate4 = component.objectsToDeactivate;
				Transform obj4 = child2.Find("WPPlanter1Long (3)");
				objectsToDeactivate4.Add((obj4 != null) ? ((Component)obj4).gameObject : null);
				List<GameObject> objectsToDeactivate5 = component.objectsToDeactivate;
				Transform obj5 = child2.Find("WPPlanter1KnockedOver");
				objectsToDeactivate5.Add((obj5 != null) ? ((Component)obj5).gameObject : null);
				List<GameObject> objectsToDeactivate6 = component.objectsToDeactivate;
				Transform obj6 = child2.Find("WPPlanter1LongKnockedOver");
				objectsToDeactivate6.Add((obj6 != null) ? ((Component)obj6).gameObject : null);
				List<GameObject> objectsToDeactivate7 = component.objectsToDeactivate;
				Transform obj7 = child2.Find("WPPlanter1WithBonsaiTree (9)");
				objectsToDeactivate7.Add((obj7 != null) ? ((Component)obj7).gameObject : null);
				Transform val2 = (from Transform x in (IEnumerable)child2
					where ((Object)x).name == "WPPlatform2BarrierHigh"
					select x).ElementAtOrDefault(2);
				if (Object.op_Implicit((Object)(object)val2))
				{
					component.objectsToDeactivate.Add(((Component)val2).gameObject);
				}
				Transform val3 = (from Transform x in (IEnumerable)child2
					where ((Object)x).name == "WPPlatform2BarrierHigh (1)"
					select x).ElementAtOrDefault(2);
				if (Object.op_Implicit((Object)(object)val3))
				{
					component.objectsToDeactivate.Add(((Component)val3).gameObject);
				}
				PermutationBehaviour.Addressable<GameObject>("RoR2/Base/wispgraveyard/WPPlatform2BarrierHigh.prefab", out var asset);
				GameObject obj8 = Object.Instantiate<GameObject>(asset, val.transform);
				obj8.transform.localPosition = new Vector3(-8.7f, -36.5f, -11f);
				obj8.transform.localEulerAngles = new Vector3(270f, 267f, 0f);
				GameObject obj9 = Object.Instantiate<GameObject>(asset, val.transform);
				obj9.transform.localPosition = new Vector3(-8f, -36.5f, -5f);
				obj9.transform.localEulerAngles = new Vector3(270f, 280f, 0f);
				GameObject obj10 = Object.Instantiate<GameObject>(PermutationBehaviour.Addressable<GameObject>("RoR2/Base/wispgraveyard/WPPlanter1WithBonsaiTree.prefab"), val.transform);
				obj10.transform.localPosition = new Vector3(-75f, -14.4f, -26f);
				obj10.transform.localEulerAngles = new Vector3(0f, 200f, 0f);
				GameObject obj11 = Object.Instantiate<GameObject>(PermutationBehaviour.Addressable<GameObject>("RoR2/Base/wispgraveyard/WPPlanter1LongKnockedOver.prefab"), val.transform);
				obj11.transform.localPosition = new Vector3(-76f, -14.9f, -32f);
				obj11.transform.localEulerAngles = new Vector3(0f, 25f, 0f);
				GameObject val4 = new GameObject("DisableOcclusionCulling");
				val4.transform.SetParent(val.transform);
				val4.transform.localPosition = new Vector3(0f, 0f, 0f);
				val4.AddComponent<DisableOcclusionNearby>().radius = 120f;
				ref GameObjectToggleGroup[] toggleGroups = ref toggleGroupController.toggleGroups;
				GameObjectToggleGroup val5 = new GameObjectToggleGroup
				{
					objects = (GameObject[])(object)new GameObject[1] { val },
					minEnabled = 0,
					maxEnabled = 1
				};
				ArrayUtils.ArrayAppend<GameObjectToggleGroup>(ref toggleGroups, ref val5);
			}
		}
	}
}
namespace StagePermutations.skymeadow
{
	[RegisterPermutation("skymeadow", "Sky Meadow", "Mauling Rocks Direction Variation", description = "The mauling rocks on Sky Meadow will sometimes fly the opposite direction")]
	public class MaulingRocks : PermutationBehaviour
	{
		public override void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			if (rootObjects.TryGetValue("HOLDER: Mauling Rocks", out var value))
			{
				GameObject val = Object.Instantiate<GameObject>(value);
				val.SetActive(false);
				MaulingRockZoneManager[] componentsInChildren = val.GetComponentsInChildren<MaulingRockZoneManager>();
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					MaulingRockZoneManager val3;
					MaulingRockZoneManager val2;
					MaulingRockZoneManager obj = (val3 = (val2 = componentsInChildren[i]));
					Transform endZonePoint = obj.endZonePoint1;
					Transform startZonePoint = obj.startZonePoint1;
					val2.startZonePoint1 = endZonePoint;
					val3.endZonePoint1 = startZonePoint;
					val3 = obj;
					val2 = obj;
					startZonePoint = obj.endZonePoint2;
					endZonePoint = obj.startZonePoint2;
					val3.startZonePoint2 = startZonePoint;
					val2.endZonePoint2 = endZonePoint;
				}
				ref GameObjectToggleGroup[] toggleGroups = ref toggleGroupController.toggleGroups;
				GameObjectToggleGroup val4 = new GameObjectToggleGroup
				{
					objects = (GameObject[])(object)new GameObject[2] { value, val },
					minEnabled = 1,
					maxEnabled = 1
				};
				ArrayUtils.ArrayAppend<GameObjectToggleGroup>(ref toggleGroups, ref val4);
			}
		}
	}
}
namespace StagePermutations.shipgraveyard
{
	[RegisterPermutation("shipgraveyard", "Siren`s Call", "New Donut Ship", description = "A new crashed ship will sometimes appear in the middle of Siren`s Call")]
	public class NewTorusShip : PermutationBehaviour, StagePermutationsProvider.IStaticContent
	{
		private const string GATE_NAME = "BlockedByTorusShip";

		public IEnumerator LoadAsync(IProgress<float> progressReceiver)
		{
			AsyncOperationHandle<NodeGraph> shipgraveyardGroundNodeNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/shipgraveyard/shipgraveyardGroundNodeNodegraph.asset");
			AsyncOperationHandle<NodeGraph> shipgraveyardAirNodeNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/shipgraveyard/shipgraveyardAirNodeNodegraph.asset");
			List<NodeIndex> dest = new List<NodeIndex>();
			yield return shipgraveyardGroundNodeNodegraph;
			NodeGraph result = shipgraveyardGroundNodeNodegraph.Result;
			result.blockMap.GetItemsInSphere(new Vector3(-15f, 3f, 14f), 10f, dest);
			PermutationBehaviour.AssignNodesToGate(result, dest, "BlockedByTorusShip");
			dest.Clear();
			yield return shipgraveyardAirNodeNodegraph;
			NodeGraph result2 = shipgraveyardAirNodeNodegraph.Result;
			result2.blockMap.GetItemsInSphere(new Vector3(-15f, 15f, 11f), 15f, dest);
			result2.blockMap.GetItemsInSphere(new Vector3(18f, 15f, 59f), 15f, dest);
			PermutationBehaviour.AssignNodesToGate(result2, dest, "BlockedByTorusShip");
		}

		public override void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_003c: 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_00b0: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(PermutationBehaviour.Addressable<GameObject>("RoR2/Base/shipgraveyard/TorusShip Round.prefab"));
			val.AddComponent<GateStateSetter>().gateToDisableWhenEnabled = "BlockedByTorusShip";
			val.SetActive(false);
			val.transform.localPosition = new Vector3(2f, 5f, 41f);
			val.transform.localEulerAngles = new Vector3(340f, 300f, 230f);
			if (rootObjects.TryGetValue("HOLDER: Environment", out var value) && value.transform.TryFind("TO BE CONVERTED!!!!!!!!!!/HOLDER: Main Rocks", out var child))
			{
				val.AddComponent<SetSceneObjectsActive>(out SetSceneObjectsActive component);
				component.objectsToDeactivate.Add(((Component)child.GetChild(27)).gameObject);
			}
			ref GameObjectToggleGroup[] toggleGroups = ref toggleGroupController.toggleGroups;
			GameObjectToggleGroup val2 = new GameObjectToggleGroup
			{
				objects = (GameObject[])(object)new GameObject[1] { val },
				minEnabled = 0,
				maxEnabled = 1
			};
			ArrayUtils.ArrayAppend<GameObjectToggleGroup>(ref toggleGroups, ref val2);
		}
	}
	[RegisterPermutation("shipgraveyard", "Siren`s Call", "Crashed Ship Middle Section Variation", description = "The middle section of the long rectangular crashed ship on Siren`s Call will sometimes appear in a different orientation")]
	public class RectShipMid : PermutationBehaviour, StagePermutationsProvider.IStaticContent
	{
		private const string GATE_NAME = "RectShipMid";

		public IEnumerator LoadAsync(IProgress<float> progressReceiver)
		{
			AsyncOperationHandle<NodeGraph> shipgraveyardGroundNodeNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/shipgraveyard/shipgraveyardGroundNodeNodegraph.asset");
			AsyncOperationHandle<NodeGraph> shipgraveyardAirNodeNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/shipgraveyard/shipgraveyardAirNodeNodegraph.asset");
			List<NodeIndex> dest = new List<NodeIndex>();
			Bounds bounds = new Bounds(new Vector3(-3.5f, 39f, 71f), new Vector3(25f, 30f, 41f));
			yield return shipgraveyardGroundNodeNodegraph;
			NodeGraph result = shipgraveyardGroundNodeNodegraph.Result;
			result.blockMap.GetItemsInBounds(ref bounds, dest);
			PermutationBehaviour.AssignNodesToGate(result, dest, "RectShipMid");
			dest.Clear();
			yield return shipgraveyardAirNodeNodegraph;
			NodeGraph result2 = shipgraveyardAirNodeNodegraph.Result;
			result2.blockMap.GetItemsInBounds(ref bounds, dest);
			PermutationBehaviour.EnsureNodesInBounds(result2, dest, bounds);
			PermutationBehaviour.AssignNodesToGate(result2, dest, "RectShipMid");
		}

		public override void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			if (rootObjects.TryGetValue("HOLDER: Environment", out var value) && value.transform.TryFind("HOLDER: Ship Chunks/RectShipMid", out var child))
			{
				GameObject val = Object.Instantiate<GameObject>(PermutationBehaviour.Addressable<GameObject>("RoR2/Base/shipgraveyard/RectShipMid.prefab"));
				val.AddComponent<GateStateSetter>().gateToDisableWhenEnabled = "RectShipMid";
				val.SetActive(false);
				val.AddComponent<DisableOcclusionNearby>().radius = 200f;
				val.transform.localPosition = new Vector3(0f, 47f, 110f);
				val.transform.localEulerAngles = new Vector3(10f, 40f, 0f);
				val.AddComponent<SetSceneObjectsActive>(out SetSceneObjectsActive component);
				List<GameObject> objectsToDeactivate = component.objectsToDeactivate;
				Transform obj = value.transform.Find("HOLDER: Main Spikes/Spikes In Play.007");
				objectsToDeactivate.Add((obj != null) ? ((Component)obj).gameObject : null);
				if (value.transform.TryFind("HOLDER: Main Spikes/Spikes In Play.003", out var child2))
				{
					GameObject val2 = Object.Instantiate<GameObject>(((Component)child2).gameObject, child2.parent);
					val2.transform.localPosition = new Vector3(-40f, 10f, 94f);
					val2.transform.localScale = new Vector3(903.583f, 903.586f, 3921.5f);
					val2.SetActive(false);
					component.objectsToActivate.Add(val2);
				}
				ref GameObjectToggleGroup[] toggleGroups = ref toggleGroupController.toggleGroups;
				GameObjectToggleGroup val3 = new GameObjectToggleGroup
				{
					objects = (GameObject[])(object)new GameObject[2]
					{
						((Component)child).gameObject,
						val
					},
					minEnabled = 1,
					maxEnabled = 1
				};
				ArrayUtils.ArrayAppend<GameObjectToggleGroup>(ref toggleGroups, ref val3);
			}
		}
	}
}
namespace StagePermutations.rootjungle
{
	[RegisterPermutation("rootjungle", "Sundered Grove", "Mushroom Platform Variation", description = "A mushroom platform on Sundered Grove will sometimes disappear")]
	public class ShroomShelf : PermutationBehaviour, StagePermutationsProvider.IStaticContent
	{
		private const string GATE_NAME = "OnShroomShelf";

		public IEnumerator LoadAsync(IProgress<float> progressReceiver)
		{
			AsyncOperationHandle<NodeGraph> rootjungleGroundNodesNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/rootjungle/rootjungleGroundNodesNodegraph.asset");
			AsyncOperationHandle<NodeGraph> rootjungleAirNodesNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/rootjungle/rootjungleAirNodesNodegraph.asset");
			List<NodeIndex> dest = new List<NodeIndex>();
			yield return rootjungleGroundNodesNodegraph;
			NodeGraph result = rootjungleGroundNodesNodegraph.Result;
			result.blockMap.GetItemsInSphere(new Vector3(63f, 30f, 90f), 30f, dest);
			PermutationBehaviour.AssignNodesToGate(result, dest, "OnShroomShelf");
			dest.Clear();
			yield return rootjungleAirNodesNodegraph;
			NodeGraph result2 = rootjungleAirNodesNodegraph.Result;
			result2.blockMap.GetItemsInSphere(new Vector3(63f, 30f, 90f), 30f, dest);
			PermutationBehaviour.AssignNodesToGate(result2, dest, "OnShroomShelf");
		}

		public override SceneObjectToggleGroup FindToggleGroupController(Scene scene, IDictionary<string, GameObject> rootObjects)
		{
			if (rootObjects.TryGetValue("SceneInfo", out var value))
			{
				Transform obj = value.transform.Find("SceneObjectToggleGroup");
				if (obj == null)
				{
					return null;
				}
				return ((Component)obj).GetComponent<SceneObjectToggleGroup>();
			}
			return null;
		}

		public override void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Expected O, but got Unknown
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			if (!rootObjects.TryGetValue("HOLDER: Props", out var value) || !value.transform.TryFind("GROUP: Mushrooms/RJShroomBig", out var child))
			{
				return;
			}
			GameObject val = new GameObject("RJShroomBigDisabled");
			val.AddComponent<GateStateSetter>().gateToDisableWhenEnabled = "OnShroomShelf";
			val.SetActive(false);
			if (rootObjects.TryGetValue("HOLDER: Foliage", out var value2) && value2.transform.TryFind("GROUP: ShroomFoliage", out var child2))
			{
				val.AddComponent<SetSceneObjectsActive>(out SetSceneObjectsActive component);
				foreach (Transform item in child2)
				{
					Transform val2 = item;
					Vector3 val3 = val2.position - new Vector3(63f, 30f, 90f);
					if (((Vector3)(ref val3)).sqrMagnitude <= 1600f)
					{
						component.objectsToDeactivate.Add(((Component)val2).gameObject);
					}
				}
			}
			ref GameObjectToggleGroup[] toggleGroups = ref toggleGroupController.toggleGroups;
			GameObjectToggleGroup val4 = new GameObjectToggleGroup
			{
				objects = (GameObject[])(object)new GameObject[2]
				{
					((Component)child).gameObject,
					val
				},
				minEnabled = 1,
				maxEnabled = 1
			};
			ArrayUtils.ArrayAppend<GameObjectToggleGroup>(ref toggleGroups, ref val4);
		}
	}
}
namespace StagePermutations.goolake
{
	[RegisterPermutation("goolake", "Abandoned Aqueduct", "Receded Aqueduct", description = "The main aqueduct on Abandoned Aqueduct will sometimes move towards the wall to make room for a new eel skeleton")]
	public class RecededAqueduct : PermutationBehaviour, StagePermutationsProvider.IStaticContent
	{
		private const string GATE_NAME = "BlockedByEel";

		public GameObject goolakeBoulderPrefab;

		public IEnumerator LoadAsync(IProgress<float> progressReceiver)
		{
			AsyncOperationHandle<NodeGraph> goolakeAirNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/goolake/goolakeAirNodegraph.asset");
			yield return goolakeAirNodegraph;
			NodeGraph result = goolakeAirNodegraph.Result;
			List<NodeIndex> list = new List<NodeIndex>();
			result.blockMap.GetItemsInSphere(new Vector3(151f, -102f, 98f), 10f, list);
			PermutationBehaviour.AssignNodesToGate(result, list, "BlockedByEel");
			result.SetGateState("BlockedByEel", true);
		}

		public override void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_033f: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: 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_03c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0407: Unknown result type (might be due to invalid IL or missing references)
			//IL_041d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0427: Unknown result type (might be due to invalid IL or missing references)
			//IL_043a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0444: Unknown result type (might be due to invalid IL or missing references)
			//IL_0457: Unknown result type (might be due to invalid IL or missing references)
			//IL_0461: Unknown result type (might be due to invalid IL or missing references)
			//IL_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_047e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0520: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)goolakeBoulderPrefab))
			{
				goolakeBoulderPrefab = Prefab.Clone(PermutationBehaviour.Addressable<GameObject>("RoR2/Base/golemplains2/BBBoulderMediumRound1.prefab"), "GlBoulderApproximation");
				((Renderer)goolakeBoulderPrefab.GetComponent<MeshRenderer>()).sharedMaterial = PermutationBehaviour.Addressable<Material>("RoR2/Base/goolake/matGoolakeRocks.mat");
			}
			if (!rootObjects.TryGetValue("HOLDER: GameplaySpace", out var value) || !value.transform.TryFind("Terrain/mdlGlDam/mdlGlAqueductPartial", out var child))
			{
				return;
			}
			Transform transform = Object.Instantiate<GameObject>(((Component)child).gameObject, child.parent).transform;
			transform.localPosition = new Vector3(-0.89f, 1.2f, -0.53f);
			transform.localEulerAngles = new Vector3(0f, 2f, 0f);
			transform.localScale = new Vector3(1.225f, 1.263564f, 0.9f);
			((Component)transform).gameObject.AddComponent<GateStateSetter>().gateToDisableWhenEnabled = "BlockedByEel";
			((Component)transform).gameObject.SetActive(false);
			((Component)transform).gameObject.AddComponent<SetSceneObjectsActive>(out SetSceneObjectsActive component);
			if (transform.TryFind("GooWaterfall", out var child2))
			{
				((Component)child2).gameObject.SetActive(false);
			}
			if (rootObjects.TryGetValue("HOLDER: Misc Props", out var value2) && value2.transform.TryFind("Props", out var child3))
			{
				Transform val = child3.AllChildren().FirstOrDefault((Func<Transform, bool>)((Transform x) => !((Component)x).gameObject.activeSelf && ((Object)((Component)x).gameObject).name == "EelSkeleton"));
				if (Object.op_Implicit((Object)(object)val))
				{
					Transform transform2 = Object.Instantiate<GameObject>(((Component)val).gameObject, val.parent).transform;
					transform2.localPosition = new Vector3(19.4f, -27f, -78f);
					transform2.localEulerAngles = new Vector3(53f, 78f, 339f);
					transform2.localScale = Vector3.one * 14.4f;
					((Component)transform2).gameObject.SetActive(false);
					component.objectsToActivate.Add(((Component)transform2).gameObject);
					Transform transform3 = Object.Instantiate<GameObject>(((Component)val).gameObject, val.parent).transform;
					transform3.localPosition = new Vector3(-79f, -87f, -128f);
					transform3.localEulerAngles = new Vector3(25f, 226f, 173f);
					transform3.localScale = Vector3.one * 9f;
					((Component)transform3).gameObject.SetActive(false);
					component.objectsToActivate.Add(((Component)transform3).gameObject);
				}
			}
			PermutationBehaviour.Addressable<GameObject>("RoR2/Base/goolake/spmGlBamboo1Large.spm", out var asset);
			PermutationBehaviour.Addressable<GameObject>("RoR2/Base/goolake/spmGlBamboo1.spm", out var asset2);
			PermutationBehaviour.Addressable<GameObject>("RoR2/Base/goolake/spmGlCactusBush1.spm", out var asset3);
			GameObject[] array = (GameObject[])(object)new GameObject[7]
			{
				Object.Instantiate<GameObject>(goolakeBoulderPrefab, new Vector3(171f, -115f, 96f), Quaternion.Euler(340f, 0f, 0f)),
				Object.Instantiate<GameObject>(goolakeBoulderPrefab, new Vector3(155f, -112f, 117f), Quaternion.Euler(340f, 40f, 0f)),
				Object.Instantiate<GameObject>(asset, new Vector3(163f, -114f, 127f), Quaternion.Euler(5f, 20f, 0f)),
				Object.Instantiate<GameObject>(asset2, new Vector3(169f, -114f, 124f), Quaternion.Euler(0f, 0f, 350f)),
				Object.Instantiate<GameObject>(asset2, new Vector3(180f, -117f, 107f), Quaternion.Euler(5f, 30f, 340f)),
				Object.Instantiate<GameObject>(asset3, new Vector3(177f, -114f, 116f), Quaternion.Euler(0f, 0f, 330f)),
				Object.Instantiate<GameObject>(asset3, new Vector3(180.5f, -116f, 112f), Quaternion.Euler(30f, 80f, 5f))
			};
			array[0].transform.localScale = Vector3.one * 5.5f;
			array[1].transform.localScale = Vector3.one * 2.5f;
			array[2].transform.localScale = Vector3.one * 1.5f;
			array[3].transform.localScale = Vector3.one * 1.5f;
			array[4].transform.localScale = new Vector3(1.2f, 1.6f, 1.2f);
			array[5].transform.localScale = Vector3.one * 1.5f;
			array[6].transform.localScale = Vector3.one * 0.8f;
			GameObject[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				array2[i].gameObject.SetActive(false);
			}
			component.objectsToActivate.AddRange(array);
			ref GameObjectToggleGroup[] toggleGroups = ref toggleGroupController.toggleGroups;
			GameObjectToggleGroup val2 = new GameObjectToggleGroup
			{
				objects = (GameObject[])(object)new GameObject[2]
				{
					((Component)child).gameObject,
					((Component)transform).gameObject
				},
				minEnabled = 1,
				maxEnabled = 1
			};
			ArrayUtils.ArrayAppend<GameObjectToggleGroup>(ref toggleGroups, ref val2);
		}
	}
	[RegisterPermutation("goolake", "Abandoned Aqueduct", "Second Aqueduct", description = "A second aqueduct structure will sometimes appear on Abandoned Aqueduct")]
	public class SecondAqueduct : PermutationBehaviour, StagePermutationsProvider.IStaticContent
	{
		private const string GATE_NAME = "SecondaryAqueduct";

		public IEnumerator LoadAsync(IProgress<float> progressReceiver)
		{
			AsyncOperationHandle<NodeGraph> goolakeGroundNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/goolake/goolakeGroundNodegraph.asset");
			AsyncOperationHandle<NodeGraph> goolakeAirNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/goolake/goolakeAirNodegraph.asset");
			yield return goolakeGroundNodegraph;
			NodeGraph result = goolakeGroundNodegraph.Result;
			List<NodeIndex> dest = new List<NodeIndex>();
			Bounds val = default(Bounds);
			((Bounds)(ref val)).min = new Vector3(210f, -95f, -260f);
			((Bounds)(ref val)).max = new Vector3(230f, -30f, -224f);
			Bounds bounds = val;
			result.blockMap.GetItemsInBounds(ref bounds, dest);
			PermutationBehaviour.AssignNodesToGate(result, dest, "SecondaryAqueduct");
			yield return goolakeAirNodegraph;
			NodeGraph result2 = goolakeAirNodegraph.Result;
			dest.Clear();
			result2.blockMap.GetItemsInBounds(ref bounds, dest);
			PermutationBehaviour.AssignNodesToGate(result2, dest, "SecondaryAqueduct");
		}

		public override void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: 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)
			if (rootObjects.TryGetValue("HOLDER: GameplaySpace", out var value) && value.transform.TryFind("Terrain/mdlGlDam/mdlGlAqueductPartial", out var child))
			{
				GameObject val = new GameObject("SecondaryAqueductToggle");
				val.AddComponent<GateStateSetter>().gateToDisableWhenEnabled = "SecondaryAqueduct";
				val.SetActive(false);
				val.AddComponent<SetSceneObjectsActive>(out SetSceneObjectsActive component);
				val.transform.localEulerAngles = new Vector3(0f, 18.7f, 180f);
				Transform transform = Object.Instantiate<GameObject>(((Component)child).gameObject, val.transform).transform;
				transform.localPosition = new Vector3(-264.7861f, 94.7f, -158.4718f);
				transform.localScale = new Vector3(10f, 14.29f, 8f);
				if (transform.TryFind("GooWaterfall/FoamOverParticles", out var child2))
				{
					child2.localScale = new Vector3(0.8f, 1f, 0.5f);
				}
				if (transform.TryFind("GooWaterfall/SplashZone, Directional", out var child3))
				{
					Transform obj = child3;
					Vector3 localPosition = child3.localPosition;
					localPosition.y = 2.5f;
					obj.localPosition = localPosition;
				}
				if (rootObjects.TryGetValue("HOLDER: Warning Flags", out var value2))
				{
					List<GameObject> objectsToDeactivate = component.objectsToDeactivate;
					Transform obj2 = value2.transform.Find("GLWarningFlag");
					objectsToDeactivate.Add((obj2 != null) ? ((Component)obj2).gameObject : null);
					List<GameObject> objectsToDeactivate2 = component.objectsToDeactivate;
					Transform obj3 = value2.transform.Find("GLWarningFlag (2)");
					objectsToDeactivate2.Add((obj3 != null) ? ((Component)obj3).gameObject : null);
				}
				if (value.transform.TryFind("Gates/BridgeOverGooOff", out var child4))
				{
					component.objectsToActivate.Add(((Component)child4).gameObject);
				}
				ArrayUtils.ArrayAppend<GameObject>(ref toggleGroupController.toggleGroups[0].objects, ref val);
			}
		}
	}
}
namespace StagePermutations.golemplains
{
	[RegisterPermutation("golemplains2", "Titanic Plains", "Colossus Heads", description = "Two Colossus heads will sometimes appear on the alternate Titanic Plains variant")]
	public class ColossusHead : PermutationBehaviour, StagePermutationsProvider.IStaticContent
	{
		private const string GATE_NAME_RUINED = "BlockedByRuinedColossusHead";

		private const string GATE_NAME_FULL = "BlockedByFullColossusHead";

		public Material matColossusHeadMossy;

		public IEnumerator LoadAsync(IProgress<float> progressReceiver)
		{
			AsyncOperationHandle<NodeGraph> golemplains2GroundNodesNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/golemplains2/golemplains2GroundNodesNodegraph.asset");
			AsyncOperationHandle<NodeGraph> golemplains2AirNodesNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/golemplains2/golemplains2AirNodesNodegraph.asset");
			List<NodeIndex> dest = new List<NodeIndex>();
			yield return golemplains2GroundNodesNodegraph;
			NodeGraph result = golemplains2GroundNodesNodegraph.Result;
			result.blockMap.GetItemsInSphere(new Vector3(236.6f, 43.9f, 45.2f), 5f, dest);
			result.blockMap.GetItemsInSphere(new Vector3(245.7f, 45f, 45f), 5f, dest);
			result.blockMap.GetItemsInSphere(new Vector3(251f, 45f, 35f), 5f, dest);
			result.blockMap.GetItemsInSphere(new Vector3(250f, 43f, 25.6f), 5f, dest);
			PermutationBehaviour.AssignNodesToGate(result, dest, "BlockedByRuinedColossusHead");
			dest.Clear();
			result.blockMap.GetItemsInSphere(new Vector3(-28.8f, 47.6f, -154f), 30f, dest);
			PermutationBehaviour.AssignNodesToGate(result, dest, "BlockedByFullColossusHead");
			dest.Clear();
			yield return golemplains2AirNodesNodegraph;
			NodeGraph result2 = golemplains2AirNodesNodegraph.Result;
			result2.blockMap.GetItemsInSphere(new Vector3(235f, 60f, 33f), 20f, dest);
			PermutationBehaviour.AssignNodesToGate(result2, dest, "BlockedByRuinedColossusHead");
			dest.Clear();
			result2.blockMap.GetItemsInSphere(new Vector3(-23f, 70f, -155f), 30f, dest);
			PermutationBehaviour.AssignNodesToGate(result2, dest, "BlockedByFullColossusHead");
		}

		public override void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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 (!Object.op_Implicit((Object)(object)matColossusHeadMossy))
			{
				PermutationBehaviour.Addressable<Material>("RoR2/Base/golemplains/matGPBoulderHeavyMoss.mat", out var asset);
				matColossusHeadMossy = new Material(asset);
				matColossusHeadMossy.SetTexture("_NormalTex", PermutationBehaviour.Addressable<Texture>("RoR2/Junk/slice2/texColossusHead1Normal.png"));
				matColossusHeadMossy.SetTextureScale("_NormalTex", new Vector2(1f, 1f));
				matColossusHeadMossy.SetTextureScale("_MainTex", new Vector2(3f, 8f));
				matColossusHeadMossy.SetTextureScale("_SnowTex", new Vector2(10f, 10f));
				matColossusHeadMossy.SetFloat("_SnowBias", 0.14f);
				matColossusHeadMossy.SetFloat("_Depth", 0.3f);
				matColossusHeadMossy.SetInt("_RampInfo", 3);
			}
			ApplyRuinedHead(rootObjects, toggleGroupController);
			ApplyFullHead(rootObjects, toggleGroupController);
		}

		public void ApplyRuinedHead(IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_0046: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			if (rootObjects.TryGetValue("HOLDER: Ruins", out var value) && value.transform.TryFind("GPRuinedRing1 (1)", out var child))
			{
				GameObject val = Object.Instantiate<GameObject>(PermutationBehaviour.Addressable<GameObject>("RoR2/DLC1/voidraid/mdlRaidColossusHeadDestroyed.fbx"));
				Transform obj = val.transform.Find("mdlRaidColossusHeadDestroyed");
				obj.localPosition = Vector3.zero;
				obj.localEulerAngles = Vector3.zero;
				obj.localScale = Vector3.one * 5f;
				((Renderer)((Component)obj).GetComponent<MeshRenderer>()).sharedMaterial = matColossusHeadMossy;
				((Component)obj).gameObject.layer = LayerIndex.world.intVal;
				((Component)obj).gameObject.AddComponent<MeshCollider>();
				((Component)obj).gameObject.AddComponent<SurfaceDefProvider>().surfaceDef = PermutationBehaviour.Addressable<SurfaceDef>("RoR2/Base/Common/sdStone.asset");
				val.transform.localPosition = new Vector3(235f, 65.1f, 30f);
				val.transform.localEulerAngles = new Vector3(270f, 300f, 0f);
				val.AddComponent<GateStateSetter>().gateToDisableWhenEnabled = "BlockedByRuinedColossusHead";
				val.SetActive(false);
				ref GameObjectToggleGroup[] toggleGroups = ref toggleGroupController.toggleGroups;
				GameObjectToggleGroup val2 = new GameObjectToggleGroup
				{
					objects = (GameObject[])(object)new GameObject[2]
					{
						((Component)child).gameObject,
						val
					},
					minEnabled = 1,
					maxEnabled = 1
				};
				ArrayUtils.ArrayAppend<GameObjectToggleGroup>(ref toggleGroups, ref val2);
			}
		}

		public void ApplyFullHead(IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			if (rootObjects.TryGetValue("HOLDER: Columns", out var value))
			{
				Transform val = (from x in value.transform.AllChildren()
					where ((Object)x).name == "GPTerrainColumn"
					select x).ElementAtOrDefault(2);
				if (Object.op_Implicit((Object)(object)val))
				{
					GameObject val2 = Object.Instantiate<GameObject>(((Component)val).gameObject, val.parent);
					Transform transform = val2.transform;
					Vector3 localPosition = ((Component)val).transform.localPosition;
					localPosition.y = 0f;
					transform.localPosition = localPosition;
					val2.SetActive(false);
					Transform transform2 = new GameObject("colossusHead1Parent").transform;
					GameObject obj = Object.Instantiate<GameObject>(PermutationBehaviour.Addressable<GameObject>("RoR2/Base/Common/Props/mdlColossusHead1.fbx"), transform2);
					((Renderer)obj.GetComponent<MeshRenderer>()).sharedMaterial = matColossusHeadMossy;
					obj.layer = LayerIndex.world.intVal;
					obj.AddComponent<MeshCollider>();
					obj.AddComponent<SurfaceDefProvider>().surfaceDef = PermutationBehaviour.Addressable<SurfaceDef>("RoR2/Base/Common/sdStone.asset");
					obj.transform.localScale = Vector3.one * 5f;
					obj.transform.localEulerAngles = new Vector3(270f, 0f, 0f);
					transform2.localPosition = new Vector3(-35f, 38f, -152f);
					transform2.localEulerAngles = new Vector3(355f, 75f, 350f);
					((Component)transform2).gameObject.AddComponent<GateStateSetter>().gateToDisableWhenEnabled = "BlockedByFullColossusHead";
					((Component)transform2).gameObject.SetActive(false);
					SetSceneObjectsActive setSceneObjectsActive = ((Component)transform2).gameObject.AddComponent<SetSceneObjectsActive>();
					setSceneObjectsActive.objectsToDeactivate = new List<GameObject>(1) { ((Component)val).gameObject };
					setSceneObjectsActive.objectsToActivate = new List<GameObject>(1) { val2 };
					ref GameObject[] objects = ref toggleGroupController.toggleGroups[3].objects;
					GameObject gameObject = ((Component)transform2).gameObject;
					ArrayUtils.ArrayAppend<GameObject>(ref objects, ref gameObject);
				}
			}
		}
	}
	[RegisterPermutation("golemplains", "Titanic Plains", "Longer Backwall", description = "The backwall on the original Titanic Plains variant will sometimes extend to the edge of the stage")]
	public class MoreBackwall : PermutationBehaviour, StagePermutationsProvider.IStaticContent
	{
		private const string GATE_NAME = "BlockedByFullColossusHead";

		public IEnumerator LoadAsync(IProgress<float> progressReceiver)
		{
			AsyncOperationHandle<NodeGraph> golemplainsGroundNodesNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/golemplains/golemplainsGroundNodesNodegraph.asset");
			AsyncOperationHandle<NodeGraph> golemplainsAirNodesNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/golemplains/golemplainsAirNodesNodegraph.asset");
			List<NodeIndex> dest = new List<NodeIndex>();
			yield return golemplainsGroundNodesNodegraph;
			NodeGraph result = golemplainsGroundNodesNodegraph.Result;
			BlockMap<NodeIndex, NodePositionGetter> blockMap = result.blockMap;
			Bounds val = new Bounds(new Vector3(-70f, -140f, -362f), new Vector3(100f, 40f, 55f));
			blockMap.GetItemsInBounds(ref val, dest);
			result.blockMap.GetItemsInSphere(new Vector3(50f, -120f, -380f), 100f, dest);
			result.blockMap.GetItemsInSphere(new Vector3(-33.5f, -152.7f, -332.2f), 3f, dest);
			PermutationBehaviour.AssignNodesToGate(result, dest, "BlockedByFullColossusHead");
			dest.Clear();
			yield return golemplainsAirNodesNodegraph;
			NodeGraph result2 = golemplainsAirNodesNodegraph.Result;
			BlockMap<NodeIndex, NodePositionGetter> blockMap2 = result2.blockMap;
			val = new Bounds(new Vector3(-70f, -140f, -362f), new Vector3(100f, 40f, 60f));
			blockMap2.GetItemsInBounds(ref val, dest);
			result2.blockMap.GetItemsInSphere(new Vector3(50f, -120f, -380f), 100f, dest);
			result2.blockMap.GetItemsInSphere(new Vector3(-96f, -122f, -397f), 20f, dest);
			PermutationBehaviour.AssignNodesToGate(result2, dest, "BlockedByFullColossusHead");
		}

		public override void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			GameObject.CreatePrimitive((PrimitiveType)3);
			GameObject.CreatePrimitive((PrimitiveType)0);
			GameObject val = Object.Instantiate<GameObject>(PermutationBehaviour.Addressable<GameObject>("RoR2/Base/dampcave/DCTerrainBackwall.prefab"));
			val.transform.localPosition = new Vector3(253f, -42f, -310f);
			val.transform.localEulerAngles = new Vector3(270f, 112f, 0f);
			((Renderer)val.GetComponent<MeshRenderer>()).sharedMaterial = PermutationBehaviour.Addressable<Material>("RoR2/Base/golemplains/matGPTerrain.mat");
			val.AddComponent<GateStateSetter>().gateToDisableWhenEnabled = "BlockedByFullColossusHead";
			val.SetActive(false);
			if (rootObjects.TryGetValue("HOLDER: Ruined Pieces", out var value) && value.transform.TryFind("GPRuinedRing1 (3)", out var child))
			{
				val.AddComponent<SetSceneObjectsActive>().objectsToDeactivate = new List<GameObject>(1) { ((Component)child).gameObject };
			}
			ref GameObjectToggleGroup[] toggleGroups = ref toggleGroupController.toggleGroups;
			GameObjectToggleGroup val2 = new GameObjectToggleGroup
			{
				objects = (GameObject[])(object)new GameObject[1] { val },
				minEnabled = 0,
				maxEnabled = 1
			};
			ArrayUtils.ArrayAppend<GameObjectToggleGroup>(ref toggleGroups, ref val2);
		}
	}
}
namespace StagePermutations.foggyswamp
{
	[RegisterPermutation("foggyswamp", "Wetland Aspect", "Ruin Platform Variation", description = "Sometimes the ruin platform near the edge of Wetland Aspect will disappear")]
	public class FramePlatform : PermutationBehaviour, StagePermutationsProvider.IStaticContent
	{
		private const string GATE_NAME = "RuinFramePlatform";

		public IEnumerator LoadAsync(IProgress<float> progressReceiver)
		{
			AsyncOperationHandle<NodeGraph> foggyswampGroundNodesNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/foggyswamp/foggyswampGroundNodesNodegraph.asset");
			AsyncOperationHandle<NodeGraph> foggyswampAirNodesNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/foggyswamp/foggyswampAirNodesNodegraph.asset");
			List<NodeIndex> dest = new List<NodeIndex>();
			Bounds[] array = new Bounds[2];
			Bounds val = default(Bounds);
			((Bounds)(ref val)).min = new Vector3(84f, -155f, -341f);
			((Bounds)(ref val)).max = new Vector3(149f, -111f, -301f);
			array[0] = val;
			val = default(Bounds);
			((Bounds)(ref val)).min = new Vector3(128f, -142f, -340f);
			((Bounds)(ref val)).max = new Vector3(209f, -89f, -284f);
			array[1] = val;
			Bounds[] bounds = (Bounds[])(object)array;
			yield return foggyswampGroundNodesNodegraph;
			NodeGraph result = foggyswampGroundNodesNodegraph.Result;
			Bounds[] array2 = bounds;
			for (int i = 0; i < array2.Length; i++)
			{
				Bounds bounds2 = array2[i];
				result.blockMap.GetItemsInBounds(ref bounds2, dest);
				PermutationBehaviour.EnsureNodesInBounds(result, dest, bounds2);
				PermutationBehaviour.AssignNodesToGate(result, dest, "RuinFramePlatform");
				dest.Clear();
			}
			yield return foggyswampAirNodesNodegraph;
			NodeGraph result2 = foggyswampAirNodesNodegraph.Result;
			array2 = bounds;
			for (int i = 0; i < array2.Length; i++)
			{
				Bounds bounds3 = array2[i];
				result2.blockMap.GetItemsInBounds(ref bounds3, dest);
				PermutationBehaviour.EnsureNodesInBounds(result2, dest, bounds3);
				PermutationBehaviour.AssignNodesToGate(result2, dest, "RuinFramePlatform");
				dest.Clear();
			}
		}

		public override void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Expected O, but got Unknown
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			if (!rootObjects.TryGetValue("HOLDER: Ruin Pieces", out var value) || !value.transform.TryFind("FSGiantRuinFrameCollision", out var child))
			{
				return;
			}
			GameObject val = new GameObject("FSGiantRuinFrameCollisionDisabled");
			val.AddComponent<GateStateSetter>().gateToDisableWhenEnabled = "RuinFramePlatform";
			val.SetActive(false);
			if (rootObjects.TryGetValue("HOLDER: Foliage", out var value2))
			{
				val.AddComponent<SetSceneObjectsActive>(out SetSceneObjectsActive component);
				Bounds[] array = new Bounds[2];
				Bounds val2 = default(Bounds);
				((Bounds)(ref val2)).min = new Vector3(84f, -160f, -341f);
				((Bounds)(ref val2)).max = new Vector3(149f, -111f, -301f);
				array[0] = val2;
				val2 = default(Bounds);
				((Bounds)(ref val2)).min = new Vector3(128f, -160f, -340f);
				((Bounds)(ref val2)).max = new Vector3(209f, -89f, -284f);
				array[1] = val2;
				Bounds[] array2 = (Bounds[])(object)array;
				foreach (Transform item in value2.transform)
				{
					foreach (Transform item2 in item)
					{
						Transform val3 = item2;
						Bounds[] array3 = array2;
						for (int i = 0; i < array3.Length; i++)
						{
							Bounds val4 = array3[i];
							if (((Bounds)(ref val4)).Contains(val3.position))
							{
								component.objectsToDeactivate.Add(((Component)val3).gameObject);
								break;
							}
						}
					}
				}
			}
			ref GameObjectToggleGroup[] toggleGroups = ref toggleGroupController.toggleGroups;
			GameObjectToggleGroup val5 = new GameObjectToggleGroup
			{
				objects = (GameObject[])(object)new GameObject[2]
				{
					((Component)child).gameObject,
					val
				},
				minEnabled = 1,
				maxEnabled = 1
			};
			ArrayUtils.ArrayAppend<GameObjectToggleGroup>(ref toggleGroups, ref val5);
		}
	}
	[RegisterPermutation("foggyswamp", "Wetland Aspect", "More Ruin Rings", description = "Two more floating ruin rings will sometimes appear on Wetland Aspect")]
	public class MoreRings : PermutationBehaviour
	{
		public override void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: 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_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			if (rootObjects.TryGetValue("HOLDER: Tree Trunks w Collision", out var value) && value.transform.TryFind("FSTreeTrunkLongCollision (1)/FSRuinRingCollision", out var child))
			{
				GameObject val = Object.Instantiate<GameObject>(((Component)child).gameObject, new Vector3(-5f, 0f, 26f), Quaternion.Euler(5f, 0f, 90f));
				val.SetActive(false);
				val.transform.localScale = Vector3.one * 22f;
				GameObject val2 = Object.Instantiate<GameObject>(((Component)child).gameObject, new Vector3(-39f, 65f, -82f), Quaternion.Euler(0f, 0f, 90f));
				val2.SetActive(false);
				val2.transform.localScale = Vector3.one * 22f;
				ref GameObjectToggleGroup[] toggleGroups = ref toggleGroupController.toggleGroups;
				GameObjectToggleGroup val3 = new GameObjectToggleGroup
				{
					objects = (GameObject[])(object)new GameObject[2] { val, val2 },
					minEnabled = 0,
					maxEnabled = 2
				};
				ArrayUtils.ArrayAppend<GameObjectToggleGroup>(ref toggleGroups, ref val3);
			}
		}
	}
	[RegisterPermutation("foggyswamp", "Wetland Aspect", "Stump to Tree", description = "Sometimes the large tree stump on Wetland Aspect will be replaced by a full tree")]
	public class StumpToTree : PermutationBehaviour
	{
		public override void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			if (rootObjects.TryGetValue("HOLDER: Tree Trunks w Collision", out var value) && value.transform.TryFind("CompositeTreeTrunk", out var child) && value.transform.TryFind("FSTreeTrunkStumpCollision (5)", out var child2))
			{
				GameObject val = Object.Instantiate<GameObject>(((Component)child).gameObject, child.parent);
				val.SetActive(false);
				val.transform.localPosition = new Vector3(-117f, -151f, -241f);
				Transform obj = val.transform.Find("FSTreeTrunkEnormousCollision (2)");
				if (obj != null)
				{
					((Component)obj).gameObject.SetActive(false);
				}
				if (val.transform.TryFind("FSTreeTrunkEnormousCollision", out var child3))
				{
					child3.localPosition = new Vector3(0f, -5f, 0f);
					child3.localEulerAngles = new Vector3(5f, 340f, 7f);
					child3.localScale = Vector3.one * 4.3f;
				}
				if (val.transform.TryFind("FSRootBundleLargeCollision (1)", out var child4))
				{
					child4.localPosition = new Vector3(-3f, -8f, 6f);
					child4.localEulerAngles = new Vector3(80f, 69f, 3f);
				}
				if (val.transform.TryFind("FSTreeTrunkEnormousNoCollisionSkybox", out var child5))
				{
					child5.localPosition = new Vector3(-15f, 0f, 0f);
					child5.localEulerAngles = new Vector3(0f, 10f, 357f);
				}
				if (val.transform.TryFind("FSRootBundleSmallNoCollision", out var child6))
				{
					child6.localPosition = new Vector3(2f, 2f, -17f);
				}
				val.AddComponent<DisableOcclusionNearby>().radius = 50f;
				ref GameObjectToggleGroup[] toggleGroups = ref toggleGroupController.toggleGroups;
				GameObjectToggleGroup val2 = new GameObjectToggleGroup
				{
					objects = (GameObject[])(object)new GameObject[2]
					{
						((Component)child2).gameObject,
						val
					},
					minEnabled = 1,
					maxEnabled = 1
				};
				ArrayUtils.ArrayAppend<GameObjectToggleGroup>(ref toggleGroups, ref val2);
			}
		}
	}
}
namespace StagePermutations.blackbeach
{
	[RegisterPermutation("blackbeach", "Distant Roost", "New Ruin Gate", description = "Sometimes a new ruin gate will appear on the upper walkway of the original Distant Roost variant")]
	public class MoreRuins : PermutationBehaviour, StagePermutationsProvider.IStaticContent
	{
		private const string GATE_NAME = "BlockedByRuinsPath";

		public IEnumerator LoadAsync(IProgress<float> progressReceiver)
		{
			AsyncOperationHandle<NodeGraph> blackbeachGroundNodes = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/blackbeach/blackbeachGroundNodes.asset");
			AsyncOperationHandle<NodeGraph> blackbeachAirNodes = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/blackbeach/blackbeachAirNodes.asset");
			List<NodeIndex> dest = new List<NodeIndex>();
			yield return blackbeachGroundNodes;
			NodeGraph result = blackbeachGroundNodes.Result;
			result.blockMap.GetItemsInSphere(new Vector3(103f, -159f, -78f), 5f, dest);
			PermutationBehaviour.AssignNodesToGate(result, dest, "BlockedByRuinsPath");
			dest.Clear();
			yield return blackbeachAirNodes;
			NodeGraph result2 = blackbeachAirNodes.Result;
			result2.blockMap.GetItemsInSphere(new Vector3(123f, -135f, -75f), 10f, dest);
			PermutationBehaviour.AssignNodesToGate(result2, dest, "BlockedByRuinsPath");
		}

		public override void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			if (rootObjects.TryGetValue("GAMEPLAY SPACE", out var value) && value.transform.TryFind("BbRuinGate_LOD0 (2)", out var child))
			{
				GameObject val = new GameObject("ToggleableRuins");
				val.AddComponent<GateStateSetter>().gateToDisableWhenEnabled = "BlockedByRuinsPath";
				val.SetActive(false);
				val.transform.SetParent(value.transform, false);
				Object.Instantiate<GameObject>(((Component)child).gameObject, val.transform).transform.localPosition = new Vector3(130f, -135f, -74.5f);
				PermutationBehaviour.Addressable<Mesh>("RoR2/Base/blackbeach/BbRuinStep1_LOD0.fbx", out var asset);
				if (value.transform.TryFind("BbRuinStep1_LOD0 (1)", out var child2))
				{
					GameObject obj = Object.Instantiate<GameObject>(((Component)child2).gameObject, val.transform);
					obj.GetComponent<MeshFilter>().sharedMesh = asset;
					obj.transform.localPosition = new Vector3(96f, -155.5f, -64f);
					obj.transform.localEulerAngles = new Vector3(270f, 240f, 0f);
					GameObject obj2 = Object.Instantiate<GameObject>(((Component)child2).gameObject, val.transform);
					obj2.GetComponent<MeshFilter>().sharedMesh = asset;
					obj2.transform.localPosition = new Vector3(108f, -151.5f, -63f);
					obj2.transform.localEulerAngles = new Vector3(270f, 255f, 0f);
				}
				ref GameObjectToggleGroup[] toggleGroups = ref toggleGroupController.toggleGroups;
				GameObjectToggleGroup val2 = new GameObjectToggleGroup
				{
					objects = (GameObject[])(object)new GameObject[1] { val },
					minEnabled = 0,
					maxEnabled = 1
				};
				ArrayUtils.ArrayAppend<GameObjectToggleGroup>(ref toggleGroups, ref val2);
			}
		}
	}
	[RegisterPermutation("blackbeach2", "Distant Roost", "Ruin Gate Door", description = "Sometimes the door of the large ruin gate on the alternate Distant Roost variant will be closed")]
	public class RuinGateDoor : PermutationBehaviour, StagePermutationsProvider.IStaticContent
	{
		private const string GATE_NAME = "BlockedByRuinGateDoor";

		public IEnumerator LoadAsync(IProgress<float> progressReceiver)
		{
			AsyncOperationHandle<NodeGraph> blackbeach2GroundNodesNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/blackbeach2/blackbeach2GroundNodesNodegraph.asset");
			AsyncOperationHandle<NodeGraph> blackbeach2AirNodesNodegraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/Base/blackbeach2/blackbeach2AirNodesNodegraph.asset");
			List<NodeIndex> dest = new List<NodeIndex>();
			yield return blackbeach2GroundNodesNodegraph;
			NodeGraph result = blackbeach2GroundNodesNodegraph.Result;
			result.blockMap.GetItemsInSphere(new Vector3(-8f, 33f, -156f), 10f, dest);
			PermutationBehaviour.AssignNodesToGate(result, dest, "BlockedByRuinGateDoor");
			dest.Clear();
			yield return blackbeach2AirNodesNodegraph;
			NodeGraph result2 = blackbeach2AirNodesNodegraph.Result;
			result2.blockMap.GetItemsInSphere(new Vector3(-5f, 44f, -163f), 15f, dest);
			PermutationBehaviour.AssignNodesToGate(result2, dest, "BlockedByRuinGateDoor");
		}

		public override void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			if (rootObjects.TryGetValue("HOLDER: Ruins", out var value) && value.transform.TryFind("GROUP: Gates", out var child))
			{
				GameObject val = new GameObject("RuinGateDoor");
				val.AddComponent<GateStateSetter>().gateToDisableWhenEnabled = "BlockedByRuinGateDoor";
				val.SetActive(false);
				val.transform.parent = child.Find("BbRuinArch_LOD0");
				val.transform.localPosition = Vector3.zero;
				val.transform.localEulerAngles = Vector3.zero;
				val.transform.localScale = new Vector3(0.09f, 0.17f, 0.17f);
				GameObject val2 = Object.Instantiate<GameObject>(((Component)child.Find("DownstairsGate, Open/BbRuinGateDoor1_LOD0")).gameObject, val.transform);
				val2.transform.localPosition = new Vector3(0f, 0.75f, 0f);
				val2.transform.localEulerAngles = Vector3.zero;
				Transform transform = val2.transform;
				Vector3 localScale = val2.transform.localScale;
				localScale.z = 0f - val2.transform.localScale.z;
				transform.localScale = localScale;
				GameObject val3 = Object.Instantiate<GameObject>(((Component)child.Find("DownstairsGate, Open/BbRuinGateDoor2_LOD0")).gameObject, val.transform);
				val3.transform.localPosition = new Vector3(0f, -0.75f, 0f);
				val3.transform.localEulerAngles = Vector3.zero;
				Transform transform2 = val3.transform;
				localScale = val3.transform.localScale;
				localScale.z = 0f - val3.transform.localScale.z;
				transform2.localScale = localScale;
				ref GameObjectToggleGroup[] toggleGroups = ref toggleGroupController.toggleGroups;
				GameObjectToggleGroup val4 = new GameObjectToggleGroup
				{
					objects = (GameObject[])(object)new GameObject[1] { val },
					minEnabled = 0,
					maxEnabled = 1
				};
				ArrayUtils.ArrayAppend<GameObjectToggleGroup>(ref toggleGroups, ref val4);
			}
		}
	}
}
namespace StagePermutations.ancientloft
{
	[RegisterPermutation("ancientloft", "Aphelian Sanctuary", "Rocky Platform Variation", description = "Sometimes the rocky platform connected to Aphelian Sanctuary will disappear")]
	public class IslandPlatform : PermutationBehaviour, StagePermutationsProvider.IStaticContent
	{
		private const string GATE_NAME = "IslandPlatform";

		public IEnumerator LoadAsync(IProgress<float> progressReceiver)
		{
			AsyncOperationHandle<NodeGraph> ancientloft_GroundNodeGraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/DLC1/ancientloft/ancientloft_GroundNodeGraph.asset");
			AsyncOperationHandle<NodeGraph> ancientloft_AirNodeGraph = Addressables.LoadAssetAsync<NodeGraph>((object)"RoR2/DLC1/ancientloft/ancientloft_AirNodeGraph.asset");
			List<NodeIndex> dest = new List<NodeIndex>();
			Bounds[] array = new Bounds[2];
			Bounds val = default(Bounds);
			((Bounds)(ref val)).min = new Vector3(174f, 14f, -107f);
			((Bounds)(ref val)).max = new Vector3(284f, 105f, 150f);
			array[0] = val;
			val = default(Bounds);
			((Bounds)(ref val)).min = new Vector3(136f, 7f, 31f);
			((Bounds)(ref val)).max = new Vector3(218f, 56f, 110f);
			array[1] = val;
			Bounds[] bounds = (Bounds[])(object)array;
			yield return ancientloft_GroundNodeGraph;
			NodeGraph result = ancientloft_GroundNodeGraph.Result;
			Bounds[] array2 = bounds;
			for (int i = 0; i < array2.Length; i++)
			{
				Bounds val2 = array2[i];
				result.blockMap.GetItemsInBounds(ref val2, dest);
				PermutationBehaviour.AssignNodesToGate(result, dest, "IslandPlatform");
				dest.Clear();
			}
			yield return ancientloft_AirNodeGraph;
			NodeGraph result2 = ancientloft_AirNodeGraph.Result;
			array2 = bounds;
			for (int i = 0; i < array2.Length; i++)
			{
				Bounds val3 = array2[i];
				result2.blockMap.GetItemsInBounds(ref val3, dest);
				PermutationBehaviour.AssignNodesToGate(result2, dest, "IslandPlatform");
				dest.Clear();
			}
		}

		public override void Apply(Scene scene, IDictionary<string, GameObject> rootObjects, SceneObjectToggleGroup toggleGroupController)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Expected O, but got Unknown
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0509: Unknown result type (might be due to invalid IL or missing references)
			//IL_051b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0585: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: Expected O, but got Unknown
			//IL_0468: Unknown result type (might be due to invalid IL or missing references)
			//IL_046f: Expected O, but got Unknown
			//IL_0327: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			//IL_047c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			//IL_0487: Unknown result type (might be due to invalid IL or missing references)
			if (!rootObjects.TryGetValue("HOLDER: Terrain", out var value) || !value.transform.TryFind("TerrainPlatform (1)", out var child))
			{
				return;
			}
			GameObject val = new GameObject("TerrainPlatformDisabled");
			val.AddComponent<GateStateSetter>().gateToDisableWhenEnabled = "IslandPlatform";
			val.SetActive(false);
			val.AddComponent<SetSceneObjectsActive>(out SetSceneObjectsActive component);
			List<GameObject> objectsToDeactivate = component.objectsToDeactivate;
			Transform obj = value.transform.Find("mdlAncientLoft_FBridge (2)");
			objectsToDeactivate.Add((obj != null) ? ((Component)obj).gameObject : null);
			GameObject val2 = new GameObject("Edging the bridge");
			val2.transform.SetParent(val.transform, false);
			PermutationBehaviour.Addressable<GameObject>("RoR2/Base/wispgraveyard/WPPlanter2WithBonsaiTree.prefab", out var asset);
			GameObject obj2 = Object.Instantiate<GameObject>(asset, val.transform);
			obj2.transform.localPosition = new Vector3(182f, 18.8f, -15f);
			obj2.transform.eulerAngles = new Vector3(0f, 160f, 0f);
			GameObject obj3 = Object.Instantiate<GameObject>(asset, val.transform);
			obj3.transform.localPosition = new Vector3(182f, 18.8f, -42f);
			obj3.transform.eulerAngles = new Vector3(0f, 213f, 0f);
			Object.Instantiate<GameObject>(PermutationBehaviour.Addressable<GameObject>("RoR2/DLC1/ancientloft/AncientLoft_PillarHalfIntactSimpler.prefab"), val.transform).transform.localPosition = new Vector3(195f, -10f, 39f);
			GameObject obj4 = Object.Instantiate<GameObject>(PermutationBehaviour.Addressable<GameObject>("RoR2/DLC1/ancientloft/AncientLoft_TempleShrine.prefab"), val.transform);
			obj4.transform.localPosition = new Vector3(175f, 19.9f, -28.3f);
			obj4.transform.eulerAngles = new Vector3(0f, 90f, 0f);
			GameObject obj5 = Object.Instantiate<GameObject>(PermutationBehaviour.Addressable<GameObject>("RoR2/DLC1/ancientloft/AncientLoft_SpnningRocks.prefab"), val.transform);
			obj5.transform.localPosition = new Vector3(190f, 25f, -45f);
			obj5.transform.eulerAngles = new Vector3(0f, 40f, 0f);
			Bounds[] array = new Bounds[2];
			Bounds val3 = default(Bounds);
			((Bounds)(ref val3)).min = new Vector3(157f, 14f, -107f);
			((Bounds)(ref val3)).max = new Vector3(284f, 105f, 150f);
			array[0] = val3;
			val3 = default(Bounds);
			((Bounds)(ref val3)).min = new Vector3(134f, 6f, 4f);
			((Bounds)(ref val3)).max = new Vector3(218f, 56f, 110f);
			array[1] = val3;
			Bounds[] array2 = (Bounds[])(object)array;
			if (rootObjects.TryGetValue("HOLDER: Ruins", out var value2))
			{
				Object.Instantiate<GameObject>(((Component)value2.transform.Find("AncientLoft_Rubbles/Rubble_One")).gameObject, val2.transform, true);
				Object.Instantiate<GameObject>(((Component)value2.transform.Find("AncientLoft_Rubbles/Rubble_Two")).gameObject, val2.transform, true);
				foreach (Transform item in value2.transform)
				{
					Transform val4 = item;
					Bounds[] array3 = array2;
					for (int i = 0; i < array3.Length; i++)
					{
						Bounds val5 = array3[i];
						if (((Bounds)(ref val5)).Contains(val4.position))
						{
							component.objectsToDeactivate.Add(((Component)val4).gameObject);
						}
					}
				}
				if (value2.transform.TryFind("AncientLoft_CircleArchway", out var child2))
				{
					component.objectsToDeactivate.Remove(((Component)child2).gameObject);
				}
			}
			if (rootObjects.TryGetValue("HOLDER: Foliage", out var value3))
			{
				PermutationBehaviour.Addressable<Mesh>("RoR2/Base/blackbeach/mdlBBBoulderMediumRound1.fbx", out var asset2);
				Object.Instantiate<GameObject>(((Component)value3.transform.Find("mdlBBBoulderMediumRound1 (14)")).gameObject, val2.transform, true).GetComponent<MeshFilter>().sharedMesh = asset2;
				Object.Instantiate<GameObject>(((Component)value3.transform.Find("mdlBBBoulderMediumRound1 (15)")).gameObject, val2.transform, true).GetComponent<MeshFilter>().sharedMesh = asset2;
				Object.Instantiate<GameObject>(((Component)value3.transform.Find("mdlBBBoulderMediumRound1 (16)")).gameObject, val2.transform, true).GetComponent<MeshFilter>().sharedMesh = asset2;
				foreach (Transform item2 in value3.transform)
				{
					Transform val6 = item2;
					Bounds[] array3 = array2;
					for (int i = 0; i < array3.Length; i++)
					{
						Bounds val7 = array3[i];
						if (((Bounds)(ref val7)).Contains(val6.position))
						{
							component.objectsToDeactivate.Add(((Component)val6).gameObject);
						}
					}
				}
			}
			val2.transform.localPosition = new Vector3(262f, -29.5f, -94f);
			val2.transform.eulerAngles = new Vector3(0f, 90f, 0f);
			ref GameObjectToggleGroup[] toggleGroups = ref toggleGroupController.toggleGroups;
			GameObjectToggleGroup val8 = new GameObjectToggleGroup
			{
				objects = (GameObject[])(object)new GameObject[2]
				{
					((Component)child).gameObject,
					val
				},
				minEnabled = 1,
				maxEnabled = 1
			};
			ArrayUtils.ArrayAppend<GameObjectToggleGroup>(ref toggleGroups, ref val8);
			ClassicStageInfo val9 = default(ClassicStageInfo);
			if (rootObjects.TryGetValue("SceneInfo", out var value4) && value4.TryGetComponent<ClassicStageInfo>(ref val9))
			{
				ClassicStageInfo obj6 = val9;
				obj6.sceneDirectorInteractibleCredits -= 40;
				ref BonusInteractibleCreditObject[] bonusInteractibleCreditObjects = ref val9.bonusInteractibleCreditObjects;
				BonusInteractibleCreditObject val10 = new BonusInteractibleCreditObject
				{
					objectThatGrantsPointsIfEnabled = ((Component)child).gameObject,
					points = 40
				};
				ArrayUtils.ArrayAppend<BonusInteractibleCreditObject>(ref bonusInteractibleCreditObjects, ref val10);
			}
		}
	}
}