Decompiled source of WLoopWeather v1.4.0

LoopVariants.dll

Decompiled 3 weeks ago
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.Destructible;
using EntityStates.Fauna;
using HG;
using LoopVariants.Properties;
using On.EntityStates.Destructible;
using On.EntityStates.Fauna;
using On.RoR2;
using On.RoR2.Networking;
using On.RoR2.UI;
using R2API;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.ExpansionManagement;
using RoR2.Navigation;
using RoR2.UI;
using TMPro;
using ThreeEyedGames;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("LoopVariants")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LoopVariants")]
[assembly: AssemblyTitle("LoopVariants")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: UnverifiableCode]
namespace LoopVariants
{
	public class WConfig
	{
		public static ConfigFile ConfigFileSTAGES = new ConfigFile(Paths.ConfigPath + "\\Wolfo.LoopVariants.cfg", true);

		public static ConfigEntry<bool> cfgLoopWeather;

		public static ConfigEntry<bool> cfgGameplayChanges;

		public static ConfigEntry<bool> cfgEnemyAdditions;

		public static ConfigEntry<float> Chance_PreLoop;

		public static ConfigEntry<float> Chance_Loop;

		public static ConfigEntry<float> Chance_Loop_2;

		public static ConfigEntry<bool> LoopVariant_OnPreLoop_Vanilla;

		public static ConfigEntry<bool> PreLoopVariant_PostLoop_Vanilla;

		public static ConfigEntry<bool> MultiplayerTesting;

		public static ConfigEntry<bool> Stage_1_Golem;

		public static ConfigEntry<bool> Stage_1_Roost;

		public static ConfigEntry<bool> Stage_1_Snow;

		public static ConfigEntry<bool> Stage_1_LakesVillageNight;

		public static ConfigEntry<bool> Stage_2_Goolake;

		public static ConfigEntry<bool> Stage_2_Goolake_River;

		public static ConfigEntry<bool> Stage_2_Goolake_Elders;

		public static ConfigEntry<bool> Stage_2_Swamp;

		public static ConfigEntry<bool> Stage_2_Ancient;

		public static ConfigEntry<bool> Stage_2_Temple;

		public static ConfigEntry<bool> Stage_3_Frozen;

		public static ConfigEntry<bool> Stage_3_Wisp;

		public static ConfigEntry<bool> Stage_3_Sulfur;

		public static ConfigEntry<bool> Stage_3_Sulfur_Hellfire;

		public static ConfigEntry<bool> Stage_3_Sulfur_ExtraLights;

		public static ConfigEntry<bool> Stage_4_Damp_Abyss;

		public static ConfigEntry<bool> Stage_4_Ship;

		public static ConfigEntry<bool> Stage_4_Root_Jungle;

		public static ConfigEntry<bool> Stage_4_Root_Jungle_Fruit;

		public static ConfigEntry<bool> Stage_5_Sky;

		public static ConfigEntry<bool> Stage_5_Helminth;

		public static ConfigEntry<bool> Stage_6_Commencement;

		public static ConfigEntry<bool> Stage_6_Meridian;

		public static ConfigEntry<bool> WIP;

		public static void InitConfig()
		{
			cfgLoopWeather = ConfigFileSTAGES.Bind<bool>("!Main", "Loop Weather for some more stages", true, "Disable the entire mod if false");
			cfgGameplayChanges = ConfigFileSTAGES.Bind<bool>("!Main", "Enable Gameplay changes for Loop Variants", true, "Does not include new gameobjects that might block a path.\nSome changes will not activate if you are already on the stage.\nIf you plan on playing with people that do not have this mod it's better to disable this.\n\nAquaduct : Slowing Tar\nSulfur Pools : Weaker but Lethal Helfire Pods\nSundered Grove : Healing Fruits");
			Chance_PreLoop = ConfigFileSTAGES.Bind<float>("Chances", "Loop Weather chance pre-loop", 0f, "% Chance for a loop weather to happen pre-loop\n(Stages 1 - 5)");
			Chance_Loop = ConfigFileSTAGES.Bind<float>("Chances", "Loop Weather chance post-loop", 100f, "% Chance for a loop weather to happen loop 1\n(Stages 6 - 10)");
			Chance_Loop_2 = ConfigFileSTAGES.Bind<float>("Chances", "Loop Weather chance consecutive-loop", -1f, "% Chance for a loop weather to happen loop 2+\n(Stage 11+)\n-1 will just use loop 1 Chance instead");
			LoopVariant_OnPreLoop_Vanilla = ConfigFileSTAGES.Bind<bool>("Chances", "Apply pre loop chance to official stage variants", true, "Should stage 1 Viscous Falls be allowed if pre-loop chance succeeds.");
			PreLoopVariant_PostLoop_Vanilla = ConfigFileSTAGES.Bind<bool>("Chances", "Apply loop chance to official stage variants", true, "Should stage 6 Shattered Abodes be allowed if post-loop chance fails.");
			MultiplayerTesting = ConfigFileSTAGES.Bind<bool>("Testing", "Multiplayer Testing", false, "Removes kicking from lobbies so you can join yourself with 2 game instances on the same account.");
			WIP = ConfigFileSTAGES.Bind<bool>("Testing", "Wip", false, "Not much to see");
			InitConfigStages();
			RiskConfig();
		}

		public static void RiskConfig()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_003e: 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)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Expected O, but got Unknown
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Expected O, but got Unknown
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Expected O, but got Unknown
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Expected O, but got Unknown
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Expected O, but got Unknown
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Expected O, but got Unknown
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Expected O, but got Unknown
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Expected O, but got Unknown
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Expected O, but got Unknown
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Expected O, but got Unknown
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Expected O, but got Unknown
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Expected O, but got Unknown
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Expected O, but got Unknown
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Expected O, but got Unknown
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Expected O, but got Unknown
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Expected O, but got Unknown
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Expected O, but got Unknown
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Expected O, but got Unknown
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Expected O, but got Unknown
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Expected O, but got Unknown
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Expected O, but got Unknown
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Expected O, but got Unknown
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Expected O, but got Unknown
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Expected O, but got Unknown
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Expected O, but got Unknown
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Expected O, but got Unknown
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Expected O, but got Unknown
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Expected O, but got Unknown
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Expected O, but got Unknown
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Expected O, but got Unknown
			Texture2D val = new Texture2D(256, 256, (TextureFormat)12, false);
			ImageConversion.LoadImage(val, Resources.icon, true);
			((Texture)val).filterMode = (FilterMode)1;
			Sprite modIcon = Sprite.Create(val, new Rect(0f, 0f, 256f, 256f), new Vector2(0.5f, 0.5f));
			ModSettingsManager.SetModIcon(modIcon);
			ModSettingsManager.SetModDescription("Diet Loop Weather Variants for more stages.");
			CheckBoxConfig val2 = new CheckBoxConfig
			{
				name = "Disable Entire Mod",
				restartRequired = true
			};
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(cfgLoopWeather, val2));
			val2 = new CheckBoxConfig
			{
				name = "Gameplay Changes"
			};
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(cfgGameplayChanges, val2));
			FloatFieldConfig val3 = new FloatFieldConfig
			{
				name = "Chance pre-loop"
			};
			ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(Chance_PreLoop, val3));
			val3 = new FloatFieldConfig
			{
				name = "Chance post-loop"
			};
			ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(Chance_Loop, val3));
			val3 = new FloatFieldConfig
			{
				name = "Chance consecutive-loop"
			};
			ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(Chance_Loop_2, val3));
			val2 = new CheckBoxConfig
			{
				name = "Chance Based Official Variants Pre-loop"
			};
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(LoopVariant_OnPreLoop_Vanilla, val2));
			val2 = new CheckBoxConfig
			{
				name = "Chance Based Official Variants Post-loop"
			};
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(PreLoopVariant_PostLoop_Vanilla, val2));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_1_Golem));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_1_Snow));
			val2 = new CheckBoxConfig
			{
				name = "Friendly Viscious/Disturbed SpawnPool",
				restartRequired = true
			};
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_1_LakesVillageNight, val2));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_2_Goolake));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_2_Goolake_River));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_2_Swamp));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_2_Temple));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_3_Wisp));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_3_Sulfur));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_3_Sulfur_Hellfire));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_3_Sulfur_ExtraLights));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_4_Damp_Abyss));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_4_Root_Jungle));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_4_Root_Jungle_Fruit));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_5_Helminth));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Stage_6_Meridian));
		}

		public static void InitConfigStages()
		{
			Stage_1_Golem = ConfigFileSTAGES.Bind<bool>("Stage 1", "Golem Plains", true, "Enable alt weather for this stage");
			Stage_1_Snow = ConfigFileSTAGES.Bind<bool>("Stage 1", "Snowy Forest", true, "Enable alt weather for this stage");
			Stage_1_LakesVillageNight = ConfigFileSTAGES.Bind<bool>("Stage 1", "Viscious Falls & Disturbed Impact - Spawn Pool Nerf", true, "Make spawn pools more Stage 1 friendly.\nDisables Elder Lemurian, Void Reavers from spawning here Stage 1.");
			Stage_2_Goolake = ConfigFileSTAGES.Bind<bool>("Stage 2", "Aquaduct", true, "Enable alt weather for this stage");
			Stage_2_Goolake_River = ConfigFileSTAGES.Bind<bool>("Stage 2", "Aquaduct - River of Tar", true, "Enable the Tar River in the alt of this stage");
			Stage_2_Swamp = ConfigFileSTAGES.Bind<bool>("Stage 2", "Wetlands", true, "Enable alt weather for this stage");
			Stage_2_Ancient = ConfigFileSTAGES.Bind<bool>("Stage 2", "Aphelian Sanctuary", true, "Enable alt weather for this stage");
			Stage_2_Temple = ConfigFileSTAGES.Bind<bool>("Stage 2", "Reformed Altar", true, "Enable alt weather for this stage");
			Stage_3_Frozen = ConfigFileSTAGES.Bind<bool>("Stage 3", "Rally Point", true, "Enable alt weather for this stage");
			Stage_3_Wisp = ConfigFileSTAGES.Bind<bool>("Stage 3", "Scorched Acres", true, "Enable alt weather for this stage");
			Stage_3_Sulfur = ConfigFileSTAGES.Bind<bool>("Stage 3", "Sulfur Pool", true, "Enable alt weather for this stage");
			Stage_3_Sulfur_Hellfire = ConfigFileSTAGES.Bind<bool>("Stage 3", "Sulfur Pool : Helfire", true, "Should Sulfur Pods in alt weather do less overall damage but also add lethal helfire.");
			Stage_3_Sulfur_ExtraLights = ConfigFileSTAGES.Bind<bool>("Stage 3", "Sulfur Pool : Reduce Lights", false, "Reduce Light amount on this stage. This might help optimization");
			Stage_4_Damp_Abyss = ConfigFileSTAGES.Bind<bool>("Stage 4", "Abyssal Depths", true, "Enable alt weather for this stage");
			Stage_4_Root_Jungle = ConfigFileSTAGES.Bind<bool>("Stage 4", "Sundered Grove", true, "Enable alt weather for this stage");
			Stage_4_Root_Jungle_Fruit = ConfigFileSTAGES.Bind<bool>("Stage 4", "Sundered Grove - Healing Fruit", true, "Spawn 30-40 Healing Fruits like the Healing Fruit in Treeborn or Eggs in Sirens Call");
			Stage_5_Helminth = ConfigFileSTAGES.Bind<bool>("Stage 5", "Helminth", true, "Enable alt weather for this stage");
			Stage_6_Meridian = ConfigFileSTAGES.Bind<bool>("Stage Final", "Prime Meridian", true, "Change trees to Golden Dieback coloration on loops");
		}
	}
	internal static class Files
	{
		public static AssetBundle Bundle;

		public static PluginInfo PluginInfo;

		public static string Folder = "LoopWeather\\";

		internal static string assemblyDir => Path.GetDirectoryName(PluginInfo.Location);

		internal static void Init(PluginInfo info)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			PluginInfo = info;
			if (!Directory.Exists(GetPathToFile("LoopWeather")))
			{
				Folder = "";
			}
			if (Directory.Exists(GetPathToFile(Folder + "Languages")))
			{
				Language.SetFolders += new hook_SetFolders(SetFolders);
			}
			else
			{
				Debug.LogWarning((object)"COULD NOT FIND LANGUAGES FOLDER");
			}
			if (Directory.Exists(GetPathToFile(Folder + "AssetBundles")))
			{
				Bundle = AssetBundle.LoadFromFile(GetPathToFile(Folder + "AssetBundles", "loopvariants"));
			}
			else
			{
				Debug.LogWarning((object)"COULD NOT FIND ASSETBUNDLES FOLDER");
			}
		}

		private static void SetFolders(orig_SetFolders orig, Language self, IEnumerable<string> newFolders)
		{
			IEnumerable<string> second = Directory.EnumerateDirectories(Path.Combine(GetPathToFile(Folder + "Languages")), self.name);
			orig.Invoke(self, newFolders.Union(second));
		}

		internal static string GetPathToFile(string folderName)
		{
			return Path.Combine(assemblyDir, folderName);
		}

		internal static string GetPathToFile(string folderName, string fileName)
		{
			return Path.Combine(assemblyDir, folderName, fileName);
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Wolfo.LoopVariants", "WolfosLoopVariants", "1.4.0")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class LoopVariantsMain : BaseUnityPlugin
	{
		public class SendSyncLoopWeather : ChatMessageBase
		{
			public bool CURRENT;

			public bool NEXT;

			public override string ConstructChatString()
			{
				SyncLoopWeather component = ((Component)Run.instance).GetComponent<SyncLoopWeather>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.CurrentStage_LoopVariant = CURRENT;
					component.NextStage_LoopVariant = NEXT;
					if (!NetworkServer.active)
					{
						ApplyLoopWeatherChanges();
					}
				}
				else
				{
					Debug.LogWarning((object)"Sent SendSyncLoopWeather without SyncLoopWeather");
				}
				return null;
			}

			public override void Serialize(NetworkWriter writer)
			{
				((ChatMessageBase)this).Serialize(writer);
				writer.Write(CURRENT);
				writer.Write(NEXT);
			}

			public override void Deserialize(NetworkReader reader)
			{
				((ChatMessageBase)this).Deserialize(reader);
				CURRENT = reader.ReadBoolean();
				NEXT = reader.ReadBoolean();
			}
		}

		public class SyncLoopWeather : MonoBehaviour
		{
			public bool CurrentStage_LoopVariant;

			public bool NextStage_LoopVariant;
		}

		public static ExpansionDef DLC2 = Addressables.LoadAssetAsync<ExpansionDef>((object)"RoR2/DLC2/Common/DLC2.asset").WaitForCompletion();

		public static Dictionary<string, SceneDef> loopSceneDefToNon = new Dictionary<string, SceneDef>();

		public static List<string> DisabledVariants = new List<string>();

		public void Awake()
		{
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Expected O, but got Unknown
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Expected O, but got Unknown
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Expected O, but got Unknown
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Expected O, but got Unknown
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			WConfig.InitConfig();
			if (WConfig.cfgLoopWeather.Value)
			{
				Files.Init(((BaseUnityPlugin)this).Info);
				ChatMessageBase.chatMessageTypeToIndex.Add(typeof(SendSyncLoopWeather), (byte)ChatMessageBase.chatMessageIndexToType.Count);
				ChatMessageBase.chatMessageIndexToType.Add(typeof(SendSyncLoopWeather));
				Main_Variants.Start();
				RemoveVariantNames();
				Run.Start += new hook_Start(AddRoll_StartOfRun);
				SceneDirector.onPrePopulateSceneServer += ApplyAndRollOnStage;
				AssignStageToken.Start += new hook_Start(ApplyLoopNameChanges);
				ClassicStageInfo.RebuildCards += new hook_RebuildCards(AddVariantExclusiveMonsters);
				Run.PickNextStageScene += new hook_PickNextStageScene(Official_Variants_MainPath);
				SceneExitController.IfLoopedUseValidLoopStage += new hook_IfLoopedUseValidLoopStage(Official_Variants_AltPath);
				BazaarController.IsUnlockedBeforeLooping += new hook_IsUnlockedBeforeLooping(Official_Variants_Bazaar);
			}
		}

		private void AddVariantExclusiveMonsters(orig_RebuildCards orig, ClassicStageInfo self, DirectorCardCategorySelection forcedMonsterCategory, DirectorCardCategorySelection forcedInteractableCategory)
		{
			orig.Invoke(self, forcedMonsterCategory, forcedInteractableCategory);
		}

		private void ApplyAndRollOnStage(SceneDirector obj)
		{
			if (NetworkServer.active)
			{
				ChooseIfNextStageLoop(send: true);
				ApplyLoopWeatherChanges();
			}
		}

		private bool Official_Variants_Bazaar(orig_IsUnlockedBeforeLooping orig, BazaarController self, SceneDef sceneDef)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			if (Object.op_Implicit((Object)(object)Run.instance))
			{
				SyncLoopWeather component = ((Component)Run.instance).GetComponent<SyncLoopWeather>();
				if ((int)Run.instance.ruleBook.stageOrder == 0)
				{
					if (component.NextStage_LoopVariant)
					{
						if (Run.instance.stageClearCount < 5 && WConfig.LoopVariant_OnPreLoop_Vanilla.Value)
						{
							return true;
						}
					}
					else if (Run.instance.stageClearCount > 4 && WConfig.PreLoopVariant_PostLoop_Vanilla.Value)
					{
						return false;
					}
				}
			}
			return orig.Invoke(self, sceneDef);
		}

		private static void ApplyLoopWeatherChanges()
		{
			SyncLoopWeather component = ((Component)Run.instance).GetComponent<SyncLoopWeather>();
			Debug.Log((object)("Stage Start : " + SceneCatalog.mostRecentSceneDef.baseSceneName));
			Debug.Log((object)("Loop weather for curr " + component.CurrentStage_LoopVariant));
			Debug.Log((object)("Loop weather for next " + component.NextStage_LoopVariant));
			if (NetworkServer.active)
			{
				if (Run.instance.loopClearCount > 0 && WConfig.Chance_Loop_2.Value == -1f && WConfig.Chance_Loop.Value == 100f)
				{
					component.CurrentStage_LoopVariant = true;
				}
				else if (Run.instance.loopClearCount == 0 && WConfig.Chance_PreLoop.Value == 0f)
				{
					component.CurrentStage_LoopVariant = false;
				}
			}
			if (!Object.op_Implicit((Object)(object)component) || !component.CurrentStage_LoopVariant)
			{
				return;
			}
			try
			{
				switch (SceneInfo.instance.sceneDef.baseSceneName)
				{
				case "golemplains":
					if (WConfig.Stage_1_Golem.Value)
					{
						Variants_1_GolemPlains.LoopWeather();
					}
					break;
				case "blackbeach":
					if (WConfig.WIP.Value)
					{
						Variants_1_BlackBeach.LoopWeather();
					}
					break;
				case "snowyforest":
					if (WConfig.Stage_1_Snow.Value)
					{
						Variants_1_SnowyForest.LoopWeather();
					}
					break;
				case "goolake":
					if (WConfig.Stage_2_Goolake.Value)
					{
						Variants_2_Goolake.LoopWeather();
					}
					break;
				case "foggyswamp":
					if (WConfig.Stage_2_Swamp.Value)
					{
						Variants_2_FoggySwamp.LoopWeather();
					}
					break;
				case "ancientloft":
					if (WConfig.Stage_2_Ancient.Value)
					{
						Variants_2_AncientLoft.LoopWeather();
					}
					break;
				case "lemuriantemple":
					if (WConfig.Stage_2_Temple.Value)
					{
						Variants_2_LemurianTemple.LoopWeather();
					}
					break;
				case "frozenwall":
					if (WConfig.WIP.Value)
					{
						Variants_3_FrozenWall.LoopWeather();
					}
					break;
				case "wispgraveyard":
					if (WConfig.Stage_3_Wisp.Value)
					{
						Variants_3_WispGraveyard.LoopWeather();
					}
					break;
				case "sulfurpools":
					if (WConfig.Stage_3_Sulfur.Value)
					{
						Variants_3_Sulfur.LoopWeather();
					}
					break;
				case "dampcavesimple":
					if (WConfig.Stage_4_Damp_Abyss.Value)
					{
						Variants_4_DampCaveSimpleAbyss.LoopWeather();
					}
					break;
				case "shipgraveyard":
					if (WConfig.WIP.Value)
					{
						Variants_4_ShipGraveyard.LoopWeather();
					}
					break;
				case "rootjungle":
					if (WConfig.Stage_4_Root_Jungle.Value)
					{
						Variants_4_RootJungle.LoopWeather();
					}
					break;
				case "skymeadow":
					if (WConfig.WIP.Value)
					{
						Variants_5_SkyMeadow.LoopWeather();
					}
					break;
				case "helminthroost":
					if (WConfig.Stage_5_Helminth.Value)
					{
						Variants_5_HelminthRoost.LoopWeather();
					}
					break;
				case "moon2":
					if (WConfig.WIP.Value)
					{
						Variants_6_Moon.LoopWeather();
					}
					break;
				case "meridian":
					if (WConfig.Stage_6_Meridian.Value)
					{
						Variants_6_Meridian.LoopWeather();
					}
					break;
				}
			}
			catch (Exception ex)
			{
				Debug.LogWarning((object)("LoopVariants Error: " + ex));
			}
		}

		private void Official_Variants_MainPath(orig_PickNextStageScene orig, Run self, WeightedSelection<SceneDef> choices)
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Invalid comparison between Unknown and I4
			orig.Invoke(self, choices);
			SyncLoopWeather component = ((Component)Run.instance).GetComponent<SyncLoopWeather>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				Debug.LogWarning((object)"SyncLoopWeather wasn't added when the run started, How?");
			}
			else
			{
				if (!NetworkServer.active || (int)self.ruleBook.stageOrder != 0)
				{
					return;
				}
				if (component.NextStage_LoopVariant)
				{
					if (self.stageClearCount < 5 && WConfig.LoopVariant_OnPreLoop_Vanilla.Value && Object.op_Implicit((Object)(object)self.nextStageScene) && Object.op_Implicit((Object)(object)self.nextStageScene.loopedSceneDef) && self.IsExpansionEnabled(self.nextStageScene.loopedSceneDef.requiredExpansion))
					{
						Debug.Log((object)("Replacing " + ((object)self.nextStageScene)?.ToString() + " with " + (object)self.nextStageScene.loopedSceneDef));
						self.nextStageScene = self.nextStageScene.loopedSceneDef;
					}
				}
				else if (self.stageClearCount > 4 && WConfig.PreLoopVariant_PostLoop_Vanilla.Value && loopSceneDefToNon.ContainsKey(self.nextStageScene.baseSceneName))
				{
					SceneDef val = loopSceneDefToNon[self.nextStageScene.baseSceneName];
					if ((Object)(object)val != (Object)null)
					{
						Debug.Log((object)("Replacing " + ((object)self.nextStageScene)?.ToString() + " with " + (object)val));
						self.nextStageScene = val;
					}
				}
			}
		}

		private SceneDef Official_Variants_AltPath(orig_IfLoopedUseValidLoopStage orig, SceneExitController self, SceneDef sceneDef)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Invalid comparison between Unknown and I4
			if (NetworkServer.active)
			{
				SyncLoopWeather component = ((Component)Run.instance).GetComponent<SyncLoopWeather>();
				if ((int)Run.instance.ruleBook.stageOrder == 0)
				{
					if (component.NextStage_LoopVariant)
					{
						if (Run.instance.stageClearCount < 5 && WConfig.LoopVariant_OnPreLoop_Vanilla.Value && Object.op_Implicit((Object)(object)sceneDef.loopedSceneDef))
						{
							Debug.Log((object)("Replacing " + ((object)sceneDef)?.ToString() + " with " + (object)sceneDef.loopedSceneDef));
							return sceneDef.loopedSceneDef;
						}
					}
					else if (Run.instance.stageClearCount > 4 && WConfig.PreLoopVariant_PostLoop_Vanilla.Value && loopSceneDefToNon.ContainsKey(sceneDef.baseSceneName))
					{
						Debug.Log((object)("Replacing " + ((object)sceneDef.loopedSceneDef)?.ToString() + " with " + (object)sceneDef));
						return sceneDef;
					}
				}
			}
			return orig.Invoke(self, sceneDef);
		}

		private void AddRoll_StartOfRun(orig_Start orig, Run self)
		{
			if (!Object.op_Implicit((Object)(object)((Component)self).gameObject.GetComponent<SyncLoopWeather>()))
			{
				((Component)self).gameObject.AddComponent<SyncLoopWeather>();
			}
			if (NetworkServer.active)
			{
				ChooseIfNextStageLoop(send: false);
			}
			orig.Invoke(self);
		}

		public static void ChooseIfNextStageLoop(bool send)
		{
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Invalid comparison between Unknown and I4
			if (!NetworkServer.active)
			{
				return;
			}
			if (!Object.op_Implicit((Object)(object)Run.instance))
			{
				Debug.LogWarning((object)"Called without a Run Instance");
				return;
			}
			SyncLoopWeather syncLoopWeather = ((Component)Run.instance).GetComponent<SyncLoopWeather>();
			if (!Object.op_Implicit((Object)(object)syncLoopWeather))
			{
				Debug.LogWarning((object)"SyncLoopWeather wasn't added when the run started, How?");
				syncLoopWeather = ((Component)Run.instance).gameObject.AddComponent<SyncLoopWeather>();
			}
			if (Run.instance.loopClearCount > 0 && WConfig.Chance_Loop_2.Value == -1f && WConfig.Chance_Loop.Value == 100f)
			{
				syncLoopWeather.CurrentStage_LoopVariant = true;
			}
			else if (Run.instance.loopClearCount == 0 && WConfig.Chance_PreLoop.Value == 0f)
			{
				syncLoopWeather.CurrentStage_LoopVariant = false;
			}
			bool flag = false;
			bool flag2 = false;
			flag = syncLoopWeather.NextStage_LoopVariant;
			syncLoopWeather.CurrentStage_LoopVariant = syncLoopWeather.NextStage_LoopVariant;
			if ((int)Run.instance.ruleBook.stageOrder == 1)
			{
				if (Util.CheckRoll(50f, (CharacterMaster)null))
				{
					if (WConfig.Chance_Loop.Value > 0f)
					{
						flag2 = Util.CheckRoll(WConfig.Chance_Loop.Value, (CharacterMaster)null);
					}
				}
				else if (WConfig.Chance_PreLoop.Value > 0f)
				{
					flag2 = Util.CheckRoll(WConfig.Chance_PreLoop.Value, (CharacterMaster)null);
				}
			}
			else if (WConfig.Chance_Loop_2.Value > 0f && Run.instance.stageClearCount >= 9)
			{
				flag2 = Util.CheckRoll(WConfig.Chance_Loop_2.Value, (CharacterMaster)null);
			}
			else if (Run.instance.stageClearCount >= 4)
			{
				if (WConfig.Chance_Loop.Value > 0f)
				{
					flag2 = Util.CheckRoll(WConfig.Chance_Loop.Value, (CharacterMaster)null);
				}
			}
			else if (WConfig.Chance_PreLoop.Value > 0f)
			{
				flag2 = Util.CheckRoll(WConfig.Chance_PreLoop.Value, (CharacterMaster)null);
			}
			syncLoopWeather.NextStage_LoopVariant = flag2;
			if (send)
			{
				Chat.SendBroadcastChat((ChatMessageBase)(object)new SendSyncLoopWeather
				{
					CURRENT = flag,
					NEXT = flag2
				});
			}
		}

		public static void RemoveVariantNames()
		{
			if (!WConfig.Stage_1_Golem.Value)
			{
				DisabledVariants.Add("golemplains");
			}
			if (WConfig.Stage_1_Roost != null && !WConfig.Stage_1_Roost.Value)
			{
				DisabledVariants.Add("blackbeach");
			}
			if (!WConfig.Stage_1_Snow.Value)
			{
				DisabledVariants.Add("snowyforest");
			}
			if (!WConfig.Stage_2_Goolake.Value)
			{
				DisabledVariants.Add("goolake");
			}
			if (!WConfig.Stage_2_Swamp.Value)
			{
				DisabledVariants.Add("foggyswamp");
			}
			if (!WConfig.Stage_2_Ancient.Value)
			{
				DisabledVariants.Add("ancientloft");
			}
			if (!WConfig.Stage_2_Temple.Value)
			{
				DisabledVariants.Add("lemuriantemple");
			}
			if (WConfig.Stage_3_Frozen != null && !WConfig.Stage_3_Frozen.Value)
			{
				DisabledVariants.Add("frozenwall");
			}
			if (!WConfig.Stage_3_Wisp.Value)
			{
				DisabledVariants.Add("wispgraveyard");
			}
			if (!WConfig.Stage_3_Sulfur.Value)
			{
				DisabledVariants.Add("sulfurpools");
			}
			if (!WConfig.Stage_4_Damp_Abyss.Value)
			{
				DisabledVariants.Add("dampcavesimple");
			}
			if (WConfig.Stage_4_Ship != null && !WConfig.Stage_4_Ship.Value)
			{
				DisabledVariants.Add("shipgraveyard");
			}
			if (!WConfig.Stage_4_Root_Jungle.Value)
			{
				DisabledVariants.Add("rootjungle");
			}
			if (WConfig.Stage_5_Sky != null && !WConfig.Stage_5_Sky.Value)
			{
				DisabledVariants.Add("skymeadow");
			}
			if (!WConfig.Stage_5_Helminth.Value)
			{
				DisabledVariants.Add("helminthroost");
			}
			if (WConfig.Stage_6_Commencement != null && !WConfig.Stage_6_Commencement.Value)
			{
				DisabledVariants.Add("moon2");
			}
			if (!WConfig.Stage_6_Meridian.Value)
			{
				DisabledVariants.Add("meridian");
			}
		}

		private static void ApplyLoopNameChanges(orig_Start orig, AssignStageToken self)
		{
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)Run.instance))
			{
				return;
			}
			SyncLoopWeather component = ((Component)Run.instance).GetComponent<SyncLoopWeather>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			if (Run.instance.loopClearCount > 0 && WConfig.Chance_Loop_2.Value == -1f && WConfig.Chance_Loop.Value == 100f)
			{
				component.CurrentStage_LoopVariant = true;
			}
			else if (Run.instance.loopClearCount == 0 && WConfig.Chance_PreLoop.Value == 0f)
			{
				component.CurrentStage_LoopVariant = false;
			}
			if (component.CurrentStage_LoopVariant)
			{
				SceneDef mostRecentSceneDef = SceneCatalog.mostRecentSceneDef;
				Language val = Language.FindLanguageByName("en");
				if (val.stringsByToken.ContainsKey(mostRecentSceneDef.nameToken + "_LOOP") && !DisabledVariants.Contains(mostRecentSceneDef.baseSceneName))
				{
					((TMP_Text)self.titleText).SetText(Language.GetString(mostRecentSceneDef.nameToken + "_LOOP"), true);
					((TMP_Text)self.subtitleText).SetText(Language.GetString(mostRecentSceneDef.subtitleToken + "_LOOP"), true);
				}
			}
		}
	}
	public class Main_Variants
	{
		public static void Start()
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			Variants_1_GolemPlains.Setup();
			Variants_1_BlackBeach.Setup();
			Variants_1_SnowyForest.Setup();
			Variants_2_Goolake.Setup();
			Variants_2_FoggySwamp.Setup();
			Variants_2_AncientLoft.Setup();
			Variants_2_LemurianTemple.Setup();
			Variants_3_FrozenWall.Setup();
			Variants_3_WispGraveyard.Setup();
			Variants_3_Sulfur.Setup();
			Variants_4_DampCaveSimpleAbyss.Setup();
			Variants_4_ShipGraveyard.Setup();
			Variants_4_RootJungle.Setup();
			Variants_5_SkyMeadow.Setup();
			Variants_5_HelminthRoost.Setup();
			Variants_6_Meridian.Setup();
			Variants_6_Moon.Setup();
			if (WConfig.Stage_1_LakesVillageNight.Value)
			{
				Nerf_OfficialStage1LoopSpawnpools();
			}
			SceneDef value = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/DLC2/lakes/lakes.asset").WaitForCompletion();
			SceneDef value2 = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/DLC2/village/village.asset").WaitForCompletion();
			SceneDef value3 = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/DLC2/habitat/habitat.asset").WaitForCompletion();
			LoopVariantsMain.loopSceneDefToNon.Add("lakesnight", value);
			LoopVariantsMain.loopSceneDefToNon.Add("villagenight", value2);
			LoopVariantsMain.loopSceneDefToNon.Add("habitatfall", value3);
			if (WConfig.MultiplayerTesting.Value)
			{
				ServerAuthManager.HandleSetClientAuth += new hook_HandleSetClientAuth(ServerAuthManager_HandleSetClientAuth);
				UnusedStages();
			}
		}

		public static void Nerf_OfficialStage1LoopSpawnpools()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			DirectorCardCategorySelection val = Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/lakesnight/dccsLakesnightMonsters.asset").WaitForCompletion();
			DirectorCardCategorySelection val2 = Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/villagenight/dccsVillageNightMonsters.asset").WaitForCompletion();
			DirectorCardCategorySelection val3 = Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/lakesnight/dccsLakesnightInteractables.asset").WaitForCompletion();
			DirectorCardCategorySelection val4 = Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/villagenight/dccsVillagenightInteractablesDLC2.asset").WaitForCompletion();
			try
			{
				val.categories[0].cards[1].minimumStageCompletions = 1;
				val.categories[0].cards[4].minimumStageCompletions = 1;
				val.categories[1].cards[2].minimumStageCompletions = 1;
				val.categories[1].cards[3].minimumStageCompletions = 1;
				val2.categories[1].cards[2].minimumStageCompletions = 1;
				val4.categories[2].cards[2].minimumStageCompletions = 1;
				val4.categories[5].cards[3].minimumStageCompletions = 1;
			}
			catch (Exception ex)
			{
				Debug.LogWarning((object)"Some dude edited LakesVillageNight");
				Debug.LogWarning((object)ex);
			}
		}

		public static void LoadStuff()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: 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)
			//IL_002c: 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_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: 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_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/Skyboxes/matSkybox1.mat").WaitForCompletion();
			Addressables.LoadAssetAsync<Material>((object)"RoR2/Junk/slice1/matSkybox2.mat").WaitForCompletion();
			Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/bazaar/matSkybox4.mat").WaitForCompletion();
			Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/Skyboxes/matSkyboxFoggy.mat").WaitForCompletion();
			Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/arena/matSkyboxArena.mat").WaitForCompletion();
			Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/artifactworld/matSkyboxArtifactWorld.mat").WaitForCompletion();
			Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/golemplains/matSkyboxGolemplainsFoggy.mat").WaitForCompletion();
			Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/snowyforest/matSkyboxSF.mat").WaitForCompletion();
			Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/goolake/matSkyboxGoolake.mat").WaitForCompletion();
			Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/ancientloft/matSkyboxAncientLoft.mat").WaitForCompletion();
			Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/sulfurpools/matSkyboxSP.mat").WaitForCompletion();
			Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/frozenwall/matSkyboxFrozenwallNight.mat").WaitForCompletion();
			Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/moon2/matSkyboxMoon.mat").WaitForCompletion();
			Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/goldshores/matSkyboxGoldshores.mat").WaitForCompletion();
			Addressables.LoadAssetAsync<PostProcessProfile>((object)"RoR2/Base/title/PostProcessing/ppSceneGolemplainsTrailer.asset").WaitForCompletion();
		}

		public static void UnusedStages()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Expected O, but got Unknown
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Expected O, but got Unknown
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Expected O, but got Unknown
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Expected O, but got Unknown
			SceneDef val = ScriptableObject.CreateInstance<SceneDef>();
			val.sceneAddress = new AssetReferenceScene("31b8f728a914c9a4faa3df76d1bc0c0e");
			val.cachedName = "golemplains_trailer";
			val.nameToken = "Trailer Plains";
			val.shouldIncludeInLogbook = false;
			ContentAddition.AddSceneDef(val);
			val = ScriptableObject.CreateInstance<SceneDef>();
			val.sceneAddress = new AssetReferenceScene("b30e537b28c514b4a99227ab56a3e1d3");
			val.cachedName = "ItemLogBookPositionalOffsets";
			val.nameToken = "ItemLogBookPositionalOffsets";
			val.shouldIncludeInLogbook = false;
			ContentAddition.AddSceneDef(val);
			val = ScriptableObject.CreateInstance<SceneDef>();
			val.sceneAddress = new AssetReferenceScene("722873b571c73734c8572658dbb8f0db");
			val.cachedName = "renderitem";
			val.nameToken = "renderitem";
			val.shouldIncludeInLogbook = false;
			ContentAddition.AddSceneDef(val);
			val = ScriptableObject.CreateInstance<SceneDef>();
			val.sceneAddress = new AssetReferenceScene("835344f0a7461cc4b8909469b31a3ccc");
			val.cachedName = "slice2";
			val.nameToken = "slice2";
			val.shouldIncludeInLogbook = false;
			ContentAddition.AddSceneDef(val);
			val = ScriptableObject.CreateInstance<SceneDef>();
			val.sceneAddress = new AssetReferenceScene("5d8ea33392b43b94daac86dcf06740ab");
			val.cachedName = "space";
			val.nameToken = "space";
			val.shouldIncludeInLogbook = false;
			ContentAddition.AddSceneDef(val);
			val = ScriptableObject.CreateInstance<SceneDef>();
			val.sceneAddress = new AssetReferenceScene("db3348f5ee64faa48b2c14c3c52d5186");
			val.cachedName = "stage1";
			val.nameToken = "stage1";
			val.shouldIncludeInLogbook = false;
			ContentAddition.AddSceneDef(val);
		}

		private static void ServerAuthManager_HandleSetClientAuth(orig_HandleSetClientAuth orig, NetworkMessage netMsg)
		{
		}
	}
	public class Variants_1_BlackBeach
	{
		public static void Setup()
		{
		}

		public static void LoopWeather()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			((Component)SceneInfo.instance).GetComponent<PostProcessVolume>().profile = Addressables.LoadAssetAsync<PostProcessProfile>((object)"RoR2/Base/title/PostProcessing/ppSceneShipgraveyard.asset").WaitForCompletion();
		}

		public static void VariantMonsters()
		{
		}
	}
	public class Variants_3_FrozenWall
	{
		public static PostProcessProfile ppFrozenWallDay;

		public static void Setup()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			ppFrozenWallDay = Object.Instantiate<PostProcessProfile>(Addressables.LoadAssetAsync<PostProcessProfile>((object)"RoR2/Base/title/PostProcessing/ppSceneFrozenwallNight.asset").WaitForCompletion());
			PostProcessProfile val = Addressables.LoadAssetAsync<PostProcessProfile>((object)"RoR2/DLC1/snowyforest/ppSceneSnowyForest.asset").WaitForCompletion();
			ppFrozenWallDay = Addressables.LoadAssetAsync<PostProcessProfile>((object)"RoR2/DLC1/snowyforest/ppSceneSnowyForest.asset").WaitForCompletion();
		}

		public static void LoopWeather()
		{
			PostProcessVolume component = ((Component)SceneInfo.instance).gameObject.GetComponent<PostProcessVolume>();
			component.profile = ppFrozenWallDay;
			GameObject val = GameObject.Find("/HOLDER: Skybox");
			Transform child = val.transform.GetChild(0);
		}
	}
	public class Variants_6_Moon
	{
		public static void Setup()
		{
		}

		public static void LoopWeather()
		{
		}
	}
	public class Variants_4_ShipGraveyard
	{
		public static void Setup()
		{
		}

		public static void LoopWeather()
		{
			//IL_0033: 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_006c: Expected O, but got Unknown
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: 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_00e6: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("/Weather, Shipgraveyard");
			Light component = ((Component)val.transform.GetChild(0)).GetComponent<Light>();
			component.color = new Color(0.9f, 0.62f, 0.62f, 1f);
			PostProcessVolume component2 = ((Component)val.transform.GetChild(2)).GetComponent<PostProcessVolume>();
			RampFog val2 = (RampFog)Object.Instantiate<PostProcessEffectSettings>(component2.profile.settings[0]);
			component2.profile.settings[0] = (PostProcessEffectSettings)(object)val2;
			((ParameterOverride<Color>)(object)val2.fogColorEnd).value = new Color(0.63f, 0.46f, 0.46f, 1f);
			((ParameterOverride<Color>)(object)val2.fogColorMid).value = new Color(0.48f, 0.29f, 0.29f, 0.51f);
			((ParameterOverride<Color>)(object)val2.fogColorStart).value = new Color(0.45f, 0.38f, 0.38f, 0f);
		}
	}
	public class Variants_5_SkyMeadow
	{
		public static void Setup()
		{
		}

		public static void LoopWeather()
		{
			//IL_0019: 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)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("/HOLDER: Weather Set 1");
			val.SetActive(false);
			GameObject val2 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC2/lakesnight/Weather, Lakesnight.prefab").WaitForCompletion());
			Light component = ((Component)val2.transform.GetChild(1)).GetComponent<Light>();
			component.color = new Color(0.9149f, 0.5961f, 0.9333f, 1f);
			component.shadowStrength *= 0.5f;
		}
	}
	public class Variants_1_GolemPlains
	{
		public static void Setup()
		{
		}

		public static void LoopWeather()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: 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_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("/Weather, Golemplains");
			PostProcessVolume component = ((Component)val.transform.GetChild(2)).gameObject.GetComponent<PostProcessVolume>();
			PostProcessProfile sharedProfile = (component.profile = Addressables.LoadAssetAsync<PostProcessProfile>((object)"RoR2/Base/title/PostProcessing/ppSceneGolemplainsTrailer.asset").WaitForCompletion());
			component.sharedProfile = sharedProfile;
			Light component2 = ((Component)val.transform.GetChild(1)).gameObject.GetComponent<Light>();
			component2.color = new Color(1f, 0.5329f, 0f, 1f);
			component2.intensity = 1.14f;
			if (SceneInfo.instance.sceneDef.cachedName.EndsWith("2"))
			{
				component2.shadowStrength *= 0.4f;
				((Component)component2).gameObject.transform.localEulerAngles = new Vector3(54f, 80f, 150f);
			}
			else
			{
				component2.shadowStrength *= 0.6f;
				((Component)component2).gameObject.transform.localEulerAngles = new Vector3(42.6938f, 140.2757f, 150.3377f);
			}
			SetAmbientLight val3 = val.AddComponent<SetAmbientLight>();
			val3.setAmbientLightColor = true;
			val3.ambientMode = (AmbientMode)3;
			val3.ambientSkyColor = new Color(0.4191f, 0.305f, 0.7264f, 0f);
			val3.ambientEquatorColor = new Color(0.114f, 0.125f, 0.133f, 1f);
			val3.ambientGroundColor = new Color(0.047f, 0.043f, 0.035f, 1f);
			val3.ambientIntensity = 1f;
			val3.setSkyboxMaterial = true;
			val3.skyboxMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/bazaar/matSkybox4.mat").WaitForCompletion();
			val3.ApplyLighting();
		}
	}
	public class Variants_1_SnowyForest
	{
		public static void Setup()
		{
		}

		public static void LoopWeather()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Expected O, but got Unknown
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: 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_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: 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_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: 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_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02af: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: Unknown result type (might be due to invalid IL or missing references)
			//IL_036d: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03af: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_041b: Unknown result type (might be due to invalid IL or missing references)
			//IL_043c: Unknown result type (might be due to invalid IL or missing references)
			//IL_045d: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("/HOLDER: Skybox");
			Light component = ((Component)val.transform.GetChild(1)).GetComponent<Light>();
			component.color = new Color(0.6667f, 0.9373f, 0.8f, 1f);
			component.intensity = 0.7f;
			PostProcessVolume component2 = ((Component)SceneInfo.instance).gameObject.GetComponent<PostProcessVolume>();
			PostProcessProfile val2 = Addressables.LoadAssetAsync<PostProcessProfile>((object)"RoR2/DLC2/villagenight/ppSceneLVnight.asset").WaitForCompletion();
			PostProcessProfile val3 = Object.Instantiate<PostProcessProfile>(val2);
			RampFog val4 = (RampFog)Object.Instantiate<PostProcessEffectSettings>(val3.settings[0]);
			((ParameterOverride<Color>)(object)val4.fogColorStart).value = ((Color)(ref ((ParameterOverride<Color>)(object)val4.fogColorStart).value)).AlphaMultiplied(0.8f);
			FloatParameter fogIntensity = val4.fogIntensity;
			((ParameterOverride<float>)(object)fogIntensity).value = ((ParameterOverride<float>)(object)fogIntensity).value * 1.2f;
			FloatParameter skyboxStrength = val4.skyboxStrength;
			((ParameterOverride<float>)(object)skyboxStrength).value = ((ParameterOverride<float>)(object)skyboxStrength).value * 0.33f;
			val3.settings[0] = (PostProcessEffectSettings)(object)val4;
			component2.profile = val3;
			component2.sharedProfile = val3;
			component2 = ((Component)val.transform.GetChild(2)).GetComponent<PostProcessVolume>();
			((Behaviour)component2).enabled = false;
			Transform child = val.transform.GetChild(8);
			SetAmbientLight val5 = ((Component)SceneInfo.instance).gameObject.AddComponent<SetAmbientLight>();
			val5.setAmbientLightColor = true;
			val5.ambientMode = (AmbientMode)3;
			val5.ambientGroundColor = new Color(0.1407f, 0.2235f, 0.1392f, 0.5f) * 1.4f;
			val5.ambientEquatorColor = new Color(0.0521f, 0.0804f, 0.049f, 0.5f) * 1.4f;
			val5.ambientSkyColor = new Color(0.2796f, 0.3443f, 0.2745f, 0.5f) * 1.4f;
			val5.ambientIntensity = 1.2f;
			val5.setSkyboxMaterial = true;
			val5.skyboxMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Junk/slice1/matSkybox2.mat").WaitForCompletion();
			val5.ApplyLighting();
			GameObject val6 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC2/meridian/EventClearedVFX.prefab").WaitForCompletion();
			Mesh mesh = Addressables.LoadAssetAsync<Mesh>((object)"RoR2/DLC1/snowyforest/mdlSnowyForestAurora.fbx").WaitForCompletion();
			GameObject val7 = Object.Instantiate<GameObject>(val6);
			((Component)val7.transform.GetChild(0)).gameObject.SetActive(false);
			((Component)val7.transform.GetChild(1)).GetComponent<MeshFilter>().mesh = mesh;
			((Component)val7.transform.GetChild(2)).GetComponent<MeshFilter>().mesh = mesh;
			((Component)val7.transform.GetChild(3)).GetComponent<MeshFilter>().mesh = mesh;
			val7.transform.localScale = new Vector3(0.22f, 0.22f, 0.22f);
			val7.transform.localPosition = new Vector3(-106.9092f, 50f, -141.4909f);
			val7.transform.localEulerAngles = new Vector3(0f, 15f, 0f);
			GameObject val8 = Object.Instantiate<GameObject>(val7);
			GameObject val9 = Object.Instantiate<GameObject>(val7);
			val8.transform.SetParent(val7.transform);
			val9.transform.SetParent(val7.transform);
			val8.transform.localPosition = new Vector3(4f, -4f, 4f);
			val8.transform.localScale = new Vector3(1f, 1f, 1f);
			val8.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			val9.transform.localPosition = new Vector3(-4f, 4f, -4f);
			val9.transform.localScale = new Vector3(1f, 1f, 1f);
			val9.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			val7 = Object.Instantiate<GameObject>(val7);
			val7.transform.localScale = new Vector3(-0.22f, 0.22f, -0.22f);
			val7.transform.localPosition = new Vector3(-204.8727f, 50f, -160.3091f);
			val7.transform.localEulerAngles = new Vector3(0f, 26f, 0f);
		}
	}
	public class Variants_2_AncientLoft
	{
		public static Material matAncientLoft_SunCloud;

		public static Material matAncientLoft_CloudFloor;

		public static Material matAncientLoftDeepFog;

		public static Material matAncientLoft_Cloud;

		public static Material matAncientLoft_Water;

		public static Material matAncientLoftEndlessHole;

		public static Material matEclipseMoon;

		public static void Setup()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: 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_0095: 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_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: 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_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: 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)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			matAncientLoft_CloudFloor = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/ancientloft/matAncientLoft_CloudFloor.mat").WaitForCompletion());
			matAncientLoft_CloudFloor.SetColor("_TintColor", new Color(0.03f, 0.07f, 0.16f, 1f));
			matAncientLoftDeepFog = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/ancientloft/matAncientLoftDeepFog.mat").WaitForCompletion());
			matAncientLoftDeepFog.SetColor("_TintColor", new Color(0.03f, 0.05f, 0.07f, 1f));
			matAncientLoft_Cloud = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/ancientloft/matAncientLoft_Cloud.mat").WaitForCompletion());
			matAncientLoft_Cloud.SetColor("_TintColor", new Color(0.07f, 0.18f, 0.32f, 1f));
			matAncientLoft_SunCloud = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/ancientloft/matAncientLoft_SunCloud.mat").WaitForCompletion());
			matAncientLoft_SunCloud.SetTexture("_RemapTex", matAncientLoft_CloudFloor.GetTexture("_RemapTex"));
			matAncientLoft_SunCloud.SetColor("_TintColor", new Color(0f, 0.4f, 0.5f, 0.4f));
			matAncientLoft_Water = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/ancientloft/matAncientLoft_Water.mat").WaitForCompletion());
			matAncientLoft_Water.SetTexture("_Cube", (Texture)null);
			matAncientLoftEndlessHole = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/ancientloft/matAncientLoftEndlessHole.mat").WaitForCompletion());
			matAncientLoftEndlessHole.SetColor("_TintColor", new Color(0.03f, 0.05f, 0.08f, 1f));
			matEclipseMoon = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/eclipseworld/matEclipseMoon.mat").WaitForCompletion());
		}

		public static void LoopWeather()
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: 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_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("/HOLDER: Terrain/AL_Sun");
			val.SetActive(false);
			GameObject val2 = GameObject.Find("/Weather, AncientLoft");
			((Behaviour)((Component)val2.transform.GetChild(1)).GetComponent<Light>()).enabled = false;
			((Component)val2.transform.GetChild(2)).gameObject.SetActive(false);
			GameObject val3 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/eclipseworld/Weather, Eclipse.prefab").WaitForCompletion();
			GameObject val4 = Object.Instantiate<GameObject>(((Component)val3.transform.GetChild(3).GetChild(2)).gameObject);
			GameObject val5 = Object.Instantiate<GameObject>(val3);
			Light component = ((Component)val5.transform.GetChild(1)).GetComponent<Light>();
			component.shadowStrength = 0.5f;
			SetAmbientLight component2 = ((Component)val5.transform.GetChild(2)).GetComponent<SetAmbientLight>();
			component2.ambientIntensity = 0.6f;
			component2.ApplyLighting();
			val4.gameObject.SetActive(true);
			val4.transform.GetChild(0).localEulerAngles = new Vector3(0f, 0f, 0f);
			val4.transform.localPosition = new Vector3(-1800f, 360f, 310f);
			val4.transform.localEulerAngles = new Vector3(0f, 100f, 0f);
			val4.transform.localScale = new Vector3(420f, 420f, 420f);
			((Renderer)val4.GetComponent<MeshRenderer>()).material = matEclipseMoon;
			Object.Instantiate<GameObject>(((Component)val2.transform.GetChild(1)).gameObject);
			GameObject val6 = GameObject.Find("/HOLDER: Water");
			((Renderer)((Component)val6.transform.GetChild(1)).GetComponent<MeshRenderer>()).material = matAncientLoft_Water;
			GameObject val7 = GameObject.Find("/HOLDER: Terrain/Endless Hole Illusion Card");
			((Renderer)val7.GetComponent<MeshRenderer>()).material = matAncientLoftEndlessHole;
			((Renderer)((Component)val7.transform.GetChild(0)).GetComponent<MeshRenderer>()).material = matAncientLoftEndlessHole;
			((Renderer)((Component)val7.transform.GetChild(1)).GetComponent<MeshRenderer>()).material = matAncientLoftEndlessHole;
			((Renderer)((Component)val7.transform.GetChild(2)).GetComponent<MeshRenderer>()).material = matAncientLoftEndlessHole;
			GameObject val8 = GameObject.Find("/HOLDER: Cards");
			Transform child = val8.transform.GetChild(3);
			Vector3 localScale = child.localScale;
			localScale.z *= -1f;
			child.localScale = localScale;
			((Component)val8.transform.GetChild(4)).gameObject.SetActive(false);
			((Component)val8.transform.GetChild(5)).gameObject.SetActive(false);
			MeshRenderer[] componentsInChildren = val8.GetComponentsInChildren<MeshRenderer>();
			MeshRenderer[] array = componentsInChildren;
			foreach (MeshRenderer val9 in array)
			{
				switch (((Object)((Renderer)val9).material).name)
				{
				case "matAncientLoft_SunCloud (Instance)":
					((Renderer)val9).material = matAncientLoft_SunCloud;
					break;
				case "matAncientLoft_CloudFloor (Instance)":
					((Renderer)val9).material = matAncientLoft_CloudFloor;
					break;
				case "matAncientLoftDeepFog (Instance)":
					((Renderer)val9).material = matAncientLoftDeepFog;
					break;
				}
			}
			((Renderer)((Component)val2.transform.GetChild(3)).GetComponent<ParticleSystemRenderer>()).material = matAncientLoft_Cloud;
		}
	}
	public class Variants_2_FoggySwamp
	{
		public static void Setup()
		{
		}

		private static void AltarSkeletonDeath_Explode(orig_Explode orig, AltarSkeletonDeath self)
		{
			orig.Invoke(self);
		}

		public static void LoopWeather()
		{
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: 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_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0310: 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_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Expected O, but got Unknown
			//IL_0372: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0417: Unknown result type (might be due to invalid IL or missing references)
			//IL_0438: Unknown result type (might be due to invalid IL or missing references)
			//IL_0459: Unknown result type (might be due to invalid IL or missing references)
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0512: Unknown result type (might be due to invalid IL or missing references)
			//IL_051c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0521: Unknown result type (might be due to invalid IL or missing references)
			//IL_0544: Unknown result type (might be due to invalid IL or missing references)
			//IL_054b: Expected O, but got Unknown
			//IL_0566: Unknown result type (might be due to invalid IL or missing references)
			//IL_056b: Unknown result type (might be due to invalid IL or missing references)
			//IL_058b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0590: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0635: Unknown result type (might be due to invalid IL or missing references)
			//IL_0656: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("/Directional Light (SUN)");
			Light component = val.GetComponent<Light>();
			component.shadowStrength /= 0.5f;
			GameObject val2 = GameObject.Find("/HOLDER: Hero Assets");
			Transform child = val2.transform.GetChild(0);
			Transform child2 = val2.transform.GetChild(1);
			Material val3 = Object.Instantiate<Material>(((Renderer)((Component)child).GetComponent<MeshRenderer>()).material);
			Material val4 = Object.Instantiate<Material>(val3);
			val4.color = new Color(1f, 1f, 1f, 0.8f);
			val3.color = new Color(1f, 1f, 1f, 0.8f);
			((Renderer)((Component)child).GetComponent<MeshRenderer>()).material = val3;
			((Renderer)((Component)child2).GetComponent<MeshRenderer>()).material = val4;
			GameObject val5 = Object.Instantiate<GameObject>(((Component)child).gameObject);
			Object.Destroy((Object)(object)val5.GetComponent<MeshRenderer>());
			Transform transform = GameObject.Find("/HOLDER: Foliage/Cloverfield").transform;
			Tools.UpTransformByY(child, 1f);
			Tools.UpTransformByY(transform.GetChild(8), 1f);
			Tools.UpTransformByY(transform.GetChild(9), 1f);
			Tools.UpTransformByY(transform.GetChild(15), 1f);
			Tools.UpTransformByY(transform.GetChild(16), 1f);
			Tools.UpTransformByY(transform.GetChild(17), 1f);
			Tools.UpTransformByY(transform.GetChild(10), 1f);
			Tools.UpTransformByY(transform.GetChild(32), 1f);
			Tools.UpTransformByY(transform.GetChild(33), 1f);
			Tools.UpTransformByY(transform.GetChild(47), 1f);
			Tools.UpTransformByY(transform.GetChild(48), 1f);
			Tools.UpTransformByY(transform.GetChild(45), 1f);
			float num = -149.5f;
			Tools.UpTransformByY(child2, 5.1f);
			Tools.UpTransformByY(transform.GetChild(63), 5.1f);
			Tools.UpTransformByY(transform.GetChild(64), 5.1f);
			GameObject val6 = GameObject.Find("/HOLDER: Ruin Pieces");
			Transform val7 = val6.transform.Find("FSGiantRuinDoorCollision (3)");
			Transform val8 = val6.transform.Find("FSGiantRuinDoorCollision (1)");
			val7.localScale = new Vector3(1f, 2f, 1f);
			val8.localScale = new Vector3(1f, 2f, 1f);
			Tools.UpTransformByY(val7, -40.5f);
			Tools.UpTransformByY(val8, -40.5f);
			GameObject val9 = GameObject.Find("/HOLDER: Tree Trunks w Collision/");
			Transform child3 = val9.transform.GetChild(20);
			child3.localEulerAngles = new Vector3(0f, 340f, 90f);
			child3.localPosition = new Vector3(85f, -150.9878f, -156.2819f);
			Transform val10 = val9.transform.Find("FSTreeTrunkMediumCollision (28)");
			val10.rotation = new Quaternion(-0.5998f, -0.5506f, 0.3745f, 0.4437f);
			val10.localPosition = new Vector3(-87.9046f, -153.3757f, -209.8361f);
			val10.localScale = new Vector3(1.54f, 1.62f, 1.54f);
			GameObject val11 = new GameObject("New Waters");
			val11.transform.localPosition = new Vector3(0f, num, 0f);
			GameObject val12 = Object.Instantiate<GameObject>(((Component)child).gameObject, val11.transform);
			((Renderer)val12.GetComponent<MeshRenderer>()).material = val4;
			val12.transform.rotation = new Quaternion(-0.6996f, 0.1027f, -0.1027f, -0.6996f);
			val12.transform.localPosition = new Vector3(-222.6811f, 0f, -379.4f);
			GameObject val13 = Object.Instantiate<GameObject>(val12.gameObject, val11.transform);
			val13.transform.rotation = new Quaternion(-0.6996f, 0.1027f, -0.1027f, -0.6996f);
			val13.transform.localPosition = new Vector3(-64.5721f, 0f, -150.2274f);
			val13.transform.localScale = new Vector3(354.2f, 100f, 100f);
			GameObject val14 = Object.Instantiate<GameObject>(val12.gameObject, val11.transform);
			val14.transform.localEulerAngles = new Vector3(90f, 0f, 0f);
			val14.transform.localPosition = new Vector3(-64.5721f, 0f, -114.2274f);
			val14.transform.localScale = new Vector3(200f, 100f, 100f);
			GameObject val15 = GameObject.Find("/HOLDER: Hidden Altar Stuff");
			HookLightingIntoPostProcessVolume component2 = ((Component)val15.transform.GetChild(2)).GetComponent<HookLightingIntoPostProcessVolume>();
			component2.defaultAmbientColor = new Color(0.2363f, 0.3038f, 0.42f, 1f) * 1.4f;
			PostProcessVolume component3 = ((Component)SceneInfo.instance).GetComponent<PostProcessVolume>();
			RampFog val16 = (RampFog)component3.profile.settings[0];
			((ParameterOverride<Color>)(object)val16.fogColorEnd).value = new Color(0.3535f, 0.4074f, 0.4434f, 0.94f);
			((ParameterOverride<Color>)(object)val16.fogColorMid).value = new Color(0.3373f, 0.3793f, 0.4157f, 0.65f);
			((ParameterOverride<Color>)(object)val16.fogColorStart).value = new Color(0f, 0f, 0f, 0f);
			((ParameterOverride<float>)(object)val16.fogOne).value = 0.09f;
			((ParameterOverride<float>)(object)val16.fogPower).value = 2f;
			component3.profile.settings[0] = (PostProcessEffectSettings)(object)val16;
			GameObject val17 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC2/ShrineHalcyonite.prefab").WaitForCompletion();
			GameObject val18 = Object.Instantiate<GameObject>(((Component)val17.transform.GetChild(7)).gameObject);
			val18.transform.position = new Vector3(50f, -150f, -150f);
			val18.transform.localScale = new Vector3(6f, 6f, 6f);
			GameObject val19 = Object.Instantiate<GameObject>(((Component)val17.transform.GetChild(8)).gameObject);
			val19.SetActive(true);
			val19.AddComponent<WeatherParticles>().lockPosition = true;
			val17.transform.GetChild(9);
		}
	}
	public class Variants_2_Goolake
	{
		public class DebuffZoneFixed : MonoBehaviour
		{
			public float buffTimer;

			public float interval;

			[Tooltip("The buff type to grant")]
			public BuffDef buffType;

			[Tooltip("The buff duration")]
			public float buffDuration;

			public string buffApplicationSoundString;

			public GameObject buffApplicationEffectPrefab;

			private void Awake()
			{
			}

			private void OnTriggerEnter(Collider other)
			{
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0096: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c4: Expected O, but got Unknown
				if (!NetworkServer.active)
				{
					return;
				}
				if (!WConfig.cfgGameplayChanges.Value)
				{
					buffType = null;
				}
				if (!Object.op_Implicit((Object)(object)buffType))
				{
					return;
				}
				CharacterBody component = ((Component)other).GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.AddTimedBuff(buffType.buffIndex, buffDuration);
					Util.PlaySound(buffApplicationSoundString, ((Component)component).gameObject);
					if (Object.op_Implicit((Object)(object)buffApplicationEffectPrefab))
					{
						EffectManager.SpawnEffect(buffApplicationEffectPrefab, new EffectData
						{
							origin = ((Component)component.mainHurtBox).transform.position,
							scale = component.radius
						}, true);
					}
				}
			}

			private void OnTriggerStay(Collider other)
			{
				//IL_006e: Unknown result type (might be due to invalid IL or missing references)
				if (!NetworkServer.active || !Object.op_Implicit((Object)(object)buffType))
				{
					return;
				}
				buffTimer -= Time.fixedDeltaTime;
				if (buffTimer <= 0f)
				{
					buffTimer = interval;
					CharacterBody component = ((Component)other).GetComponent<CharacterBody>();
					if (Object.op_Implicit((Object)(object)component))
					{
						component.AddTimedBuff(buffType.buffIndex, buffDuration);
					}
				}
			}
		}

		public static Material matGoolakeTerrain;

		public static Cubemap ReflectionProbe = Addressables.LoadAssetAsync<Cubemap>((object)"RoR2/Base/goolake/ReflectionProbe-0.exr").WaitForCompletion();

		public static void Setup()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			matGoolakeTerrain = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/goolake/matGoolakeTerrain.mat").WaitForCompletion());
			matGoolakeTerrain.SetFloat("_BlueChannelBias", 0.4f);
		}

		public static void LoopWeather()
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: 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_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: 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_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Expected O, but got Unknown
			//IL_0667: Unknown result type (might be due to invalid IL or missing references)
			//IL_066c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0692: Unknown result type (might be due to invalid IL or missing references)
			//IL_0699: Expected O, but got Unknown
			//IL_06b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06de: Unknown result type (might be due to invalid IL or missing references)
			//IL_0767: Unknown result type (might be due to invalid IL or missing references)
			//IL_076c: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_080a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0815: Unknown result type (might be due to invalid IL or missing references)
			//IL_0817: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Unknown result type (might be due to invalid IL or missing references)
			//IL_0434: Unknown result type (might be due to invalid IL or missing references)
			//IL_0455: Unknown result type (might be due to invalid IL or missing references)
			//IL_0497: 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_04de: 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_0541: Unknown result type (might be due to invalid IL or missing references)
			//IL_0562: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0844: Unknown result type (might be due to invalid IL or missing references)
			//IL_0849: Unknown result type (might be due to invalid IL or missing references)
			//IL_0853: Unknown result type (might be due to invalid IL or missing references)
			//IL_085f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0861: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0916: Unknown result type (might be due to invalid IL or missing references)
			//IL_0937: Unknown result type (might be due to invalid IL or missing references)
			//IL_0958: Unknown result type (might be due to invalid IL or missing references)
			//IL_0983: Unknown result type (might be due to invalid IL or missing references)
			//IL_099f: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a1c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a68: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a84: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aba: Unknown result type (might be due to invalid IL or missing references)
			//IL_0adb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0afc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b0c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b13: Expected O, but got Unknown
			//IL_0b39: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bcd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bfe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c1f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c40: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("/HOLDER: GameplaySpace");
			GameObject gameObject = ((Component)val.transform.GetChild(2)).gameObject;
			((Renderer)gameObject.GetComponent<MeshRenderer>()).material = matGoolakeTerrain;
			GameObject val2 = GameObject.Find("/HOLDER: Misc Props");
			GameObject val3 = GameObject.Find("/HOLDER: GameplaySpace/mdlGlDam/GL_AqueductPartial/GL_Waterfall");
			BuffDef buffType = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/Common/bdClayGoo.asset").WaitForCompletion();
			val3.transform.localPosition = new Vector3(-0.36f, -1f, 0f);
			val3.transform.localScale = new Vector3(1f, 0.9f, 1f);
			((Component)val3.transform.GetChild(8)).GetComponent<DebuffZone>().buffType = buffType;
			((Component)val3.transform.GetChild(8)).GetComponent<DebuffZone>().buffDuration = 2f;
			GameObject gameObject2 = ((Component)val3.transform.GetChild(9)).gameObject;
			GameObject gameObject3 = ((Component)val2.transform.GetChild(2)).gameObject;
			GameObject gameObject4 = ((Component)val2.transform.GetChild(3)).gameObject;
			DebuffZone componentInChildren = gameObject4.GetComponentInChildren<DebuffZone>();
			componentInChildren.buffType = null;
			DebuffZoneFixed debuffZoneFixed = ((Component)componentInChildren).gameObject.AddComponent<DebuffZoneFixed>();
			debuffZoneFixed.interval = 1f;
			debuffZoneFixed.buffApplicationEffectPrefab = componentInChildren.buffApplicationEffectPrefab;
			debuffZoneFixed.buffApplicationSoundString = componentInChildren.buffApplicationSoundString;
			debuffZoneFixed.buffDuration = 3f;
			debuffZoneFixed.buffType = buffType;
			componentInChildren = gameObject3.GetComponentInChildren<DebuffZone>();
			componentInChildren.buffType = null;
			debuffZoneFixed = ((Component)componentInChildren).gameObject.AddComponent<DebuffZoneFixed>();
			debuffZoneFixed.interval = 1f;
			debuffZoneFixed.buffApplicationEffectPrefab = componentInChildren.buffApplicationEffectPrefab;
			debuffZoneFixed.buffApplicationSoundString = componentInChildren.buffApplicationSoundString;
			debuffZoneFixed.buffDuration = 3f;
			debuffZoneFixed.buffType = buffType;
			gameObject3.transform.localPosition = new Vector3(107.6f, -122.7f, 50.3f);
			gameObject3.transform.localScale = new Vector3(7.5579f, 1f, 7.8565f);
			gameObject3.transform.GetChild(0).localScale = new Vector3(10f, 100f, 10f);
			gameObject4.transform.localPosition = new Vector3(164.4f, -83.01f, -221.2f);
			gameObject4.transform.localScale = new Vector3(7.467f, 1f, 7.9853f);
			gameObject4.transform.GetChild(1).localScale = new Vector3(10f, 100f, 10f);
			GameObject val4 = Object.Instantiate<GameObject>(gameObject3, val2.transform.parent);
			val4.transform.localPosition = new Vector3(360f, -106f, -260f);
			val4.transform.localScale = new Vector3(15f, 1f, 10f);
			val4.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			((Object)val4).name = "GooPlane Decor";
			GameObject val5 = new GameObject("TarDecalHolder_TarRiver");
			if (WConfig.Stage_2_Goolake_River.Value)
			{
				GameObject val6 = Object.Instantiate<GameObject>(gameObject4, val2.transform.parent);
				val6.transform.localPosition = new Vector3(270f, -134.4f, 160f);
				val6.transform.localScale = new Vector3(30f, 1f, 30f);
				val6.transform.localEulerAngles = new Vector3(0f, 326.1636f, 0f);
				val6.transform.GetChild(1).localPosition = new Vector3(0f, -0.2f, 0f);
				((Object)val6).name = "GooPlane CentralRiver";
				GameObject val7 = Object.Instantiate<GameObject>(gameObject2, val5.transform);
				val7.GetComponent<Decal>().LimitTo = gameObject;
				val7.transform.localPosition = new Vector3(265.3105f, -123.385f, 225.0929f);
				val7.transform.localEulerAngles = new Vector3(0f, 45f, 0f);
				val7.transform.localScale = new Vector3(150f, 40f, 67f);
				val7 = Object.Instantiate<GameObject>(gameObject2, val5.transform);
				val7.GetComponent<Decal>().Fade = 2f;
				val7.transform.localPosition = new Vector3(136.7616f, -135.4982f, 218.1272f);
				val7.transform.localRotation = new Quaternion(0.1426f, -0.8367f, -0.0888f, 0.5212f);
				val7.transform.localScale = new Vector3(70.9044f, 86.1103f, 76.1418f);
				val7 = Object.Instantiate<GameObject>(gameObject2, val5.transform);
				val7.GetComponent<Decal>().Fade = 4f;
				val7.transform.localPosition = new Vector3(240.8404f, -158.2065f, 33.9958f);
				val7.transform.localScale = new Vector3(50f, 79.6727f, 30.3744f);
				val7.transform.localEulerAngles = new Vector3(6.4184f, 343.1097f, 0f);
				val7 = Object.Instantiate<GameObject>(gameObject2, val5.transform);
				val7.GetComponent<Decal>().Fade = 4f;
				val7.transform.localPosition = new Vector3(240.8404f, -158.2065f, 33.9958f);
				val7.transform.localScale = new Vector3(50f, 79.6727f, 30.3744f);
				val7.transform.localEulerAngles = new Vector3(6.4184f, 343.1097f, 0f);
			}
			GameObject val8 = GameObject.Find("HOLDER: Secret Ring Area Content/ApproxCenter");
			GameObject gameObject5 = ((Component)val8.transform.GetChild(4)).gameObject;
			GameObject val9 = GameObject.Find("/Weather, Goolake");
			Light component = ((Component)val9.transform.GetChild(0)).GetComponent<Light>();
			component.shadowStrength = 0.5f;
			ReflectionProbe val10 = val9.AddComponent<ReflectionProbe>();
			val10.bakedTexture = (Texture)(object)ReflectionProbe;
			val10.resolution = 512;
			PostProcessProfile val11 = Addressables.LoadAssetAsync<PostProcessProfile>((object)"RoR2/Base/title/PostProcessing/ppSceneGoolakeInTunnels.asset").WaitForCompletion();
			PostProcessProfile val12 = Object.Instantiate<PostProcessProfile>(val11);
			RampFog val13 = (RampFog)Object.Instantiate<PostProcessEffectSettings>(val12.settings[0]);
			((ParameterOverride<Color>)(object)val13.fogColorEnd).value = new Color(0.7f, 1f, 0.213f, 1f);
			((ParameterOverride<Color>)(object)val13.fogColorMid).value = new Color(0.8896f, 0.9151f, 0.3842f, 0.2745f);
			((ParameterOverride)val13.fogColorEnd).overrideState = true;
			val12.settings[0] = (PostProcessEffectSettings)(object)val13;
			PostProcessVolume component2 = ((Component)val9.transform.GetChild(1)).GetComponent<PostProcessVolume>();
			component2.sharedProfile = val12;
			component2.profile = val12;
			component2.priority = 1f;
			val9.SetActive(false);
			val9.SetActive(true);
			SceneWeatherController component3 = ((Component)SceneInfo.instance).GetComponent<SceneWeatherController>();
			component3.initialWeatherParams.sunColor = new Color(0.5f, 0.6f, 0.5f);
			component3.initialWeatherParams.sunIntensity = 1f;
			HookLightingIntoPostProcessVolume component4 = gameObject5.GetComponent<HookLightingIntoPostProcessVolume>();
			component4.defaultAmbientColor = new Color(0.4f, 0.55f, 0.45f, 1f);
			component4.overrideAmbientColor = new Color(0.22f, 0.35f, 0.24f, 1f);
			List<NodeIndex> list = new List<NodeIndex>();
			HullMask forbiddenHulls = (HullMask)7;
			Bounds val14 = default(Bounds);
			((Bounds)(ref val14)).min = new Vector3(230f, -120f, -300f);
			((Bounds)(ref val14)).max = new Vector3(250f, -30f, -228f);
			Bounds val15 = val14;
			NodeGraph groundNodes = SceneInfo.instance.groundNodes;
			groundNodes.blockMap.GetItemsInBounds(ref val15, list);
			foreach (NodeIndex item in list)
			{
				groundNodes.nodes[item.nodeIndex].forbiddenHulls = forbiddenHulls;
			}
			NodeGraph airNodes = SceneInfo.instance.airNodes;
			airNodes.blockMap.GetItemsInBounds(ref val15, list);
			foreach (NodeIndex item2 in list)
			{
				airNodes.nodes[item2.nodeIndex].forbiddenHulls = forbiddenHulls;
			}
			Transform child = val.transform.GetChild(4).GetChild(0);
			GameObject val16 = Object.Instantiate<GameObject>(((Component)child).gameObject);
			val16.transform.localScale = child.lossyScale;
			val16.transform.localEulerAngles = new Vector3(0f, 25f, 180f);
			val16.transform.localPosition = new Vector3(214f, -95.1249f, -248f);
			Transform child2 = val16.transform.GetChild(1);
			child2.localPosition = new Vector3(0f, -3f, 0f);
			child2.localScale = new Vector3(1f, 0.7f, 1f);
			Transform val17 = val.transform.Find("Gates");
			((Component)val17.GetChild(0)).gameObject.SetActive(false);
			((Component)val17.GetChild(1)).gameObject.SetActive(true);
			GameObject val18 = Object.Instantiate<GameObject>(((Component)child).gameObject);
			val18.transform.localScale = child.lossyScale;
			val18.transform.localEulerAngles = new Vector3(0f, 207.3991f, 180f);
			val18.transform.localPosition = new Vector3(-233.9893f, -40f, -228.5455f);
			Transform child3 = val18.transform.GetChild(1);
			child3.localPosition = new Vector3(-0.36f, -3f, 0f);
			child3.localScale = new Vector3(1f, 0.7f, 1f);
			((Component)child3.GetChild(4)).gameObject.SetActive(false);
			GameObject val19 = Object.Instantiate<GameObject>(val18.gameObject);
			val19.transform.localScale = child.lossyScale;
			val19.transform.localEulerAngles = new Vector3(0f, 262.7f, 180f);
			val19.transform.localPosition = new Vector3(106.1051f, -95.3636f, 329.692f);
			GameObject val20 = new GameObject("TarDecalHolder_DistantAquaduct");
			GameObject val21 = Object.Instantiate<GameObject>(gameObject2, val20.transform);
			val21.transform.localPosition = new Vector3(-185.5541f, -60.0904f, -250.7442f);
			val21.transform.localScale = new Vector3(70f, 70f, 70f);
			val21 = Object.Instantiate<GameObject>(gameObject2, val20.transform);
			val21.transform.localPosition = new Vector3(-156f, -47f, -290f);
			val21.transform.localScale = new Vector3(153f, 150f, 91f);
			val21.transform.localEulerAngles = new Vector3(0f, 51f, 0f);
			val21 = Object.Instantiate<GameObject>(gameObject2, val20.transform);
			val21.transform.localPosition = new Vector3(-73f, -96.6f, -343f);
			val21.transform.localScale = new Vector3(153f, 45f, 66f);
			val21.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			GameObject val22 = GameObject.Find("/HOLDER: Stage Count Toggled Objects/RescueshipBroken/escapeship/DropshipArmature/ROOT/Base");
			if (Object.op_Implicit((Object)(object)val22))
			{
				val22.SetActive(false);
			}
			if (WConfig.cfgGameplayChanges.Value && NetworkServer.active && Run.instance.stageClearCount > 4 && Run.instance.IsExpansionEnabled(LoopVariantsMain.DLC2))
			{
				GameObject gameObject6 = ((Component)val8.transform.GetChild(0)).gameObject;
				((Behaviour)((Component)gameObject6.transform.GetChild(1)).GetComponent<StartEvent>()).enabled = false;
				((Behaviour)((Component)gameObject6.transform.GetChild(2)).GetComponent<StartEvent>()).enabled = false;
				Inventory component5 = ((Component)gameObject6.transform.GetChild(1)).GetComponent<Inventory>();
				component5.GiveItem(Items.FireRing, 1);
				component5.GiveItem(Items.Clover, 20);
				component5.GiveItem(Items.BoostHp, 20);
				component5.GiveEquipmentString("EliteAurelioniteEquipment");
				component5 = ((Component)gameObject6.transform.GetChild(2)).GetComponent<Inventory>();
				component5.GiveItem(Items.IceRing, 1);
				component5.GiveItem(Items.Clover, 20);
				component5.GiveItem(Items.BoostHp, 20);
				component5.GiveEquipmentString("EliteBeadEquipment");
			}
		}
	}
	public class Variants_2_LemurianTemple
	{
		public static Material matBHFallEnvfxLeaves;

		public static Material matBHDistantTree_Billboard;

		public static Material matBHDistantTree;

		public static Material Cealing_Leaves_0_LOD0;

		public static Material LTFallenLeaf;

		public static Material matBHFallTerrainVines;

		public static Material Gold_matLTCrystal;

		public static Material CrystalForAltar;

		public static PostProcessProfile PP_AncientLoft;

		public static void Setup()
		{
			//IL_0015: 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_0024: 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_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_00ff: 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_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Expected O, but got Unknown
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Expected O, but got Unknown
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			Color color = new Color(0.6604f, 0.3208f, 0.529f, 1f) * 1.1f;
			matBHFallEnvfxLeaves = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC2/habitatfall/Assets/matBHFallEnvfxLeaves.mat").WaitForCompletion());
			matBHDistantTree_Billboard = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC2/habitatfall/Assets/matBHFallDistantTreeBillboard.mat").WaitForCompletion());
			matBHDistantTree = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC2/habitatfall/Assets/matBHFallDistantTree.mat").WaitForCompletion());
			LTFallenLeaf = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC2/lemuriantemple/Assets/LTFallenLeaf.spm").WaitForCompletion());
			Texture2D mainTexture = Files.Bundle.LoadAsset<Texture2D>("Assets/LoopVariants/LemurianTemple/BHDistantTreeP_Atlas.png");
			Texture2D mainTexture2 = Files.Bundle.LoadAsset<Texture2D>("Assets/LoopVariants/LemurianTemple/LTFallenLeaf_Atlas.png");
			LTFallenLeaf.color = color;
			LTFallenLeaf.mainTexture = (Texture)(object)mainTexture2;
			LTFallenLeaf.SetColor("_HueVariation", new Color(1f, 0.5f, 0.1f, 0.5f));
			matBHFallEnvfxLeaves.color = color;
			matBHFallEnvfxLeaves.mainTexture = (Texture)(object)mainTexture;
			matBHFallTerrainVines = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC2/habitatfall/Assets/matBHFallTerrainVines.mat"