Decompiled source of PEAKapalooza v0.9.1

PEAKapalooza.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using DG.Tweening;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using Photon.Realtime;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using Zorro.Core;
using Zorro.PhotonUtility;
using pworld.Scripts.Extensions;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("DOTween")]
[assembly: IgnoresAccessChecksTo("PhotonRealtime")]
[assembly: IgnoresAccessChecksTo("PhotonUnityNetworking")]
[assembly: IgnoresAccessChecksTo("pworld")]
[assembly: IgnoresAccessChecksTo("Sirenix.Serialization")]
[assembly: IgnoresAccessChecksTo("Unity.Localization")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: IgnoresAccessChecksTo("Zorro.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Zorro.PhotonUtility")]
[assembly: IgnoresAccessChecksTo("Zorro.Settings.Runtime")]
[assembly: IgnoresAccessChecksTo("Zorro.UI.Runtime")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("PEAKapalooza")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.6.4.0")]
[assembly: AssemblyInformationalVersion("0.6.4+4879dee2af5116ca849be3a02908a67215aec13f")]
[assembly: AssemblyProduct("PEAKapalooza")]
[assembly: AssemblyTitle("PEAKapalooza")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.6.4.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace PEAKapalooza
{
	[BepInPlugin("PEAKapalooza", "PEAKapalooza", "0.6.4")]
	[BepInProcess("PEAK.exe")]
	public class PEAKapalooza : BaseUnityPlugin
	{
		public class PhotonInterfacer : MonoBehaviour
		{
			[PunRPC]
			public void RPC_Send_Current_Segment(int segmentNum)
			{
				currentSegment = segmentNum;
			}

			[PunRPC]
			public void RPC_Start_Peak_To_Beach()
			{
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0068: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d0: 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_00fe: Unknown result type (might be due to invalid IL or missing references)
				MapHandler.JumpToSegment((Segment)4);
				GameObject val = GameObject.Find("Map/Biome_4/Volcano/Peak/PeakSequence/Helicopter/Helicopter");
				val.transform.parent = GameObject.Find("Map/Biome_4/Volcano/Peak").transform;
				val.transform.position = new Vector3(15.8f, 1225.486f, 2245.563f);
				val.transform.rotation = new Quaternion(0.9866f, 0.1127f, 0f, -0.1182f);
				GameObject.Find("Map/Biome_4/Volcano/Peak/Helicopter/Rotor").SetActive(false);
				GameObject.Find("Map/Biome_4/Volcano/Peak/Helicopter/ButtFan").SetActive(false);
				GameObject val2 = GameObject.Find("Map/Biome_1/Beach/Beach_Segment/crashed plane/Back Half/VFX_Smoke (1)");
				val2.transform.parent = GameObject.Find("Map/Biome_4/Volcano/Peak").transform;
				val2.transform.position = new Vector3(15.8f, 1225.486f, 2245.563f);
				if (PhotonNetwork.IsMasterClient)
				{
					PhotonNetwork.Instantiate("0_Items/Backpack", new Vector3(16f, 1235f, 2239f), Quaternion.identity, (byte)0, (object[])null).GetComponent<Item>();
				}
			}

			[PunRPC]
			public void RPC_Next_Section_Peak_To_Beach()
			{
				if (currentSegment == 3)
				{
					MapHandler.JumpToSegment((Segment)3);
					if (toggleForceAlpine)
					{
						GameObject.Find("Map/Biome_3/Alpine").SetActive(true);
						GameObject.Find("Map/Biome_3/Mesa").SetActive(false);
					}
					if (toggleForceMesa)
					{
						GameObject.Find("Map/Biome_3/Alpine").SetActive(false);
						GameObject.Find("Map/Biome_3/Mesa").SetActive(true);
					}
					if (toggleAlpineAndMesa)
					{
						GameObject.Find("Map/Biome_3/Mesa/Desert_Campfire").SetActive(true);
						GUIManager.instance.SetHeroTitle(Singleton<MountainProgressHandler>.Instance.progressPoints[4].localizedTitle, Singleton<MountainProgressHandler>.Instance.progressPoints[3].clip);
					}
					else
					{
						GUIManager.instance.SetHeroTitle(Singleton<MountainProgressHandler>.Instance.progressPoints[3].localizedTitle, Singleton<MountainProgressHandler>.Instance.progressPoints[3].clip);
					}
				}
				else if (currentSegment == 2)
				{
					MapHandler.JumpToSegment((Segment)2);
					if (toggleForceAlpine)
					{
						GameObject.Find("Map/Biome_3/Alpine").SetActive(true);
						GameObject.Find("Map/Biome_3/Mesa").SetActive(false);
					}
					if (toggleForceMesa)
					{
						GameObject.Find("Map/Biome_3/Alpine").SetActive(false);
						GameObject.Find("Map/Biome_3/Mesa").SetActive(true);
					}
					if (toggleAlpineAndMesa)
					{
						GameObject.Find("Map/Biome_3/Alpine/Snow_Segment").SetActive(true);
						GameObject.Find("Map/Biome_3/Mesa/Desert_Segment").SetActive(true);
						LightVolume[] array = Object.FindObjectsByType<LightVolume>((FindObjectsSortMode)0);
						foreach (LightVolume val in array)
						{
							val.Bake((Action)null);
						}
						GUIManager.instance.SetHeroTitle("ALPINE & MESA", Singleton<MountainProgressHandler>.Instance.progressPoints[2].clip);
					}
					else
					{
						GUIManager.instance.SetHeroTitle(Singleton<MountainProgressHandler>.Instance.progressPoints[2].localizedTitle, Singleton<MountainProgressHandler>.Instance.progressPoints[2].clip);
					}
				}
				else if (currentSegment == 1)
				{
					GUIManager.instance.SetHeroTitle(Singleton<MountainProgressHandler>.Instance.progressPoints[1].localizedTitle, Singleton<MountainProgressHandler>.Instance.progressPoints[1].clip);
					MapHandler.JumpToSegment((Segment)1);
					if (toggleSkyJungle)
					{
						GameObject.Find("Map/Biome_2/Tropics/Jungle_Segment/Ground").SetActive(false);
						GameObject.Find("Map/Biome_2/Tropics/Jungle_Segment/SkyJungle").SetActive(true);
					}
					if (toggleAlpineAndMesa)
					{
						GameObject.Find("Map/Biome_3/Alpine").SetActive(false);
						GameObject.Find("Map/Biome_3/Mesa").SetActive(false);
					}
				}
				else if (currentSegment == 0)
				{
					GUIManager.instance.SetHeroTitle(Singleton<MountainProgressHandler>.Instance.progressPoints[0].localizedTitle, Singleton<MountainProgressHandler>.Instance.progressPoints[0].clip);
					MapHandler.JumpToSegment((Segment)0);
					GameObject.Find("Map/Biome_1/Beach/Beach_Segment/crashed plane").SetActive(false);
				}
			}

			[PunRPC]
			public void HandleAssignedViewIDs_RPC(int[] ids)
			{
				if (PhotonNetwork.IsMasterClient)
				{
					return;
				}
				PhotonView[] source = (from v in ((Component)Singleton<MapHandler>.Instance).gameObject.GetComponentsInChildren<PhotonView>(true)
					where v.ViewID == 0
					select v).ToArray();
				PhotonView[] array = source.OrderBy(delegate(PhotonView v)
				{
					//IL_002e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0039: Expected O, but got Unknown
					GameObject gameObject = ((Component)v).gameObject;
					List<string> list = new List<string>();
					Transform val = gameObject.transform;
					while ((Object)val != (Object)null)
					{
						list.Add(((Object)val).name);
						val = val.parent;
					}
					list.Reverse();
					return string.Join("/", list);
				}).ToArray();
				int num = Math.Min(array.Length, ids.Length);
				for (int i = 0; i < num; i++)
				{
					try
					{
						array[i].ViewID = ids[i];
					}
					catch
					{
					}
				}
			}
		}

		internal static ManualLogSource Logger;

		public static bool debug = false;

		public static bool wonGame = false;

		public static bool keypress = false;

		public static int currentSegment = 3;

		public static bool startingRun = false;

		public static bool tempbool = false;

		public static bool shownStartTitle = false;

		public static EyeBlinkController ebc = null;

		public static bool temp = false;

		public static bool shownAMTitle = false;

		public static List<LevelGenStep> lgs = new List<LevelGenStep>();

		public static BiomeType[] defaultBiomes = Array.Empty<BiomeType>();

		public static bool setupComplete = false;

		public static bool toggleRainDisable = false;

		public static bool toggleSnowDisable = false;

		public static bool toggleTornadoDisable = false;

		public static bool toggleFogFaster = false;

		public static bool toggleFogDisable = false;

		public static bool toggleTornadoFaster = false;

		public static bool togglePeakToBeach = false;

		public static bool toggleSnowInfinite = false;

		public static bool toggleRainInfinite = false;

		public static bool toggleForceAlpine = false;

		public static bool toggleForceMesa = false;

		public static bool toggleAlpineAndMesa = false;

		public static bool toggleSkyJungle = false;

		public static bool toggleHotSunDisable = false;

		public static bool toggleLavaRisingDisable = false;

		public static bool toggleLavaRisingFaster = false;

		public static int numberOfElements = 0;

		public static WindChillZone rainZone;

		public static WindChillZone snowZone;

		public static TornadoSpawner tornados;

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"\n _____  ______          _  __                 _                       _\n|  __ \\|  ____|   /\\   | |/ /                | |                     | |\n| |__) | |__     /  \\  | ' / __ _ _ __   __ _| | ___   ___ ______ _  | |\n|  ___/|  __|   / /\\ \\ |  < / _` | '_ \\ / _` | |/ _ \\ / _ \\_  / _` | | |\n| |    | |____ / ____ \\| . \\ (_| | |_) | (_| | | (_) | (_) / / (_| | |_|\n|_|    |______/_/    \\_\\_|\\_\\__,_| .__/ \\__,_|_|\\___/ \\___/___\\__,_| (_)\n                                 | |                                    \n                                 |_|                                    \n");
			SceneManager.sceneLoaded += OnSceneChange;
			Harmony.CreateAndPatchAll(typeof(PEAKapalooza), (string)null);
		}

		public void Update()
		{
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			if (!debug)
			{
				return;
			}
			if (Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)49) && !keypress)
			{
				keypress = true;
				MapHandler.JumpToSegment((Segment)0);
			}
			else if (Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)50) && !keypress)
			{
				keypress = true;
				MapHandler.JumpToSegment((Segment)1);
			}
			else if (Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)51) && !keypress)
			{
				keypress = true;
				MapHandler.JumpToSegment((Segment)2);
			}
			else if (Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)52) && !keypress)
			{
				keypress = true;
				MapHandler.JumpToSegment((Segment)3);
			}
			else if (Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)53) && !keypress)
			{
				keypress = true;
				MapHandler.JumpToSegment((Segment)4);
			}
			else if (Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)54) && !keypress)
			{
				keypress = true;
				MapHandler.JumpToSegment((Segment)5);
			}
			else if (Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)55) && !keypress)
			{
				keypress = true;
				Character.localCharacter.WarpPlayer(Singleton<MapHandler>.Instance.segments[4].reconnectSpawnPos.position, true);
			}
			else if (Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)56) && !keypress)
			{
				keypress = true;
				GameObject.Find("FogSphereSystem").SetActive(false);
			}
			else if (Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)57) && !keypress)
			{
				keypress = true;
				RunManager.Instance.SyncTimeMaster();
			}
			else if (Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)48) && !keypress)
			{
				keypress = true;
				LightVolume[] array = Object.FindObjectsByType<LightVolume>((FindObjectsSortMode)0);
				foreach (LightVolume val in array)
				{
					val.Bake((Action)null);
				}
			}
			if (!Input.GetKey((KeyCode)306))
			{
				keypress = false;
			}
		}

		[HarmonyPatch(typeof(PointPinger), "ReceivePoint_Rpc")]
		[HarmonyPostfix]
		public static void Postfix_PingWarp_ReceivePoint_Rpc(PointPinger __instance)
		{
			//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)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			RaycastHit val = default(RaycastHit);
			if (debug && PExt.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), ref val, HelperExtensions.ToLayerMask((LayerType)1), -1f) && __instance.photonView.IsMine)
			{
				__instance.character.WarpPlayer(((RaycastHit)(ref val)).point, true);
			}
		}

		[HarmonyPatch(typeof(RunManager), "RPC_SyncTime")]
		[HarmonyPostfix]
		public static void Postfix_PeakToBeach_RPC_SyncTime(RunManager __instance)
		{
			if (!togglePeakToBeach)
			{
				return;
			}
			if ((Object)(object)((Component)GameUtils.instance).gameObject.GetComponent<PhotonInterfacer>() == (Object)null)
			{
				((Component)GameUtils.instance).gameObject.AddComponent<PhotonInterfacer>();
			}
			ebc = GameObject.Find(((Object)((Component)Character.localCharacter).gameObject).name + "/Scout/Misc/EyeBlinkController").GetComponent<EyeBlinkController>();
			Character[] array = Object.FindObjectsByType<Character>((FindObjectsSortMode)0);
			foreach (Character val in array)
			{
				if (!val.isBot && (Object)(object)((Component)val).gameObject.GetComponent<PhotonInterfacer>() == (Object)null)
				{
					((Component)val).gameObject.AddComponent<PhotonInterfacer>();
				}
			}
			if (PhotonNetwork.IsMasterClient && startingRun && !tempbool)
			{
				tempbool = true;
				currentSegment = 3;
				GameUtils.instance.photonView.RPC("RPC_Start_Peak_To_Beach", (RpcTarget)0, Array.Empty<object>());
			}
		}

		[HarmonyPatch(typeof(CharacterSpawner), "OnPlayerEnteredRoom")]
		[HarmonyPostfix]
		public static void Postfix_PeakToBeach_Update(CharacterSpawner __instance)
		{
			if (PhotonNetwork.IsMasterClient && togglePeakToBeach)
			{
				((MonoBehaviour)__instance).StartCoroutine(PlayerJoined());
			}
		}

		public static IEnumerator PlayerJoined()
		{
			yield return (object)new WaitForSeconds(3f);
			RunManager.Instance.SyncTimeMaster();
		}

		[HarmonyPatch(typeof(Character), "Update")]
		[HarmonyPostfix]
		public static void Postfix_PeakToBeach_Update(Character __instance)
		{
			if (togglePeakToBeach && !shownStartTitle && startingRun && (Object)(object)ebc != (Object)null && (double)ebc.eyeOpenValue > 0.999)
			{
				shownStartTitle = true;
				GUIManager.instance.SetHeroTitle("Peak To Beach", (AudioClip)null);
			}
		}

		[HarmonyPatch(typeof(Campfire), "Light_Rpc")]
		[HarmonyPrefix]
		public static bool Prefix_PeakToBeach_Light_Rpc(Campfire __instance)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Invalid comparison between Unknown and I4
			if (togglePeakToBeach)
			{
				__instance.state = (FireState)1;
				__instance.UpdateLit();
				__instance.smokeParticlesOff.Stop();
				__instance.smokeParticlesLit.Play();
				GUIManager.instance.RefreshInteractablePrompt();
				if (PhotonNetwork.IsMasterClient)
				{
					Character.localCharacter.view.RPC("RPC_Next_Section_Peak_To_Beach", (RpcTarget)0, Array.Empty<object>());
					Singleton<MapHandler>.Instance.currentSegment = currentSegment;
					if (currentSegment != 0)
					{
						currentSegment--;
						Character.localCharacter.view.RPC("RPC_Send_Current_Segment", (RpcTarget)0, new object[1] { currentSegment });
					}
				}
				foreach (Luggage item in Luggage.ALL_LUGGAGE)
				{
					if ((int)item.state == 1)
					{
						item.anim.Play("Luggage_Open");
					}
				}
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(MapHandler), "JumpToSegmentLogic")]
		[HarmonyPrefix]
		public static bool Prefix_PeakToBeach_JumpToSegmentLogic(Segment segment, HashSet<int> playersToTeleport, bool sendToEveryone, MapHandler __instance)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected I4, but got Unknown
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Expected I4, but got Unknown
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Invalid comparison between Unknown and I4
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Invalid comparison between Unknown and I4
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Invalid comparison between Unknown and I4
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Invalid comparison between Unknown and I4
			//IL_034b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Unknown result type (might be due to invalid IL or missing references)
			//IL_035c: Expected O, but got Unknown
			if (togglePeakToBeach)
			{
				Singleton<MapHandler>.Instance.currentSegment = (int)segment;
				MapSegment[] segments = Singleton<MapHandler>.Instance.segments;
				foreach (MapSegment val in segments)
				{
					val.segmentParent.SetActive(false);
					if (Object.op_Implicit((Object)(object)val.segmentCampfire))
					{
						val.segmentCampfire.SetActive(false);
					}
					if (Object.op_Implicit((Object)(object)val.wallNext))
					{
						val.wallNext.gameObject.SetActive(false);
					}
					if (Object.op_Implicit((Object)(object)val.wallPrevious))
					{
						val.wallPrevious.gameObject.SetActive(false);
					}
				}
				int num = (int)segment;
				if ((int)segment == 5)
				{
					num--;
				}
				MapSegment val2 = Singleton<MapHandler>.Instance.segments[num];
				if ((int)segment == 4)
				{
					val2.reconnectSpawnPos.position = new Vector3(16f, 1235f, 2239f);
				}
				val2.segmentParent.SetActive(true);
				if (Object.op_Implicit((Object)(object)val2.segmentCampfire))
				{
					val2.segmentCampfire.SetActive(true);
				}
				if (Object.op_Implicit((Object)(object)val2.wallNext))
				{
					val2.wallNext.gameObject.SetActive(true);
				}
				if (Object.op_Implicit((Object)(object)val2.wallPrevious))
				{
					val2.wallPrevious.gameObject.SetActive(true);
				}
				if (num > 0)
				{
					MapSegment val3 = Singleton<MapHandler>.Instance.segments[num - 1];
					GameObject segmentCampfire = val3.segmentCampfire;
					if (segmentCampfire != null)
					{
						segmentCampfire.SetActive(true);
					}
				}
				if (PhotonNetwork.IsMasterClient && ((toggleAlpineAndMesa && (int)segment != 2) || !toggleAlpineAndMesa))
				{
					ISpawner[] componentsInChildren = val2.segmentParent.GetComponentsInChildren<ISpawner>();
					int num2 = 0;
					ISpawner[] array = componentsInChildren;
					foreach (ISpawner val4 in array)
					{
						val4.TrySpawnItems();
						num2++;
					}
					if (Object.op_Implicit((Object)(object)val2.segmentCampfire))
					{
						ISpawner[] componentsInChildren2 = val2.segmentCampfire.GetComponentsInChildren<ISpawner>();
						for (int k = 0; k < componentsInChildren2.Length; k++)
						{
							componentsInChildren2[k].TrySpawnItems();
						}
					}
				}
				if ((Object)(object)val2.dayNightProfile != (Object)null)
				{
					DayNightManager.instance.BlendProfiles(val2.dayNightProfile);
				}
				if (PhotonNetwork.IsMasterClient && (int)segment == 4)
				{
					List<Character> list = new List<Character>();
					foreach (Character allPlayerCharacter in PlayerHandler.GetAllPlayerCharacters())
					{
						if (!allPlayerCharacter.isBot)
						{
							list.Add(allPlayerCharacter);
						}
					}
					foreach (Character item in list)
					{
						((MonoBehaviour)Singleton<MapHandler>.Instance).StartCoroutine(PlayerWarpHelper(item));
					}
				}
				if (sendToEveryone)
				{
					CustomCommands<CustomCommandType>.SendPackage((CustomCommandPackage<CustomCommandType>)new SyncMapHandlerDebugCommandPackage(segment, Array.Empty<int>()), (ReceiverGroup)0);
				}
				return false;
			}
			return true;
		}

		public static IEnumerator PlayerWarpHelper(Character character)
		{
			yield return (object)new WaitForSeconds(3f);
			character.view.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2]
			{
				(object)new Vector3(16f, 1235f, 2239f),
				false
			});
		}

		[HarmonyPatch(typeof(Luggage), "OpenLuggageRPC")]
		[HarmonyPostfix]
		public static void Postfix_FixLuggageState_OpenLuggageRPC(bool spawnItems, Luggage __instance)
		{
			if (togglePeakToBeach)
			{
				Luggage.ALL_LUGGAGE.Add(__instance);
			}
		}

		[HarmonyPatch(typeof(Flare), "Update")]
		[HarmonyPrefix]
		public static bool Prefix_PeakToBeach_Update(Flare __instance)
		{
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			if (togglePeakToBeach)
			{
				bool value = ((ItemComponent)__instance).GetData<BoolItemData>((DataEntryKey)3).Value;
				((ItemComponent)__instance).item.UIData.canPocket = !value;
				if (value && !__instance.trackable.hasTracker)
				{
					__instance.EnableFlareVisuals();
				}
				if (value && Object.op_Implicit((Object)(object)((ItemComponent)__instance).item.holderCharacter) && Vector3.Distance(GameObject.Find("BingBong(Clone)").transform.position, ((ItemComponent)__instance).item.holderCharacter.Center) < 40f && !wonGame)
				{
					foreach (Character allPlayerCharacter in PlayerHandler.GetAllPlayerCharacters())
					{
						allPlayerCharacter.RPCEndGame_ForceWin();
					}
					wonGame = true;
				}
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(GUIManager), "SetHeroTitle")]
		[HarmonyPrefix]
		public static bool Prefix_CustomHeroTitle_SetHeroTitle(string text, AudioClip stinger, GUIManager __instance)
		{
			if (__instance._heroRoutine != null)
			{
				((MonoBehaviour)__instance).StopCoroutine(__instance._heroRoutine);
			}
			if (Object.op_Implicit((Object)(object)__instance.stingerSound) && (Object)(object)stinger != (Object)null)
			{
				__instance.stingerSound.clip = stinger;
				__instance.stingerSound.Play();
			}
			__instance._heroRoutine = ((MonoBehaviour)__instance).StartCoroutine(CustomHeroTitle(text, __instance));
			return false;
		}

		public static IEnumerator CustomHeroTitle(string heroString, GUIManager __instance)
		{
			__instance.heroCanvasObject.gameObject.SetActive(true);
			yield return null;
			string dayString = ((!(heroString == "Peak To Beach")) ? DayNightManager.instance.DayCountString() : "Light a Flare near BingBong!");
			if (!(heroString == "PEAK") || !togglePeakToBeach)
			{
				if ((heroString == "ALPINE" || heroString == "MESA") && toggleAlpineAndMesa && !shownAMTitle)
				{
					shownAMTitle = true;
					heroString = "ALPINE & MESA";
				}
				string timeOfDayString = DayNightManager.instance.TimeOfDayString();
				__instance.heroObject.gameObject.SetActive(true);
				((Graphic)__instance.heroImage).color = new Color(((Graphic)__instance.heroImage).color.r, ((Graphic)__instance.heroImage).color.g, ((Graphic)__instance.heroImage).color.b, 1f);
				((Graphic)__instance.heroShadowImage).color = new Color(((Graphic)__instance.heroShadowImage).color.r, ((Graphic)__instance.heroShadowImage).color.g, ((Graphic)__instance.heroShadowImage).color.b, 0.12f);
				((TMP_Text)__instance.heroDayText).text = "";
				((TMP_Text)__instance.heroTimeOfDayText).text = "";
				((Graphic)__instance.heroBG).color = new Color(0f, 0f, 0f, 0f);
				DOTweenModuleUI.DOFade(__instance.heroBG, 0.5f, 0.5f);
				for (int i = 0; i < heroString.Length; i++)
				{
					((TMP_Text)__instance.heroText).text = heroString.Substring(0, i + 1);
					__instance.heroCamera.Render();
					yield return (object)new WaitForSeconds(0.1f);
				}
				yield return (object)new WaitForSeconds(0.5f);
				for (int j = 0; j < dayString.Length; j++)
				{
					((TMP_Text)__instance.heroDayText).text = dayString.Substring(0, j + 1);
					__instance.heroCamera.Render();
					yield return (object)new WaitForSeconds(0.066f);
				}
				yield return (object)new WaitForSeconds(0.5f);
				for (int k = 0; k < timeOfDayString.Length; k++)
				{
					((TMP_Text)__instance.heroTimeOfDayText).text = timeOfDayString.Substring(0, k + 1);
					__instance.heroCamera.Render();
					yield return (object)new WaitForSeconds(0.066f);
				}
				yield return (object)new WaitForSeconds(1.5f);
				DOTweenModuleUI.DOFade((Graphic)(object)__instance.heroImage, 0f, 2f);
				DOTweenModuleUI.DOFade((Graphic)(object)__instance.heroShadowImage, 0f, 1f);
				DOTweenModuleUI.DOFade(__instance.heroBG, 0f, 2f);
				yield return (object)new WaitForSeconds(2f);
				__instance.heroObject.gameObject.SetActive(false);
				__instance.heroCanvasObject.gameObject.SetActive(false);
			}
		}

		[HarmonyPatch(typeof(Campfire), "Light_Rpc")]
		[HarmonyPostfix]
		public static void Postfix_LightingUpdates_Light_Rpc(Campfire __instance)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Invalid comparison between Unknown and I4
			if (toggleAlpineAndMesa && !togglePeakToBeach && (int)__instance.advanceToSegment == 2)
			{
				GameObject.Find("Map/Biome_3/Alpine/Snow_Segment").SetActive(true);
				GameObject.Find("Map/Biome_3/Mesa/Desert_Segment").SetActive(true);
				GameObject.Find("Map/Biome_3/Mesa/Desert_Campfire").SetActive(true);
				LightVolume[] array = Object.FindObjectsByType<LightVolume>((FindObjectsSortMode)0);
				foreach (LightVolume val in array)
				{
					val.Bake((Action)null);
				}
			}
		}

		[HarmonyPatch(typeof(ConnectionHandler), "Awake")]
		[HarmonyPostfix]
		public static void Postfix_DontKickMe_Awake(ConnectionHandler __instance)
		{
			__instance.KeepAliveInBackground = int.MaxValue;
		}

		[HarmonyPatch(typeof(Pretitle), "Update")]
		[HarmonyPrefix]
		public static bool Prefix_StopBlindingMe_Update(Pretitle __instance)
		{
			__instance.allowedToSwitch = true;
			return false;
		}

		[HarmonyPatch(typeof(PropSpawner), "SpawnNew")]
		[HarmonyPrefix]
		public static bool Prefix_SpawnProps_SpawnNew(bool executeDeferredImmediately, PropSpawner __instance)
		{
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Invalid comparison between Unknown and I4
			if (toggleAlpineAndMesa)
			{
				if (__instance.chanceToUseSpawner < 0.999f && Random.value > __instance.chanceToUseSpawner)
				{
					return false;
				}
				int num = __instance.nrOfSpawns;
				if (__instance.randomSpawns)
				{
					num = Random.Range(__instance.minSpawnCount, __instance.nrOfSpawns);
				}
				int num2 = 6000;
				int num3 = 1000;
				int num4 = 0;
				while (num4 < num && num2 > 0 && num3 > 0)
				{
					num2--;
					num3--;
					if (__instance.TryToSpawn(num4))
					{
						num4++;
						num3 = 1000;
						if (__instance.syncTransforms)
						{
							Physics.SyncTransforms();
						}
					}
				}
				__instance.currentSpawns = ((Component)__instance).transform.childCount;
				foreach (PostSpawnBehavior postSpawnBehavior in __instance.postSpawnBehaviors)
				{
					if (!postSpawnBehavior.mute)
					{
						if (executeDeferredImmediately || (int)postSpawnBehavior.DeferredTiming != 2)
						{
							postSpawnBehavior.RunBehavior(__instance.SpawnedProps);
						}
						else
						{
							__instance._deferredSteps.Add(postSpawnBehavior.ConstructDeferred((IMayHaveDeferredStep)(object)__instance));
						}
					}
				}
				return false;
			}
			return true;
		}

		public static void Generate_Terrain(MapSegment segment)
		{
			if (toggleAlpineAndMesa)
			{
				PropGrouper val = null;
				PropGrouper val2 = null;
				PropGrouper pgrouper = null;
				PropGrouper pgrouper2 = null;
				if (defaultBiomes.Contains((BiomeType)2))
				{
					GameObject.Find("Map/Biome_3/Mesa").SetActive(true);
					segment.segmentParent.SetActive(true);
					segment.segmentCampfire.SetActive(true);
					val = ((Component)segment.segmentParent.transform).GetComponent<PropGrouper>() ?? ((Component)segment.segmentParent.transform).gameObject.AddComponent<PropGrouper>();
					val.RunAll(false);
					val2 = segment.segmentCampfire.GetComponent<PropGrouper>() ?? segment.segmentCampfire.AddComponent<PropGrouper>();
					val2.RunAll(true);
					pgrouper = ((Component)GameObject.Find("Map/Biome_3/Alpine/Snow_Segment").transform).GetComponent<PropGrouper>() ?? ((Component)GameObject.Find("Map/Biome_3/Alpine/Snow_Segment").transform).gameObject.AddComponent<PropGrouper>();
					pgrouper2 = GameObject.Find("Map/Biome_3/Alpine/Snow_Campfire").GetComponent<PropGrouper>() ?? GameObject.Find("Map/Biome_3/Alpine/Snow_Campfire").AddComponent<PropGrouper>();
				}
				else if (defaultBiomes.Contains((BiomeType)6))
				{
					GameObject.Find("Map/Biome_3/Alpine").SetActive(true);
					GameObject val3 = GameObject.Find("Map/Biome_3/Alpine/Snow_Segment");
					GameObject val4 = GameObject.Find("Map/Biome_3/Alpine/Snow_Campfire");
					val3.SetActive(true);
					val4.SetActive(true);
					val = ((Component)val3.transform).GetComponent<PropGrouper>() ?? ((Component)val3.transform).gameObject.AddComponent<PropGrouper>();
					val.RunAll(false);
					val2 = val4.GetComponent<PropGrouper>() ?? val4.AddComponent<PropGrouper>();
					val2.RunAll(true);
					pgrouper = ((Component)GameObject.Find("Map/Biome_3/Mesa/Desert_Segment").transform).GetComponent<PropGrouper>() ?? ((Component)GameObject.Find("Map/Biome_3/Mesa/Desert_Segment").transform).gameObject.AddComponent<PropGrouper>();
					pgrouper2 = GameObject.Find("Map/Biome_3/Mesa/Desert_Campfire").GetComponent<PropGrouper>() ?? GameObject.Find("Map/Biome_3/Mesa/Desert_Campfire").AddComponent<PropGrouper>();
				}
				segment.segmentParent.SetActive(true);
				segment.segmentCampfire.SetActive(true);
				Generate_Late_Props(val);
				Generate_Late_Props(val2);
				Generate_Late_Props(pgrouper);
				Generate_Late_Props(pgrouper2);
			}
		}

		public static void Generate_Late_Props(PropGrouper pgrouper)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Invalid comparison between Unknown and I4
			if (!toggleAlpineAndMesa)
			{
				return;
			}
			lgs.Clear();
			LevelGenStep[] componentsInChildren = ((Component)pgrouper).GetComponentsInChildren<LevelGenStep>(true);
			LevelGenStep[] array = componentsInChildren;
			foreach (LevelGenStep val in array)
			{
				PropGrouper componentInParent = ((Component)val).GetComponentInParent<PropGrouper>();
				try
				{
					if ((Object)(object)componentInParent != (Object)null && (int)componentInParent.timing == 1)
					{
						lgs.Add(val);
					}
				}
				catch
				{
					if ((Object)(object)componentInParent == (Object)(object)pgrouper)
					{
						lgs.Add(val);
					}
				}
			}
			foreach (LevelGenStep lg in lgs)
			{
				try
				{
					lg.Execute();
				}
				catch
				{
				}
			}
		}

		[HarmonyPatch(typeof(MapHandler), "Start")]
		[HarmonyPostfix]
		public static IEnumerator Postfix_GenOptions_RunAll(IEnumerator __result)
		{
			while (__result.MoveNext())
			{
				yield return __result.Current;
			}
			if (toggleAlpineAndMesa)
			{
				((MonoBehaviour)Singleton<MapHandler>.Instance).StartCoroutine(MH_Start_Gen());
			}
		}

		public static IEnumerator MH_Start_Gen()
		{
			List<int> assignedViewIDs = new List<int>();
			MapSegment[] segments = Singleton<MapHandler>.Instance.segments;
			MapSegment[] array = segments;
			foreach (MapSegment segment in array)
			{
				GameObject segmentParent = segment.segmentParent;
				Transform segmentParentTransform = segmentParent.transform;
				GameObject segmentCampfire = segment.segmentCampfire;
				if ((Object)(object)segmentCampfire == (Object)null)
				{
					Transform[] componentsInChildren = ((Component)segmentParentTransform).GetComponentsInChildren<Transform>(true);
					foreach (Transform val in componentsInChildren)
					{
						if (((Object)((Component)val).gameObject).name.Contains("Campfire"))
						{
							_ = ((Component)val).gameObject;
							break;
						}
					}
				}
				if (toggleAlpineAndMesa && ((Object)((Component)segmentParentTransform).gameObject).name.Contains("Desert") && (defaultBiomes.Contains((BiomeType)2) || defaultBiomes.Contains((BiomeType)6)))
				{
					Generate_Terrain(segment);
					GameObject.Find("Map/Biome_3/Mesa/Desert_Campfire").SetActive(false);
					assignedViewIDs.AddRange(HostAssignIDs(GameObject.Find("Map/Biome_3/Alpine/Snow_Segment").transform, GameObject.Find("Map/Biome_3/Alpine/Snow_Campfire")));
					assignedViewIDs.AddRange(HostAssignIDs(GameObject.Find("Map/Biome_3/Mesa/Desert_Segment").transform, GameObject.Find("Map/Biome_3/Mesa/Desert_Campfire")));
				}
				if (assignedViewIDs.Count > 0)
				{
					if ((Object)(object)GameObject.Find("GAME").GetComponent<PhotonInterfacer>() == (Object)null)
					{
						GameObject.Find("GAME").AddComponent<PhotonInterfacer>();
					}
					PunExtensions.GetPhotonView(GameObject.Find("GAME")).RPC("HandleAssignedViewIDs_RPC", (RpcTarget)0, new object[1] { assignedViewIDs.ToArray() });
				}
			}
			GameObject.Find("Map/Biome_3/Alpine/Snow_Segment").SetActive(false);
			GameObject.Find("Map/Biome_3/Alpine/Snow_Campfire").SetActive(false);
			GameObject.Find("Map/Biome_3/Mesa/Desert_Segment").SetActive(false);
			GameObject.Find("Map/Biome_3/Mesa/Desert_Campfire").SetActive(false);
			yield break;
		}

		public static List<int> HostAssignIDs(Transform segment, GameObject campfire)
		{
			List<int> list = new List<int>();
			if (PhotonNetwork.IsMasterClient)
			{
				List<PhotonView> list2 = new List<PhotonView>();
				list2.AddRange(from v in ((Component)segment).GetComponentsInChildren<PhotonView>(true)
					where v.ViewID == 0
					select v);
				List<PhotonView> list3 = list2;
				if ((Object)(object)campfire != (Object)null)
				{
					list3.AddRange(from v in campfire.GetComponentsInChildren<PhotonView>(true)
						where v.ViewID == 0
						select v);
				}
				List<PhotonView> list4 = new List<PhotonView>();
				list4.AddRange(from v in list3
					where (Object)(object)v != (Object)null
					orderby GetHierarchyPath(((Component)v).gameObject)
					select v);
				PhotonView[] array = list4.ToArray();
				PhotonView[] array2 = array;
				PhotonView[] array3 = array2;
				foreach (PhotonView val in array3)
				{
					list.Add(AssignMasterClientViewID(((Component)val).gameObject));
				}
			}
			return list;
		}

		public static string GetHierarchyPath(GameObject go)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			List<string> list = new List<string>();
			Transform val = go.transform;
			while ((Object)val != (Object)null)
			{
				list.Add(((Object)val).name);
				val = val.parent;
			}
			list.Reverse();
			return string.Join("/", list);
		}

		public static int AssignMasterClientViewID(GameObject go)
		{
			int num = PhotonNetwork.AllocateViewID(false);
			PhotonView component = go.GetComponent<PhotonView>();
			component.ViewID = num;
			return num;
		}

		[HarmonyPatch(typeof(MapHandler), "Awake")]
		[HarmonyPostfix]
		public static void Postfix_GenOptions_Awake(MapHandler __instance)
		{
			if (toggleAlpineAndMesa)
			{
				__instance.DetectBiomes();
			}
		}

		[HarmonyPatch(typeof(MapHandler), "DetectBiomes")]
		[HarmonyPrefix]
		public static bool Prefix_GenOptions_DetectBiomes(MapHandler __instance)
		{
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			if (toggleAlpineAndMesa)
			{
				defaultBiomes = __instance.biomes.ToArray();
				__instance.biomes.Clear();
				Biome val = default(Biome);
				for (int i = 0; i < ((Component)__instance).transform.childCount; i++)
				{
					Transform child = ((Component)__instance).transform.GetChild(i);
					for (int j = 0; j < child.childCount; j++)
					{
						if (toggleAlpineAndMesa && (((Object)((Component)child.GetChild(j)).gameObject).name == "Alpine" || ((Object)((Component)child.GetChild(j)).gameObject).name == "Mesa"))
						{
							((Component)child.GetChild(j)).gameObject.SetActive(true);
						}
						if (((Component)child.GetChild(j)).gameObject.activeInHierarchy && ((Component)child.GetChild(j)).TryGetComponent<Biome>(ref val))
						{
							__instance.biomes.Add(val.biomeType);
						}
					}
				}
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(MapHandler), "GoToSegment")]
		[HarmonyPostfix]
		public static void Postfix_GenOptions_GoToSegment(Segment s, MapHandler __instance)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Invalid comparison between Unknown and I4
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Invalid comparison between Unknown and I4
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Invalid comparison between Unknown and I4
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Invalid comparison between Unknown and I4
			if (toggleSkyJungle && (int)s == 1)
			{
				GameObject.Find("Map/Biome_2/Tropics/Jungle_Segment/Ground").SetActive(false);
				GameObject.Find("Map/Biome_2/Tropics/Jungle_Segment/SkyJungle").SetActive(true);
			}
			if (toggleForceAlpine && (int)s == 2)
			{
				GameObject.Find("Map/Biome_3/Alpine").SetActive(true);
				GameObject.Find("Map/Biome_3/Mesa").SetActive(false);
			}
			if (toggleForceMesa && (int)s == 2)
			{
				GameObject.Find("Map/Biome_3/Alpine").SetActive(false);
				GameObject.Find("Map/Biome_3/Mesa").SetActive(true);
			}
			if (toggleAlpineAndMesa && (int)s == 2)
			{
				if (GameObject.Find("Map/Biome_3/Alpine").activeSelf)
				{
					GameObject.Find("Map/Biome_3/Mesa").SetActive(true);
				}
				else
				{
					GameObject.Find("Map/Biome_3/Alpine").SetActive(true);
				}
			}
		}

		[HarmonyPatch(typeof(OrbFogHandler), "WaitToMove")]
		[HarmonyPrefix]
		public static bool Prefix_FogFaster_WaitToMove(OrbFogHandler __instance)
		{
			if (toggleFogFaster)
			{
				__instance.photonView.RPC("StartMovingRPC", (RpcTarget)0, Array.Empty<object>());
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(Tornado), "Movement")]
		[HarmonyPrefix]
		public static bool Prefix_TornadoFaster_Movement(Tornado __instance)
		{
			//IL_0028: 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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: 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_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: 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_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: 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_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			if (toggleTornadoFaster)
			{
				if ((Object)(object)__instance.target == (Object)null)
				{
					return false;
				}
				Vector3 vel = __instance.vel;
				Vector3 val = Vector3Extensions.Flat(__instance.target.position - __instance.tornadoPos);
				__instance.vel = FRILerp.Lerp(vel, ((Vector3)(ref val)).normalized * 15f, 0.15f, true);
				__instance.tornadoPos += __instance.vel * 5f * Time.deltaTime;
				RaycastHit groundPosRaycast = HelperFunctions.GetGroundPosRaycast(__instance.tornadoPos + Vector3.up * 200f, (LayerType)2, 0f);
				if (Object.op_Implicit((Object)(object)((RaycastHit)(ref groundPosRaycast)).transform) && Vector3.Distance(__instance.tornadoPos, ((RaycastHit)(ref groundPosRaycast)).point) < 100f)
				{
					((Component)__instance).transform.position = ((RaycastHit)(ref groundPosRaycast)).point;
					return false;
				}
				((Component)__instance).transform.position = __instance.tornadoPos;
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(HotSun), "Update")]
		[HarmonyPrefix]
		public static bool Prefix_HotSunDisable_Update(HotSun __instance)
		{
			if (toggleHotSunDisable)
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(LavaRising), "Update")]
		[HarmonyPrefix]
		public static bool Prefix_LavaRisingDisable_Update(LavaRising __instance)
		{
			if (toggleLavaRisingDisable)
			{
				return false;
			}
			if (toggleLavaRisingFaster)
			{
				__instance.travelTime = 30f;
			}
			return true;
		}

		[HarmonyPatch(typeof(OrbFogHandler), "Move")]
		[HarmonyPrefix]
		public static bool Prefix_FogFaster_Move(OrbFogHandler __instance)
		{
			if (toggleFogFaster)
			{
				__instance.sphere.REVEAL_AMOUNT = 0f;
				__instance.sphere.ENABLE = Mathf.MoveTowards(__instance.sphere.ENABLE, 1f, Time.deltaTime * 0.1f);
				__instance.currentSize -= __instance.speed * 2f * Time.deltaTime;
				if (__instance.currentSize == 0f)
				{
					__instance.Stop();
				}
				return false;
			}
			return true;
		}

		private void OnSceneChange(Scene scene, LoadSceneMode mode)
		{
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			if (((Scene)(ref scene)).name.StartsWith("Airport"))
			{
				setupComplete = false;
				numberOfElements = 0;
				currentSegment = 3;
				startingRun = false;
			}
			else if (((Scene)(ref scene)).name.StartsWith("Level_"))
			{
				startingRun = true;
				shownStartTitle = false;
				tempbool = false;
				wonGame = false;
				shownAMTitle = false;
				Peaking();
			}
			else if (((Scene)(ref scene)).name == "Title")
			{
				((Graphic)GameObject.Find("MainMenu/Canvas/MainPage/WhiteFade").GetComponent<Image>()).color = Color.black;
			}
		}

		[HarmonyPatch(typeof(PassportManager), "ToggleOpen")]
		[HarmonyPostfix]
		public static void Postfix_PassportOpen_ToggleOpen(PassportManager __instance)
		{
			if (!setupComplete)
			{
				UIHelper uIHelper = new UIHelper("2", UIHelper.UIType.PAGE, "", null, Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel")));
				uIHelper.CreateInteractElement();
				UIHelper uIHelper2 = new UIHelper("NextPageButton", UIHelper.UIType.NAVBUTTON, ">", null, Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), 0, 570f, -61f);
				uIHelper2.CreateInteractElement();
				UIHelper uIHelper3 = new UIHelper("PrevPageButton", UIHelper.UIType.NAVBUTTON, "<", null, Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), 0, 70f, -61f);
				uIHelper3.CreateInteractElement();
				UIHelper uIHelper4 = new UIHelper("SnowDisable", UIHelper.UIType.BUTTON, "Disable Blizzards:", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper4.CreateTextElement();
				uIHelper4.CreateInteractElement();
				numberOfElements++;
				UIHelper uIHelper5 = new UIHelper("SnowInfinite", UIHelper.UIType.BUTTON, "Infinite Blizzard: ", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper5.CreateTextElement();
				uIHelper5.CreateInteractElement();
				numberOfElements++;
				UIHelper uIHelper6 = new UIHelper("RainDisable", UIHelper.UIType.BUTTON, "Disable Rain: ", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper6.CreateTextElement();
				uIHelper6.CreateInteractElement();
				numberOfElements++;
				UIHelper uIHelper7 = new UIHelper("RainInfinite", UIHelper.UIType.BUTTON, "Infinite Rain: ", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper7.CreateTextElement();
				uIHelper7.CreateInteractElement();
				numberOfElements++;
				UIHelper uIHelper8 = new UIHelper("TornadoFaster", UIHelper.UIType.BUTTON, "Tornado 10x Faster: ", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper8.CreateTextElement();
				uIHelper8.CreateInteractElement();
				numberOfElements++;
				UIHelper uIHelper9 = new UIHelper("TornadoDisable", UIHelper.UIType.BUTTON, "Disable Tornados: ", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper9.CreateTextElement();
				uIHelper9.CreateInteractElement();
				numberOfElements++;
				UIHelper uIHelper10 = new UIHelper("HotSunDisable", UIHelper.UIType.BUTTON, "Disable Sun Heat: ", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper10.CreateTextElement();
				uIHelper10.CreateInteractElement();
				numberOfElements++;
				UIHelper uIHelper11 = new UIHelper("FogFaster", UIHelper.UIType.BUTTON, "Fog 2x Faster: ", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper11.CreateTextElement();
				uIHelper11.CreateInteractElement();
				numberOfElements++;
				UIHelper uIHelper12 = new UIHelper("FogDisable", UIHelper.UIType.BUTTON, "Disable Fog: ", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper12.CreateTextElement();
				uIHelper12.CreateInteractElement();
				numberOfElements++;
				UIHelper uIHelper13 = new UIHelper("LavaRisingDisable", UIHelper.UIType.BUTTON, "Disable Rising Lava: ", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper13.CreateTextElement();
				uIHelper13.CreateInteractElement();
				numberOfElements++;
				UIHelper uIHelper14 = new UIHelper("LavaRisingFaster", UIHelper.UIType.BUTTON, "Lava Rises 2x Faster: ", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper14.CreateTextElement();
				uIHelper14.CreateInteractElement();
				numberOfElements++;
				UIHelper uIHelper15 = new UIHelper("ForceAlpine", UIHelper.UIType.BUTTON, "Force Alpine: ", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper15.CreateTextElement();
				uIHelper15.CreateInteractElement();
				numberOfElements++;
				UIHelper uIHelper16 = new UIHelper("ForceMesa", UIHelper.UIType.BUTTON, "Force Mesa: ", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper16.CreateTextElement();
				uIHelper16.CreateInteractElement();
				numberOfElements++;
				UIHelper uIHelper17 = new UIHelper("AlpineAndMesa", UIHelper.UIType.BUTTON, "Alpine And Mesa Gen: ", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper17.CreateTextElement();
				uIHelper17.CreateInteractElement();
				numberOfElements++;
				UIHelper uIHelper18 = new UIHelper("SkyJungle", UIHelper.UIType.BUTTON, "Sky Jungle Gen: ", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper18.CreateTextElement();
				uIHelper18.CreateInteractElement();
				numberOfElements++;
				UIHelper uIHelper19 = new UIHelper("PeakToBeach", UIHelper.UIType.BUTTON, "Peak To Beach: ", Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")), Object.Instantiate<GameObject>(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/UI_Close")), numberOfElements);
				uIHelper19.CreateTextElement();
				uIHelper19.CreateInteractElement();
				numberOfElements++;
				setupComplete = true;
			}
		}

		public static void Peaking()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			rainZone = GameObject.Find("Map/Biome_2/Tropics/RainStorm").GetComponent<WindChillZone>();
			snowZone = GameObject.Find("Map/Biome_3/Alpine/SnowStorm").GetComponent<WindChillZone>();
			tornados = GameObject.Find("Map/Biome_3/Mesa/Desert_Segment/Misc/Tornados").GetComponent<TornadoSpawner>();
			if (toggleRainDisable)
			{
				rainZone.windTimeRangeOff = new Vector2(float.MaxValue, float.MaxValue);
				if (rainZone.windActive)
				{
					rainZone.windActive = false;
				}
			}
			if (toggleSnowDisable)
			{
				snowZone.windTimeRangeOff = new Vector2(float.MaxValue, float.MaxValue);
				if (snowZone.windActive)
				{
					snowZone.windActive = false;
				}
			}
			if (toggleTornadoDisable)
			{
				tornados.minSpawnTime = float.MaxValue;
				for (int i = 0; i < Object.FindObjectsByType<Tornado>((FindObjectsSortMode)0).Length; i++)
				{
					Object.Destroy((Object)(object)GameObject.Find("Tornado(Clone)"));
				}
			}
			if (toggleSnowInfinite)
			{
				snowZone.windTimeRangeOn = new Vector2(float.MaxValue, float.MaxValue);
				snowZone.windTimeRangeOff = new Vector2(0f, 0f);
				if (!snowZone.windActive)
				{
					snowZone.windActive = true;
				}
			}
			if (toggleRainInfinite)
			{
				rainZone.windTimeRangeOn = new Vector2(float.MaxValue, float.MaxValue);
				rainZone.windTimeRangeOff = new Vector2(0f, 0f);
				if (!rainZone.windActive)
				{
					rainZone.windActive = true;
				}
			}
			if (toggleFogDisable)
			{
				GameObject.Find("FogSphereSystem").SetActive(false);
			}
		}
	}
	internal class UIHelper
	{
		public enum UIType
		{
			BUTTON,
			SLIDER,
			PAGE,
			NAVBUTTON
		}

		[CompilerGenerated]
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private string <internalName>P;

		[CompilerGenerated]
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private UIType <type>P;

		[CompilerGenerated]
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private string <textInfo>P;

		[CompilerGenerated]
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private GameObject <textObject>P;

		[CompilerGenerated]
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private GameObject <interactObject>P;

		[CompilerGenerated]
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private int <index>P;

		[CompilerGenerated]
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private float <xpos>P;

		[CompilerGenerated]
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private float <ypos>P;

		public int maxRows;

		public Vector3 topText;

		public Vector2 topInteract;

		public Vector2 hold;

		public UIHelper(string internalName, UIType type, string textInfo, GameObject textObject, GameObject interactObject, int index = 0, float xpos = 0f, float ypos = 0f)
		{
			//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_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			<internalName>P = internalName;
			<type>P = type;
			<textInfo>P = textInfo;
			<textObject>P = textObject;
			<interactObject>P = interactObject;
			<index>P = index;
			<xpos>P = xpos;
			<ypos>P = ypos;
			maxRows = 8;
			topText = new Vector3(27f, 130f, 0f);
			topInteract = new Vector2(175f, -105f);
			base..ctor();
		}

		public void CreateTextElement()
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: 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)
			((Object)<textObject>P).name = <internalName>P + "OptionText";
			<textObject>P.transform.SetParent(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG").transform);
			<textObject>P.transform.localScale = new Vector3(0.66f, 0.66f, 0.66f);
			hold = new Vector2(topText.x + (float)(200 * (<index>P / maxRows)), topText.y + (float)(-40 * (<index>P % maxRows)));
			<textObject>P.GetComponent<RectTransform>().anchoredPosition = hold;
			((TMP_Text)GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<textObject>P).name).GetComponent<TextMeshProUGUI>()).text = <textInfo>P;
			<textObject>P.SetActive(true);
		}

		public void CreateInteractElement()
		{
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Expected O, but got Unknown
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Expected O, but got Unknown
			//IL_06c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0804: Unknown result type (might be due to invalid IL or missing references)
			//IL_081a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0824: Expected O, but got Unknown
			//IL_083c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0846: Expected O, but got Unknown
			if (<type>P == UIType.BUTTON)
			{
				<interactObject>P.transform.SetParent(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG").transform);
				((Object)<interactObject>P).name = <internalName>P + "OptionButton";
				<interactObject>P.transform.localScale = new Vector3(0.4f, 0.4f, 0.4f);
				<interactObject>P.GetComponent<RectTransform>().anchoredPosition = new Vector2(topInteract.x + (float)(200 * (<index>P / maxRows)), topInteract.y + (float)(-40 * (<index>P % maxRows)));
				<interactObject>P.GetComponent<Button>().onClick = new ButtonClickedEvent();
				((UnityEvent)<interactObject>P.GetComponent<Button>().onClick).AddListener(new UnityAction(OptionListener));
				switch (<internalName>P)
				{
				case "SnowDisable":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.toggleSnowDisable);
					break;
				case "RainDisable":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.toggleRainDisable);
					break;
				case "TornadoDisable":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.toggleTornadoDisable);
					break;
				case "TornadoFaster":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.toggleTornadoFaster);
					break;
				case "FogDisable":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.toggleFogDisable);
					break;
				case "FogFaster":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.toggleFogFaster);
					break;
				case "PeakToBeach":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.togglePeakToBeach);
					break;
				case "SnowInfinite":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.toggleSnowInfinite);
					break;
				case "RainInfinite":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.toggleRainInfinite);
					break;
				case "ForceAlpine":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.toggleForceAlpine);
					break;
				case "ForceMesa":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.toggleForceMesa);
					break;
				case "AlpineAndMesa":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.toggleAlpineAndMesa);
					break;
				case "SkyJungle":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.toggleSkyJungle);
					break;
				case "HotSunDisable":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.toggleHotSunDisable);
					break;
				case "LavaRisingDisable":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.toggleLavaRisingDisable);
					break;
				case "LavaRisingFaster":
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(PEAKapalooza.toggleLavaRisingFaster);
					break;
				}
			}
			else if (<type>P == UIType.PAGE)
			{
				((Object)<interactObject>P).name = <internalName>P;
				<interactObject>P.transform.SetParent(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel").transform);
				<interactObject>P.transform.localScale = new Vector3(1f, 1f, 1f);
				<interactObject>P.transform.localPosition = new Vector3(0f, -228.05f, 0f);
				<interactObject>P.SetActive(false);
				Object.Destroy((Object)(object)GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/Portrait"));
				Object.Destroy((Object)(object)GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/Tabs"));
				Object.Destroy((Object)(object)GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/Options"));
				Object.Destroy((Object)(object)GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/Text"));
			}
			else if (<type>P == UIType.NAVBUTTON)
			{
				((Object)<interactObject>P).name = <internalName>P;
				if (<internalName>P == "PrevPageButton")
				{
					<interactObject>P.transform.SetParent(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2").transform);
				}
				else
				{
					<interactObject>P.transform.SetParent(GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel").transform);
				}
				<interactObject>P.transform.localScale = new Vector3(0.66f, 0.66f, 0.66f);
				<interactObject>P.GetComponent<RectTransform>().anchoredPosition = new Vector2(<xpos>P, <ypos>P);
				<interactObject>P.GetComponent<Button>().onClick = new ButtonClickedEvent();
				((UnityEvent)<interactObject>P.GetComponent<Button>().onClick).AddListener(new UnityAction(OptionListener));
				if (<internalName>P == "PrevPageButton")
				{
					Object.DestroyImmediate((Object)(object)GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/" + <internalName>P + "/Box/Icon").GetComponent<RawImage>());
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/" + <internalName>P + "/Box/Icon").AddComponent<TextMeshProUGUI>();
					((TMP_Text)GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/" + <internalName>P + "/Box/Icon").GetComponent<TextMeshProUGUI>()).text = <textInfo>P;
					<interactObject>P.SetActive(false);
				}
				else
				{
					Object.DestroyImmediate((Object)(object)GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/" + <internalName>P + "/Box/Icon").GetComponent<RawImage>());
					GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/" + <internalName>P + "/Box/Icon").AddComponent<TextMeshProUGUI>();
					((TMP_Text)GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/" + <internalName>P + "/Box/Icon").GetComponent<TextMeshProUGUI>()).text = <textInfo>P;
				}
			}
		}

		public void OptionListener()
		{
			switch (<internalName>P)
			{
			case "SnowDisable":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.toggleSnowDisable);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/SnowInfiniteOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.toggleSnowDisable = !PEAKapalooza.toggleSnowDisable;
				PEAKapalooza.toggleSnowInfinite = false;
				break;
			case "RainDisable":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.toggleRainDisable);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/RainInfiniteOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.toggleRainDisable = !PEAKapalooza.toggleRainDisable;
				PEAKapalooza.toggleRainInfinite = false;
				break;
			case "TornadoDisable":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.toggleTornadoDisable);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/TornadoFasterOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.toggleTornadoDisable = !PEAKapalooza.toggleTornadoDisable;
				PEAKapalooza.toggleTornadoFaster = false;
				break;
			case "TornadoFaster":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.toggleTornadoFaster);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/TornadoDisableOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.toggleTornadoFaster = !PEAKapalooza.toggleTornadoFaster;
				PEAKapalooza.toggleTornadoDisable = false;
				break;
			case "FogDisable":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.toggleFogDisable);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/FogFasterOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.toggleFogDisable = !PEAKapalooza.toggleFogDisable;
				PEAKapalooza.toggleFogFaster = false;
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/PeakToBeachOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.togglePeakToBeach = false;
				break;
			case "FogFaster":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.toggleFogFaster);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/FogDisableOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.toggleFogFaster = !PEAKapalooza.toggleFogFaster;
				PEAKapalooza.toggleFogDisable = false;
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/PeakToBeachOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.togglePeakToBeach = false;
				break;
			case "PeakToBeach":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.togglePeakToBeach);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/FogFasterOptionButton/Box/Icon").SetActive(false);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/FogDisableOptionButton/Box/Icon").SetActive(true);
				PEAKapalooza.togglePeakToBeach = !PEAKapalooza.togglePeakToBeach;
				PEAKapalooza.toggleFogDisable = true;
				PEAKapalooza.toggleFogFaster = false;
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/LavaRisingDisableOptionButton/Box/Icon").SetActive(true);
				PEAKapalooza.toggleLavaRisingDisable = true;
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/LavaRisingFasterOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.toggleLavaRisingFaster = false;
				break;
			case "NextPageButton":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel").SetActive(false);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2").SetActive(true);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/NextPageButton").SetActive(false);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/PrevPageButton").SetActive(true);
				break;
			case "PrevPageButton":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel").SetActive(true);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2").SetActive(false);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/PrevPageButton").SetActive(false);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/NextPageButton").SetActive(true);
				break;
			case "SnowInfinite":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.toggleSnowInfinite);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/SnowDisableOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.toggleSnowInfinite = !PEAKapalooza.toggleSnowInfinite;
				PEAKapalooza.toggleSnowDisable = false;
				break;
			case "RainInfinite":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.toggleRainInfinite);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/RainDisableOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.toggleRainInfinite = !PEAKapalooza.toggleRainInfinite;
				PEAKapalooza.toggleRainDisable = false;
				break;
			case "ForceAlpine":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.toggleForceAlpine);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/ForceMesaOptionButton/Box/Icon").SetActive(false);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/AlpineAndMesaOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.toggleForceAlpine = !PEAKapalooza.toggleForceAlpine;
				PEAKapalooza.toggleAlpineAndMesa = false;
				PEAKapalooza.toggleForceMesa = false;
				break;
			case "ForceMesa":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.toggleForceMesa);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/ForceAlpineOptionButton/Box/Icon").SetActive(false);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/AlpineAndMesaOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.toggleForceMesa = !PEAKapalooza.toggleForceMesa;
				PEAKapalooza.toggleAlpineAndMesa = false;
				PEAKapalooza.toggleForceAlpine = false;
				break;
			case "AlpineAndMesa":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.toggleAlpineAndMesa);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/ForceAlpineOptionButton/Box/Icon").SetActive(false);
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/ForceMesaOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.toggleForceAlpine = false;
				PEAKapalooza.toggleForceMesa = false;
				PEAKapalooza.toggleAlpineAndMesa = !PEAKapalooza.toggleAlpineAndMesa;
				break;
			case "SkyJungle":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.toggleSkyJungle);
				PEAKapalooza.toggleSkyJungle = !PEAKapalooza.toggleSkyJungle;
				break;
			case "HotSunDisable":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.toggleHotSunDisable);
				PEAKapalooza.toggleHotSunDisable = !PEAKapalooza.toggleHotSunDisable;
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/ForceAlpineOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.toggleForceAlpine = false;
				break;
			case "LavaRisingDisable":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.toggleLavaRisingDisable);
				PEAKapalooza.toggleLavaRisingDisable = !PEAKapalooza.toggleLavaRisingDisable;
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/PeakToBeachOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.togglePeakToBeach = false;
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/LavaRisingFasterOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.toggleLavaRisingFaster = false;
				break;
			case "LavaRisingFaster":
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/" + ((Object)<interactObject>P).name + "/Box/Icon").SetActive(!PEAKapalooza.toggleLavaRisingFaster);
				PEAKapalooza.toggleLavaRisingFaster = !PEAKapalooza.toggleLavaRisingFaster;
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/LavaRisingDisableOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.toggleLavaRisingDisable = false;
				GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/2/BG/PeakToBeachOptionButton/Box/Icon").SetActive(false);
				PEAKapalooza.togglePeakToBeach = false;
				break;
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "PEAKapalooza";

		public const string PLUGIN_NAME = "PEAKapalooza";

		public const string PLUGIN_VERSION = "0.6.4";
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}