Decompiled source of Dropper v1.0.6

com.github.Arof2.Beast_Mode.dll

Decompiled 44 minutes ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PEAKLib.Core;
using PEAKLib.Items;
using Photon.Pun;
using TMPro;
using UnityEngine;
using Zorro.Core;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.github.Arof2.Beast_Mode")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0+19b02b7ddc37ab24572eb3c213f9ed3a4298c1a2")]
[assembly: AssemblyProduct("com.github.Arof2.Beast_Mode")]
[assembly: AssemblyTitle("Dropper")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace Dropper
{
	public class FinisherScript : MonoBehaviourPun
	{
		private PhotonView photonView;

		private void Awake()
		{
			photonView = ((Component)this).GetComponent<PhotonView>();
		}

		public void Finish()
		{
			photonView.RPC("FinishGameMod", (RpcTarget)0, Array.Empty<object>());
		}

		[PunRPC]
		public void FinishGameMod()
		{
			Plugin.Log.LogInfo((object)$"Game finished sequence started {Singleton<PeakHandler>.Instance}");
		}
	}
	public class InteractableBackPorter : MonoBehaviourPun, IInteractibleConstant, IInteractible
	{
		public Action<Character> Interacted;

		private MaterialPropertyBlock mpb;

		private MeshRenderer[] _mr;

		public float interactTime => 2f;

		public bool holdOnFinish
		{
			get
			{
				throw new NotImplementedException();
			}
		}

		private MeshRenderer[] meshRenderers
		{
			get
			{
				if (_mr == null)
				{
					_mr = ((Component)this).GetComponentsInChildren<MeshRenderer>();
					MonoBehaviour.print((object)_mr.Length);
				}
				return _mr;
			}
			set
			{
				_mr = value;
			}
		}

		public void CancelCast(Character interactor)
		{
		}

		public void Awake()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			mpb = new MaterialPropertyBlock();
		}

		public Vector3 Center()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)this).transform.position;
		}

		public string GetInteractionText()
		{
			return "Teleport To Last Area";
		}

		public float GetInteractTime(Character interactor)
		{
			return interactTime;
		}

		public string GetName()
		{
			return "Reverse Teleporter";
		}

		public Transform GetTransform()
		{
			return ((Component)this).transform;
		}

		public void HoverEnter()
		{
			if (mpb == null)
			{
				return;
			}
			mpb.SetFloat(Item.PROPERTY_INTERACTABLE, 1f);
			for (int i = 0; i < meshRenderers.Length; i++)
			{
				if ((Object)(object)meshRenderers[i] != (Object)null)
				{
					((Renderer)meshRenderers[i]).SetPropertyBlock(mpb);
				}
			}
		}

		public void HoverExit()
		{
			if (mpb != null)
			{
				mpb.SetFloat(Item.PROPERTY_INTERACTABLE, 0f);
				for (int i = 0; i < meshRenderers.Length; i++)
				{
					((Renderer)meshRenderers[i]).SetPropertyBlock(mpb);
				}
			}
		}

		public void Interact(Character interactor)
		{
		}

		public void Interact_CastFinished(Character interactor)
		{
			Interacted?.Invoke(interactor);
		}

		public bool IsConstantlyInteractable(Character interactor)
		{
			return IsInteractible(interactor);
		}

		public bool IsInteractible(Character interactor)
		{
			return true;
		}

		public void ReleaseInteract(Character interactor)
		{
		}
	}
	public class InteractableBrewingStand : MonoBehaviourPun, IInteractibleConstant, IInteractible
	{
		private bool ineracted;

		public Action<Character> Interacted;

		private MaterialPropertyBlock mpb;

		private MeshRenderer[] _mr;

		public float interactTime => 0.5f;

		public bool holdOnFinish
		{
			get
			{
				throw new NotImplementedException();
			}
		}

		private MeshRenderer[] meshRenderers
		{
			get
			{
				if (_mr == null)
				{
					_mr = ((Component)this).GetComponentsInChildren<MeshRenderer>();
					MonoBehaviour.print((object)_mr.Length);
				}
				return _mr;
			}
			set
			{
				_mr = value;
			}
		}

		public void Awake()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			mpb = new MaterialPropertyBlock();
		}

		public void CancelCast(Character interactor)
		{
		}

		public Vector3 Center()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)this).transform.position;
		}

		public string GetInteractionText()
		{
			return "Take Potion";
		}

		public float GetInteractTime(Character interactor)
		{
			return interactTime;
		}

		public string GetName()
		{
			return "Brewing stand";
		}

		public Transform GetTransform()
		{
			return ((Component)this).transform;
		}

		public void HoverEnter()
		{
			if (ineracted || mpb == null)
			{
				return;
			}
			mpb.SetFloat(Item.PROPERTY_INTERACTABLE, 1f);
			for (int i = 0; i < meshRenderers.Length; i++)
			{
				if ((Object)(object)meshRenderers[i] != (Object)null)
				{
					((Renderer)meshRenderers[i]).SetPropertyBlock(mpb);
				}
			}
		}

		public void HoverExit()
		{
			if (mpb != null)
			{
				mpb.SetFloat(Item.PROPERTY_INTERACTABLE, 0f);
				for (int i = 0; i < meshRenderers.Length; i++)
				{
					((Renderer)meshRenderers[i]).SetPropertyBlock(mpb);
				}
			}
		}

		public void Interact(Character interactor)
		{
		}

		public void Interact_CastFinished(Character interactor)
		{
			if (!ineracted)
			{
				((Component)this).gameObject.layer = 2;
				((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(false);
				((Component)((Component)this).transform.GetChild(1)).gameObject.SetActive(true);
				HarmonyPatches.SetupMaterial(((Component)((Component)this).transform.GetChild(1)).gameObject);
				ineracted = true;
				Interacted?.Invoke(interactor);
			}
		}

		public bool IsConstantlyInteractable(Character interactor)
		{
			return IsInteractible(interactor);
		}

		public bool IsInteractible(Character interactor)
		{
			return true;
		}

		public void ReleaseInteract(Character interactor)
		{
		}
	}
	public class InteratableFinisher : MonoBehaviourPun, IInteractibleConstant, IInteractible
	{
		public Action<Character> Interacted;

		private MaterialPropertyBlock mpb;

		private MeshRenderer[] _mr;

		public float interactTime => 2f;

		public bool holdOnFinish
		{
			get
			{
				throw new NotImplementedException();
			}
		}

		private MeshRenderer[] meshRenderers
		{
			get
			{
				if (_mr == null)
				{
					_mr = ((Component)this).GetComponentsInChildren<MeshRenderer>();
					MonoBehaviour.print((object)_mr.Length);
				}
				return _mr;
			}
			set
			{
				_mr = value;
			}
		}

		public void Awake()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			mpb = new MaterialPropertyBlock();
		}

		public void CancelCast(Character interactor)
		{
		}

		public Vector3 Center()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)this).transform.position;
		}

		public string GetInteractionText()
		{
			Plugin.Log.LogDebug((object)$"Current Spawn point Index: {HarmonyPatches.CurrentSpawnPointIndex} | Max index: {HarmonyPatches.MaxSpawnPointIndex}");
			if (HarmonyPatches.CurrentSpawnPointIndex == HarmonyPatches.MaxSpawnPointIndex)
			{
				return "Finish the game for all players";
			}
			return "Breaking out of the map doesn't allow you to finish early";
		}

		public float GetInteractTime(Character interactor)
		{
			return interactTime;
		}

		public string GetName()
		{
			return "Goal";
		}

		public Transform GetTransform()
		{
			return ((Component)this).transform;
		}

		public void HoverEnter()
		{
			if (mpb == null)
			{
				return;
			}
			mpb.SetFloat(Item.PROPERTY_INTERACTABLE, 1f);
			for (int i = 0; i < meshRenderers.Length; i++)
			{
				if ((Object)(object)meshRenderers[i] != (Object)null)
				{
					((Renderer)meshRenderers[i]).SetPropertyBlock(mpb);
				}
			}
		}

		public void HoverExit()
		{
			if (mpb != null)
			{
				mpb.SetFloat(Item.PROPERTY_INTERACTABLE, 0f);
				for (int i = 0; i < meshRenderers.Length; i++)
				{
					((Renderer)meshRenderers[i]).SetPropertyBlock(mpb);
				}
			}
		}

		public void Interact(Character interactor)
		{
		}

		public void Interact_CastFinished(Character interactor)
		{
			if (HarmonyPatches.CurrentSpawnPointIndex == HarmonyPatches.MaxSpawnPointIndex)
			{
				Interacted?.Invoke(interactor);
			}
		}

		public bool IsConstantlyInteractable(Character interactor)
		{
			return IsInteractible(interactor);
		}

		public bool IsInteractible(Character interactor)
		{
			return true;
		}

		public void ReleaseInteract(Character interactor)
		{
		}
	}
	public class InteratableTeleporter : MonoBehaviourPun, IInteractibleConstant, IInteractible
	{
		public Action<Character> Interacted;

		private MaterialPropertyBlock mpb;

		private MeshRenderer[] _mr;

		public float interactTime => 2f;

		public bool holdOnFinish
		{
			get
			{
				throw new NotImplementedException();
			}
		}

		private MeshRenderer[] meshRenderers
		{
			get
			{
				if (_mr == null)
				{
					_mr = ((Component)this).GetComponentsInChildren<MeshRenderer>();
					MonoBehaviour.print((object)_mr.Length);
				}
				return _mr;
			}
			set
			{
				_mr = value;
			}
		}

		public void CancelCast(Character interactor)
		{
		}

		public void Awake()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			mpb = new MaterialPropertyBlock();
		}

		public Vector3 Center()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)this).transform.position;
		}

		public string GetInteractionText()
		{
			return "Teleport To Next Area";
		}

		public float GetInteractTime(Character interactor)
		{
			return interactTime;
		}

		public string GetName()
		{
			return "Teleporter";
		}

		public Transform GetTransform()
		{
			return ((Component)this).transform;
		}

		public void HoverEnter()
		{
			if (mpb == null)
			{
				return;
			}
			mpb.SetFloat(Item.PROPERTY_INTERACTABLE, 1f);
			for (int i = 0; i < meshRenderers.Length; i++)
			{
				if ((Object)(object)meshRenderers[i] != (Object)null)
				{
					((Renderer)meshRenderers[i]).SetPropertyBlock(mpb);
				}
			}
		}

		public void HoverExit()
		{
			if (mpb != null)
			{
				mpb.SetFloat(Item.PROPERTY_INTERACTABLE, 0f);
				for (int i = 0; i < meshRenderers.Length; i++)
				{
					((Renderer)meshRenderers[i]).SetPropertyBlock(mpb);
				}
			}
		}

		public void Interact(Character interactor)
		{
		}

		public void Interact_CastFinished(Character interactor)
		{
			Interacted?.Invoke(interactor);
		}

		public bool IsConstantlyInteractable(Character interactor)
		{
			return IsInteractible(interactor);
		}

		public bool IsInteractible(Character interactor)
		{
			return true;
		}

		public void ReleaseInteract(Character interactor)
		{
		}
	}
	public class LoadCorrectDropper : MonoBehaviourPun
	{
		[PunRPC]
		public void LoadDropper(int ascentIndex)
		{
			Plugin.Log.LogDebug((object)$"LoadDropper called with ascentIndex: {ascentIndex}");
			if (ascentIndex == 0)
			{
				Plugin.ToggleModpack(0);
			}
			if (ascentIndex == 1)
			{
				Plugin.ToggleModpack(1);
			}
			if (ascentIndex > 1 || ascentIndex == -1)
			{
				Plugin.ToggleModpack(-1);
			}
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.github.Beast.Dropper", "Dropper", "1.0.6")]
	public class Plugin : BaseUnityPlugin
	{
		public static Action<int> ToggleModpack;

		public static bool alreadyPatched;

		public static bool PlayingDropperMap;

		internal static ManualLogSource Log { get; private set; }

		public static AssetBundle Bundle { get; private set; }

		internal static ModDefinition Definition { get; set; }

		public static string PluginName => "Dropper";

		public static Version PLuginVersion => new Version(1, 0, 6);

		public static string PLuginID => "com.github.Beast.Dropper";

		private void Awake()
		{
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			Log = ((BaseUnityPlugin)this).Logger;
			LoadBundle();
			ToggleModpack = delegate(int mode)
			{
				Log.LogInfo((object)$"Setting up Modpack with mode {mode}");
				switch (mode)
				{
				case 0:
					PlayingDropperMap = true;
					HarmonyPatches.Mode = HarmonyPatches.GameMode.Dropper;
					if (!alreadyPatched)
					{
						alreadyPatched = true;
						Harmony.CreateAndPatchAll(typeof(HarmonyPatches), (string)null);
					}
					break;
				case 1:
					PlayingDropperMap = true;
					HarmonyPatches.Mode = HarmonyPatches.GameMode.Descend;
					if (!alreadyPatched)
					{
						Harmony.CreateAndPatchAll(typeof(HarmonyPatches), (string)null);
						alreadyPatched = true;
					}
					break;
				default:
					PlayingDropperMap = false;
					alreadyPatched = false;
					Harmony.UnpatchAll();
					Harmony.CreateAndPatchAll(typeof(MandatoryHarmonyPatches), (string)null);
					break;
				}
			};
			LocalizedText.mainTable.Add("Name_Reset".ToUpperInvariant(), GetLocalisationOf("Resetter"));
			LocalizedText.mainTable.Add("reset".ToUpperInvariant(), GetLocalisationOf("Reset back to top"));
			LocalizedText.mainTable.Add("Force reset on #targetchar".ToUpperInvariant(), GetLocalisationOf("force reset #targetchar"));
			LocalizedText.mainTable.Add("Name_Instant Health I".ToUpperInvariant(), GetLocalisationOf("Instant Health I"));
			LocalizedText.mainTable.Add("administer #targetchar".ToUpperInvariant(), GetLocalisationOf("administer #targetchar"));
			LocalizedText.mainTable.Add("Dropper".ToUpperInvariant(), GetLocalisationOf("Dropper"));
			LocalizedText.mainTable.Add("Immense dread".ToUpperInvariant(), GetLocalisationOf("Immense dread"));
			LocalizedText.mainTable.Add("Desc_Dropper".ToUpperInvariant(), GetLocalisationOf("Does falling from 50 meters and crushing all your bones hurt? YES! But the adrenaline keeps you alive and ready to hit the portal next time!"));
			LocalizedText.mainTable.Add("Dropper - Descend".ToUpperInvariant(), GetLocalisationOf("Dropper - Descent"));
			LocalizedText.mainTable.Add("Desc_Dropper - Descend".ToUpperInvariant(), GetLocalisationOf("Instead of doing it all in one jump, how about we mix it up with some parkour to climb down. Why would you do that? Well let's finish the first map an you will see why"));
			Harmony.CreateAndPatchAll(typeof(MandatoryHarmonyPatches), (string)null);
			Definition = ModDefinition.GetOrCreate(PLuginID, PluginName, PLuginVersion);
			Item component = Bundle.LoadAsset<GameObject>("ResetBerry").GetComponent<Item>();
			new ItemContent(component).Register(Definition);
			Item component2 = Bundle.LoadAsset<GameObject>("Health potion").GetComponent<Item>();
			new ItemContent(component2).Register(Definition);
			HarmonyPatches.SetupMaterial(((Component)component2).gameObject);
			Log.LogInfo((object)"Plugin Dropper is loaded!");
		}

		private List<string> GetLocalisationOf(string input)
		{
			List<string> list = new List<string>();
			for (int i = 0; i < 15; i++)
			{
				list.Add(input);
			}
			return list;
		}

		private void LoadBundle()
		{
			Log.LogInfo((object)"Loading AssetBundle...");
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			string path = "dropper_assets";
			string text = Path.Combine(directoryName, path);
			if (File.Exists(text))
			{
				Log.LogInfo((object)"Found AssetBundle");
				Bundle = AssetBundle.LoadFromFile(text);
				if ((Object)(object)Bundle == (Object)null)
				{
					((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load AssetBundle!");
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogInfo((object)"AssetBundle loaded successfully!");
				}
			}
			else
			{
				Log.LogError((object)("AssetBundle not found at " + text));
			}
		}
	}
	internal class HarmonyPatches
	{
		public enum GameMode
		{
			Dropper,
			Descend
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass11_0
		{
			public int localindex;

			public TriggerTeleporter component;

			internal void <DelayedActivation>b__0(Character character)
			{
				//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_0049: Unknown result type (might be due to invalid IL or missing references)
				<>c__DisplayClass11_1 CS$<>8__locals0 = new <>c__DisplayClass11_1
				{
					CS$<>8__locals1 = this,
					character = character
				};
				if (((Component)CS$<>8__locals0.character).GetComponent<PhotonView>().IsMine)
				{
					CS$<>8__locals0.character.WarpPlayerRPC(spawnPoints[localindex + 1].position - Vector3.up, true);
					Plugin.Log.LogInfo((object)$"Teleported {((Object)CS$<>8__locals0.character).name} to Spawn Point {localindex + 1} from Teleporter {((Object)((Component)component).gameObject).name}");
					CurrentSpawnPointIndex = localindex + 1;
					CS$<>8__locals0.character.refs.afflictions.ClearAllStatus(false);
					GiveResetBerry(CS$<>8__locals0.character);
					((MonoBehaviour)CS$<>8__locals0.character).StartCoroutine(HealDealyed());
				}
				[IteratorStateMachine(typeof(<>c__DisplayClass11_1.<<DelayedActivation>g__HealDealyed|1>d))]
				IEnumerator HealDealyed()
				{
					//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
					return new <>c__DisplayClass11_1.<<DelayedActivation>g__HealDealyed|1>d(0)
					{
						<>4__this = CS$<>8__locals0
					};
				}
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass11_1
		{
			public Character character;

			public <>c__DisplayClass11_0 CS$<>8__locals1;
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass11_2
		{
			public int localindex;

			public InteratableTeleporter component;

			internal void <DelayedActivation>b__2(Character character)
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				character.WarpPlayerRPC(spawnPoints[localindex + 1].position - Vector3.up, true);
				Plugin.Log.LogInfo((object)$"Teleported {((Object)character).name} to Spawn Point {localindex + 1} from Teleporter {((Object)((Component)component).gameObject).name}");
				CurrentSpawnPointIndex = localindex + 1;
				character.refs.afflictions.ClearAllStatus(false);
				GiveResetBerry(character);
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass11_3
		{
			public int localindex;

			internal void <DelayedActivation>b__3(Character character)
			{
				//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_0029: Unknown result type (might be due to invalid IL or missing references)
				if (((Component)character).GetComponent<PhotonView>().IsMine)
				{
					character.WarpPlayerRPC(spawnPoints[localindex].position - Vector3.up, true);
					CurrentSpawnPointIndex = localindex;
					Plugin.Log.LogInfo((object)$"reverse Teleported {((Object)character).name} to Spawn Point {localindex}");
					character.refs.afflictions.ClearAllStatus(false);
					GiveResetBerry(character);
				}
			}
		}

		[CompilerGenerated]
		private sealed class <DelayedActivation>d__11 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <DelayedActivation>d__11(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0047: Expected O, but got Unknown
				//IL_0613: 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_00ac: Expected O, but got Unknown
				//IL_0179: Unknown result type (might be due to invalid IL or missing references)
				//IL_0183: Unknown result type (might be due to invalid IL or missing references)
				//IL_0188: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01eb: Expected O, but got Unknown
				//IL_0256: Unknown result type (might be due to invalid IL or missing references)
				//IL_025d: Expected O, but got Unknown
				//IL_052b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0532: Expected O, but got Unknown
				//IL_05e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_05eb: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					Plugin.Log.LogInfo((object)"Delaying Activation of ScoutmasterSpawner ------------------------------------ new Round ----------------------------------------------");
					CurrentSpawnPointIndex = 0;
					<>2__current = (object)new WaitForSeconds(1f);
					<>1__state = 1;
					return true;
				case 1:
				{
					<>1__state = -1;
					Plugin.Log.LogInfo((object)"Moving Peak Finisher So that we can use it later");
					((Component)Singleton<PeakHandler>.Instance).transform.SetParent((Transform)null, true);
					Plugin.Log.LogInfo((object)"Deactivating Map Parts");
					foreach (Transform item2 in GameObject.Find("Map").transform)
					{
						Transform val = item2;
						((Component)val).gameObject.SetActive(false);
					}
					GameObject.Find("EdgeWalls").SetActive(false);
					GameObject.Find("FogCutouts").SetActive(false);
					GameObject.Find("MountainProgress").SetActive(false);
					GameObject.Find("FogSphereSystem").SetActive(false);
					GameObject.Find("BlindPost").SetActive(false);
					GameObject.Find("Post Fog").SetActive(false);
					GameObject.Find("WaterMesh").SetActive(false);
					GameObject.Find("WaterZone").SetActive(false);
					Plugin.Log.LogInfo((object)"Instantiating Cutom Map Prefab");
					GameObject val2 = Plugin.Bundle.LoadAsset<GameObject>("Dropper Prefab");
					GameObject val3 = Object.Instantiate<GameObject>(val2, Vector3.up * 10f, Quaternion.identity);
					Plugin.Log.LogInfo((object)"Setting up Networking objects");
					Character val4 = Object.FindFirstObjectByType<Character>();
					finisher = ((Component)val4).gameObject.AddComponent<FinisherScript>();
					Plugin.Log.LogInfo((object)"Setting up Default Material");
					DefaultMaterial = new Material(((Renderer)((Component)val3.transform.Find("Dummy test object (1)")).GetComponent<MeshRenderer>()).material);
					DefaultMaterial.shader = Shader.Find("W/Peak_Standard");
					Plugin.Log.LogInfo((object)"Setting up Materials");
					SetupMaterial(val3);
					Plugin.Log.LogInfo((object)"Setting up Spawn Points");
					Transform val5 = val3.gameObject.transform.Find("Spawn Points Modding");
					spawnPoints = new List<Transform>();
					foreach (Transform item3 in val5)
					{
						Transform item = item3;
						spawnPoints.Add(item);
					}
					Plugin.Log.LogInfo((object)$"Found {spawnPoints.Count} Spawn points");
					Plugin.Log.LogInfo((object)"Setting Up Teleporation Cubes");
					if (Mode == GameMode.Dropper)
					{
						GameObject val6 = GameObject.Find("ohter parent");
						Plugin.Log.LogInfo((object)$"Found {val6.transform.childCount} End Portals");
						MaxSpawnPointIndex = val6.transform.childCount;
						for (int j = 0; j < val6.transform.childCount; j++)
						{
							<>c__DisplayClass11_0 CS$<>8__locals0 = new <>c__DisplayClass11_0
							{
								localindex = j,
								component = ((Component)val6.transform.GetChild(j)).gameObject.AddComponent<TriggerTeleporter>()
							};
							TriggerTeleporter component = CS$<>8__locals0.component;
							component.Interacted = (Action<Character>)Delegate.Combine(component.Interacted, (Action<Character>)delegate(Character character)
							{
								//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_0049: Unknown result type (might be due to invalid IL or missing references)
								<>c__DisplayClass11_1 CS$<>8__locals3 = new <>c__DisplayClass11_1
								{
									CS$<>8__locals1 = CS$<>8__locals0,
									character = character
								};
								if (((Component)CS$<>8__locals3.character).GetComponent<PhotonView>().IsMine)
								{
									CS$<>8__locals3.character.WarpPlayerRPC(spawnPoints[CS$<>8__locals0.localindex + 1].position - Vector3.up, true);
									Plugin.Log.LogInfo((object)$"Teleported {((Object)CS$<>8__locals3.character).name} to Spawn Point {CS$<>8__locals0.localindex + 1} from Teleporter {((Object)((Component)CS$<>8__locals0.component).gameObject).name}");
									CurrentSpawnPointIndex = CS$<>8__locals0.localindex + 1;
									CS$<>8__locals3.character.refs.afflictions.ClearAllStatus(false);
									GiveResetBerry(CS$<>8__locals3.character);
									((MonoBehaviour)CS$<>8__locals3.character).StartCoroutine(HealDealyed());
								}
								[IteratorStateMachine(typeof(<>c__DisplayClass11_1.<<DelayedActivation>g__HealDealyed|1>d))]
								IEnumerator HealDealyed()
								{
									//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
									return new <>c__DisplayClass11_1.<<DelayedActivation>g__HealDealyed|1>d(0)
									{
										<>4__this = CS$<>8__locals3
									};
								}
							});
						}
					}
					else if (Mode == GameMode.Descend)
					{
						GameObject val7 = GameObject.Find("Next Stage Parent");
						Plugin.Log.LogInfo((object)$"Found {val7.transform.childCount} Teleporters");
						MaxSpawnPointIndex = val7.transform.childCount;
						for (int k = 0; k < val7.transform.childCount; k++)
						{
							<>c__DisplayClass11_2 CS$<>8__locals1 = new <>c__DisplayClass11_2
							{
								localindex = k,
								component = ((Component)val7.transform.GetChild(k).GetChild(0)).gameObject.AddComponent<InteratableTeleporter>()
							};
							InteratableTeleporter component2 = CS$<>8__locals1.component;
							component2.Interacted = (Action<Character>)Delegate.Combine(component2.Interacted, (Action<Character>)delegate(Character character)
							{
								//IL_0013: Unknown result type (might be due to invalid IL or missing references)
								//IL_0018: Unknown result type (might be due to invalid IL or missing references)
								//IL_001d: Unknown result type (might be due to invalid IL or missing references)
								character.WarpPlayerRPC(spawnPoints[CS$<>8__locals1.localindex + 1].position - Vector3.up, true);
								Plugin.Log.LogInfo((object)$"Teleported {((Object)character).name} to Spawn Point {CS$<>8__locals1.localindex + 1} from Teleporter {((Object)((Component)CS$<>8__locals1.component).gameObject).name}");
								CurrentSpawnPointIndex = CS$<>8__locals1.localindex + 1;
								character.refs.afflictions.ClearAllStatus(false);
								GiveResetBerry(character);
							});
						}
					}
					Plugin.Log.LogInfo((object)"Setting up Reverse Teleporters");
					GameObject val8 = GameObject.Find("Reverse Teleporters");
					for (int l = 0; l < val8.transform.childCount; l++)
					{
						<>c__DisplayClass11_3 CS$<>8__locals2 = new <>c__DisplayClass11_3();
						Transform child = val8.transform.GetChild(l);
						CS$<>8__locals2.localindex = l;
						InteractableBackPorter interactableBackPorter = ((Component)child).gameObject.AddComponent<InteractableBackPorter>();
						interactableBackPorter.Interacted = (Action<Character>)Delegate.Combine(interactableBackPorter.Interacted, (Action<Character>)delegate(Character character)
						{
							//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_0029: Unknown result type (might be due to invalid IL or missing references)
							if (((Component)character).GetComponent<PhotonView>().IsMine)
							{
								character.WarpPlayerRPC(spawnPoints[CS$<>8__locals2.localindex].position - Vector3.up, true);
								CurrentSpawnPointIndex = CS$<>8__locals2.localindex;
								Plugin.Log.LogInfo((object)$"reverse Teleported {((Object)character).name} to Spawn Point {CS$<>8__locals2.localindex}");
								character.refs.afflictions.ClearAllStatus(false);
								GiveResetBerry(character);
							}
						});
					}
					InteratableFinisher interatableFinisher = GameObject.Find("Finisher").AddComponent<InteratableFinisher>();
					interatableFinisher.Interacted = (Action<Character>)Delegate.Combine(interatableFinisher.Interacted, (Action<Character>)delegate(Character character)
					{
						MethodInfo method2 = typeof(Character).GetMethod("TestWin", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
						method2.Invoke(character, new object[0]);
					});
					foreach (Transform item4 in GameObject.Find("Brewing stands").transform)
					{
						Transform val9 = item4;
						InteractableBrewingStand interactableBrewingStand = ((Component)val9).gameObject.AddComponent<InteractableBrewingStand>();
						interactableBrewingStand.Interacted = (Action<Character>)Delegate.Combine(interactableBrewingStand.Interacted, (Action<Character>)delegate(Character character)
						{
							MethodInfo method = typeof(CharacterItems).GetMethod("SpawnItemInHand", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
							method.Invoke(character.refs.items, new object[1] { HealthPotionName });
						});
					}
					if (Mode == GameMode.Dropper)
					{
						GameObject.Find("Dropper Map").SetActive(true);
						GameObject.Find("Descend map").SetActive(false);
					}
					else
					{
						GameObject.Find("Dropper Map").SetActive(false);
						GameObject.Find("Descend map").SetActive(true);
					}
					<>2__current = (object)new WaitForSeconds(5f);
					<>1__state = 2;
					return true;
				}
				case 2:
				{
					<>1__state = -1;
					if (spawnPoints.Count > 0)
					{
						TeleportAllPlayers(spawnPoints[0].position);
						Plugin.Log.LogInfo((object)$"Teleproting Players to Spawn Point {0} | {((Object)((Component)spawnPoints[0]).gameObject).name}");
					}
					else
					{
						Plugin.Log.LogError((object)"No spawn points found in the prefab!");
					}
					Character[] array = Object.FindObjectsByType<Character>((FindObjectsSortMode)0);
					foreach (Character character2 in array)
					{
						GiveResetBerry(character2);
					}
					return false;
				}
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public static Material DefaultMaterial;

		public static List<Transform> spawnPoints;

		public static int CurrentSpawnPointIndex = 0;

		public static int MaxSpawnPointIndex = 0;

		public static PhotonView photonScript;

		public static FinisherScript finisher;

		public static GameMode Mode = GameMode.Dropper;

		public static string ResetBerryName = Plugin.PLuginID + ":ResetBerry";

		public static string HealthPotionName = Plugin.PLuginID + ":Health potion";

		private static Dictionary<string, Shader> _peakShaders = null;

		internal static Dictionary<string, Shader> PeakShaders
		{
			get
			{
				if (_peakShaders == null)
				{
					List<string> list = new List<string>
					{
						"W/Peak_Standard", "W/Character", "W/Peak_Transparent", "W/Peak_Glass", "W/Peak_Clip", "W/Peak_glass_liquid", "W/Peak_GroundTransition", "W/Peak_Guidebook", "W/Peak_Honey", "W/Peak_Ice",
						"W/Peak_Rock", "W/Peak_Rope", "W/Peak_Splash", "W/Peak_Waterfall", "W/Vine", "Universal Render Pipeline/Lit"
					};
					_peakShaders = new Dictionary<string, Shader>();
					foreach (string item in list)
					{
						Shader val = Shader.Find(item);
						if ((Object)(object)val == (Object)null)
						{
							Plugin.Log.LogWarning((object)("Shader " + item + " not found, skipping."));
						}
						else
						{
							_peakShaders[item] = val;
						}
					}
				}
				return _peakShaders;
			}
		}

		[HarmonyPatch(typeof(ScoutmasterSpawner), "Awake")]
		[HarmonyPostfix]
		private static void ScoutmasterSpawner_Awake_Postfix(ScoutmasterSpawner __instance)
		{
			((MonoBehaviour)__instance).StartCoroutine(DelayedActivation());
		}

		[IteratorStateMachine(typeof(<DelayedActivation>d__11))]
		public static IEnumerator DelayedActivation()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DelayedActivation>d__11(0);
		}

		public static void GiveResetBerry(Character character)
		{
			if (character.player.itemSlots.Count((ItemSlot w) => !w.IsEmpty()) <= 0)
			{
				MethodInfo method = typeof(CharacterItems).GetMethod("SpawnItemInHand", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				method.Invoke(character.refs.items, new object[1] { ResetBerryName });
			}
		}

		public static void TeleportAllPlayers(Vector3 position)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			Player[] array = Object.FindObjectsByType<Player>((FindObjectsSortMode)0);
			foreach (Player val in array)
			{
				val.character.WarpPlayerRPC(position, true);
			}
		}

		[HarmonyPatch(typeof(AchievementManager), "ThrowAchievement")]
		[HarmonyPrefix]
		private static bool AchievementManager_ThrowAchievement_Prefix(AchievementManager __instance)
		{
			return false;
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		public static bool OverrideHungerRateMultiplier(ref float __result)
		{
			__result = 0f;
			return false;
		}

		[HarmonyPatch(typeof(BerryBush), "SpawnItems")]
		[HarmonyPrefix]
		private static void BerryBush_SpawnItems_Prefix(BerryBush __instance, ref List<Transform> spawnSpots)
		{
			spawnSpots.Clear();
		}

		[HarmonyPatch(typeof(ScoutmasterSpawner), "SpawnScoutmaster")]
		[HarmonyPrefix]
		private static bool ScoutmasterSpawner_SpawnScoutmaster_Prefix(ScoutmasterSpawner __instance)
		{
			return false;
		}

		[HarmonyPatch(typeof(Character), "RPCA_PassOut")]
		[HarmonyPrefix]
		private static bool Character_RPCA_PassOut_Prefix(Character __instance)
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			Plugin.Log.LogInfo((object)$"Preventing {((Object)__instance).name} from passing out and respawning him at spawnpointIndex: {CurrentSpawnPointIndex}");
			__instance.refs.afflictions.ClearAllStatus(false);
			__instance.WarpPlayerRPC(spawnPoints[CurrentSpawnPointIndex].position, true);
			GiveResetBerry(__instance);
			return false;
		}

		[HarmonyPatch(typeof(CharacterItems), "DoDropping")]
		[HarmonyPrefix]
		private static bool CharacterItems_DoDropping_Prefix(CharacterItems __instance)
		{
			return false;
		}

		[HarmonyPatch(typeof(ItemSlot), "EmptyOut")]
		[HarmonyPrefix]
		private static bool ItemSlot_EmptyOut_Prefix(ItemSlot __instance)
		{
			Plugin.Log.LogInfo((object)("Preventing " + ((Object)((Component)__instance.prefab).gameObject).name + " from being dropped isntead " + ResetBerryName));
			if (((Object)((Component)__instance.prefab).gameObject).name == ResetBerryName)
			{
				return false;
			}
			return true;
		}

		private static void CheckEveryMaterialShader(GameObject gameObject)
		{
			Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>();
			foreach (Renderer val in componentsInChildren)
			{
				for (int j = 0; j < val.materials.Length; j++)
				{
					Material val2 = val.materials[j];
					Plugin.Log.LogInfo((object)("Rendere " + ((Object)((Component)val).gameObject).name + " with Material " + ((Object)val2).name + " uses shader " + ((Object)val2.shader).name));
				}
			}
		}

		public static void SetupMaterial(GameObject gameObject)
		{
			Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>();
			foreach (Renderer val in componentsInChildren)
			{
				Material[] materials = val.materials;
				foreach (Material val2 in materials)
				{
					if (PeakShaders.TryGetValue(((Object)val2.shader).name, out Shader value))
					{
						val2.shader = value;
					}
				}
			}
			Renderer[] componentsInChildren2 = gameObject.GetComponentsInChildren<Renderer>();
			foreach (Renderer val3 in componentsInChildren2)
			{
				Material[] materials2 = val3.materials;
				foreach (Material val4 in materials2)
				{
					if (((Object)val4.shader).name == "Universal Render Pipeline/Lit" && !val4.IsKeywordEnabled("_EMISSION") && !IsTransparent(val4) && !HasAlphaClipping(val4))
					{
						Texture texture = val4.GetTexture("_BaseMap");
						if ((Object)(object)texture == (Object)null)
						{
							Plugin.Log.LogInfo((object)("No texture found for material " + ((Object)val4).name + ", skipping conversion."));
							continue;
						}
						val4.shader = DefaultMaterial.shader;
						val4.SetTexture("_BaseTexture", texture);
					}
				}
				val3.materials = materials2;
			}
		}

		private static bool IsTransparent(Material mat)
		{
			if (mat.HasProperty("_Surface"))
			{
				float @float = mat.GetFloat("_Surface");
				return @float > 0.5f;
			}
			return mat.renderQueue >= 3000;
		}

		private static bool HasAlphaClipping(Material mat)
		{
			return mat.IsKeywordEnabled("_ALPHATEST_ON");
		}
	}
	internal class MandatoryHarmonyPatches
	{
		private static bool modifiedBoardpass;

		private static LoadCorrectDropper loader;

		[HarmonyPatch(typeof(AchievementManager), "GetMaxAscent")]
		[HarmonyPostfix]
		public static void AchievementManager_GetMaxAscent_Postfix(ref int __result)
		{
			__result += 2;
		}

		[HarmonyPatch(typeof(AirportCheckInKiosk), "Awake")]
		[HarmonyPostfix]
		private static void AirportCheckInKiosk_Awake_Postfix(AirportCheckInKiosk __instance)
		{
			loader = ((Component)__instance).gameObject.AddComponent<LoadCorrectDropper>();
		}

		[HarmonyPatch(typeof(BoardingPass), "Initialize")]
		[HarmonyPrefix]
		public static void Prefix(BoardingPass __instance)
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: 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_0097: Expected O, but got Unknown
			//IL_00a2: 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_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: 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_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Expected O, but got Unknown
			if (!modifiedBoardpass)
			{
				FieldInfo field = typeof(BoardingPass).GetField("maxAscent", BindingFlags.Instance | BindingFlags.NonPublic);
				int num = (int)field.GetValue(__instance);
				field.SetValue(__instance, num + 1);
				modifiedBoardpass = true;
				__instance.ascentData.ascents.Add(new AscentInstanceData
				{
					color = Color.black,
					title = "Dropper",
					description = "",
					titleReward = "Immense dread",
					sashSprite = Plugin.Bundle.LoadAsset<Sprite>("icon")
				});
				__instance.ascentData.ascents.Add(new AscentInstanceData
				{
					color = Color.black,
					title = "Dropper - Descend",
					description = "",
					titleReward = "Immense dread",
					sashSprite = Plugin.Bundle.LoadAsset<Sprite>("icon")
				});
				AscentInstanceData value = __instance.ascentData.ascents[__instance.ascentData.ascents.Count - 1];
				AscentInstanceData value2 = __instance.ascentData.ascents[__instance.ascentData.ascents.Count - 2];
				for (int num2 = __instance.ascentData.ascents.Count - 1; num2 > 1; num2--)
				{
					__instance.ascentData.ascents[num2] = __instance.ascentData.ascents[num2 - 1];
				}
				for (int num3 = __instance.ascentData.ascents.Count - 1; num3 > 1; num3--)
				{
					__instance.ascentData.ascents[num3] = __instance.ascentData.ascents[num3 - 1];
				}
				__instance.ascentData.ascents[1] = value2;
				__instance.ascentData.ascents[2] = value;
			}
		}

		[HarmonyPatch(typeof(BoardingPass), "StartGame")]
		[HarmonyPrefix]
		public static void BoardingPass_StartGame_Prefix(BoardingPass __instance)
		{
			((Component)loader).GetComponent<PhotonView>().RPC("LoadDropper", (RpcTarget)0, new object[1] { __instance.ascentIndex });
			if (__instance.ascentIndex == 1)
			{
				__instance.ascentIndex = 0;
			}
			if (__instance.ascentIndex > 1)
			{
				__instance.ascentIndex -= 2;
			}
		}

		[HarmonyPatch(typeof(AscentUI), "Update")]
		[HarmonyPostfix]
		public static void AscentUI_Update_Postfix(AscentUI __instance)
		{
			if (Ascents.currentAscent >= 0 && !Plugin.PlayingDropperMap)
			{
				((TMP_Text)__instance.text).text = SingletonAsset<AscentData>.Instance.ascents[Ascents.currentAscent + 3].localizedTitle;
			}
			else if (Plugin.PlayingDropperMap)
			{
				switch (HarmonyPatches.Mode)
				{
				case HarmonyPatches.GameMode.Dropper:
					((TMP_Text)__instance.text).text = SingletonAsset<AscentData>.Instance.ascents[Ascents.currentAscent + 1].localizedTitle;
					break;
				case HarmonyPatches.GameMode.Descend:
					((TMP_Text)__instance.text).text = SingletonAsset<AscentData>.Instance.ascents[Ascents.currentAscent + 2].localizedTitle;
					break;
				}
			}
		}
	}
	public class TriggerTeleporter : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <EnableCharactersDelayed>d__3 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public TriggerTeleporter <>4__this;

			public int id;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <EnableCharactersDelayed>d__3(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_002e: Expected O, but got Unknown
				int num = <>1__state;
				TriggerTeleporter triggerTeleporter = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(2f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					triggerTeleporter.charactersInTrigger.Remove(id);
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public Action<Character> Interacted;

		public List<int> charactersInTrigger = new List<int>();

		private void OnTriggerEnter(Collider other)
		{
			Character componentInParent = ((Component)((Component)other).transform).GetComponentInParent<Character>();
			if ((Object)(object)componentInParent != (Object)null)
			{
				int viewID = ((Component)componentInParent).GetComponent<PhotonView>().ViewID;
				if (!charactersInTrigger.Contains(viewID))
				{
					charactersInTrigger.Add(viewID);
					Interacted?.Invoke(componentInParent);
					((MonoBehaviour)componentInParent).StartCoroutine(EnableCharactersDelayed(viewID));
				}
			}
		}

		[IteratorStateMachine(typeof(<EnableCharactersDelayed>d__3))]
		private IEnumerator EnableCharactersDelayed(int id)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <EnableCharactersDelayed>d__3(0)
			{
				<>4__this = this,
				id = id
			};
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}