Decompiled source of YOURETAKINGTOOLONG v2.0.2

YTTL/YTTL2.0.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityStandardAssets.Characters.FirstPerson;
using YTTL2._0;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("YTTL2.0")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("YTTL2.0")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("203530c2-15e7-45a9-8f3f-11a455d3d14c")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
public class YTTLai : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <ChaseMiniTikva>d__15 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public YTTLai <>4__this;

		private float <distanceToMiniTikva>5__1;

		private YTTLaiMini <tikvaAiMini>5__2;

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

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

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

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

		private bool MoveNext()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				break;
			case 1:
				<>1__state = -1;
				break;
			}
			if (<>4__this.isChasingMiniTikva && (Object)(object)<>4__this.miniTikvaTarget != (Object)null)
			{
				<distanceToMiniTikva>5__1 = Vector3.Distance(((Component)<>4__this).transform.position, <>4__this.miniTikvaTarget.transform.position);
				if (!(<distanceToMiniTikva>5__1 < 2f))
				{
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				<tikvaAiMini>5__2 = <>4__this.miniTikvaTarget.GetComponent<YTTLaiMini>();
				((MonoBehaviour)<tikvaAiMini>5__2).StartCoroutine(<tikvaAiMini>5__2.Explodes());
				<>4__this.miniTikvaTarget = null;
				<>4__this.isChasingMiniTikva = false;
			}
			if (<>4__this.isChasingMiniTikva)
			{
				<>4__this.isChasingMiniTikva = false;
			}
			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();
		}
	}

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

		private object <>2__current;

		public YTTLai <>4__this;

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

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

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

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

		private bool MoveNext()
		{
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				break;
			case 1:
				<>1__state = -1;
				<>4__this.rendere.sprite = <>4__this.close;
				<>2__current = (object)new WaitForSeconds(0.1f);
				<>1__state = 2;
				return true;
			case 2:
				<>1__state = -1;
				break;
			}
			<>4__this.rendere.sprite = <>4__this.open;
			<>2__current = (object)new WaitForSeconds(0.1f);
			<>1__state = 1;
			return true;
		}

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

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

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

		private object <>2__current;

		public YTTLai <>4__this;

		private float <timer>5__1;

		private int <>s__2;

		private float <progress>5__3;

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

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

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

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

		private bool MoveNext()
		{
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Expected O, but got Unknown
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Expected O, but got Unknown
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Expected O, but got Unknown
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Expected O, but got Unknown
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
			{
				<>1__state = -1;
				<>4__this.Ai = YTTL.Instance.GetAi();
				int ai = <>4__this.Ai;
				<>s__2 = ai;
				switch (<>s__2)
				{
				case 1:
					<timer>5__1 = 0f;
					<>2__current = (object)new WaitForSeconds(1f);
					<>1__state = 1;
					return true;
				case 2:
					<>2__current = (object)new WaitForSeconds(2.6f);
					<>1__state = 4;
					return true;
				default:
					<>2__current = (object)new WaitForSeconds(2.25f);
					<>1__state = 5;
					return true;
				}
			}
			case 1:
				<>1__state = -1;
				goto IL_0168;
			case 2:
				<>1__state = -1;
				goto IL_0168;
			case 3:
				<>1__state = -1;
				goto IL_021d;
			case 4:
				<>1__state = -1;
				<>4__this.miniTikvaTarget = <>4__this.FindMiniTikva();
				if ((Object)(object)<>4__this.miniTikvaTarget != (Object)null)
				{
					<>4__this.isChasingMiniTikva = true;
				}
				goto IL_021d;
			case 5:
				<>1__state = -1;
				goto IL_021d;
			case 6:
				{
					<>1__state = -1;
					<>4__this.Move = true;
					YTTL.Instance.SetText("");
					((Behaviour)GameObject.FindWithTag("Player").GetComponent<FirstPersonController>()).enabled = true;
					if (<>4__this.Ai == 2)
					{
						<>4__this.source.Play();
						((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.Laugh());
						((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.ChaseMiniTikva());
					}
					else
					{
						<>4__this.source.Play();
						((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.Laugh());
					}
					return false;
				}
				IL_0168:
				if (<timer>5__1 < 1.5f)
				{
					<timer>5__1 += Time.deltaTime;
					<progress>5__3 = <timer>5__1 / 1.5f;
					((Component)<>4__this).transform.localScale = Vector3.Lerp(((Component)<>4__this).transform.localScale, new Vector3(3f, 1f, 1f), <progress>5__3);
					Camera.main.aspect = Mathf.Lerp(Camera.main.aspect, 1f, <progress>5__3);
					<>2__current = null;
					<>1__state = 2;
					return true;
				}
				<>2__current = (object)new WaitForSeconds(0.25f);
				<>1__state = 3;
				return true;
				IL_021d:
				<>2__current = (object)new WaitForSecondsRealtime(0.5f);
				<>1__state = 6;
				return true;
			}
		}

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

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

	private float CurSpeed = 0f;

	private float targetSpeed = 20f;

	private float accelerationTime = 7f;

	private float speedTimer = 0f;

	public Sprite open;

	private Sprite close;

	private SpriteRenderer rendere;

	public int Ai;

	private AudioSource source;

	private bool Move = false;

	private bool isChasingMiniTikva = false;

	private GameObject miniTikvaTarget;

	private void OnEnable()
	{
		Animator component = ((Component)this).GetComponent<Animator>();
		((Behaviour)component).enabled = false;
		rendere = ((Component)this).GetComponent<SpriteRenderer>();
		close = rendere.sprite;
		source = ((Component)this).GetComponent<AudioSource>();
		((MonoBehaviour)this).StartCoroutine(STARTt());
		((Component)this).transform.LookAt(GameObject.FindWithTag("Player").transform);
	}

	[IteratorStateMachine(typeof(<STARTt>d__13))]
	private IEnumerator STARTt()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <STARTt>d__13(0)
		{
			<>4__this = this
		};
	}

	private void Update()
	{
		//IL_009b: 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_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		if (!Move)
		{
			((Component)this).transform.LookAt(GameObject.FindWithTag("Player").transform);
		}
		if (Move)
		{
			if (isChasingMiniTikva)
			{
				((Component)this).transform.LookAt(miniTikvaTarget.transform);
			}
			else
			{
				((Component)this).transform.LookAt(GameObject.FindWithTag("Player").transform);
			}
			OrigSpeed();
			speedTimer += Time.deltaTime;
			Transform transform = ((Component)this).transform;
			transform.position += ((Component)this).transform.forward * CurSpeed * Time.deltaTime;
		}
	}

	[IteratorStateMachine(typeof(<ChaseMiniTikva>d__15))]
	private IEnumerator ChaseMiniTikva()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <ChaseMiniTikva>d__15(0)
		{
			<>4__this = this
		};
	}

	private GameObject FindMiniTikva()
	{
		YTTLaiMini[] array = Object.FindObjectsOfType<YTTLaiMini>();
		if (array.Length != 0)
		{
			return ((Component)array[0]).gameObject;
		}
		return null;
	}

	private void OnTriggerEnter(Collider collision)
	{
		if (((Component)collision).gameObject.CompareTag("Player"))
		{
			YTTL.Instance.Reset();
		}
	}

	[IteratorStateMachine(typeof(<Laugh>d__18))]
	private IEnumerator Laugh()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <Laugh>d__18(0)
		{
			<>4__this = this
		};
	}

	private void OrigSpeed()
	{
		float num = Mathf.Clamp01(speedTimer / accelerationTime);
		CurSpeed = Mathf.Lerp(5f, targetSpeed, num * num);
	}
}
public class YTTLaiMini : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <Explodes>d__14 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public YTTLaiMini <>4__this;

		private Animator <anim>5__1;

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

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

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

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

		private bool MoveNext()
		{
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>4__this.Move = false;
				<>4__this.rendere.sprite = null;
				<>4__this.source.clip = YTTL.Instance.LoadFromBundle<AudioClip>("Explode");
				<anim>5__1 = ((Component)<>4__this).GetComponent<Animator>();
				((Behaviour)<anim>5__1).enabled = true;
				<anim>5__1.Play("Explode");
				<>4__this.source.Play();
				<>2__current = (object)new WaitForSeconds(1.5f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				Object.Destroy((Object)(object)((Component)<>4__this).gameObject);
				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();
		}
	}

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

		private object <>2__current;

		public YTTLaiMini <>4__this;

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

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

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

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

		private bool MoveNext()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(2.75f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<>4__this.Move = true;
				YTTL.Instance.SetText("");
				((Behaviour)GameObject.FindWithTag("Player").GetComponent<FirstPersonController>()).enabled = true;
				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();
		}
	}

	private float CurSpeed = 3f;

	private float targetSpeed = 20f;

	private float accelerationTime = 7f;

	private float speedTimer = 0f;

	private SpriteRenderer rendere;

	public int Ai;

	private AudioSource source;

	private bool Move = false;

	private bool isChasingMiniTikva = false;

	private GameObject miniTikvaTarget;

	private void OnEnable()
	{
		Animator component = ((Component)this).GetComponent<Animator>();
		((Behaviour)component).enabled = false;
		rendere = ((Component)this).GetComponent<SpriteRenderer>();
		source = ((Component)this).GetComponent<AudioSource>();
		((MonoBehaviour)this).StartCoroutine(STARTt());
	}

	[IteratorStateMachine(typeof(<STARTt>d__11))]
	private IEnumerator STARTt()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <STARTt>d__11(0)
		{
			<>4__this = this
		};
	}

	private void Update()
	{
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.LookAt(GameObject.FindWithTag("Player").transform);
		if (Move)
		{
			speedTimer += Time.deltaTime;
			Transform transform = ((Component)this).transform;
			transform.position += ((Component)this).transform.forward * CurSpeed * Time.deltaTime;
		}
	}

	private void OnTriggerEnter(Collider collision)
	{
		if (((Component)collision).gameObject.CompareTag("Player"))
		{
			YTTL.Instance.Reset();
		}
	}

	[IteratorStateMachine(typeof(<Explodes>d__14))]
	public IEnumerator Explodes()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <Explodes>d__14(0)
		{
			<>4__this = this
		};
	}
}
namespace YTTL2._0;

[BepInPlugin("ru.MxyfellKek.YTTL", "YOUR TAKING TOO LONG", "2.0")]
public class YTTL : BaseUnityPlugin
{
	[CompilerGenerated]
	private sealed class <GetCrono>d__27 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public YTTL <>4__this;

		private Contrarreloj <crono>5__1;

		private FieldInfo <timeField>5__2;

		private string[] <tiempos>5__3;

		private string[] <parts>5__4;

		private int <minutes>5__5;

		private int <seconds>5__6;

		private int <milliseconds>5__7;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<crono>5__1 = null;
			<timeField>5__2 = null;
			<tiempos>5__3 = null;
			<parts>5__4 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>4__this.Timer = 0f;
				<>4__this.TimerScene = false;
				<>2__current = (object)new WaitForSeconds(1f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<crono>5__1 = Object.FindObjectOfType<Contrarreloj>();
				if ((Object)(object)<crono>5__1 != (Object)null)
				{
					<>4__this.TimerScene = true;
					<timeField>5__2 = typeof(Contrarreloj).GetField("tiempos", BindingFlags.Instance | BindingFlags.NonPublic);
					<tiempos>5__3 = (string[])<timeField>5__2.GetValue(<crono>5__1);
					if (<tiempos>5__3 != null && <tiempos>5__3.Length != 0 && !string.IsNullOrEmpty(<tiempos>5__3[0]))
					{
						<parts>5__4 = <tiempos>5__3[0].Split(new char[1] { ':' });
						if (<parts>5__4.Length == 3)
						{
							<minutes>5__5 = int.Parse(<parts>5__4[0]);
							<seconds>5__6 = int.Parse(<parts>5__4[1]);
							<milliseconds>5__7 = int.Parse(<parts>5__4[2]);
							<>4__this.LevelTime = (float)(<minutes>5__5 * 60 + <seconds>5__6) + (float)<milliseconds>5__7 / 1000f - Random.Range(7f, 10f);
							<>4__this.Timer = <>4__this.LevelTime;
						}
						<parts>5__4 = null;
					}
					<timeField>5__2 = null;
					<tiempos>5__3 = null;
				}
				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();
		}
	}

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

		private object <>2__current;

		public YTTL <>4__this;

		private int <currentAi>5__1;

		private string[] <words1>5__2;

		private string[] <words2>5__3;

		private int <>s__4;

		private string[] <>s__5;

		private int <>s__6;

		private string <word>5__7;

		private string[] <>s__8;

		private int <>s__9;

		private string <word>5__10;

		private SpriteRenderer <renderer>5__11;

		private string[] <words>5__12;

		private string[] <>s__13;

		private int <>s__14;

		private string <word>5__15;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<words1>5__2 = null;
			<words2>5__3 = null;
			<>s__5 = null;
			<word>5__7 = null;
			<>s__8 = null;
			<word>5__10 = null;
			<renderer>5__11 = null;
			<words>5__12 = null;
			<>s__13 = null;
			<word>5__15 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			//IL_0344: Unknown result type (might be due to invalid IL or missing references)
			//IL_0349: Unknown result type (might be due to invalid IL or missing references)
			//IL_0354: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Expected O, but got Unknown
			//IL_0401: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Expected O, but got Unknown
			//IL_0422: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Expected O, but got Unknown
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Expected O, but got Unknown
			//IL_0519: Unknown result type (might be due to invalid IL or missing references)
			//IL_0523: Expected O, but got Unknown
			//IL_0314: Unknown result type (might be due to invalid IL or missing references)
			//IL_031e: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(0.2f);
				<>1__state = 1;
				return true;
			case 1:
			{
				<>1__state = -1;
				<>4__this.displayText = "";
				<currentAi>5__1 = ((<>4__this.Deistvie == 2 && (Object)(object)<>4__this.tikvaAiMini != (Object)null) ? <>4__this.tikvaAiMini.Ai : (((Object)(object)<>4__this.tikvaAi != (Object)null) ? <>4__this.tikvaAi.Ai : 0));
				int num = <currentAi>5__1;
				<>s__4 = num;
				if (<>s__4 != 1)
				{
					<words1>5__2 = "YOUR TAKING TOO LONG".Split(new char[1] { ' ' });
					<>s__5 = <words1>5__2;
					<>s__6 = 0;
					goto IL_01d5;
				}
				<words2>5__3 = "YOUR LONG".Split(new char[1] { ' ' });
				<>s__8 = <words2>5__3;
				<>s__9 = 0;
				goto IL_02cc;
			}
			case 2:
				<>1__state = -1;
				<word>5__7 = null;
				<>s__6++;
				goto IL_01d5;
			case 3:
				<>1__state = -1;
				<word>5__10 = null;
				<>s__9++;
				goto IL_02cc;
			case 4:
				<>1__state = -1;
				<>4__this.SpawnPos = <>4__this.plr.transform.position;
				<>2__current = (object)new WaitForSeconds(3f);
				<>1__state = 5;
				return true;
			case 5:
				<>1__state = -1;
				((Behaviour)<>4__this.plr.GetComponent<FirstPersonController>()).enabled = false;
				<>4__this.tikva = Object.Instantiate<GameObject>(<>4__this.tikvaPref);
				<>4__this.tikvaAi = <>4__this.tikva.AddComponent<YTTLai>();
				<>4__this.tikvaAi.open = <>4__this.LoadFromBundle<Sprite>("FaceOp");
				<renderer>5__11 = <>4__this.tikva.GetComponent<SpriteRenderer>();
				((Renderer)<renderer>5__11).material = new Material(Shader.Find("Sprites/Default"));
				<>4__this.tikva.transform.position = <>4__this.SpawnPos;
				<>4__this.plrNewAud.clip = <>4__this.LoadFromBundle<AudioClip>("audio_YTTLITTL");
				<>4__this.plrNewAud.Play();
				<>4__this.displayText = "";
				<words>5__12 = "YOUR TAKING TOO LONG IS TAKING TOO LONG".Split(new char[1] { ' ' });
				<>s__13 = <words>5__12;
				<>s__14 = 0;
				goto IL_0549;
			case 6:
				{
					<>1__state = -1;
					<word>5__15 = null;
					<>s__14++;
					goto IL_0549;
				}
				IL_0549:
				if (<>s__14 < <>s__13.Length)
				{
					<word>5__15 = <>s__13[<>s__14];
					if (!string.IsNullOrEmpty(<>4__this.displayText))
					{
						<>4__this.displayText += " ";
					}
					<>4__this.displayText += <word>5__15;
					<>2__current = (object)new WaitForSeconds(0.4f);
					<>1__state = 6;
					return true;
				}
				<>s__13 = null;
				<renderer>5__11 = null;
				<words>5__12 = null;
				break;
				IL_02cc:
				if (<>s__9 < <>s__8.Length)
				{
					<word>5__10 = <>s__8[<>s__9];
					if (!string.IsNullOrEmpty(<>4__this.displayText))
					{
						<>4__this.displayText += " ";
					}
					<>4__this.displayText += <word>5__10;
					<>2__current = (object)new WaitForSeconds(0.75f);
					<>1__state = 3;
					return true;
				}
				<>s__8 = null;
				goto IL_02e8;
				IL_02e8:
				<words1>5__2 = null;
				<words2>5__3 = null;
				if (<>4__this.Deistvie == 2)
				{
					<>2__current = (object)new WaitForSeconds(7f);
					<>1__state = 4;
					return true;
				}
				break;
				IL_01d5:
				if (<>s__6 < <>s__5.Length)
				{
					<word>5__7 = <>s__5[<>s__6];
					if (!string.IsNullOrEmpty(<>4__this.displayText))
					{
						<>4__this.displayText += " ";
					}
					<>4__this.displayText += <word>5__7;
					<>2__current = (object)new WaitForSeconds(0.4f);
					<>1__state = 2;
					return true;
				}
				<>s__5 = null;
				goto IL_02e8;
			}
			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();
		}
	}

	private AssetBundle _bundle;

	private Font _font;

	private string displayText = "";

	private GameObject tikva;

	private GameObject tikvaMini;

	private GameObject tikvaPref;

	private Vector3 SpawnPos;

	private AudioSource plrNewAud;

	private GameObject plr;

	public float Timer = 0f;

	public int Deistvie;

	private bool TimerScene = false;

	private YTTLai tikvaAi;

	private YTTLaiMini tikvaAiMini;

	public float LevelTime;

	private GUIStyle phrase;

	public static YTTL Instance { get; private set; }

	private void Awake()
	{
		Instance = this;
		LoadBundle();
		SceneManager.sceneLoaded += OnSceneLoaded;
		_font = this.LoadFromBundle<Font>("VCR");
		tikvaPref = this.LoadFromBundle<GameObject>("FOG");
	}

	private void OnDestroy()
	{
		SceneManager.sceneLoaded -= OnSceneLoaded;
	}

	private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
	{
		plr = GameObject.FindWithTag("Player");
		plrNewAud = plr.AddComponent<AudioSource>();
		((MonoBehaviour)this).StartCoroutine(GetCrono());
	}

	private void LoadBundle()
	{
		string directoryName = Path.GetDirectoryName(typeof(YTTL).Assembly.Location);
		string text = Path.Combine(directoryName, "yttl");
		if (File.Exists(text))
		{
			_bundle = AssetBundle.LoadFromFile(text);
		}
	}

	public T LoadFromBundle<T>(string assetName) where T : Object
	{
		return _bundle.LoadAsset<T>(assetName);
	}

	private void OnGUI()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Expected O, but got Unknown
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		phrase = new GUIStyle(GUI.skin.label)
		{
			fontSize = 60,
			alignment = (TextAnchor)4,
			font = _font
		};
		GUI.Label(new Rect((float)(Screen.width / 2 - 750), 50f, 1500f, 150f), displayText, phrase);
	}

	private void SpawnTikva()
	{
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Expected O, but got Unknown
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Expected O, but got Unknown
		//IL_0175: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Expected O, but got Unknown
		//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_021e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0250: Unknown result type (might be due to invalid IL or missing references)
		int num = Random.Range(0, 101);
		int num2 = num;
		int num3 = num2;
		if (num3 < 80)
		{
			Deistvie = 0;
			tikva = Object.Instantiate<GameObject>(tikvaPref);
			tikvaAi = tikva.AddComponent<YTTLai>();
			plrNewAud.clip = this.LoadFromBundle<AudioClip>("audio_YTTL");
			tikvaAi.open = this.LoadFromBundle<Sprite>("FaceOp");
			SpriteRenderer component = tikva.GetComponent<SpriteRenderer>();
			((Renderer)component).material = new Material(Shader.Find("Sprites/Default"));
		}
		else
		{
			int num4 = num3;
			if (num4 < 90)
			{
				Deistvie = 1;
				tikva = Object.Instantiate<GameObject>(tikvaPref);
				tikvaAi = tikva.AddComponent<YTTLai>();
				plrNewAud.clip = this.LoadFromBundle<AudioClip>("audio_YL");
				tikvaAi.open = this.LoadFromBundle<Sprite>("FaceOp");
				SpriteRenderer component2 = tikva.GetComponent<SpriteRenderer>();
				((Renderer)component2).material = new Material(Shader.Find("Sprites/Default"));
			}
			else
			{
				Deistvie = 2;
				tikvaMini = Object.Instantiate<GameObject>(tikvaPref);
				tikvaAiMini = tikvaMini.AddComponent<YTTLaiMini>();
				plrNewAud.clip = this.LoadFromBundle<AudioClip>("audio_YTTLh");
				SpriteRenderer component3 = tikvaMini.GetComponent<SpriteRenderer>();
				((Renderer)component3).material = new Material(Shader.Find("Sprites/Default"));
				component3.sprite = this.LoadFromBundle<Sprite>("FaceSmile");
			}
		}
		if (Deistvie == 2 && (Object)(object)tikvaMini != (Object)null)
		{
			tikvaMini.transform.position = SpawnPos;
			((Behaviour)plr.GetComponent<FirstPersonController>()).enabled = false;
			((Component)Camera.main).transform.LookAt(tikvaMini.transform.position);
		}
		else if ((Object)(object)tikva != (Object)null)
		{
			tikva.transform.position = SpawnPos;
			((Behaviour)plr.GetComponent<FirstPersonController>()).enabled = false;
			((Component)Camera.main).transform.LookAt(tikva.transform.position);
		}
		plrNewAud.Play();
		((MonoBehaviour)this).StartCoroutine(YTTL_anim());
	}

	[IteratorStateMachine(typeof(<GetCrono>d__27))]
	private IEnumerator GetCrono()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <GetCrono>d__27(0)
		{
			<>4__this = this
		};
	}

	private void Update()
	{
		//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)
		if (TimerScene && Timer > 0f)
		{
			Timer -= Time.deltaTime;
			if (Timer >= (float)Random.Range(2, 5))
			{
				SpawnPos = plr.transform.position;
			}
			if (Timer <= 0f)
			{
				SpawnTikva();
				Timer = 0f;
			}
		}
	}

	[IteratorStateMachine(typeof(<YTTL_anim>d__29))]
	private IEnumerator YTTL_anim()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <YTTL_anim>d__29(0)
		{
			<>4__this = this
		};
	}

	public void Reset()
	{
		if ((Object)(object)tikva != (Object)null)
		{
			Object.Destroy((Object)(object)tikva);
			tikvaAi = null;
		}
		if ((Object)(object)tikvaMini != (Object)null)
		{
			Object.Destroy((Object)(object)tikvaMini);
			tikvaAiMini = null;
		}
		plr.GetComponent<FirstPersonController>().Morir(false);
		Timer = LevelTime;
		Camera.main.aspect = 1.7777777f;
		plrNewAud.Stop();
	}

	public void SetText(string text)
	{
		displayText = text;
	}

	public int GetAi()
	{
		return Deistvie;
	}
}