Decompiled source of Tag The Fleas v1.0.2

TagTheFleas.dll

Decompiled 2 weeks 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.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using HutongGames.PlayMaker;
using Microsoft.CodeAnalysis;
using Silksong.AssetHelper.ManagedAssets;
using TeamCherry.Localization;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.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 TagTheFleas
{
	public class BoidSimulation : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass12_0
		{
			public GameObject go;

			internal bool <Boid>b__1(GameObject other)
			{
				return (Object)(object)other != (Object)(object)go;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass12_1
		{
			public Vector3 p;

			internal float <Boid>b__2(GameObject other)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//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_0016: Unknown result type (might be due to invalid IL or missing references)
				Vector3 val = p - other.transform.position;
				return ((Vector3)(ref val)).sqrMagnitude;
			}
		}

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

			private object <>2__current;

			public BoidSimulation <>4__this;

			private float <interval>5__1;

			private WaitForSeconds <wait>5__2;

			private List<GameObject> <boids>5__3;

			private Vector3 <playerPos>5__4;

			private List<GameObject>.Enumerator <>s__5;

			private <>c__DisplayClass12_0 <>8__6;

			private Vector3 <steeringForce>5__7;

			private Rigidbody2D <rb>5__8;

			private (Vector3 position, Vector2 velocity, bool collided) <data>5__9;

			private <>c__DisplayClass12_1 <>8__10;

			private Vector3 <v>5__11;

			private int <k>5__12;

			private List<GameObject> <neighbors>5__13;

			private float <threshold>5__14;

			private float <forceX>5__15;

			private float <forceY>5__16;

			private float <wallPos>5__17;

			private float <distToWall>5__18;

			private Vector3 <wallForce>5__19;

			private Vector3 <fleeForce>5__20;

			private float <playerDistSqr>5__21;

			private Vector3 <localCOM>5__22;

			private Vector3 <localVel>5__23;

			private Vector3 <nearestPos>5__24;

			private Vector3 <separationDir>5__25;

			private Vector3 <alignForce>5__26;

			private Vector3 <cohesionForce>5__27;

			private Vector3 <separationForce>5__28;

			private List<GameObject>.Enumerator <>s__29;

			private GameObject <neighbor>5__30;

			private Rigidbody2D <rbNgh>5__31;

			private Vector3 <away>5__32;

			private float <weight>5__33;

			private HealthManager <hm>5__34;

			private PlayMakerFSM <controlGiant>5__35;

			private AudioSource <src>5__36;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<wait>5__2 = null;
				<boids>5__3 = null;
				<>s__5 = default(List<GameObject>.Enumerator);
				<>8__6 = null;
				<rb>5__8 = null;
				<>8__10 = null;
				<neighbors>5__13 = null;
				<>s__29 = default(List<GameObject>.Enumerator);
				<neighbor>5__30 = null;
				<rbNgh>5__31 = null;
				<hm>5__34 = null;
				<controlGiant>5__35 = null;
				<src>5__36 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Expected O, but got Unknown
				//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_00d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00de: Unknown result type (might be due to invalid IL or missing references)
				//IL_0777: Unknown result type (might be due to invalid IL or missing references)
				//IL_0160: Unknown result type (might be due to invalid IL or missing references)
				//IL_0165: Unknown result type (might be due to invalid IL or missing references)
				//IL_0186: Unknown result type (might be due to invalid IL or missing references)
				//IL_018b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0208: Unknown result type (might be due to invalid IL or missing references)
				//IL_020d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0213: Unknown result type (might be due to invalid IL or missing references)
				//IL_0218: Unknown result type (might be due to invalid IL or missing references)
				//IL_0248: Unknown result type (might be due to invalid IL or missing references)
				//IL_0258: Unknown result type (might be due to invalid IL or missing references)
				//IL_025d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0262: Unknown result type (might be due to invalid IL or missing references)
				//IL_027a: Unknown result type (might be due to invalid IL or missing references)
				//IL_029a: Unknown result type (might be due to invalid IL or missing references)
				//IL_029f: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_05dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_05ec: Unknown result type (might be due to invalid IL or missing references)
				//IL_05f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_05fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0601: Unknown result type (might be due to invalid IL or missing references)
				//IL_0606: Unknown result type (might be due to invalid IL or missing references)
				//IL_0612: Unknown result type (might be due to invalid IL or missing references)
				//IL_0618: Unknown result type (might be due to invalid IL or missing references)
				//IL_061d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0622: Unknown result type (might be due to invalid IL or missing references)
				//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0301: Unknown result type (might be due to invalid IL or missing references)
				//IL_0308: Unknown result type (might be due to invalid IL or missing references)
				//IL_0319: Unknown result type (might be due to invalid IL or missing references)
				//IL_031e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0335: Unknown result type (might be due to invalid IL or missing references)
				//IL_033a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0346: Unknown result type (might be due to invalid IL or missing references)
				//IL_034c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0351: Unknown result type (might be due to invalid IL or missing references)
				//IL_0356: Unknown result type (might be due to invalid IL or missing references)
				//IL_035a: Unknown result type (might be due to invalid IL or missing references)
				//IL_035f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0366: Unknown result type (might be due to invalid IL or missing references)
				//IL_036c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0371: Unknown result type (might be due to invalid IL or missing references)
				//IL_0380: Unknown result type (might be due to invalid IL or missing references)
				//IL_038a: Unknown result type (might be due to invalid IL or missing references)
				//IL_038f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0396: Unknown result type (might be due to invalid IL or missing references)
				//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
				//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_03cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_03da: Unknown result type (might be due to invalid IL or missing references)
				//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_03f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0401: Unknown result type (might be due to invalid IL or missing references)
				//IL_0406: Unknown result type (might be due to invalid IL or missing references)
				//IL_040b: Unknown result type (might be due to invalid IL or missing references)
				//IL_06ca: Unknown result type (might be due to invalid IL or missing references)
				//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_06d6: Unknown result type (might be due to invalid IL or missing references)
				//IL_06db: Unknown result type (might be due to invalid IL or missing references)
				//IL_06e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_06e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_06ec: Unknown result type (might be due to invalid IL or missing references)
				//IL_06f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_06fd: Unknown result type (might be due to invalid IL or missing references)
				//IL_0702: Unknown result type (might be due to invalid IL or missing references)
				//IL_0707: Unknown result type (might be due to invalid IL or missing references)
				//IL_0713: Unknown result type (might be due to invalid IL or missing references)
				//IL_0718: Unknown result type (might be due to invalid IL or missing references)
				//IL_0722: Unknown result type (might be due to invalid IL or missing references)
				//IL_0743: Unknown result type (might be due to invalid IL or missing references)
				//IL_074e: Unknown result type (might be due to invalid IL or missing references)
				//IL_065b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0661: Unknown result type (might be due to invalid IL or missing references)
				//IL_0666: Unknown result type (might be due to invalid IL or missing references)
				//IL_066b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0699: Unknown result type (might be due to invalid IL or missing references)
				//IL_06a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_06b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_06bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_06c2: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<interval>5__1 = 0.2f;
					<wait>5__2 = new WaitForSeconds(<interval>5__1);
					<>4__this.StartTimer();
					break;
				case 1:
					<>1__state = -1;
					<boids>5__3 = null;
					break;
				}
				if (FleaSpawner.boidRun)
				{
					<boids>5__3 = FleaSpawner.fleaData.Keys.Where((GameObject go) => (Object)(object)go != (Object)null).ToList();
					<playerPos>5__4 = ((Component)HeroController.instance).transform.position;
					<>s__5 = <boids>5__3.GetEnumerator();
					try
					{
						while (<>s__5.MoveNext())
						{
							<>8__6 = new <>c__DisplayClass12_0();
							<>8__6.go = <>s__5.Current;
							<steeringForce>5__7 = Vector3.zero;
							<rb>5__8 = <>8__6.go.GetComponent<Rigidbody2D>();
							if ((Object)(object)<rb>5__8 == (Object)null)
							{
								continue;
							}
							<data>5__9 = FleaSpawner.fleaData[<>8__6.go];
							if (!<data>5__9.collided)
							{
								<>8__10 = new <>c__DisplayClass12_1();
								<>8__10.p = <>8__6.go.transform.position;
								<v>5__11 = new Vector3(<rb>5__8.linearVelocityX, <rb>5__8.linearVelocityY, 0f);
								<k>5__12 = Mathf.Min(5, <boids>5__3.Count - 1);
								<neighbors>5__13 = <boids>5__3.Where((GameObject other) => (Object)(object)other != (Object)(object)<>8__6.go).OrderBy(delegate(GameObject other)
								{
									//IL_0001: Unknown result type (might be due to invalid IL or missing references)
									//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_0016: Unknown result type (might be due to invalid IL or missing references)
									Vector3 val2 = <>8__10.p - other.transform.position;
									return ((Vector3)(ref val2)).sqrMagnitude;
								}).Take(<k>5__12)
									.ToList();
								Vector3 val;
								if (<neighbors>5__13.Count > 0)
								{
									<localCOM>5__22 = Vector3.zero;
									<localVel>5__23 = Vector3.zero;
									<>s__29 = <neighbors>5__13.GetEnumerator();
									try
									{
										while (<>s__29.MoveNext())
										{
											<neighbor>5__30 = <>s__29.Current;
											<localCOM>5__22 += <neighbor>5__30.transform.position;
											<rbNgh>5__31 = <neighbor>5__30.GetComponent<Rigidbody2D>();
											<localVel>5__23 += new Vector3(<rbNgh>5__31.linearVelocityX, <rbNgh>5__31.linearVelocityY, 0f);
											<rbNgh>5__31 = null;
											<neighbor>5__30 = null;
										}
									}
									finally
									{
										((IDisposable)<>s__29).Dispose();
									}
									<>s__29 = default(List<GameObject>.Enumerator);
									<localCOM>5__22 /= (float)<neighbors>5__13.Count;
									<localVel>5__23 /= (float)<neighbors>5__13.Count;
									<nearestPos>5__24 = <neighbors>5__13[0].transform.position;
									val = <>8__10.p - <nearestPos>5__24;
									<separationDir>5__25 = ((Vector3)(ref val)).normalized;
									<alignForce>5__26 = (<localVel>5__23 - <v>5__11) * TagTheFleas.alignStrength.Value * 10f;
									<cohesionForce>5__27 = (<localCOM>5__22 - <>8__10.p) * TagTheFleas.cohesionStrength.Value * 10f;
									<separationForce>5__28 = <separationDir>5__25 * TagTheFleas.separationStrength.Value * 50f;
									<steeringForce>5__7 = <alignForce>5__26 + <cohesionForce>5__27 + <separationForce>5__28;
								}
								<threshold>5__14 = 10f;
								<forceX>5__15 = 0f;
								<forceY>5__16 = 0f;
								<wallPos>5__17 = 142f;
								<distToWall>5__18 = <>8__10.p.x - <wallPos>5__17;
								if (<distToWall>5__18 < <threshold>5__14)
								{
									<forceX>5__15 += 1f / Mathf.Max(<distToWall>5__18, 0.01f);
								}
								<wallPos>5__17 = 70f;
								<distToWall>5__18 = <>8__10.p.y - (<>8__10.p.x - 140f) * 0.62f - <wallPos>5__17;
								if (<distToWall>5__18 < <threshold>5__14)
								{
									<forceY>5__16 += 1f / Mathf.Max(<distToWall>5__18, 0.01f);
								}
								<wallPos>5__17 = 182f;
								<distToWall>5__18 = <wallPos>5__17 - <>8__10.p.x;
								if (<distToWall>5__18 < <threshold>5__14)
								{
									<forceX>5__15 -= 1f / Mathf.Max(<distToWall>5__18, 0.01f);
								}
								<wallPos>5__17 = 120f;
								<distToWall>5__18 = <wallPos>5__17 - <>8__10.p.y;
								if (<distToWall>5__18 < <threshold>5__14)
								{
									<forceY>5__16 -= 1f / Mathf.Max(<distToWall>5__18, 0.01f);
								}
								<wallForce>5__19 = new Vector3(<forceX>5__15, <forceY>5__16, 0f) * TagTheFleas.wallStrength.Value * 500f;
								<fleeForce>5__20 = Vector3.zero;
								val = <>8__10.p - <playerPos>5__4;
								<playerDistSqr>5__21 = ((Vector3)(ref val)).sqrMagnitude;
								if (<playerDistSqr>5__21 < TagTheFleas.playerRunRadius.Value * TagTheFleas.playerRunRadius.Value)
								{
									<away>5__32 = <>8__10.p - <playerPos>5__4;
									<weight>5__33 = 1f - Mathf.Sqrt(<playerDistSqr>5__21) / TagTheFleas.playerRunRadius.Value;
									<fleeForce>5__20 = ((Vector3)(ref <away>5__32)).normalized * TagTheFleas.fleeStrength.Value * <weight>5__33 * 50f;
								}
								<steeringForce>5__7 += <fleeForce>5__20 + <wallForce>5__19;
								<v>5__11 += <steeringForce>5__7 * <interval>5__1;
								<rb>5__8.linearVelocity = Vector2.ClampMagnitude(Vector2.op_Implicit(<v>5__11), 20f);
								FleaSpawner.fleaData[<>8__6.go] = (<>8__10.p, <rb>5__8.linearVelocity, false);
								<>8__10 = null;
								<neighbors>5__13 = null;
							}
							else
							{
								<rb>5__8.linearVelocity = Vector2.zero;
							}
							<rb>5__8 = null;
							<>8__6 = null;
						}
					}
					finally
					{
						((IDisposable)<>s__5).Dispose();
					}
					<>s__5 = default(List<GameObject>.Enumerator);
					if (FleaSpawner.fleaData.Count == 0)
					{
						TagTheFleas.Log.LogInfo((object)"All fleas tagged");
						<hm>5__34 = FleaSpawner.giantFlea.GetComponent<HealthManager>();
						if (FleaSpawner.boidRun)
						{
							<hm>5__34.hp = 1;
						}
						<controlGiant>5__35 = PlayMakerFSM.FindFsmOnGameObject(FleaSpawner.giantFlea, "Control");
						if (<controlGiant>5__35.Fsm.ActiveStateName == "Leave" && FleaSpawner.boidRun)
						{
							FleaSpawner.boidRun = false;
							TagTheFleas.boidCoroutineStarted = false;
							if ((Object)(object)FleaSpawner.musicInstance != (Object)null)
							{
								<src>5__36 = FleaSpawner.musicInstance.GetComponentInChildren<AudioSource>();
								if ((Object)(object)<src>5__36 != (Object)null)
								{
									((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.FadeOutMusic(<src>5__36, 5f));
								}
								<src>5__36 = null;
							}
							return false;
						}
						<hm>5__34 = null;
						<controlGiant>5__35 = null;
					}
					<>2__current = <wait>5__2;
					<>1__state = 1;
					return 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();
			}
		}

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

			private object <>2__current;

			public AudioSource src;

			public float duration;

			public BoidSimulation <>4__this;

			private float <startVolume>5__1;

			private float <t>5__2;

			private IEnumerator <>s__3;

			private Transform <child>5__4;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0157: Unknown result type (might be due to invalid IL or missing references)
				//IL_0161: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					TagTheFleas.Log.LogInfo((object)"Giant flea left");
					<>4__this.StopTimer();
					<>4__this.SaveBoidTime(Mathf.CeilToInt(<>4__this.elapsedTime / (float)TagTheFleas.numFleas.Value));
					<startVolume>5__1 = src.volume;
					<t>5__2 = 0f;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (<t>5__2 < duration)
				{
					<t>5__2 += Time.deltaTime;
					src.volume = Mathf.Lerp(<startVolume>5__1, 0f, <t>5__2 / duration);
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				src.volume = 0f;
				Object.Destroy((Object)(object)((Component)src).gameObject);
				Object.Destroy((Object)(object)TagTheFleas.playGround);
				((MonoBehaviour)<>4__this).StartCoroutine(FleaGameArena.instance.CamZoom(1f));
				<>s__3 = ((Component)HeroController.instance).transform.GetEnumerator();
				try
				{
					while (<>s__3.MoveNext())
					{
						<child>5__4 = (Transform)<>s__3.Current;
						if (((Object)<child>5__4).name == "Vignette")
						{
							((Component)<child>5__4).gameObject.SetActive(true);
						}
						<child>5__4 = null;
					}
				}
				finally
				{
					if (<>s__3 is IDisposable disposable)
					{
						disposable.Dispose();
					}
				}
				<>s__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();
			}
		}

		public static BoidSimulation instance;

		private float elapsedTime = 0f;

		public static bool timerRunning = false;

		public static string filePath = Path.Combine(PluginDirectory, "ScoreBoard", "BoidTimes.txt");

		public static string PluginDirectory => Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
		}

		private void Update()
		{
			if (timerRunning)
			{
				elapsedTime += Time.deltaTime;
			}
		}

		private void SaveBoidTime(int time)
		{
			string text = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss},{time}";
			File.AppendAllText(filePath, text + "\n");
		}

		private void OnGUI()
		{
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Expected O, but got Unknown
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			if (timerRunning)
			{
				int num = 200;
				int num2 = 60;
				Rect val = default(Rect);
				((Rect)(ref val))..ctor(10f, (float)(Screen.height - num2), (float)num, (float)num2);
				int num3 = Mathf.FloorToInt(elapsedTime / 60f);
				int num4 = Mathf.FloorToInt(elapsedTime % 60f);
				GUIStyle val2 = new GUIStyle(GUI.skin.label);
				val2.fontSize = 60;
				val2.alignment = (TextAnchor)3;
				GUI.Label(val, $"{num3:00}:{num4:00}", val2);
			}
		}

		private void StartTimer()
		{
			elapsedTime = 0f;
			timerRunning = true;
		}

		private void StopTimer()
		{
			timerRunning = false;
		}

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

		public static void SetBoidCollided(GameObject go)
		{
			if (FleaSpawner.fleaData.ContainsKey(go))
			{
				(Vector3, Vector2, bool) value = FleaSpawner.fleaData[go];
				value.Item3 = true;
				FleaSpawner.fleaData[go] = value;
			}
		}

		[IteratorStateMachine(typeof(<FadeOutMusic>d__14))]
		private IEnumerator FadeOutMusic(AudioSource src, float duration)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <FadeOutMusic>d__14(0)
			{
				<>4__this = this,
				src = src,
				duration = duration
			};
		}
	}
	public class FleaGameArena : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <BuildWallsFromLifts>d__5 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public FleaGameArena <>4__this;

			private GameObject <musicInstance>5__1;

			private GameObject <leftWall>5__2;

			private GameObject <rightWall>5__3;

			private GameObject <roof>5__4;

			private GameObject <platform>5__5;

			private GameObject <liftCol>5__6;

			private BoxCollider2D <col>5__7;

			private int <i>5__8;

			private int <i>5__9;

			private int <i>5__10;

			private int <i>5__11;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<musicInstance>5__1 = null;
				<leftWall>5__2 = null;
				<rightWall>5__3 = null;
				<roof>5__4 = null;
				<platform>5__5 = null;
				<liftCol>5__6 = null;
				<col>5__7 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0065: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Expected O, but got Unknown
				//IL_0094: Unknown result type (might be due to invalid IL or missing references)
				//IL_009e: Expected O, but got Unknown
				//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ce: Expected O, but got Unknown
				//IL_017a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0184: Expected O, but got Unknown
				//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b5: Expected O, but got Unknown
				//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e6: Expected O, but got Unknown
				//IL_020d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0217: Expected O, but got Unknown
				//IL_023e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0248: Expected O, but got Unknown
				//IL_0299: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0319: Unknown result type (might be due to invalid IL or missing references)
				//IL_0334: Unknown result type (might be due to invalid IL or missing references)
				//IL_036d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0388: Unknown result type (might be due to invalid IL or missing references)
				//IL_03c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0472: Unknown result type (might be due to invalid IL or missing references)
				//IL_047c: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = null;
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					TagTheFleas.playGround = new GameObject("Play Ground");
					TagTheFleas.playGround.transform.SetParent(TagTheFleas.tagGameGO.transform);
					<>4__this.walls = new GameObject("Arena Walls");
					<>4__this.walls.transform.SetParent(TagTheFleas.playGround.transform);
					<musicInstance>5__1 = new GameObject("Wall Sound");
					<musicInstance>5__1.transform.SetParent(<>4__this.walls.transform);
					<>4__this.musicSource = <musicInstance>5__1.AddComponent<AudioSource>();
					<musicInstance>5__1.SetActive(true);
					<>4__this.musicSource.loop = false;
					<>4__this.musicSource.volume = 1f;
					<>4__this.musicSource.clip = ((IEnumerable<AudioClip>)Resources.FindObjectsOfTypeAll<AudioClip>()).FirstOrDefault((Func<AudioClip, bool>)((AudioClip c) => ((Object)c).name == "sword_hit_snow_1"));
					<leftWall>5__2 = new GameObject("Left Wall");
					<leftWall>5__2.transform.SetParent(<>4__this.walls.transform);
					<rightWall>5__3 = new GameObject("Right Wall");
					<rightWall>5__3.transform.SetParent(<>4__this.walls.transform);
					<roof>5__4 = new GameObject("Roof");
					<roof>5__4.transform.SetParent(<>4__this.walls.transform);
					<platform>5__5 = new GameObject("Platform");
					<platform>5__5.transform.SetParent(<>4__this.walls.transform);
					<liftCol>5__6 = new GameObject("Colliders");
					<liftCol>5__6.transform.SetParent(<>4__this.walls.transform);
					<liftCol>5__6.layer = LayerMask.NameToLayer("Terrain");
					<liftCol>5__6.transform.position = new Vector3(142f, 95f, 0.5855f);
					<col>5__7 = <liftCol>5__6.AddComponent<BoxCollider2D>();
					<col>5__7.size = new Vector2(2f, 60f);
					((Collider2D)<col>5__7).offset = new Vector2(2.1f, 0f);
					((Collider2D)<col>5__7).isTrigger = false;
					<col>5__7 = <liftCol>5__6.AddComponent<BoxCollider2D>();
					<col>5__7.size = new Vector2(1f, 60f);
					((Collider2D)<col>5__7).offset = new Vector2(38.7f, 0f);
					((Collider2D)<col>5__7).isTrigger = false;
					<col>5__7 = <liftCol>5__6.AddComponent<BoxCollider2D>();
					<col>5__7.size = new Vector2(50f, 1f);
					((Collider2D)<col>5__7).offset = new Vector2(18.5f, 21f);
					((Collider2D)<col>5__7).isTrigger = false;
					<col>5__7 = <liftCol>5__6.AddComponent<BoxCollider2D>();
					<col>5__7.size = new Vector2(50f, 1f);
					((Collider2D)<col>5__7).offset = new Vector2(18.5f, -24.6f);
					((Collider2D)<col>5__7).isTrigger = false;
					<i>5__8 = 1;
					goto IL_0455;
				case 2:
					<>1__state = -1;
					<>4__this.SpawnLift(FleaGameObjects.cachedLiftGO, <platform>5__5, 142f + 5f * (float)<i>5__8, 70f);
					<i>5__8++;
					goto IL_0455;
				case 3:
					<>1__state = -1;
					<>4__this.SpawnLift(FleaGameObjects.cachedLiftGO, <leftWall>5__2, 142f, 30f + 4f * (float)<i>5__9);
					<i>5__9++;
					goto IL_04cc;
				case 4:
					<>1__state = -1;
					<>4__this.SpawnLift(FleaGameObjects.cachedLiftGO, <rightWall>5__3, 182f, 30f + 4f * (float)<i>5__10 + 60f);
					<i>5__10++;
					goto IL_0541;
				case 5:
					{
						<>1__state = -1;
						<>4__this.SpawnLift(FleaGameObjects.cachedLiftGO, <roof>5__4, 142f + 5f * (float)<i>5__11, 118f);
						<i>5__11++;
						break;
					}
					IL_0541:
					if (<i>5__10 < 8)
					{
						<>2__current = null;
						<>1__state = 4;
						return true;
					}
					<i>5__11 = 1;
					break;
					IL_0455:
					if (<i>5__8 < 2)
					{
						<>2__current = null;
						<>1__state = 2;
						return true;
					}
					<i>5__9 = 8;
					goto IL_04cc;
					IL_04cc:
					if (<i>5__9 < 23)
					{
						<>2__current = (object)new WaitForSeconds(0.2f);
						<>1__state = 3;
						return true;
					}
					<i>5__10 = 0;
					goto IL_0541;
				}
				if (<i>5__11 < 9)
				{
					<>2__current = null;
					<>1__state = 5;
					return true;
				}
				((MonoBehaviour)<>4__this).StartCoroutine(FleaSpawner.instance.FleasEnterArena());
				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 <CamZoom>d__9 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public float zoom;

			public FleaGameArena <>4__this;

			private float <duration>5__1;

			private float <interval>5__2;

			private float <camZoom>5__3;

			private float <t>5__4;

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

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

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

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

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<duration>5__1 = 0.5f;
					<interval>5__2 = 0f;
					<camZoom>5__3 = GameCameras.instance.tk2dCam.ZoomFactor;
					break;
				case 1:
					<>1__state = -1;
					<interval>5__2 += Time.deltaTime;
					<t>5__4 = <interval>5__2 / <duration>5__1;
					GameCameras.instance.tk2dCam.ZoomFactor = Mathf.Lerp(<camZoom>5__3, zoom, <t>5__4);
					<>2__current = null;
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					break;
				}
				if (<interval>5__2 < <duration>5__1)
				{
					<>2__current = null;
					<>1__state = 1;
					return 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();
			}
		}

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

			private object <>2__current;

			public FleaGameArena <>4__this;

			private GameObject <tagUpdrafts>5__1;

			private int <i>5__2;

			private GameObject <tagUpDraft>5__3;

			private Vector3 <poss>5__4;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<tagUpdrafts>5__1 = null;
				<tagUpDraft>5__3 = null;
				<>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_00ea: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_0100: Unknown result type (might be due to invalid IL or missing references)
				//IL_0116: Unknown result type (might be due to invalid IL or missing references)
				//IL_0148: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = null;
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<tagUpdrafts>5__1 = new GameObject("Updrafts");
					<tagUpdrafts>5__1.transform.SetParent(TagTheFleas.playGround.transform);
					<i>5__2 = 0;
					while (<i>5__2 < 5)
					{
						<tagUpDraft>5__3 = ManagedAssetExtensions.InstantiateAsset<GameObject>(TagTheFleas.upDraftGO);
						<tagUpDraft>5__3.transform.parent = <tagUpdrafts>5__1.transform;
						((Object)<tagUpDraft>5__3).name = $"Updraft {<i>5__2 + 1}";
						<poss>5__4 = new Vector3(153f + (float)<i>5__2 * 6f, 68f + (float)<i>5__2 * 5f, -0.1f);
						<tagUpDraft>5__3.transform.position = <poss>5__4;
						<tagUpDraft>5__3.transform.rotation = Quaternion.identity;
						<tagUpDraft>5__3.SetActive(true);
						<tagUpDraft>5__3.transform.localScale = new Vector3(2f, 10f, 1f);
						<tagUpDraft>5__3 = null;
						<i>5__2++;
					}
					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 <PutPeaksDrifters>d__8 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public FleaGameArena <>4__this;

			private GameObject <tagDrifters>5__1;

			private int <i>5__2;

			private GameObject <tagDrifter>5__3;

			private Vector3 <pos>5__4;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<tagDrifters>5__1 = null;
				<tagDrifter>5__3 = null;
				<>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_00bf: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0125: Unknown result type (might be due to invalid IL or missing references)
				//IL_010f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0114: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = null;
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<tagDrifters>5__1 = new GameObject("Drifters");
					<tagDrifters>5__1.transform.SetParent(TagTheFleas.playGround.transform);
					<i>5__2 = 0;
					while (<i>5__2 < 2)
					{
						<tagDrifter>5__3 = Object.Instantiate<GameObject>(FleaGameObjects.cachedDrifterGO);
						<tagDrifter>5__3.transform.parent = <tagDrifters>5__1.transform;
						((Object)<tagDrifter>5__3).name = $"Peaks Drifter {<i>5__2 + 1}";
						<pos>5__4 = Vector3.one;
						if (<i>5__2 == 0)
						{
							<pos>5__4 = new Vector3(160f, 102f, -0.1f);
						}
						else if (<i>5__2 == 1)
						{
							<pos>5__4 = new Vector3(162f, 92f, -0.1f);
						}
						<tagDrifter>5__3.transform.position = <pos>5__4;
						<tagDrifter>5__3.SetActive(true);
						<tagDrifter>5__3 = null;
						<i>5__2++;
					}
					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 FleaGameArena instance;

		private AudioSource musicSource;

		private GameObject walls;

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
		}

		public void BuildArena()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Expected O, but got Unknown
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Expected O, but got Unknown
			((MonoBehaviour)this).StartCoroutine(CamZoom(TagTheFleas.camZoomLevel.Value));
			foreach (Transform item in ((Component)HeroController.instance).transform)
			{
				Transform val = item;
				if (((Object)val).name == "Vignette")
				{
					((Component)val).gameObject.SetActive(false);
				}
			}
			if ((Object)(object)TagTheFleas.playGround != (Object)null)
			{
				Object.Destroy((Object)(object)TagTheFleas.playGround);
			}
			((MonoBehaviour)this).StartCoroutine(BuildWallsFromLifts());
			((MonoBehaviour)this).StartCoroutine(InstallUpdrafts());
			((MonoBehaviour)this).StartCoroutine(PutPeaksDrifters());
			GameObject val2 = ManagedAssetExtensions.InstantiateAsset<GameObject>(TagTheFleas.scoreBoardGO);
			val2.transform.position = new Vector3(191f, 111.5f, 0f);
			foreach (Transform item2 in val2.transform)
			{
				Transform val3 = item2;
				if (((Object)((Component)val3).gameObject).name.Contains("(2)"))
				{
					((Component)val3).gameObject.SetActive(true);
				}
			}
			GameObject val4 = GameObject.Find("Flea Festival Score Board(Clone)");
			((Object)val4).name = "Score Container";
			val4.transform.SetParent(TagTheFleas.tagGameGO.transform);
			foreach (Transform item3 in val4.transform)
			{
				Transform val5 = item3;
				if (((Object)((Component)val5).gameObject).name.Contains("Divider"))
				{
					Object.Destroy((Object)(object)((Component)val5).gameObject);
				}
			}
		}

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

		private void SpawnLift(GameObject cachedLiftGO, GameObject wall, float targetX, float targetY)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(cachedLiftGO.gameObject, wall.transform);
			val.transform.position = new Vector3(targetX, targetY, 0.5855f);
			((Component)val.transform.GetChild(6)).gameObject.SetActive(false);
			((Component)val.transform.GetChild(7)).gameObject.SetActive(false);
			((Component)val.transform.GetChild(10)).gameObject.SetActive(false);
			musicSource.Play();
		}

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

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

		[IteratorStateMachine(typeof(<CamZoom>d__9))]
		public IEnumerator CamZoom(float zoom)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CamZoom>d__9(0)
			{
				<>4__this = this,
				zoom = zoom
			};
		}
	}
	public class FleaGameObjects : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <CacheNonSceneObjects>d__7 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public FleaGameObjects <>4__this;

			private GameObject <scoreBoard>5__1;

			private string <sceneName>5__2;

			private AsyncOperationHandle<SceneInstance> <handle>5__3;

			private Scene <scene>5__4;

			private IEnumerator <>s__5;

			private Transform <child>5__6;

			private IEnumerator <>s__7;

			private Transform <child>5__8;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				<scoreBoard>5__1 = null;
				<sceneName>5__2 = null;
				<handle>5__3 = default(AsyncOperationHandle<SceneInstance>);
				<>s__5 = null;
				<child>5__6 = null;
				<>s__7 = null;
				<child>5__8 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_005a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0065: Unknown result type (might be due to invalid IL or missing references)
				//IL_0070: Unknown result type (might be due to invalid IL or missing references)
				//IL_007b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d6: Expected O, but got Unknown
				//IL_0110: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_033d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0343: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b6: Expected O, but got Unknown
				//IL_0157: Unknown result type (might be due to invalid IL or missing references)
				//IL_0161: Expected O, but got Unknown
				//IL_0236: Unknown result type (might be due to invalid IL or missing references)
				//IL_0240: Expected O, but got Unknown
				//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					((ManagedAssetBase<GameObject>)(object)TagTheFleas.upDraftGO).Load();
					((ManagedAssetBase<GameObject>)(object)TagTheFleas.fleaGO).Load();
					((ManagedAssetBase<GameObject>)(object)TagTheFleas.fleaAwooGO).Load();
					((ManagedAssetBase<GameObject>)(object)TagTheFleas.giantFleaGO).Load();
					((ManagedAssetBase<GameObject>)(object)TagTheFleas.scoreBoardGO).Load();
					<>2__current = (object)new WaitUntil((Func<bool>)(() => ((ManagedAssetBase<GameObject>)(object)TagTheFleas.upDraftGO).IsLoaded && ((ManagedAssetBase<GameObject>)(object)TagTheFleas.fleaGO).IsLoaded && ((ManagedAssetBase<GameObject>)(object)TagTheFleas.fleaAwooGO).IsLoaded && ((ManagedAssetBase<GameObject>)(object)TagTheFleas.giantFleaGO).IsLoaded && ((ManagedAssetBase<GameObject>)(object)TagTheFleas.scoreBoardGO).IsLoaded));
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.1f);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					<scoreBoard>5__1 = ManagedAssetExtensions.InstantiateAsset<GameObject>(TagTheFleas.scoreBoardGO);
					<scoreBoard>5__1.transform.position = new Vector3(70f, 4.8f, 0f);
					<>2__current = null;
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -1;
					<>s__5 = <scoreBoard>5__1.transform.GetEnumerator();
					try
					{
						while (<>s__5.MoveNext())
						{
							<child>5__6 = (Transform)<>s__5.Current;
							if (((Object)((Component)<child>5__6).gameObject).name == "Pin_examples")
							{
								((Component)<child>5__6).gameObject.SetActive(true);
							}
							<child>5__6 = null;
						}
					}
					finally
					{
						if (<>s__5 is IDisposable disposable2)
						{
							disposable2.Dispose();
						}
					}
					<>s__5 = null;
					<scoreBoard>5__1 = ManagedAssetExtensions.InstantiateAsset<GameObject>(TagTheFleas.scoreBoardGO);
					<scoreBoard>5__1.transform.position = new Vector3(191f, 111.5f, 0f);
					<>2__current = null;
					<>1__state = 4;
					return true;
				case 4:
					<>1__state = -1;
					<>s__7 = <scoreBoard>5__1.transform.GetEnumerator();
					try
					{
						while (<>s__7.MoveNext())
						{
							<child>5__8 = (Transform)<>s__7.Current;
							if (((Object)((Component)<child>5__8).gameObject).name == "Pin_examples")
							{
								((Component)<child>5__8).gameObject.SetActive(true);
							}
							<child>5__8 = null;
						}
					}
					finally
					{
						if (<>s__7 is IDisposable disposable)
						{
							disposable.Dispose();
						}
					}
					<>s__7 = null;
					<sceneName>5__2 = "Scenes/Aqueduct_05_festival";
					<handle>5__3 = Addressables.LoadSceneAsync((object)<sceneName>5__2, (LoadSceneMode)1, true, 100, (SceneReleaseMode)0);
					<>2__current = <handle>5__3;
					<>1__state = 5;
					return true;
				case 5:
				{
					<>1__state = -1;
					SceneInstance result = <handle>5__3.Result;
					<scene>5__4 = ((SceneInstance)(ref result)).Scene;
					festiveMusic = Object.Instantiate<GameObject>(GameObject.Find("Main"));
					((Object)festiveMusic).name = "Flea Game Music";
					Object.DontDestroyOnLoad((Object)(object)festiveMusic);
					festiveMusic.SetActive(false);
					<>2__current = Addressables.UnloadSceneAsync(<handle>5__3, true);
					<>1__state = 6;
					return true;
				}
				case 6:
					<>1__state = -1;
					TagTheFleas.Log.LogInfo((object)"Non-scene objects cached in");
					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 <CachePeak05Objects>d__8 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public FleaGameObjects <>4__this;

			private Scene <scene>5__1;

			private GameObject[] <>s__2;

			private int <>s__3;

			private GameObject <root>5__4;

			private IEnumerator <>s__5;

			private Transform <child>5__6;

			private GameObject <heroDetector>5__7;

			private float <ballZ>5__8;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>s__2 = null;
				<root>5__4 = null;
				<>s__5 = null;
				<child>5__6 = null;
				<heroDetector>5__7 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_017b: 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_01ca: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bf: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = null;
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<scene>5__1 = SceneManager.GetActiveScene();
					<>s__2 = ((Scene)(ref <scene>5__1)).GetRootGameObjects();
					for (<>s__3 = 0; <>s__3 < <>s__2.Length; <>s__3++)
					{
						<root>5__4 = <>s__2[<>s__3];
						if (((Object)<root>5__4).name == "chair_lift (7)")
						{
							<>s__5 = <root>5__4.transform.GetEnumerator();
							try
							{
								while (<>s__5.MoveNext())
								{
									<child>5__6 = (Transform)<>s__5.Current;
									if (((Object)<child>5__6).name.Contains("main_carriage"))
									{
										cachedLiftGO = ((Component)<child>5__6).gameObject;
										break;
									}
									<child>5__6 = null;
								}
							}
							finally
							{
								if (<>s__5 is IDisposable disposable)
								{
									disposable.Dispose();
								}
							}
							<>s__5 = null;
						}
						if (((Object)<root>5__4).name == "Peak_Break_white_ball (6)")
						{
							<heroDetector>5__7 = Object.Instantiate<GameObject>(<root>5__4.gameObject);
							((Object)<heroDetector>5__7.gameObject).name = "Hornet Detector";
							<ballZ>5__8 = <root>5__4.gameObject.transform.position.z;
							<heroDetector>5__7.transform.position = new Vector3(162f, 80f, <ballZ>5__8);
							<heroDetector>5__7.transform.localScale = new Vector3(2f, 2f, 1f);
							<heroDetector>5__7 = null;
						}
						if (((Object)<root>5__4).name.Contains("Peaks Drifter"))
						{
							cachedDrifterGO = <root>5__4.gameObject;
							drifterHit = cachedDrifterGO.GetComponent<EnemyHitEffectsRegular>();
						}
						<root>5__4 = null;
					}
					<>s__2 = null;
					TagTheFleas.Log.LogInfo((object)"Peak_05 objects cached in");
					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 FleaGameObjects instance;

		public static GameObject festiveMusic;

		public static GameObject cachedLiftGO;

		public static GameObject cachedDrifterGO;

		public static EnemyHitEffectsRegular drifterHit;

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
		}

		public void CacheFleaGameObjects()
		{
			((MonoBehaviour)this).StartCoroutine(CacheNonSceneObjects());
			((MonoBehaviour)this).StartCoroutine(CachePeak05Objects());
		}

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

		[IteratorStateMachine(typeof(<CachePeak05Objects>d__8))]
		private IEnumerator CachePeak05Objects()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CachePeak05Objects>d__8(0)
			{
				<>4__this = this
			};
		}
	}
	public class FleaSpawner : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <FleaAppear>d__11 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public GameObject flea;

			public FleaSpawner <>4__this;

			private Rigidbody2D <rb>5__1;

			private float <vX>5__2;

			private float <vY>5__3;

			private tk2dSprite <sp>5__4;

			private float <duration>5__5;

			private float <interval>5__6;

			private float <t>5__7;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				//IL_003e: Expected O, but got Unknown
				//IL_0184: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(1f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<rb>5__1 = flea.GetComponent<Rigidbody2D>();
					<vX>5__2 = Random.Range(0f, 5f);
					<vY>5__3 = Random.Range(0f, 10f);
					<rb>5__1.linearVelocityX = <vX>5__2;
					<rb>5__1.linearVelocityY = <vY>5__3;
					<sp>5__4 = flea.GetComponent<tk2dSprite>();
					<duration>5__5 = 2f;
					<interval>5__6 = 0f;
					break;
				case 2:
					<>1__state = -1;
					<interval>5__6 += Time.deltaTime;
					<t>5__7 = <interval>5__6 / <duration>5__5;
					<rb>5__1.linearVelocityX = Mathf.Lerp(<vX>5__2, 0f, <t>5__7);
					<rb>5__1.linearVelocityY = Mathf.Lerp(<vY>5__3, 0f, <t>5__7);
					((tk2dBaseSprite)<sp>5__4).color = new Color(1f, 1f, 1f, Mathf.Lerp(0f, 1f, <t>5__7));
					flea.transform.localRotation = Quaternion.Euler(0f, Mathf.Lerp(-90f, 0f, <t>5__7), 0f);
					flea.transform.localScale = new Vector3(1f, Mathf.Lerp(0f, 1f, <t>5__7), 1f);
					break;
				}
				if (<interval>5__6 < <duration>5__5)
				{
					<>2__current = null;
					<>1__state = 2;
					return true;
				}
				<rb>5__1.linearVelocityX = Random.Range(5f, 20f);
				<rb>5__1.linearVelocityY = Random.Range(10f, 15f);
				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 <FleasEnterArena>d__9 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public FleaSpawner <>4__this;

			private GameObject <tagFleas>5__1;

			private GameObject <awoo>5__2;

			private HealthManager <hm>5__3;

			private tk2dSprite <sp>5__4;

			private AudioSource <musicSource>5__5;

			private int <i>5__6;

			private Vector3 <pos>5__7;

			private GameObject <tagFlea>5__8;

			private PlayMakerFixedUpdate <playUpdate>5__9;

			private Rigidbody2D <rb>5__10;

			private CircleCollider2D <bounceCol>5__11;

			private FlyAwayOnTag <trigger>5__12;

			private EnemyHitEffectsRegular <fleaHit>5__13;

			private EnemyHitEffectsRegular <giantFleaHit>5__14;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<tagFleas>5__1 = null;
				<awoo>5__2 = null;
				<hm>5__3 = null;
				<sp>5__4 = null;
				<musicSource>5__5 = null;
				<tagFlea>5__8 = null;
				<playUpdate>5__9 = null;
				<rb>5__10 = null;
				<bounceCol>5__11 = null;
				<trigger>5__12 = null;
				<fleaHit>5__13 = null;
				<giantFleaHit>5__14 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Expected O, but got Unknown
				//IL_0104: Unknown result type (might be due to invalid IL or missing references)
				//IL_0159: Unknown result type (might be due to invalid IL or missing references)
				//IL_018a: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_022e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0233: Unknown result type (might be due to invalid IL or missing references)
				//IL_05d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_05df: Expected O, but got Unknown
				//IL_053d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0560: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_0319: Unknown result type (might be due to invalid IL or missing references)
				//IL_047b: Unknown result type (might be due to invalid IL or missing references)
				//IL_04ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0517: Unknown result type (might be due to invalid IL or missing references)
				//IL_0521: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<tagFleas>5__1 = new GameObject("Tag Fleas");
					<tagFleas>5__1.transform.SetParent(TagTheFleas.playGround.transform);
					<awoo>5__2 = ManagedAssetExtensions.InstantiateAsset<GameObject>(TagTheFleas.fleaAwooGO);
					((Object)<awoo>5__2.gameObject).name = "Awoo";
					callOutFSM = PlayMakerFSM.FindFsmOnGameObject(<awoo>5__2, "Call Out");
					<>4__this.awooSource = <awoo>5__2.GetComponent<AudioSource>();
					<awoo>5__2.SetActive(false);
					giantFlea = ManagedAssetExtensions.InstantiateAsset<GameObject>(TagTheFleas.giantFleaGO);
					((Object)giantFlea.gameObject).name = "Giant Flea";
					giantFlea.transform.SetParent(<tagFleas>5__1.transform);
					giantFlea.transform.position = new Vector3(152f, 82f, 0f);
					<hm>5__3 = giantFlea.GetComponent<HealthManager>();
					<hm>5__3.hp = 9999;
					<sp>5__4 = giantFlea.GetComponentInChildren<tk2dSprite>();
					((tk2dBaseSprite)<sp>5__4).color = new Color(1f, 1f, 1f, 0f);
					((Behaviour)<sp>5__4).enabled = true;
					giantFlea.transform.localRotation = Quaternion.Euler(0f, -90f, 0f);
					giantFlea.transform.localScale = new Vector3(1f, 0.01f, 1f);
					giantFleaReady = false;
					giantFlea.SetActive(true);
					((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.GiantFleaAppear(giantFlea));
					<i>5__6 = 0;
					break;
				case 1:
					<>1__state = -1;
					fleaData[<tagFlea>5__8] = (<pos>5__7, new Vector2(Random.Range(-1f, 1f), Random.Range(-1f, 1f)), false);
					<tagFlea>5__8 = null;
					<playUpdate>5__9 = null;
					<rb>5__10 = null;
					<bounceCol>5__11 = null;
					<trigger>5__12 = null;
					<fleaHit>5__13 = null;
					<giantFleaHit>5__14 = null;
					<i>5__6++;
					break;
				}
				if (<i>5__6 < TagTheFleas.numFleas.Value)
				{
					<pos>5__7 = new Vector3(146f + Random.Range(0f, 1f), 72f + Random.Range(1f, 8f), Random.Range(-0.2f, 0.2f));
					<tagFlea>5__8 = ManagedAssetExtensions.InstantiateAsset<GameObject>(TagTheFleas.fleaGO);
					<tagFlea>5__8.transform.SetParent(<tagFleas>5__1.transform);
					((Object)<tagFlea>5__8).name = $"Tag Flea {<i>5__6 + 1}";
					if ((Object)(object)<>4__this.awooSource != (Object)null)
					{
						<tagFlea>5__8.AddComponent<AudioSource>();
					}
					<tagFlea>5__8.transform.position = <pos>5__7;
					Physics2D.IgnoreLayerCollision(<tagFlea>5__8.layer, 17, false);
					<playUpdate>5__9 = <tagFlea>5__8.GetComponent<PlayMakerFixedUpdate>();
					((Behaviour)<playUpdate>5__9).enabled = false;
					<rb>5__10 = <tagFlea>5__8.GetComponent<Rigidbody2D>();
					<rb>5__10.gravityScale = 0f;
					<rb>5__10.linearVelocity = Vector2.zero;
					<rb>5__10.constraints = (RigidbodyConstraints2D)4;
					<rb>5__10.collisionDetectionMode = (CollisionDetectionMode2D)1;
					<tagFlea>5__8.layer = LayerMask.NameToLayer("Enemies");
					<bounceCol>5__11 = <tagFlea>5__8.GetComponent<CircleCollider2D>();
					if ((Object)(object)<bounceCol>5__11 == (Object)null)
					{
						<bounceCol>5__11 = <tagFlea>5__8.AddComponent<CircleCollider2D>();
					}
					((Behaviour)<bounceCol>5__11).enabled = true;
					((Collider2D)<bounceCol>5__11).isTrigger = false;
					CircleCollider2D obj = <bounceCol>5__11;
					obj.radius *= 0.5f;
					<trigger>5__12 = <tagFlea>5__8.AddComponent<FlyAwayOnTag>();
					<trigger>5__12.Init(<tagFlea>5__8);
					<fleaHit>5__13 = <tagFlea>5__8.gameObject.AddComponent<EnemyHitEffectsRegular>();
					<giantFleaHit>5__14 = giantFlea.GetComponent<EnemyHitEffectsRegular>();
					if ((Object)(object)<giantFleaHit>5__14.Profile != (Object)null)
					{
						<fleaHit>5__13.Profile = <giantFleaHit>5__14.Profile;
					}
					<hm>5__3 = <tagFlea>5__8.gameObject.AddComponent<HealthManager>();
					<hm>5__3.IsInvincible = true;
					<sp>5__4 = <tagFlea>5__8.GetComponent<tk2dSprite>();
					((tk2dBaseSprite)<sp>5__4).color = new Color(1f, 1f, 1f, 0f);
					((Behaviour)<sp>5__4).enabled = true;
					<tagFlea>5__8.transform.localRotation = Quaternion.Euler(0f, -90f, 0f);
					<tagFlea>5__8.transform.localScale = new Vector3(1f, 0.01f, 1f);
					<tagFlea>5__8.SetActive(true);
					((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.FleaAppear(<tagFlea>5__8));
					<>2__current = (object)new WaitForSeconds(Random.Range(0.05f, 0.1f));
					<>1__state = 1;
					return true;
				}
				musicInstance = new GameObject("Flea Game Music");
				musicInstance.transform.SetParent(TagTheFleas.playGround.transform);
				<musicSource>5__5 = musicInstance.AddComponent<AudioSource>();
				musicInstance.SetActive(true);
				<musicSource>5__5.loop = true;
				<musicSource>5__5.volume = 1f;
				<musicSource>5__5.clip = ((IEnumerable<AudioClip>)Resources.FindObjectsOfTypeAll<AudioClip>()).FirstOrDefault((Func<AudioClip, bool>)((AudioClip c) => ((Object)c).name == "Pinstress Battle"));
				<musicSource>5__5.Play();
				boidRun = true;
				((MonoBehaviour)<>4__this).StartCoroutine(BoidSimulation.instance.Boid());
				TagTheFleas.Log.LogInfo((object)"Fleas spawned, starting the game");
				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 <GiantFleaAppear>d__10 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public GameObject flea;

			public FleaSpawner <>4__this;

			private PlayMakerFSM <controlFSM>5__1;

			private tk2dSprite <sp>5__2;

			private float <duration>5__3;

			private float <interval>5__4;

			private float <t>5__5;

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

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

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

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

			private bool MoveNext()
			{
				//IL_019a: Unknown result type (might be due to invalid IL or missing references)
				//IL_01df: Unknown result type (might be due to invalid IL or missing references)
				//IL_0214: Unknown result type (might be due to invalid IL or missing references)
				//IL_0259: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
				//IL_010d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0285: Unknown result type (might be due to invalid IL or missing references)
				//IL_029b: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<controlFSM>5__1 = PlayMakerFSM.FindFsmOnGameObject(flea, "Control");
					if ((Object)(object)<controlFSM>5__1 != (Object)null)
					{
						((Behaviour)<controlFSM>5__1).enabled = true;
						<>2__current = null;
						<>1__state = 1;
						return true;
					}
					goto IL_0098;
				case 1:
					<>1__state = -1;
					<controlFSM>5__1.SetState("Idle");
					((Behaviour)<controlFSM>5__1).enabled = false;
					goto IL_0098;
				case 2:
					{
						<>1__state = -1;
						<interval>5__4 += Time.deltaTime;
						<t>5__5 = <interval>5__4 / <duration>5__3;
						((tk2dBaseSprite)<sp>5__2).color = new Color(1f, 1f, 1f, Mathf.Lerp(0f, 1f, <t>5__5));
						flea.transform.localRotation = Quaternion.Euler(0f, Mathf.Lerp(90f, 0f, <t>5__5), Mathf.Lerp(-30f, 0f, <t>5__5));
						flea.transform.localScale = new Vector3(1f, Mathf.Lerp(0f, 1f, <t>5__5), 1f);
						flea.transform.position = new Vector3(Mathf.Lerp(152f, 153f, <t>5__5), Mathf.Lerp(82f, 81f, <t>5__5), 0f);
						break;
					}
					IL_0098:
					<sp>5__2 = flea.GetComponentInChildren<tk2dSprite>();
					flea.transform.localRotation = Quaternion.Euler(0f, -90f, 0f);
					flea.transform.localScale = new Vector3(1f, 0.01f, 1f);
					flea.transform.position = new Vector3(152f, 82f, 0f);
					<duration>5__3 = 0.5f;
					<interval>5__4 = 0f;
					break;
				}
				if (<interval>5__4 < <duration>5__3)
				{
					<>2__current = null;
					<>1__state = 2;
					return true;
				}
				flea.transform.localRotation = Quaternion.identity;
				flea.transform.localScale = Vector3.one;
				flea.transform.position = new Vector3(153f, 81f, 0f);
				((tk2dBaseSprite)<sp>5__2).color = Color.white;
				giantFleaReady = true;
				if ((Object)(object)<controlFSM>5__1 != (Object)null)
				{
					((Behaviour)<controlFSM>5__1).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();
			}
		}

		public static FleaSpawner instance;

		public static PlayMakerFSM callOutFSM;

		private AudioSource awooSource;

		public static GameObject musicInstance;

		public static GameObject giantFlea;

		public static bool boidRun = true;

		public static bool giantFleaReady = false;

		public static Dictionary<GameObject, (Vector3 position, Vector2 velocity, bool collided)> fleaData = new Dictionary<GameObject, (Vector3, Vector2, bool)>();

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
		}

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

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

		[IteratorStateMachine(typeof(<FleaAppear>d__11))]
		private IEnumerator FleaAppear(GameObject flea)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <FleaAppear>d__11(0)
			{
				<>4__this = this,
				flea = flea
			};
		}
	}
	public class FlyAwayOnTag : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <TagFlea>d__4 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public GameObject obj;

			public FlyAwayOnTag <>4__this;

			private EnemyHitEffectsRegular <fleaHit>5__1;

			private HitInstance <fleaHitInstance>5__2;

			private PlayMakerFSM <fsm>5__3;

			private Collider2D[] <>s__4;

			private int <>s__5;

			private Collider2D <colChild>5__6;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				<fleaHit>5__1 = null;
				<fleaHitInstance>5__2 = default(HitInstance);
				<fsm>5__3 = null;
				<>s__4 = null;
				<colChild>5__6 = null;
				<>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_01c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cd: Expected O, but got Unknown
				//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0143: Unknown result type (might be due to invalid IL or missing references)
				//IL_014d: Expected O, but got Unknown
				//IL_0192: Unknown result type (might be due to invalid IL or missing references)
				//IL_019c: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.1f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>s__4 = obj.GetComponentsInChildren<Collider2D>();
					for (<>s__5 = 0; <>s__5 < <>s__4.Length; <>s__5++)
					{
						<colChild>5__6 = <>s__4[<>s__5];
						((Behaviour)<colChild>5__6).enabled = false;
						<colChild>5__6 = null;
					}
					<>s__4 = null;
					<fleaHit>5__1 = obj.gameObject.GetComponent<EnemyHitEffectsRegular>();
					<fleaHitInstance>5__2 = new HitInstance
					{
						DamageDealt = 1
					};
					<fleaHit>5__1.ReceiveHitEffect(<fleaHitInstance>5__2, Vector2.zero);
					((Behaviour)<fleaHit>5__1).enabled = true;
					<fsm>5__3 = PlayMakerFSM.FindFsmOnGameObject(obj, "Behaviour");
					((Behaviour)<fsm>5__3).enabled = false;
					<fsm>5__3.Fsm = new Fsm(FleaSpawner.callOutFSM.Fsm, (FsmVariables)null);
					<fsm>5__3.FsmName = FleaSpawner.callOutFSM.FsmName;
					<fsm>5__3.Fsm.InitData();
					((Behaviour)<fsm>5__3).enabled = true;
					<>2__current = (object)new WaitForSeconds(Random.Range(0.1f, 1f));
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					<fsm>5__3.SendEvent("TOUCH");
					<>2__current = (object)new WaitForSeconds(6f);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -1;
					Object.Destroy((Object)(object)obj);
					FleaSpawner.fleaData.Remove(obj);
					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 GameObject obj;

		private bool tagged;

		public void Init(GameObject gameObject)
		{
			obj = gameObject;
		}

		private void OnTriggerEnter2D(Collider2D col)
		{
			if (!tagged && LayerMask.LayerToName(((Component)col).gameObject.layer).Contains("Attack"))
			{
				tagged = true;
				((MonoBehaviour)this).StartCoroutine(TagFlea(obj));
				BoidSimulation.SetBoidCollided(obj);
			}
		}

		[IteratorStateMachine(typeof(<TagFlea>d__4))]
		private IEnumerator TagFlea(GameObject obj)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <TagFlea>d__4(0)
			{
				<>4__this = this,
				obj = obj
			};
		}
	}
	[BepInPlugin("lagerthon.TagTheFleas", "Tag Flea Game", "1.0.2")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class TagTheFleas : BaseUnityPlugin
	{
		public static TagTheFleas instance;

		public static ManualLogSource Log;

		private static ConfigEntry<KeyboardShortcut> scoreResetKey;

		public static ConfigEntry<string> gameName;

		public static ConfigEntry<string> sethName;

		public static ConfigEntry<string> vogName;

		public static ConfigEntry<string> leaderName;

		public static ConfigEntry<string> shortName;

		public static ConfigEntry<string> tallName;

		public static ConfigEntry<string> krattName;

		public static ConfigEntry<bool> enableMod;

		public static ManagedAsset<GameObject> fleaGO;

		public static ManagedAsset<GameObject> fleaAwooGO;

		public static ManagedAsset<GameObject> giantFleaGO;

		public static ManagedAsset<GameObject> upDraftGO;

		public static ManagedAsset<GameObject> scoreBoardGO;

		public static ManagedAsset<GameObject> scoreContainerGO;

		public static GameObject playGround;

		public static bool boidCoroutineStarted = false;

		public static ConfigEntry<int> numFleas;

		public static ConfigEntry<float> alignStrength;

		public static ConfigEntry<float> cohesionStrength;

		public static ConfigEntry<float> separationStrength;

		public static ConfigEntry<float> playerRunRadius;

		public static ConfigEntry<float> fleeStrength;

		public static ConfigEntry<float> wallStrength;

		public static ConfigEntry<float> camZoomLevel;

		public static GameObject tagGameGO;

		public static int[] times = new int[0];

		public static string filePath = Path.Combine(PluginDirectory, "ScoreBoard", "BoidTimes.txt");

		public static string PluginDirectory => Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

		private void Awake()
		{
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Expected O, but got Unknown
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Expected O, but got Unknown
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Expected O, but got Unknown
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Expected O, but got Unknown
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Expected O, but got Unknown
			//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Expected O, but got Unknown
			//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Expected O, but got Unknown
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0344: Expected O, but got Unknown
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0499: Expected O, but got Unknown
			//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0517: Unknown result type (might be due to invalid IL or missing references)
			//IL_051d: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			enableMod = ((BaseUnityPlugin)this).Config.Bind<bool>("Enable Mod", "Enable Mod", true, "Key used to enable or disable the mod");
			gameName = ((BaseUnityPlugin)this).Config.Bind<string>("Names", "Game", "Tag", "Changes game's name");
			scoreResetKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Score Reset", "Reset flea game score", new KeyboardShortcut((KeyCode)304, Array.Empty<KeyCode>()), "Key to reset flea game scores");
			sethName = ((BaseUnityPlugin)this).Config.Bind<string>("Names", "Seth", "Seth The Legend", "Changes Seth's name");
			vogName = ((BaseUnityPlugin)this).Config.Bind<string>("Names", "Vog", "Warrior", "Changes Vog' name");
			leaderName = ((BaseUnityPlugin)this).Config.Bind<string>("Names", "Mooshka", "Leader", "Changes Mooshka's name");
			shortName = ((BaseUnityPlugin)this).Config.Bind<string>("Names", "Grishkin", "Potion Master", "Changes Grishkin's name");
			tallName = ((BaseUnityPlugin)this).Config.Bind<string>("Names", "Varga", "Lazy", "Changes Varga's name");
			krattName = ((BaseUnityPlugin)this).Config.Bind<string>("Names", "Kratt", "Kreep", "Changes Kratt's name");
			numFleas = ((BaseUnityPlugin)this).Config.Bind<int>("Fleas", "Number of fleas to spawn", 10, new ConfigDescription("Set how many fleas to spawn. Your computer's performance will matter a lot on how many fleas it can handle.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 50), Array.Empty<object>()));
			alignStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Flea Boid", "Strength Velocity Align", 1f, new ConfigDescription("How strongly fleas fly together.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			cohesionStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Flea Boid", "Strength Attraction", 1f, new ConfigDescription("How strongly fleas attract each other.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			wallStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Flea Boid", "Strength Wall", 50f, new ConfigDescription("How strongly fleas fly away from the walls.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			separationStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Flea Boid", "Strength Separation", 5f, new ConfigDescription("How strongly a flea repel its nearest flea.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			fleeStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Flea Boid", "Strength  flee", 10f, new ConfigDescription("How strongly fleas fly away from Hornet.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			playerRunRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Flea Boid", "Distance from Hornet", 10f, new ConfigDescription("From how far fleas can detect Hornet.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 50f), Array.Empty<object>()));
			camZoomLevel = ((BaseUnityPlugin)this).Config.Bind<float>("Visuals", "Camera Zoom Level", 0.5f, new ConfigDescription("Zooms out the camera when the game begins", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 1f), Array.Empty<object>()));
			upDraftGO = ManagedAsset<GameObject>.FromSceneAsset("bone_east_08", "Updraft Region (9)");
			if (upDraftGO != null)
			{
				Log.LogInfo((object)("Found: " + upDraftGO.Key));
			}
			fleaGO = ManagedAsset<GameObject>.FromSceneAsset("bone_10", "Black Thread States Thread Only Variant/Normal World/Caravan/Fleas/Group1/Caravan Troupe Flea Saved 1");
			if (fleaGO != null)
			{
				Log.LogInfo((object)("Found: " + fleaGO.Key));
			}
			fleaAwooGO = ManagedAsset<GameObject>.FromSceneAsset("dock_16", "Flea Rescue Sleeping");
			if (fleaAwooGO != null)
			{
				Log.LogInfo((object)("Found: " + fleaAwooGO.Key));
			}
			giantFleaGO = ManagedAsset<GameObject>.FromSceneAsset("arborium_08", "Giant Flea Scene/Giant Flea");
			if (giantFleaGO != null)
			{
				Log.LogInfo((object)("Found: " + giantFleaGO.Key));
			}
			scoreBoardGO = ManagedAsset<GameObject>.FromSceneAsset("aqueduct_05_festival", "Caravan_States/Flea Festival/Flea Festival Scoreboard");
			if (scoreBoardGO != null)
			{
				Log.LogInfo((object)("Found: " + scoreBoardGO.Key));
			}
			tagGameGO = new GameObject("Tag Game");
			Object.DontDestroyOnLoad((Object)(object)tagGameGO);
			tagGameGO.AddComponent<FleaGameObjects>();
			tagGameGO.AddComponent<FleaGameArena>();
			tagGameGO.AddComponent<FleaSpawner>();
			tagGameGO.AddComponent<BoidSimulation>();
			tagGameGO.transform.position = new Vector3(0f, 0f, 0f);
			tagGameGO.SetActive(true);
			SceneManager.sceneLoaded += OnSceneLoaded;
			Harmony val = new Harmony("lagerthon.TagTheFleas");
			val.PatchAll();
			Log.LogInfo((object)"Tag Flea Game loaded");
		}

		private void Update()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			KeyboardShortcut value = scoreResetKey.Value;
			if (((KeyboardShortcut)(ref value)).IsDown())
			{
				if (File.Exists(filePath))
				{
					File.WriteAllText(filePath, "");
				}
				times = new int[0];
			}
		}

		private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			if (!enableMod.Value)
			{
				return;
			}
			if ((Object)(object)playGround != (Object)null)
			{
				Object.Destroy((Object)(object)playGround);
				FleaSpawner.fleaData.Clear();
				((MonoBehaviour)this).StartCoroutine(FleaGameArena.instance.CamZoom(1f));
			}
			BoidSimulation.timerRunning = false;
			if (!(((Scene)(ref scene)).name == "Peak_05"))
			{
				return;
			}
			Log.LogInfo((object)"Hornet in Peak 05, caching flea game objects");
			FleaSpawner.giantFleaReady = false;
			string directoryName = Path.GetDirectoryName(filePath);
			if (!Directory.Exists(directoryName))
			{
				Directory.CreateDirectory(directoryName);
			}
			if (!File.Exists(filePath))
			{
				File.WriteAllText(filePath, string.Empty);
			}
			if (File.Exists(filePath))
			{
				times = (from t in File.ReadAllLines(filePath).Select(delegate(string line)
					{
						string[] array = line.Split(',');
						if (array.Length < 2)
						{
							return null;
						}
						int result;
						return int.TryParse(array[1], out result) ? new int?(result) : null;
					})
					where t.HasValue
					select t.Value).ToArray();
			}
			FleaGameObjects.instance.CacheFleaGameObjects();
		}
	}
	[HarmonyPatch(typeof(Breakable), "Break")]
	public class BreakablePatch
	{
		private static void Postfix(Breakable __instance)
		{
			if (((Object)((Component)__instance).gameObject).name.Contains("Hornet Detector"))
			{
				FleaGameArena.instance.BuildArena();
				TagTheFleas.Log.LogInfo((object)"Snow ball broke, spawning flea game objects");
			}
		}
	}
	[HarmonyPatch(typeof(AlertRange), "IsHeroInRange")]
	public class AlertRangePatch
	{
		private static bool Prefix(AlertRange __instance, ref bool __result)
		{
			if (!FleaSpawner.giantFleaReady)
			{
				return true;
			}
			Transform parent = ((Component)__instance).transform.parent;
			if ((Object)(object)parent != (Object)null && ((Object)parent).name.Contains("Giant Flea"))
			{
				__result = true;
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(ScoreBoardUI), "Refresh")]
	public class ScoreBoardUIPatch
	{
		private static int[] times;

		private static void Postfix(ScoreBoardUI __instance, Transform[] ___columns)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Expected O, but got Unknown
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name != "Peak_05")
			{
				return;
			}
			times = TagTheFleas.times;
			foreach (Transform item in ((Component)__instance).transform)
			{
				Transform val = item;
				if (!(((Object)val).name == "Container"))
				{
					continue;
				}
				foreach (Transform item2 in ((Component)val).transform)
				{
					Transform val2 = item2;
					if (((Object)val2).name.Contains("Juggle") || ((Object)val2).name.Contains("Bounce") || ((Object)val2).name.Contains("Divider"))
					{
						((Component)val2).gameObject.SetActive(false);
					}
					if (((Object)val2).name == "Back")
					{
						((Component)val2).transform.localScale = new Vector3(1f, 3.5f, 1f);
					}
					if (((Object)val2).name == "Title Dodge")
					{
						((Object)val2).name = "Title Tag";
					}
				}
			}
			Transform val3 = ___columns[2];
			((Object)val3).name = "Column Tag";
			foreach (Transform item3 in val3)
			{
				Transform val4 = item3;
				ScoreBoardUIBadge component = ((Component)val4).GetComponent<ScoreBoardUIBadge>();
				if ((Object)(object)component == (Object)null)
				{
					continue;
				}
				FieldInfo field = typeof(ScoreBoardUIBadge).GetField("score", BindingFlags.Instance | BindingFlags.NonPublic);
				if (field == null)
				{
					continue;
				}
				int num = 0;
				string name = ((Object)val4).name;
				string text = name;
				if (text != null)
				{
					if (text.Contains("Lech"))
					{
						num = ((times.Length != 0) ? times.Max() : 0);
					}
					else
					{
						string text2 = text;
						if (text2.Contains("Tall"))
						{
							num = ((times.Length != 0) ? Mathf.CeilToInt((float)(times.Max() + times.Min()) / 2f) : 0);
						}
						else
						{
							string text3 = text;
							if (text3.Contains("Leader"))
							{
								num = ((times.Length != 0) ? Mathf.CeilToInt((float)times.Average()) : 0);
							}
							else
							{
								string text4 = text;
								if (text4.Contains("Short"))
								{
									num = ((times.Length != 0) ? times[Random.Range(0, times.Length)] : 0);
								}
							}
						}
					}
				}
				field.SetValue(component, num);
			}
			PlayerData.instance.fleaGames_dodging_played = true;
			PlayerData.instance.fleaGames_dodging_highscore = ((times.Length != 0) ? Mathf.CeilToInt((float)times[times.Length - 1]) : 0);
			ScoreBoardUIBadgeBase[] componentsInChildren = ((Component)val3).GetComponentsInChildren<ScoreBoardUIBadgeBase>(true);
			List<ScoreBoardUIBadgeBase> list = (from b in componentsInChildren
				orderby b.Score, (b is ScoreBoardUIBadgeHero) ? 1 : 0
				select b).ToList();
			for (int i = 0; i < list.Count; i++)
			{
				((Component)list[i]).transform.SetSiblingIndex(i);
			}
		}
	}
	[HarmonyPatch]
	internal class SethChampConstPatch
	{
		private static int[] times;

		private static MethodBase TargetMethod()
		{
			MethodInfo method = typeof(Constants).GetMethod("GetConstantValue");
			return method.MakeGenericMethod(typeof(int));
		}

		private static bool Prefix(string variableName, ref int __result)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name != "Peak_05")
			{
				return true;
			}
			int[] array = TagTheFleas.times;
			if (variableName.Contains("FLEA_FESTIVAL_SETH"))
			{
				__result = ((array.Length != 0) ? array.Min() : 0);
				return false;
			}
			if (variableName.Contains("FLEA_FESTIVAL_CHAMP"))
			{
				if (array.Length == 0)
				{
					__result = 0;
				}
				else
				{
					int key = (from t in array
						group t by t into g
						orderby g.Count() descending, g.Key
						select g).First().Key;
					__result = key;
				}
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(Language), "Get", new Type[]
	{
		typeof(string),
		typeof(string)
	})]
	public static class LanguagePatch
	{
		private static readonly Dictionary<string, Func<string>> CaravanOverrides = new Dictionary<string, Func<string>> { 
		{
			"FESTIVAL_BOARD_TITLE_DODGE",
			() => TagTheFleas.gameName.Value
		} };

		private static readonly Dictionary<string, Func<string>> TitleOverrides = new Dictionary<string, Func<string>>
		{
			{
				"SETH_MAIN",
				() => TagTheFleas.sethName.Value
			},
			{
				"FLEA_TRACKER_MAIN",
				() => TagTheFleas.vogName.Value
			},
			{
				"FLEAMASTER_MAIN",
				() => TagTheFleas.leaderName.Value
			},
			{
				"FLEAMEMBER_SHORT_MAIN",
				() => TagTheFleas.shortName.Value
			},
			{
				"FLEAMEMBER_TALL_MAIN",
				() => TagTheFleas.tallName.Value
			},
			{
				"FLEA_LECH_MAIN",
				() => TagTheFleas.krattName.Value
			}
		};

		[HarmonyPostfix]
		public static void Postfix(string key, string sheetTitle, ref string __result)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name != "Peak_05")
			{
				return;
			}
			Func<string> value2;
			if (!(sheetTitle == "Caravan"))
			{
				if (sheetTitle == "Titles" && TitleOverrides.TryGetValue(key, out Func<string> value))
				{
					__result = value();
				}
			}
			else if (CaravanOverrides.TryGetValue(key, out value2))
			{
				__result = value2();
			}
		}
	}
}