Decompiled source of ModdedTools FatherOfTheFlame v1.4.2

ThreadsoftheFlame/HKTestMod1.dll

Decompiled a year 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.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using GlobalEnums;
using HarmonyLib;
using HutongGames.PlayMaker.Actions;
using InControl;
using NeedolinWispfires;
using PhaseStepDash;
using ProjectileLabNS;
using TeamCherry.Localization;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Networking;
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: AssemblyTitle("HKTestMod1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HKTestMod1")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("13ac8ee8-84a7-4c6f-9726-58a612930d2d")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("com.sammods.coordprobe", "Coord Probe", "1.0.0")]
public class CoordProbe : BaseUnityPlugin
{
	private void Update()
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown((KeyCode)112))
		{
			HeroController instance = HeroController.instance;
			if (Object.op_Implicit((Object)(object)instance))
			{
				Vector3 position = ((Component)instance).transform.position;
				Scene activeScene = SceneManager.GetActiveScene();
				string name = ((Scene)(ref activeScene)).name;
				((BaseUnityPlugin)this).Logger.LogInfo((object)$"[CoordProbe] Scene='{name}', Position=({position.x:F2}, {position.y:F2})");
			}
		}
	}
}
internal static class WispExternalAudio
{
	private static bool _tried;

	public static AudioClip RewindClip { get; private set; }

	public static AudioClip ChantClip { get; private set; }

	public static void TryLoad(ManualLogSource log, BaseUnityPlugin plugin)
	{
		if (!_tried)
		{
			_tried = true;
			string directoryName = Path.GetDirectoryName(plugin.Info.Location);
			RewindClip = LoadOne(log, Path.Combine(directoryName, "rewind.wav"), (AudioType)20);
			ChantClip = LoadOne(log, Path.Combine(directoryName, "chant.wav"), (AudioType)20);
		}
	}

	private static AudioClip LoadOne(ManualLogSource log, string path, AudioType type)
	{
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			if (!File.Exists(path))
			{
				return null;
			}
			string text = "file://" + path.Replace("\\", "/");
			UnityWebRequest audioClip = UnityWebRequestMultimedia.GetAudioClip(text, type);
			UnityWebRequestAsyncOperation val = audioClip.SendWebRequest();
			while (!((AsyncOperation)val).isDone)
			{
			}
			if (audioClip.isNetworkError || audioClip.isHttpError)
			{
				if (log != null)
				{
					log.LogWarning((object)("[WispAudio] Failed to load " + path + ": " + audioClip.error));
				}
				return null;
			}
			AudioClip content = DownloadHandlerAudioClip.GetContent(audioClip);
			if (log != null)
			{
				log.LogInfo((object)("[WispAudio] Loaded " + Path.GetFileName(path)));
			}
			return content;
		}
		catch (Exception ex)
		{
			if (log != null)
			{
				log.LogWarning((object)("[WispAudio] Exception loading " + path + ": " + ex.Message));
			}
			return null;
		}
	}
}
internal static class WispAudioUtils
{
	public static void PlayOneShot(AudioClip clip, float volume = 1f)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		if (!((Object)(object)clip == (Object)null))
		{
			GameObject val = new GameObject("Wisp_AudioOneShot");
			Object.DontDestroyOnLoad((Object)(object)val);
			AudioSource val2 = val.AddComponent<AudioSource>();
			val2.playOnAwake = false;
			val2.ignoreListenerPause = true;
			val2.dopplerLevel = 0f;
			val2.rolloffMode = (AudioRolloffMode)1;
			val2.minDistance = 1f;
			val2.maxDistance = 100000f;
			val2.spatialBlend = 0f;
			val2.volume = volume;
			val2.pitch = 1f;
			val2.PlayOneShot(clip);
			float num = Mathf.Max(clip.length, 0.25f) + 0.15f;
			Object.Destroy((Object)(object)val, num);
		}
	}
}
[HarmonyPatch]
internal static class ChantPatch
{
	private static bool _lastPlaying;

	private static MethodBase TargetMethod()
	{
		return AccessTools.Method("NeedolinWispfires.NeedolinWispfiresPlugin+WispBus:SetPlaying", (Type[])null, (Type[])null);
	}

	private static void Postfix()
	{
		bool flag = false;
		try
		{
			flag = NeedolinWispfiresPlugin.WispBus.IsPlaying;
		}
		catch
		{
		}
		if (flag && !_lastPlaying)
		{
			WispAudioUtils.PlayOneShot(WispExternalAudio.ChantClip);
		}
		_lastPlaying = flag;
	}
}
namespace WispTester
{
	[BepInPlugin("com.sammods.wisptester", "Wisp Tester", "1.4.0")]
	public class WispTesterPlugin : BaseUnityPlugin
	{
		private static class DamageHooker
		{
			private static Harmony _h;

			private static bool _patched;

			internal static void EnsurePatched(ManualLogSource log)
			{
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Expected O, but got Unknown
				//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bf: Expected O, but got Unknown
				if (_patched)
				{
					return;
				}
				_h = new Harmony("com.sammods.wisptester.damage");
				Type type = AccessTools.TypeByName("HeroController");
				if (type == null)
				{
					if (log != null)
					{
						log.LogWarning((object)"[WispTester] HeroController not found for damage hook.");
					}
					return;
				}
				int num = 0;
				string[] array = new string[4] { "TakeDamage", "TakeHit", "Hit", "ApplyDamage" };
				for (int i = 0; i < array.Length; i++)
				{
					MethodInfo methodInfo = AccessTools.Method(type, array[i], (Type[])null, (Type[])null);
					if (!(methodInfo == null))
					{
						_h.Patch((MethodBase)methodInfo, (HarmonyMethod)null, new HarmonyMethod(typeof(DamageHooker), "Post_HeroDamaged", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
						num++;
					}
				}
				if (num > 0)
				{
					_patched = true;
					if (log != null)
					{
						log.LogInfo((object)$"[WispTester] Damage hook active ({num} method(s)).");
					}
				}
				else if (log != null)
				{
					log.LogWarning((object)"[WispTester] No damage method found to hook; playing won't auto-stop on damage.");
				}
			}

			internal static void Unpatch()
			{
				try
				{
					Harmony h = _h;
					if (h != null)
					{
						h.UnpatchSelf();
					}
				}
				catch
				{
				}
				_patched = false;
			}

			public static void Post_HeroDamaged()
			{
				if (NeedolinWispfiresPlugin.WispBus.IsPlaying)
				{
					NeedolinWispfiresPlugin.WispBus.SetPlaying(v: false);
				}
			}
		}

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

			private object <>2__current;

			public WispTesterPlugin <>4__this;

			private GameObject <hero>5__1;

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

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

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

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

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if ((Object)(object)HeroController.instance == (Object)null || (Object)(object)((Component)HeroController.instance).gameObject == (Object)null)
				{
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				<hero>5__1 = ((Component)HeroController.instance).gameObject;
				if ((Object)(object)<hero>5__1.GetComponent<WispTargetingSpawner>() == (Object)null)
				{
					<hero>5__1.AddComponent<WispTargetingSpawner>();
					((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"[WispTester] Spawner attached to hero");
				}
				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();
			}
		}

		internal static ManualLogSource Log;

		private void OnEnable()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			SceneManager.sceneLoaded += OnSceneLoaded;
			DamageHooker.EnsurePatched(((BaseUnityPlugin)this).Logger);
			WispExternalAudio.TryLoad(((BaseUnityPlugin)this).Logger, (BaseUnityPlugin)(object)this);
			Harmony val = new Harmony("com.sammods.wispaudio");
			val.PatchAll(typeof(ChantPatch));
			((BaseUnityPlugin)this).Logger.LogInfo((object)"[WispAudio] Rewind + Chant patches loaded.");
		}

		private void OnDisable()
		{
			SceneManager.sceneLoaded -= OnSceneLoaded;
			DamageHooker.Unpatch();
		}

		private void OnSceneLoaded(Scene s, LoadSceneMode m)
		{
			((MonoBehaviour)this).StartCoroutine(AttachAfterHeroReady());
		}

		[IteratorStateMachine(typeof(<AttachAfterHeroReady>d__4))]
		private IEnumerator AttachAfterHeroReady()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <AttachAfterHeroReady>d__4(0)
			{
				<>4__this = this
			};
		}
	}
	public class WispTargetingSpawner : MonoBehaviour
	{
		private class Held
		{
			public GameObject go;

			public Rigidbody2D rb;

			public RigidbodyType2D prevBody;

			public List<Behaviour> fsms;

			public Behaviour light;
		}

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

			private object <>2__current;

			public WispTargetingSpawner <>4__this;

			private int <before>5__1;

			private int <after>5__2;

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

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

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

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

			private bool MoveNext()
			{
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0047: Expected O, but got Unknown
				//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e0: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.5f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					break;
				case 2:
					<>1__state = -1;
					break;
				case 3:
					<>1__state = -1;
					break;
				}
				if (NeedolinWispfiresPlugin.WispBus.IsEquipped && NeedolinWispfiresPlugin.WispBus.IsPlaying)
				{
					<before>5__1 = <>4__this.HeldCount;
					<>4__this.SpawnHeldOnce();
					<after>5__2 = <>4__this.HeldCount;
					if (<after>5__2 > <before>5__1)
					{
						<>4__this.PlayRewindOneShot();
					}
					<>2__current = (object)new WaitForSeconds(Mathf.Max(0.05f, <>4__this.interval));
					<>1__state = 2;
					return true;
				}
				<>2__current = null;
				<>1__state = 3;
				return true;
			}

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

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

		[Header("Spawn (while playing)")]
		public float interval = 1.5f;

		public float ySpawnJitter = 1.5f;

		[Header("Release targeting (when playing stops)")]
		public bool targetRandomEnemy = true;

		public float enemySearchRadius = 10f;

		public LayerMask enemyLayerMask = LayerMask.op_Implicit(-1);

		public bool requireLOS = false;

		public int losMask = 256;

		[Header("Release motion (fallback if no enemy)")]
		public bool randomLeftRight = true;

		public float minHorizDistance = 2f;

		public float maxHorizDistance = 20f;

		public float minReleaseSpeed = 2f;

		public float maxReleaseSpeed = 20f;

		[Header("Prefab fallback")]
		public GameObject fallbackWispPrefab = null;

		[Header("Mini Circles (Held Viz)")]
		public bool showMiniCircles = false;

		public int miniCircleSegments = 32;

		public float miniCircleRadius = 0.25f;

		public float miniCircleLineWidth = 0.05f;

		public Color miniCircleColor = new Color(1f, 0.416f, 0f, 0.9f);

		public bool miniCirclesBehindHero = true;

		public float miniHoverHeight = 1.1f;

		public float miniSpreadX = 1.6f;

		public float miniBobAmplitude = 0.2f;

		public float miniBobSpeed = 3f;

		public float miniFollowLerp = 12f;

		private GameObject _wispPrefab;

		private Coroutine _loop;

		private bool _right = true;

		private readonly List<Held> _held = new List<Held>();

		private readonly List<HealthManager> _enemyBuffer = new List<HealthManager>(32);

		private readonly List<LineRenderer> _miniPool = new List<LineRenderer>();

		private Transform _miniRoot;

		private Vector3 _miniAnchor;

		public int HeldCount => (_held != null) ? _held.Count : 0;

		private void Awake()
		{
			TryResolveWispPrefab();
			EnsureMiniRoot();
		}

		private void OnEnable()
		{
			NeedolinWispfiresPlugin.WispBus.PlayingChanged += OnPlayingChanged;
			NeedolinWispfiresPlugin.WispBus.EquippedChanged += OnEquippedChanged;
			if (_loop == null)
			{
				_loop = ((MonoBehaviour)this).StartCoroutine(Loop());
			}
		}

		private void OnDisable()
		{
			NeedolinWispfiresPlugin.WispBus.PlayingChanged -= OnPlayingChanged;
			NeedolinWispfiresPlugin.WispBus.EquippedChanged -= OnEquippedChanged;
			if (_loop != null)
			{
				((MonoBehaviour)this).StopCoroutine(_loop);
			}
			_loop = null;
			ClearHeld(destroy: true);
			SetAllMiniActive(on: false);
		}

		private void Update()
		{
			UpdateMiniCircles();
		}

		private void OnPlayingChanged(bool playing)
		{
			if (!playing)
			{
				ReleaseAll();
			}
		}

		private void OnEquippedChanged(bool equipped)
		{
			if (!equipped)
			{
				ClearHeld(destroy: true);
				SetAllMiniActive(on: false);
			}
		}

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

		private void PlayRewindOneShot()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			if (!((Object)(object)WispExternalAudio.RewindClip == (Object)null))
			{
				GameObject val = new GameObject("Wisp_Rewind_OneShot");
				Object.DontDestroyOnLoad((Object)(object)val);
				AudioSource val2 = val.AddComponent<AudioSource>();
				val2.playOnAwake = false;
				val2.ignoreListenerPause = true;
				val2.dopplerLevel = 0f;
				val2.rolloffMode = (AudioRolloffMode)1;
				val2.minDistance = 1f;
				val2.maxDistance = 100000f;
				val2.spatialBlend = 0f;
				val2.volume = 0.9f;
				val2.pitch = 1f;
				val2.PlayOneShot(WispExternalAudio.RewindClip);
				float num = Mathf.Max(WispExternalAudio.RewindClip.length, 0.35f) + 0.15f;
				Object.Destroy((Object)(object)val, num);
			}
		}

		private void SpawnHeldOnce()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: 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_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: 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_025a: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = ((Component)this).transform.position + new Vector3(0f, Random.Range(0f - ySpawnJitter, ySpawnJitter), 0f);
			if ((Object)(object)_wispPrefab == (Object)null)
			{
				GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)5);
				((Object)val2).name = "WispDebugQuad_HELD";
				val2.transform.position = val;
				Rigidbody2D val3 = val2.AddComponent<Rigidbody2D>();
				val3.gravityScale = 0f;
				val3.bodyType = (RigidbodyType2D)1;
				_held.Add(new Held
				{
					go = val2,
					rb = val3,
					prevBody = (RigidbodyType2D)1,
					fsms = new List<Behaviour>(),
					light = null
				});
				Debug.Log((object)"[WispTargetingSpawner] HELD DEBUG QUAD (no prefab found)");
				return;
			}
			GameObject val4 = Object.Instantiate<GameObject>(_wispPrefab, val, Quaternion.identity);
			if (!Object.op_Implicit((Object)(object)val4))
			{
				return;
			}
			val4.transform.SetParent((Transform)null, true);
			val4.transform.localScale = Vector3.one;
			val4.transform.rotation = Quaternion.identity;
			Rigidbody2D component = val4.GetComponent<Rigidbody2D>();
			RigidbodyType2D prevBody = (RigidbodyType2D)0;
			if ((Object)(object)component != (Object)null)
			{
				prevBody = component.bodyType;
				component.velocity = Vector2.zero;
				component.angularVelocity = 1f;
				component.gravityScale = 0f;
				component.bodyType = (RigidbodyType2D)1;
			}
			Behaviour val5 = null;
			Component component2 = val4.GetComponent("WispFireballLight");
			if ((Object)(object)component2 != (Object)null)
			{
				val5 = (Behaviour)(object)((component2 is Behaviour) ? component2 : null);
				if ((Object)(object)val5 != (Object)null)
				{
					val5.enabled = false;
				}
			}
			List<Behaviour> list = new List<Behaviour>();
			Component[] componentsInChildren = val4.GetComponentsInChildren<Component>(true);
			foreach (Component val6 in componentsInChildren)
			{
				if ((Object)(object)val6 != (Object)null && ((object)val6).GetType().Name == "PlayMakerFSM")
				{
					Behaviour val7 = (Behaviour)(object)((val6 is Behaviour) ? val6 : null);
					if ((Object)(object)val7 != (Object)null)
					{
						val7.enabled = false;
						list.Add(val7);
					}
				}
			}
			_held.Add(new Held
			{
				go = val4,
				rb = component,
				prevBody = prevBody,
				fsms = list,
				light = val5
			});
			Debug.Log((object)$"[WispTargetingSpawner] HELD wisp (count={_held.Count})");
		}

		private void ReleaseAll()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: 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_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			if (_held.Count == 0)
			{
				return;
			}
			for (int i = 0; i < _held.Count; i++)
			{
				Held held = _held[i];
				if (held == null || (Object)(object)held.go == (Object)null)
				{
					continue;
				}
				Vector3 position = held.go.transform.position;
				GameObject val = null;
				Vector3 val2 = position;
				bool flag = false;
				Vector2 val6;
				if (targetRandomEnemy)
				{
					HealthManager val3 = FindRandomEnemyHM(position, enemySearchRadius, enemyLayerMask);
					if ((Object)(object)val3 != (Object)null)
					{
						Vector2 val4 = Vector2.op_Implicit(val3.TargetPoint);
						if (!requireLOS || !RaycastHit2D.op_Implicit(Physics2D.Linecast(Vector2.op_Implicit(position), val4, losMask)))
						{
							val = ((Component)val3).gameObject;
							val2 = val3.TargetPoint;
							Vector2 val5 = val4 - Vector2.op_Implicit(position);
							val6 = ((Vector2)(ref val5)).normalized;
							if (((Vector2)(ref val6)).sqrMagnitude < 0.0001f)
							{
								val6 = Vector2.right;
							}
							ApplyRelease(held, val6, val, val2, useFire: true);
							flag = true;
						}
					}
				}
				if (!flag)
				{
					val6 = ((randomLeftRight ? (Random.value > 0.5f) : (_right = !_right)) ? Vector2.right : Vector2.left);
					float num = Random.Range(minHorizDistance, maxHorizDistance);
					val2 = position + Vector2.op_Implicit(val6 * num);
					ApplyRelease(held, val6, null, val2, useFire: true);
				}
			}
			_held.Clear();
		}

		private void ApplyRelease(Held h, Vector2 dir, GameObject targetGO, Vector3 targetPos, bool useFire)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			TrySetFsm(h.go, ((Component)this).gameObject, targetGO, targetPos);
			if (h.fsms != null)
			{
				for (int i = 0; i < h.fsms.Count; i++)
				{
					if ((Object)(object)h.fsms[i] != (Object)null)
					{
						h.fsms[i].enabled = true;
					}
				}
			}
			if ((Object)(object)h.light != (Object)null)
			{
				h.light.enabled = true;
			}
			float num = Random.Range(minReleaseSpeed, maxReleaseSpeed);
			if ((Object)(object)h.rb != (Object)null)
			{
				h.rb.bodyType = (RigidbodyType2D)0;
				h.rb.gravityScale = 0f;
				h.rb.velocity = dir * num;
			}
			Component component = h.go.GetComponent("WispFireballLight");
			if ((Object)(object)component != (Object)null)
			{
				FieldInfo field = ((object)component).GetType().GetField("curveForce", BindingFlags.Instance | BindingFlags.NonPublic);
				if (field != null)
				{
					field.SetValue(component, dir * num);
				}
				if (useFire)
				{
					MethodInfo method = ((object)component).GetType().GetMethod("Fire", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
					if (method != null)
					{
						try
						{
							method.Invoke(component, null);
						}
						catch
						{
						}
					}
				}
			}
			Debug.Log((object)string.Format("[WispTargetingSpawner] RELEASE → dir=({0:0.00},{1:0.00}) speed={2:0.0} target={3}", dir.x, dir.y, num, Object.op_Implicit((Object)(object)targetGO) ? ((Object)targetGO).name : "none"));
		}

		private void ClearHeld(bool destroy)
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < _held.Count; i++)
			{
				Held held = _held[i];
				if (held != null && !((Object)(object)held.go == (Object)null))
				{
					if (destroy)
					{
						Object.Destroy((Object)(object)held.go);
					}
					else if ((Object)(object)held.rb != (Object)null)
					{
						held.rb.bodyType = held.prevBody;
					}
				}
			}
			_held.Clear();
		}

		private HealthManager FindRandomEnemyHM(Vector3 center, float radius, LayerMask mask)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: 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)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			_enemyBuffer.Clear();
			Collider2D[] array = ((((LayerMask)(ref mask)).value != 0) ? Physics2D.OverlapCircleAll(Vector2.op_Implicit(center), radius, LayerMask.op_Implicit(mask)) : Physics2D.OverlapCircleAll(Vector2.op_Implicit(center), radius));
			foreach (Collider2D val in array)
			{
				if (Object.op_Implicit((Object)(object)val))
				{
					HealthManager val2 = null;
					if ((Object)(object)val.attachedRigidbody != (Object)null)
					{
						val2 = ((Component)val.attachedRigidbody).GetComponent<HealthManager>();
					}
					if ((Object)(object)val2 == (Object)null)
					{
						val2 = ((Component)val).GetComponent<HealthManager>();
					}
					if ((Object)(object)val2 != (Object)null && !_enemyBuffer.Contains(val2))
					{
						_enemyBuffer.Add(val2);
					}
				}
			}
			if (_enemyBuffer.Count == 0)
			{
				return null;
			}
			int index = Random.Range(0, _enemyBuffer.Count);
			HealthManager val3 = _enemyBuffer[index];
			return Object.op_Implicit((Object)(object)val3) ? val3 : null;
		}

		private void TryResolveWispPrefab()
		{
			Component val = FindLantern();
			if ((Object)(object)val != (Object)null)
			{
				FieldInfo field = ((object)val).GetType().GetField("wispPrefab", BindingFlags.Instance | BindingFlags.NonPublic);
				if (field != null)
				{
					ref GameObject wispPrefab = ref _wispPrefab;
					object? value = field.GetValue(val);
					wispPrefab = (GameObject)((value is GameObject) ? value : null);
					if ((Object)(object)_wispPrefab == (Object)null)
					{
						Debug.LogWarning((object)"[WispTargetingSpawner] HeroWispLantern.wispPrefab was null");
					}
				}
				else
				{
					Debug.LogWarning((object)"[WispTargetingSpawner] Field 'wispPrefab' not found on HeroWispLantern");
				}
			}
			else
			{
				Debug.LogWarning((object)"[WispTargetingSpawner] Could not find any HeroWispLantern in scene");
			}
			if ((Object)(object)_wispPrefab == (Object)null && (Object)(object)fallbackWispPrefab != (Object)null)
			{
				_wispPrefab = fallbackWispPrefab;
			}
		}

		private Component FindLantern()
		{
			GameObject val = (Object.op_Implicit((Object)(object)HeroController.instance) ? ((Component)HeroController.instance).gameObject : null);
			if ((Object)(object)val != (Object)null)
			{
				Component[] componentsInChildren = val.GetComponentsInChildren<Component>(true);
				foreach (Component val2 in componentsInChildren)
				{
					if ((Object)(object)val2 != (Object)null && ((object)val2).GetType().Name == "HeroWispLantern")
					{
						return val2;
					}
				}
			}
			MonoBehaviour[] array = Object.FindObjectsOfType<MonoBehaviour>();
			foreach (MonoBehaviour val3 in array)
			{
				if ((Object)(object)val3 != (Object)null && ((object)val3).GetType().Name == "HeroWispLantern")
				{
					return (Component)(object)val3;
				}
			}
			return null;
		}

		private static void TrySetFsm(GameObject go, GameObject spawner, GameObject target, Vector3 targetPos)
		{
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			Component component = go.GetComponent("PlayMakerFSM");
			if ((Object)(object)component == (Object)null)
			{
				return;
			}
			try
			{
				object obj = ((object)component).GetType().GetProperty("FsmVariables")?.GetValue(component, null);
				if (obj != null)
				{
					MethodInfo method = obj.GetType().GetMethod("FindFsmGameObject");
					MethodInfo method2 = obj.GetType().GetMethod("FindFsmVector3");
					object obj2 = method?.Invoke(obj, new object[1] { "Spawner" });
					obj2?.GetType().GetProperty("Value")?.SetValue(obj2, spawner, null);
					object obj3 = method?.Invoke(obj, new object[1] { "Target" });
					obj3?.GetType().GetProperty("Value")?.SetValue(obj3, target, null);
					object obj4 = method2?.Invoke(obj, new object[1] { "Target Pos" });
					obj4?.GetType().GetProperty("Value")?.SetValue(obj4, targetPos, null);
				}
			}
			catch
			{
			}
		}

		private void EnsureMiniRoot()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_miniRoot != (Object)null))
			{
				_miniRoot = new GameObject("WispMiniCircles").transform;
				_miniRoot.SetParent(((Component)this).transform, false);
				_miniRoot.localPosition = Vector3.zero;
				_miniAnchor = ((Component)this).transform.position;
			}
		}

		private void UpdateMiniCircles()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			if (!showMiniCircles)
			{
				SetAllMiniActive(on: false);
				return;
			}
			_miniAnchor = Vector3.Lerp(_miniAnchor, ((Component)this).transform.position, Time.unscaledDeltaTime * Mathf.Max(miniFollowLerp, 0.01f));
			int num = ((NeedolinWispfiresPlugin.WispBus.IsEquipped && NeedolinWispfiresPlugin.WispBus.IsPlaying) ? HeldCount : 0);
			EnsureMiniPoolSize(num);
			float num2 = Time.unscaledTime * miniBobSpeed;
			float num3 = (float)Mathf.Max(0, num - 1) * 0.5f;
			for (int i = 0; i < _miniPool.Count; i++)
			{
				LineRenderer val = _miniPool[i];
				bool flag = i < num;
				((Component)val).gameObject.SetActive(flag);
				if (flag)
				{
					float num4 = ((float)i - num3) / Mathf.Max(1f, num3) * miniSpreadX * 0.5f;
					float num5 = (float)i * 0.8f;
					float num6 = Mathf.Sin(num2 + num5) * miniBobAmplitude;
					Vector3 position = _miniAnchor + new Vector3(num4, miniHoverHeight + num6, -0.01f);
					((Component)val).transform.position = position;
				}
			}
		}

		private void EnsureMiniPoolSize(int count)
		{
			EnsureMiniRoot();
			while (_miniPool.Count < count)
			{
				LineRenderer item = CreateMiniCircleRenderer($"miniCircle_{_miniPool.Count}");
				_miniPool.Add(item);
			}
			for (int i = count; i < _miniPool.Count; i++)
			{
				((Component)_miniPool[i]).gameObject.SetActive(false);
			}
		}

		private LineRenderer CreateMiniCircleRenderer(string name)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Expected O, but got Unknown
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject(name);
			val.transform.SetParent(_miniRoot, false);
			LineRenderer val2 = val.AddComponent<LineRenderer>();
			val2.loop = true;
			val2.useWorldSpace = false;
			val2.alignment = (LineAlignment)0;
			val2.textureMode = (LineTextureMode)0;
			val2.positionCount = Mathf.Max(8, miniCircleSegments);
			val2.widthMultiplier = miniCircleLineWidth;
			Shader val3 = Shader.Find("Universal Render Pipeline/Unlit");
			if ((Object)(object)val3 == (Object)null)
			{
				val3 = Shader.Find("Sprites/Default");
			}
			if ((Object)(object)val3 == (Object)null)
			{
				val3 = Shader.Find("Unlit/Color");
			}
			((Renderer)val2).material = new Material(val3);
			((Renderer)val2).material.renderQueue = 3000;
			TrySetMaterialColor(((Renderer)val2).material, miniCircleColor);
			val2.startColor = miniCircleColor;
			val2.endColor = miniCircleColor;
			PlaceRelativeToHero((Renderer)(object)val2, miniCirclesBehindHero, 3, 3f);
			SpriteRenderer componentInChildren = ((Component)this).GetComponentInChildren<SpriteRenderer>();
			if ((Object)(object)componentInChildren != (Object)null)
			{
				((Renderer)val2).sortingLayerID = ((Renderer)componentInChildren).sortingLayerID;
				((Renderer)val2).sortingOrder = ((Renderer)componentInChildren).sortingOrder + ((!miniCirclesBehindHero) ? 1 : (-1));
			}
			int num = Mathf.Max(8, miniCircleSegments);
			float num2 = (float)Math.PI * 2f / (float)num;
			for (int i = 0; i < num; i++)
			{
				float num3 = (float)i * num2;
				val2.SetPosition(i, new Vector3(Mathf.Cos(num3), Mathf.Sin(num3), 10f) * miniCircleRadius);
			}
			val.SetActive(false);
			return val2;
		}

		private static void PlaceRelativeToHero(Renderer r, bool behind, int delta = 1, float zNudge = 0f)
		{
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)r))
			{
				HeroController instance = HeroController.instance;
				SpriteRenderer val = ((instance != null) ? ((Component)instance).GetComponentInChildren<SpriteRenderer>() : null);
				if (Object.op_Implicit((Object)(object)val))
				{
					r.sortingLayerID = ((Renderer)val).sortingLayerID;
					r.sortingOrder = ((Renderer)val).sortingOrder + (behind ? (-Mathf.Abs(delta)) : Mathf.Abs(delta));
				}
				if (Mathf.Abs(zNudge) > 0f)
				{
					Transform transform = ((Component)r).transform;
					Vector3 localPosition = transform.localPosition;
					localPosition.z += (behind ? Mathf.Abs(zNudge) : (0f - Mathf.Abs(zNudge)));
					transform.localPosition = localPosition;
				}
			}
		}

		private void SetAllMiniActive(bool on)
		{
			for (int i = 0; i < _miniPool.Count; i++)
			{
				if ((Object)(object)_miniPool[i] != (Object)null)
				{
					((Component)_miniPool[i]).gameObject.SetActive(on);
				}
			}
		}

		private static void TrySetMaterialColor(Material m, Color c)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)m == (Object)null))
			{
				if (m.HasProperty("_BaseColor"))
				{
					m.SetColor("_BaseColor", c);
				}
				if (m.HasProperty("_Color"))
				{
					m.SetColor("_Color", c);
				}
			}
		}
	}
}
namespace ProjectileLabNS
{
	public static class ProjectileLab
	{
		private sealed class _SimpleHeroFollower : MonoBehaviour
		{
			public Transform Target;

			public Vector3 Offset;

			private void LateUpdate()
			{
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				if (!Object.op_Implicit((Object)(object)Target))
				{
					Object.Destroy((Object)(object)this);
				}
				else
				{
					((Component)this).transform.position = Target.position + Offset;
				}
			}
		}

		private static readonly Dictionary<string, GameObject> _cache = new Dictionary<string, GameObject>();

		public static GameObject SpawnProjectile(string id, Vector3 pos, Vector2 dir, float speed = 0f, Color? tint = null, bool followHero = false)
		{
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			if (string.IsNullOrEmpty(id))
			{
				return null;
			}
			GameObject val = TryFindPrefabOrLive(id);
			if (!Object.op_Implicit((Object)(object)val))
			{
				return null;
			}
			GameObject val2 = Object.Instantiate<GameObject>(val);
			((Object)val2).name = id;
			val2.transform.position = pos;
			Vector2 val3 = ((((Vector2)(ref dir)).sqrMagnitude > 0.0001f) ? ((Vector2)(ref dir)).normalized : Vector2.right);
			FlipLocalScaleX(val2.transform, val3.x);
			if (tint.HasValue)
			{
				ApplyTint(val2, tint.Value);
			}
			if (speed != 0f)
			{
				SetInitialVelocity(val2, val3 * speed);
			}
			if (followHero)
			{
				AttachFollower(val2);
			}
			val2.SetActive(true);
			return val2;
		}

		private static GameObject TryFindPrefabOrLive(string name)
		{
			if (_cache.TryGetValue(name, out var value) && Object.op_Implicit((Object)(object)value))
			{
				return value;
			}
			GameObject[] source = Resources.FindObjectsOfTypeAll<GameObject>();
			GameObject val = ((IEnumerable<GameObject>)source).FirstOrDefault((Func<GameObject, bool>)delegate(GameObject g)
			{
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				int result;
				if (((Object)g).name == name)
				{
					Scene scene = g.scene;
					result = ((!((Scene)(ref scene)).IsValid()) ? 1 : 0);
				}
				else
				{
					result = 0;
				}
				return (byte)result != 0;
			});
			if (Object.op_Implicit((Object)(object)val))
			{
				_cache[name] = val;
				return val;
			}
			GameObject val2 = ((IEnumerable<GameObject>)Object.FindObjectsOfType<GameObject>(true)).FirstOrDefault((Func<GameObject, bool>)((GameObject g) => ((Object)g).name == name));
			if (Object.op_Implicit((Object)(object)val2))
			{
				_cache[name] = val2;
				return val2;
			}
			return null;
		}

		private static void FlipLocalScaleX(Transform t, float xDir)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			Vector3 localScale = t.localScale;
			if (xDir < -0.0001f)
			{
				t.localScale = new Vector3(0f - Mathf.Abs(localScale.x), localScale.y, localScale.z);
			}
			else
			{
				t.localScale = new Vector3(Mathf.Abs(localScale.x), localScale.y, localScale.z);
			}
		}

		private static void ApplyTint(GameObject root, Color c)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			SpriteRenderer[] componentsInChildren = root.GetComponentsInChildren<SpriteRenderer>(true);
			SpriteRenderer[] array = componentsInChildren;
			foreach (SpriteRenderer val in array)
			{
				val.color = new Color(val.color.r * c.r, val.color.g * c.g, val.color.b * c.b, val.color.a * c.a);
			}
		}

		private static void SetInitialVelocity(GameObject go, Vector2 v)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			Rigidbody2D val = go.GetComponent<Rigidbody2D>() ?? go.GetComponentInChildren<Rigidbody2D>();
			if (Object.op_Implicit((Object)(object)val))
			{
				val.velocity = v;
			}
		}

		private static void AttachFollower(GameObject go)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = FindHero();
			if (Object.op_Implicit((Object)(object)val))
			{
				_SimpleHeroFollower simpleHeroFollower = go.AddComponent<_SimpleHeroFollower>();
				simpleHeroFollower.Target = val.transform;
				simpleHeroFollower.Offset = Vector3.zero;
			}
		}

		private static GameObject FindHero()
		{
			GameObject val = GameObject.FindWithTag("Player");
			if (Object.op_Implicit((Object)(object)val))
			{
				return val;
			}
			return GameObject.Find("Hero") ?? GameObject.Find("Player");
		}
	}
}
namespace FisherpinFollowerViaLab
{
	[BepInPlugin("com.sammods.fisherpin.follow.vialab.tool", "Fisherpin Follower (Idle visuals, spawn-on-attack) — Tool gated", "2.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class FisherpinFollowerViaLabPlugin : BaseUnityPlugin
	{
		public sealed class ScaleNailAttackIfNotDown : MonoBehaviour
		{
			[CompilerGenerated]
			private sealed class <ApplyScaleNextFrame>d__12 : IEnumerator<object>, IDisposable, IEnumerator
			{
				private int <>1__state;

				private object <>2__current;

				public ScaleNailAttackIfNotDown <>4__this;

				private Transform <t>5__1;

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

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

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

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

				private bool MoveNext()
				{
					//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
					//IL_008f: 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;
						if (!IsToolEquippedLazy())
						{
							return false;
						}
						if (<>4__this.ShouldSkip())
						{
							return false;
						}
						<t>5__1 = ((Component)<>4__this._nab).transform;
						if (!<>4__this._originalScale.HasValue)
						{
							<>4__this._originalScale = <t>5__1.localScale;
						}
						<t>5__1.localScale *= <>4__this.scaleFactor;
						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();
				}
			}

			[Range(0.2f, 1f)]
			public float scaleFactor = 0.75f;

			private NailAttackBase _nab;

			private HeroController _hc;

			private Vector3? _originalScale;

			private bool _subscribed;

			private void Awake()
			{
				_nab = ((Component)this).GetComponent<NailAttackBase>();
				_hc = ((Component)this).GetComponentInParent<HeroController>() ?? HeroController.instance;
				TrySubscribe();
			}

			private void OnEnable()
			{
				TrySubscribe();
			}

			private void OnDisable()
			{
				TryUnsubscribe();
			}

			private void OnDestroy()
			{
				TryUnsubscribe();
			}

			private void TrySubscribe()
			{
				if (!_subscribed && !((Object)(object)_nab == (Object)null))
				{
					_nab.AttackStarting += OnAttackStarting;
					_nab.EndedDamage += OnEndedDamage;
					_subscribed = true;
				}
			}

			private void TryUnsubscribe()
			{
				if (_subscribed && !((Object)(object)_nab == (Object)null))
				{
					_nab.AttackStarting -= OnAttackStarting;
					_nab.EndedDamage -= OnEndedDamage;
					_subscribed = false;
				}
			}

			private void OnAttackStarting()
			{
				if (IsToolEquippedLazy())
				{
					((MonoBehaviour)this).StartCoroutine(ApplyScaleNextFrame());
				}
			}

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

			private void OnEndedDamage(bool _)
			{
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				if (_originalScale.HasValue && Object.op_Implicit((Object)(object)_nab))
				{
					((Component)_nab).transform.localScale = _originalScale.Value;
				}
				_originalScale = null;
			}

			private bool ShouldSkip()
			{
				try
				{
					HeroController val = _hc ?? HeroController.instance;
					if ((Object)(object)val != (Object)null)
					{
						object obj = ((object)val).GetType().GetField("cState", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(val);
						if (obj != null)
						{
							FieldInfo field = obj.GetType().GetField("downAttacking", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
							if (field != null && field.FieldType == typeof(bool))
							{
								return (bool)field.GetValue(obj);
							}
						}
					}
				}
				catch
				{
				}
				return false;
			}
		}

		[HarmonyPatch(typeof(ListenForAttack), "OnUpdate")]
		private static class Patch_ListenForAttack_OnUpdate
		{
			private static void Postfix()
			{
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				try
				{
					if (!IsToolEquippedLazy())
					{
						return;
					}
					GameManager instance = GameManager.instance;
					if (!((Object)(object)instance == (Object)null) && !instance.isPaused)
					{
						InputHandler component = ((Component)instance).GetComponent<InputHandler>();
						if (!((Object)(object)component == (Object)null) && component.inputActions != null && ((OneAxisInputControl)component.inputActions.Attack).WasPressed)
						{
							AttackDirection dir = DetectAttackDirection(component);
							OnAttack(dir);
						}
					}
				}
				catch
				{
				}
			}

			private static AttackDirection DetectAttackDirection(InputHandler ih)
			{
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_004f: Unknown result type (might be due to invalid IL or missing references)
				try
				{
					if (ih.inputActions.Up != null && ((OneAxisInputControl)ih.inputActions.Up).IsPressed)
					{
						return (AttackDirection)1;
					}
					if (ih.inputActions.Down != null && ((OneAxisInputControl)ih.inputActions.Down).IsPressed)
					{
						return (AttackDirection)2;
					}
				}
				catch
				{
				}
				return (AttackDirection)0;
			}
		}

		public sealed class MatchHeroSorting : MonoBehaviour
		{
			[CompilerGenerated]
			private sealed class <ReapplyAfterScene>d__5 : IEnumerator<object>, IDisposable, IEnumerator
			{
				private int <>1__state;

				private object <>2__current;

				public MatchHeroSorting <>4__this;

				private float <t>5__1;

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

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

				[DebuggerHidden]
				public <ReapplyAfterScene>d__5(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;
						<>2__current = null;
						<>1__state = 1;
						return true;
					case 1:
						<>1__state = -1;
						<>2__current = null;
						<>1__state = 2;
						return true;
					case 2:
						<>1__state = -1;
						<t>5__1 = 0f;
						break;
					case 3:
						<>1__state = -1;
						break;
					}
					if (Object.op_Implicit((Object)(object)<>4__this._heroRender) && IsHeroInFlash(<>4__this._heroRender) && <t>5__1 < 0.6f)
					{
						<t>5__1 += Time.unscaledDeltaTime;
						<>2__current = null;
						<>1__state = 3;
						return true;
					}
					<>4__this.ApplyNow(forceLayerCopy: true);
					return false;
				}

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

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

			private Renderer[] _myRenders;

			private Renderer _heroRender;

			private GameObject _hero;

			private void OnEnable()
			{
				_myRenders = ((Component)this).GetComponentsInChildren<Renderer>(true);
				_hero = FindHero();
				_heroRender = FindHeroRenderer(_hero);
				ApplyNow(forceLayerCopy: true);
			}

			private void LateUpdate()
			{
				if (!Object.op_Implicit((Object)(object)_hero) || !Object.op_Implicit((Object)(object)_heroRender))
				{
					_hero = FindHero();
					_heroRender = FindHeroRenderer(_hero);
					if (!Object.op_Implicit((Object)(object)_hero) || !Object.op_Implicit((Object)(object)_heroRender))
					{
						return;
					}
				}
				if (!IsHeroInFlash(_heroRender))
				{
					ApplyNow(forceLayerCopy: false);
				}
			}

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

			private static Renderer FindHeroRenderer(GameObject hero)
			{
				if (!Object.op_Implicit((Object)(object)hero))
				{
					return null;
				}
				SpriteRenderer componentInChildren = hero.GetComponentInChildren<SpriteRenderer>(true);
				if (Object.op_Implicit((Object)(object)componentInChildren))
				{
					return (Renderer)(object)componentInChildren;
				}
				Renderer[] componentsInChildren = hero.GetComponentsInChildren<Renderer>(true);
				return (componentsInChildren != null && componentsInChildren.Length != 0) ? componentsInChildren[0] : null;
			}

			private void ApplyNow(bool forceLayerCopy)
			{
				//IL_01d3: 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_01f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_0204: Unknown result type (might be due to invalid IL or missing references)
				if (_myRenders == null || (Object)(object)_heroRender == (Object)null)
				{
					return;
				}
				int sortingLayerID = _heroRender.sortingLayerID;
				int sortingOrder = _heroRender.sortingOrder;
				string sortingLayerName = _heroRender.sortingLayerName;
				for (int i = 0; i < _myRenders.Length; i++)
				{
					Renderer val = _myRenders[i];
					if (!Object.op_Implicit((Object)(object)val))
					{
						continue;
					}
					val.sortingLayerID = sortingLayerID;
					val.sortingOrder = sortingOrder;
					try
					{
						Material sharedMaterial = _heroRender.sharedMaterial;
						Material material = val.material;
						if (Object.op_Implicit((Object)(object)sharedMaterial) && Object.op_Implicit((Object)(object)material))
						{
							material.renderQueue = sharedMaterial.renderQueue;
						}
					}
					catch
					{
					}
				}
				try
				{
					Type type = Type.GetType("tk2dBaseSprite, TeamCherry.TK2D");
					if (type != null)
					{
						Component[] componentsInChildren = ((Component)this).GetComponentsInChildren(type, true);
						PropertyInfo property = type.GetProperty("SortingLayerID");
						PropertyInfo property2 = type.GetProperty("SortingLayerName");
						PropertyInfo property3 = type.GetProperty("SortingOrder");
						foreach (Component obj2 in componentsInChildren)
						{
							try
							{
								property3?.SetValue(obj2, sortingOrder, null);
							}
							catch
							{
							}
							try
							{
								property?.SetValue(obj2, sortingLayerID, null);
							}
							catch
							{
							}
							try
							{
								if (property2 != null)
								{
									property2.SetValue(obj2, sortingLayerName, null);
								}
							}
							catch
							{
							}
						}
					}
				}
				catch
				{
				}
				try
				{
					Transform transform = ((Component)this).transform;
					transform.position = new Vector3(transform.position.x, transform.position.y, ((Component)_heroRender).transform.position.z + 0.0008f);
				}
				catch
				{
				}
			}

			private static bool IsHeroInFlash(Renderer heroR)
			{
				if (!Object.op_Implicit((Object)(object)heroR))
				{
					return false;
				}
				Material sharedMaterial = heroR.sharedMaterial;
				string text = (Object.op_Implicit((Object)(object)sharedMaterial) ? ((Object)sharedMaterial).name : "");
				object obj;
				if (!Object.op_Implicit((Object)(object)sharedMaterial))
				{
					obj = "";
				}
				else
				{
					Shader shader = sharedMaterial.shader;
					obj = ((shader != null) ? ((Object)shader).name : null);
				}
				string text2 = (string)obj;
				if (text.IndexOf("Flash", StringComparison.OrdinalIgnoreCase) >= 0)
				{
					return true;
				}
				if (text2.IndexOf("Flash", StringComparison.OrdinalIgnoreCase) >= 0)
				{
					return true;
				}
				Component[] componentsInParent = ((Component)heroR).GetComponentsInParent<Component>(true);
				foreach (Component val in componentsInParent)
				{
					if (Object.op_Implicit((Object)(object)val))
					{
						string name = ((object)val).GetType().Name;
						if (name.IndexOf("Flash", StringComparison.OrdinalIgnoreCase) >= 0)
						{
							return true;
						}
						if (name.IndexOf("Blink", StringComparison.OrdinalIgnoreCase) >= 0)
						{
							return true;
						}
						if (name.IndexOf("Invul", StringComparison.OrdinalIgnoreCase) >= 0)
						{
							return true;
						}
					}
				}
				return false;
			}
		}

		public class IdlePin : MonoBehaviour
		{
			public int slot;

			public float faceTilt;

			[NonSerialized]
			public HoverFollow hf;

			private Renderer[] _renders;

			private void Awake()
			{
				_renders = ((Component)this).GetComponentsInChildren<Renderer>(true);
			}

			public void SetVisible(bool on)
			{
				if (_renders == null || _renders.Length == 0)
				{
					_renders = ((Component)this).GetComponentsInChildren<Renderer>(true);
				}
				for (int i = 0; i < _renders.Length; i++)
				{
					if (Object.op_Implicit((Object)(object)_renders[i]))
					{
						_renders[i].enabled = on;
					}
				}
			}
		}

		public class HoverFollow : MonoBehaviour
		{
			public float lateralOffset = -0.7f;

			public float heightAboveHead = 1.3f;

			public float smoothTime = 0.08f;

			public float maxSpeed = 25f;

			public float snapTeleportIfFartherThan = 25f;

			public float hoverAmplitude = 0.12f;

			public float hoverFrequency = 2f;

			public bool faceHero = true;

			public float tiltDegrees = 18f;

			private Transform _hero;

			private HeroFacingWatcher _watcher;

			private Vector3 _vel;

			private float _t;

			public void RefreshHero()
			{
				GameObject obj = FindHero();
				_hero = ((obj != null) ? obj.transform : null);
			}

			private void OnEnable()
			{
				GameObject obj = FindHero();
				_hero = ((obj != null) ? obj.transform : null);
				if ((Object)(object)_hero != (Object)null)
				{
					_watcher = ((Component)this).gameObject.GetComponent<HeroFacingWatcher>() ?? ((Component)this).gameObject.AddComponent<HeroFacingWatcher>();
					_watcher.Init(_hero);
				}
				_t = Random.Range(0f, 10f);
			}

			private void Update()
			{
				//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
				//IL_0102: Unknown result type (might be due to invalid IL or missing references)
				//IL_0107: Unknown result type (might be due to invalid IL or missing references)
				//IL_0108: 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)
				//IL_0119: Unknown result type (might be due to invalid IL or missing references)
				//IL_0152: Unknown result type (might be due to invalid IL or missing references)
				//IL_0157: Unknown result type (might be due to invalid IL or missing references)
				//IL_016a: Unknown result type (might be due to invalid IL or missing references)
				//IL_013d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0244: 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_0190: Unknown result type (might be due to invalid IL or missing references)
				//IL_0192: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b7: 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)
				if ((Object)(object)_hero == (Object)null)
				{
					GameObject obj = FindHero();
					_hero = ((obj != null) ? obj.transform : null);
					if ((Object)(object)_hero != (Object)null)
					{
						_watcher = ((Component)this).gameObject.GetComponent<HeroFacingWatcher>() ?? ((Component)this).gameObject.AddComponent<HeroFacingWatcher>();
						_watcher.Init(_hero);
					}
					if ((Object)(object)_hero == (Object)null)
					{
						return;
					}
				}
				_t += Time.deltaTime;
				int num = ((!((Object)(object)_watcher != (Object)null)) ? 1 : _watcher.FacingSign);
				float num2 = Mathf.Sin(_t * (float)Math.PI * 2f * hoverFrequency) * hoverAmplitude;
				Vector3 val = _hero.position + new Vector3((float)num * lateralOffset, heightAboveHead + num2, 0f);
				Vector3 val2 = val - ((Component)this).transform.position;
				if (((Vector3)(ref val2)).sqrMagnitude > snapTeleportIfFartherThan * snapTeleportIfFartherThan)
				{
					((Component)this).transform.position = val;
				}
				else
				{
					((Component)this).transform.position = Vector3.SmoothDamp(((Component)this).transform.position, val, ref _vel, smoothTime, maxSpeed);
				}
				if (faceHero)
				{
					Vector3 localScale = ((Component)this).transform.localScale;
					if (Mathf.Approximately(localScale.x, 0f))
					{
						localScale.x = 1f;
					}
					localScale.x = Mathf.Abs(localScale.x) * ((num >= 0) ? 1f : (-1f));
					((Component)this).transform.localScale = localScale;
					SpriteRenderer[] componentsInChildren = ((Component)this).GetComponentsInChildren<SpriteRenderer>(true);
					for (int i = 0; i < componentsInChildren.Length; i++)
					{
						if ((Object)(object)componentsInChildren[i] != (Object)null)
						{
							componentsInChildren[i].flipX = num < 0;
						}
					}
				}
				((Component)this).transform.rotation = Quaternion.Euler(0f, 0f, (0f - tiltDegrees) * (float)num);
			}
		}

		private struct IdleLayout
		{
			public float lateral;

			public float height;

			public float tilt;

			public float bobAmp;

			public float bobHz;
		}

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

			private object <>2__current;

			public FisherpinFollowerViaLabPlugin <>4__this;

			private GameObject <hero>5__1;

			private MatchHeroSorting <sorter>5__2;

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

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

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

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

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = null;
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					if ((Object)(object)_idleBakedPrefab == (Object)null)
					{
						<>2__current = ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.EnsureIdleBakedPrefab());
						<>1__state = 2;
						return true;
					}
					goto IL_0086;
				case 2:
					<>1__state = -1;
					goto IL_0086;
				case 3:
					{
						<>1__state = -1;
						((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.FullRecreateIdlePinsNow());
						<hero>5__1 = FindHero();
						if (Object.op_Implicit((Object)(object)<hero>5__1))
						{
							<sorter>5__2 = <hero>5__1.GetComponentInChildren<MatchHeroSorting>();
							if ((Object)(object)<sorter>5__2 != (Object)null)
							{
								((MonoBehaviour)<sorter>5__2).StartCoroutine(<sorter>5__2.ReapplyAfterScene());
							}
							<sorter>5__2 = null;
						}
						<hero>5__1 = null;
						break;
					}
					IL_0086:
					if (IsToolEquippedLazy())
					{
						<>2__current = ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.EnsureIdlePinsNow());
						<>1__state = 3;
						return true;
					}
					break;
				}
				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 <AttachNailScalerLoop>d__67 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public FisherpinFollowerViaLabPlugin <>4__this;

			private WaitForSecondsRealtime <wait>5__1;

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

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

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

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

			private bool MoveNext()
			{
				//IL_003a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<wait>5__1 = new WaitForSecondsRealtime(1f);
					break;
				case 1:
					<>1__state = -1;
					goto IL_0095;
				case 2:
					<>1__state = -1;
					goto IL_0095;
				case 3:
					{
						<>1__state = -1;
						break;
					}
					IL_0095:
					<>2__current = <wait>5__1;
					<>1__state = 3;
					return true;
				}
				if (IsToolEquippedLazy())
				{
					<>2__current = ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.AttachNailScalerNow());
					<>1__state = 1;
					return true;
				}
				<>2__current = null;
				<>1__state = 2;
				return true;
			}

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

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

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

			private object <>2__current;

			public FisherpinFollowerViaLabPlugin <>4__this;

			private NailAttackBase[] <all>5__1;

			private int <added>5__2;

			private int <i>5__3;

			private NailAttackBase <nab>5__4;

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

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

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

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

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = null;
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<all>5__1 = Object.FindObjectsOfType<NailAttackBase>(true);
					<added>5__2 = 0;
					<i>5__3 = 0;
					while (<i>5__3 < <all>5__1.Length)
					{
						<nab>5__4 = <all>5__1[<i>5__3];
						if (Object.op_Implicit((Object)(object)<nab>5__4))
						{
							if (!Object.op_Implicit((Object)(object)((Component)<nab>5__4).gameObject.GetComponent<ScaleNailAttackIfNotDown>()))
							{
								((Component)<nab>5__4).gameObject.AddComponent<ScaleNailAttackIfNotDown>();
								<added>5__2++;
							}
							<nab>5__4 = null;
						}
						<i>5__3++;
					}
					if (<added>5__2 > 0)
					{
						ManualLogSource logS = LogS;
						if (logS != null)
						{
							logS.LogDebug((object)$"[Fisher] Scaler attached to {<added>5__2} NailAttackBase objects.");
						}
					}
					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 <DashThenReturn>d__82 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public GameObject proj;

			public Rigidbody2D rb;

			public int facing;

			public IdlePin idle;

			public int slotIndex;

			public AttackDirection dirMode;

			public FisherpinFollowerViaLabPlugin <>4__this;

			private float <dashEnd>5__1;

			private float <spd>5__2;

			private Vector2 <desiredStart>5__3;

			private Vector2 <heading>5__4;

			private float <tStart>5__5;

			private Vector2 <desired>5__6;

			private Vector3 <h3>5__7;

			private Vector3 <d3>5__8;

			private Vector2 <v>5__9;

			private float <z>5__10;

			private Vector3 <targetPos>5__11;

			private Vector3 <p>5__12;

			private Vector3 <next>5__13;

			private Vector2 <delta>5__14;

			private GameObject <hero>5__15;

			private float <z>5__16;

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

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

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

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

			private bool MoveNext()
			{
				//IL_02cf: 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_00f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_0137: Unknown result type (might be due to invalid IL or missing references)
				//IL_013c: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01be: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0200: Unknown result type (might be due to invalid IL or missing references)
				//IL_0204: Unknown result type (might be due to invalid IL or missing references)
				//IL_0209: Unknown result type (might be due to invalid IL or missing references)
				//IL_0210: Unknown result type (might be due to invalid IL or missing references)
				//IL_021b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0220: Unknown result type (might be due to invalid IL or missing references)
				//IL_0126: Unknown result type (might be due to invalid IL or missing references)
				//IL_012b: Unknown result type (might be due to invalid IL or missing references)
				//IL_012f: Unknown result type (might be due to invalid IL or missing references)
				//IL_022d: Unknown result type (might be due to invalid IL or missing references)
				//IL_037f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0384: Unknown result type (might be due to invalid IL or missing references)
				//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_03ec: Unknown result type (might be due to invalid IL or missing references)
				//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0402: Unknown result type (might be due to invalid IL or missing references)
				//IL_0407: Unknown result type (might be due to invalid IL or missing references)
				//IL_0418: Unknown result type (might be due to invalid IL or missing references)
				//IL_0425: Unknown result type (might be due to invalid IL or missing references)
				//IL_042b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0430: Unknown result type (might be due to invalid IL or missing references)
				//IL_0435: Unknown result type (might be due to invalid IL or missing references)
				//IL_043a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0288: Unknown result type (might be due to invalid IL or missing references)
				//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_04a7: 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_04b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_04b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_049a: Unknown result type (might be due to invalid IL or missing references)
				Vector2 val;
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
				{
					<>1__state = -1;
					if (!Object.op_Implicit((Object)(object)proj) || !Object.op_Implicit((Object)(object)rb))
					{
						if (Object.op_Implicit((Object)(object)idle))
						{
							idle.SetVisible(on: true);
						}
						return false;
					}
					if (!IsToolEquippedLazy())
					{
						if (Object.op_Implicit((Object)(object)idle))
						{
							idle.SetVisible(on: true);
						}
						if (Object.op_Implicit((Object)(object)proj))
						{
							Object.Destroy((Object)(object)proj);
						}
						return false;
					}
					<dashEnd>5__1 = Time.unscaledTime + 0.15f;
					<spd>5__2 = 60f + (float)slotIndex * 0f;
					<desiredStart>5__3 = ReadAimDirFallbackFacing(facing);
					Vector2 normalized;
					if (!(<desiredStart>5__3.y >= 0.4f))
					{
						val = new Vector2((facing >= 0) ? 1f : (-1f), -0.6f);
						normalized = ((Vector2)(ref val)).normalized;
					}
					else
					{
						normalized = <desiredStart>5__3;
					}
					<heading>5__4 = normalized;
					rb.isKinematic = false;
					rb.simulated = true;
					goto IL_02b3;
				}
				case 1:
					<>1__state = -1;
					goto IL_02b3;
				case 2:
					{
						<>1__state = -1;
						break;
					}
					IL_02b3:
					if (Time.unscaledTime < <dashEnd>5__1)
					{
						if (!Object.op_Implicit((Object)(object)proj) || !Object.op_Implicit((Object)(object)rb))
						{
							return false;
						}
						if (IsToolEquippedLazy())
						{
							<desired>5__6 = ReadAimDirFallbackFacing(facing);
							<h3>5__7 = Vector2.op_Implicit(<heading>5__4);
							<d3>5__8 = Vector2.op_Implicit(<desired>5__6);
							<h3>5__7 = Vector3.RotateTowards(<h3>5__7, <d3>5__8, 10f * Time.unscaledDeltaTime, 999f);
							val = Vector2.op_Implicit(<h3>5__7);
							<heading>5__4 = ((Vector2)(ref val)).normalized;
							<v>5__9 = <heading>5__4 * <spd>5__2;
							try
							{
								rb.velocity = <v>5__9;
							}
							catch
							{
								return false;
							}
							try
							{
								<z>5__10 = Mathf.Atan2(<v>5__9.y, <v>5__9.x) * 57.29578f;
								proj.transform.rotation = Quaternion.Euler(0f, 0f, <z>5__10);
							}
							catch
							{
							}
							<>2__current = null;
							<>1__state = 1;
							return true;
						}
					}
					rb.velocity = Vector2.zero;
					rb.isKinematic = true;
					rb.simulated = false;
					<tStart>5__5 = Time.unscaledTime;
					break;
				}
				if (!Object.op_Implicit((Object)(object)proj))
				{
					if (Object.op_Implicit((Object)(object)idle))
					{
						idle.SetVisible(on: true);
					}
					return false;
				}
				if (IsToolEquippedLazy())
				{
					if (Object.op_Implicit((Object)(object)idle) && Object.op_Implicit((Object)(object)((Component)idle).gameObject))
					{
						<targetPos>5__11 = ((Component)idle).transform.position;
					}
					else
					{
						<hero>5__15 = FindHero();
						<targetPos>5__11 = (Object.op_Implicit((Object)(object)<hero>5__15) ? <hero>5__15.transform.position : proj.transform.position);
						<hero>5__15 = null;
					}
					<p>5__12 = proj.transform.position;
					<next>5__13 = Vector3.MoveTowards(<p>5__12, <targetPos>5__11, 50f * Time.unscaledDeltaTime);
					proj.transform.position = <next>5__13;
					<delta>5__14 = Vector2.op_Implicit(<targetPos>5__11 - <p>5__12);
					if (((Vector2)(ref <delta>5__14)).sqrMagnitude > 1E-06f)
					{
						<z>5__16 = Mathf.Atan2(<delta>5__14.y, <delta>5__14.x) * 57.29578f;
						proj.transform.rotation = Quaternion.Euler(0f, 0f, <z>5__16);
					}
					Vector3 val2 = <next>5__13 - <targetPos>5__11;
					if (!(((Vector3)(ref val2)).sqrMagnitude <= 0.0009f) && !(Time.unscaledTime - <tStart>5__5 > 0.4f))
					{
						<>2__current = null;
						<>1__state = 2;
						return true;
					}
				}
				if (Object.op_Implicit((Object)(object)idle))
				{
					idle.SetVisible(on: true);
				}
				if (Object.op_Implicit((Object)(object)proj))
				{
					Object.Destroy((Object)(object)proj);
				}
				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 <EnsureIdleBakedPrefab>d__73 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public FisherpinFollowerViaLabPlugin <>4__this;

			private GameObject <hero>5__1;

			private int <face>5__2;

			private Vector2 <dir>5__3;

			private Vector3 <off>5__4;

			private GameObject <donor>5__5;

			private Exception <e>5__6;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<hero>5__1 = null;
				<donor>5__5 = null;
				<e>5__6 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0074: Unknown result type (might be due to invalid IL or missing references)
				//IL_006d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0079: Unknown result type (might be due to invalid IL or missing references)
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				//IL_009e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if (Object.op_Implicit((Object)(object)_idleBakedPrefab))
					{
						return false;
					}
					<hero>5__1 = FindHero();
					if (!Object.op_Implicit((Object)(object)<hero>5__1))
					{
						return false;
					}
					<face>5__2 = GetFacingSign(<hero>5__1);
					<dir>5__3 = ((<face>5__2 >= 0) ? Vector2.right : Vector2.left);
					<off>5__4 = <hero>5__1.transform.position + new Vector3(50f, 50f, 0f);
					<donor>5__5 = null;
					try
					{
						<donor>5__5 = ProjectileLab.SpawnProjectile("Tool Barb Spine", <off>5__4, <dir>5__3);
					}
					catch (Exception ex)
					{
						<e>5__6 = ex;
					}
					if (!Object.op_Implicit((Object)(object)<donor>5__5))
					{
						return false;
					}
					<>2__current = null;
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					_idleBakedPrefab = BakeVisualOnlyCopy(<donor>5__5, "Barb Splinter Thunk", 0);
					if (Object.op_Implicit((Object)(object)_idleBakedPrefab))
					{
						((Object)_idleBakedPrefab).name = "Fisherpin_IdleBakedPrefab";
						Object.DontDestroyOnLoad((Object)(object)_idleBakedPrefab);
						_idleBakedPrefab.SetActive(false);
					}
					Object.Destroy((Object)(object)<donor>5__5);
					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 <EnsureIdlePinsLoop>d__72 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public FisherpinFollowerViaLabPlugin <>4__this;

			private WaitForSecondsRealtime <wait>5__1;

			private int <i>5__2;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0046: Unknown result type (might be due to invalid IL or missing references)
				//IL_0050: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<wait>5__1 = new WaitForSecondsRealtime(0.75f);
					goto IL_01c7;
				case 1:
					<>1__state = -1;
					goto IL_0091;
				case 2:
					<>1__state = -1;
					goto IL_01c7;
				case 3:
					<>1__state = -1;
					break;
				case 4:
					{
						<>1__state = -1;
						goto IL_01c7;
					}
					IL_01c7:
					if ((Object)(object)_idleBakedPrefab == (Object)null)
					{
						<>2__current = ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.EnsureIdleBakedPrefab());
						<>1__state = 1;
						return true;
					}
					goto IL_0091;
					IL_0091:
					if (!IsToolEquippedLazy())
					{
						if (_idles.Count > 0)
						{
							<i>5__2 = 0;
							while (<i>5__2 < _idles.Count)
							{
								if (Object.op_Implicit((Object)(object)_idles[<i>5__2]) && Object.op_Implicit((Object)(object)((Component)_idles[<i>5__2]).gameObject))
								{
									Object.Destroy((Object)(object)((Component)_idles[<i>5__2]).gameObject);
								}
								<i>5__2++;
							}
							_idles.Clear();
						}
						<>2__current = <wait>5__1;
						<>1__state = 2;
						return true;
					}
					if (_idles.Count != 3)
					{
						<>2__current = ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.EnsureIdlePinsNow());
						<>1__state = 3;
						return true;
					}
					break;
				}
				<>2__current = <wait>5__1;
				<>1__state = 4;
				return true;
			}

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

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

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

			private object <>2__current;

			public FisherpinFollowerViaLabPlugin <>4__this;

			private GameObject <hero>5__1;

			private List<IdlePin>.Enumerator <>s__2;

			private IdlePin <idle>5__3;

			private List<IdlePin>.Enumerator <>s__4;

			private IdlePin <old>5__5;

			private int <slot>5__6;

			private GameObject <g>5__7;

			private int <face>5__8;

			private IdlePin <idle>5__9;

			private HoverFollow <hf>5__10;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<hero>5__1 = null;
				<>s__2 = default(List<IdlePin>.Enumerator);
				<idle>5__3 = null;
				<>s__4 = default(List<IdlePin>.Enumerator);
				<old>5__5 = null;
				<g>5__7 = null;
				<idle>5__9 = null;
				<hf>5__10 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0228: Unknown result type (might be due to invalid IL or missing references)
				//IL_022d: Unknown result type (might be due to invalid IL or missing references)
				if (<>1__state != 0)
				{
					return false;
				}
				<>1__state = -1;
				<hero>5__1 = FindHero();
				if (!Object.op_Implicit((Object)(object)<hero>5__1))
				{
					return false;
				}
				_idles.RemoveAll((IdlePin i) => !Object.op_Implicit((Object)(object)i) || !Object.op_Implicit((Object)(object)((Component)i).gameObject));
				if (_idles.Count == 3)
				{
					<>s__2 = _idles.GetEnumerator();
					try
					{
						while (<>s__2.MoveNext())
						{
							<idle>5__3 = <>s__2.Current;
							<idle>5__3.hf?.RefreshHero();
							<idle>5__3 = null;
						}
					}
					finally
					{
						((IDisposable)<>s__2).Dispose();
					}
					<>s__2 = default(List<IdlePin>.Enumerator);
					return false;
				}
				<>s__4 = _idles.GetEnumerator();
				try
				{
					while (<>s__4.MoveNext())
					{
						<old>5__5 = <>s__4.Current;
						if (Object.op_Implicit((Object)(object)<old>5__5))
						{
							Object.Destroy((Object)(object)((Component)<old>5__5).gameObject);
						}
						<old>5__5 = null;
					}
				}
				finally
				{
					((IDisposable)<>s__4).Dispose();
				}
				<>s__4 = default(List<IdlePin>.Enumerator);
				_idles.Clear();
				<slot>5__6 = 0;
				while (<slot>5__6 < 3 && !((Object)(object)_idleBakedPrefab == (Object)null))
				{
					<g>5__7 = Object.Instantiate<GameObject>(_idleBakedPrefab);
					((Object)<g>5__7).name = $"FisherpinIdle_{<slot>5__6}";
					<g>5__7.SetActive(true);
					<g>5__7.AddComponent<MatchHeroSorting>();
					<face>5__8 = GetFacingSign(<hero>5__1);
					<g>5__7.transform.position = <hero>5__1.transform.position + new Vector3(1.2f * (float)<face>5__8, 0.9f + 0.18f * (float)<slot>5__6, -0.1f);
					<idle>5__9 = <g>5__7.AddComponent<IdlePin>();
					<idle>5__9.slot = <slot>5__6;
					<idle>5__9.faceTilt = Layouts[<slot>5__6].tilt;
					<hf>5__10 = <g>5__7.AddComponent<HoverFollow>();
					<idle>5__9.hf = <hf>5__10;
					<hf>5__10.lateralOffset = Layouts[<slot>5__6].lateral;
					<hf>5__10.heightAboveHead = Layouts[<slot>5__6].height;
					<hf>5__10.hoverAmplitude = Layouts[<slot>5__6].bobAmp;
					<hf>5__10.hoverFrequency = Layouts[<slot>5__6].bobHz;
					<hf>5__10.tiltDegrees = Layouts[<slot>5__6].tilt;
					_idles.Add(<idle>5__9);
					<g>5__7 = null;
					<idle>5__9 = null;
					<hf>5__10 = null;
					<slot>5__6++;
				}
				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 <FireSequence>d__80 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public AttackDirection dir;

			public FisherpinFollowerViaLabPlugin <>4__this;

			private GameObject <hero>5__1;

			private int <facing>5__2;

			private List<IdlePin> <ordered>5__3;

			private int <i>5__4;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0155: Unknown result type (might be due to invalid IL or missing references)
				//IL_016e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0178: Expected O, but got Unknown
				//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c7: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					_sequenceRunning = true;
					if (!IsToolEquippedLazy())
					{
						_sequenceRunning = false;
						return false;
					}
					if (_idles.Count != 3)
					{
						<>2__current = ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.EnsureIdlePinsNow());
						<>1__state = 1;
						return true;
					}
					goto IL_0092;
				case 1:
					<>1__state = -1;
					goto IL_0092;
				case 2:
					<>1__state = -1;
					<i>5__4++;
					goto IL_019b;
				case 3:
					{
						<>1__state = -1;
						_sequenceRunning = false;
						return false;
					}
					IL_0092:
					<hero>5__1 = FindHero();
					if (!Object.op_Implicit((Object)(object)<hero>5__1))
					{
						_sequenceRunning = false;
						return false;
					}
					<facing>5__2 = GetFacingSign(<hero>5__1);
					<ordered>5__3 = (from i in _idles
						where Object.op_Implicit((Object)(object)i) && ((Behaviour)i).isActiveAndEnabled
						orderby i.slot
						select i).ToList();
					<i>5__4 = 0;
					goto IL_019b;
					IL_019b:
					if (<i>5__4 < <ordered>5__3.Count)
					{
						((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.SpawnDashReturnFromIdle(<ordered>5__3[<i>5__4], <facing>5__2, <i>5__4, dir));
						bool flag = true;
						<>2__current = (object)new WaitForSecondsRealtime(0.1f);
						<>1__state = 2;
						return true;
					}
					<>2__current = (object)new WaitForSecondsRealtime(0.05f);
					<>1__state = 3;
					return true;
				}
			}

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

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

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

			private object <>2__current;

			public FisherpinFollowerViaLabPlugin <>4__this;

			private GameObject <hero>5__1;

			private int <i>5__2;

			private IdlePin <old>5__3;

			private int <slot>5__4;

			private GameObject <g>5__5;

			private int <face>5__6;

			private IdlePin <idle>5__7;

			private HoverFollow <hf>5__8;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<hero>5__1 = null;
				<old>5__3 = null;
				<g>5__5 = null;
				<idle>5__7 = null;
				<hf>5__8 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if (!IsToolEquippedLazy())
					{
						return false;
					}
					<hero>5__1 = FindHero();
					if (!Object.op_Implicit((Object)(object)<hero>5__1))
					{
						return false;
					}
					<i>5__2 = 0;
					while (<i>5__2 < _idles.Count)
					{
						<old>5__3 = _idles[<i>5__2];
						if (Object.op_Implicit((Object)(object)<old>5__3) && Object.op_Implicit((Object)(object)((Component)<old>5__3).gameObject))
						{
							Object.Destroy((Object)(object)((Component)<old>5__3).gameObject);
						}
						<old>5__3 = null;
						<i>5__2++;
					}
					_idles.Clear();
					if ((Object)(object)_idleBakedPrefab == (Object)null)
					{
						<>2__current = ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.EnsureIdleBakedPrefab());
						<>1__state = 1;
						return true;
					}
					break;
				case 1:
					<>1__state = -1;
					if ((Object)(object)_idleBakedPrefab == (Object)null)
					{
						return false;
					}
					break;
				}
				<slot>5__4 = 0;
				while (<slot>5__4 < 3)
				{
					<g>5__5 = Object.Instantiate<GameObject>(_idleBakedPrefab);
					((Object)<g>5__5).name = $"FisherpinIdle_{<slot>5__4}";
					<g>5__5.SetActive(true);
					<face>5__6 = GetFacingSign(<hero>5__1);
					<g>5__5.transform.position = <hero>5__1.transform.position + new Vector3(1.2f * (float)<face>5__6, 0.9f + 0.18f * (float)<slot>5__4, -0.1f);
					<idle>5__7 = <g>5__5.AddComponent<IdlePin>();
					<idle>5__7.slot = <slot>5__4;
					<idle>5__7.faceTilt = Layouts[<slot>5__4].tilt;
					<hf>5__8 = <g>5__5.AddComponent<HoverFollow>();
					<idle>5__7.hf = <hf>5__8;
					<hf>5__8.lateralOffset = Layouts[<slot>5__4].lateral;
					<hf>5__8.heightAboveHead = Layouts[<slot>5__4].height;
					<hf>5__8.hoverAmplitude = Layouts[<slot>5__4].bobAmp;
					<hf>5__8.hoverFrequency = Layouts[<slot>5__4].bobHz;
					<hf>5__8.tiltDegrees = Layouts[<slot>5__4].tilt;
					_idles.Add(<idle>5__7);
					<g>5__5 = null;
					<idle>5__7 = null;
					<hf>5__8 = null;
					<slot>5__4++;
				}
				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 <InjectorLoop>d__40 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public FisherpinFollowerViaLabPlugin <>4__this;

			private WaitForSecondsRealtime <wait>5__1;

			private bool <injected>5__2;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<wait>5__1 = 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
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<wait>5__1 = new WaitForSecondsRealtime(2f);
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				<injected>5__2 = false;
				if ((Object)(object)_clonedTool == (Object)null)
				{
					TryCreateClone();
				}
				if ((Object)(object)_clonedTool != (Object)null)
				{
					<injected>5__2 = EnsureCloneInToolDatabase(_clonedTool);
				}
				if ((Object)(object)_clonedTool != (Object)null)
				{
					TrySetBoolField(_clonedTool, new string[4] { "visibleInMenu", "_visibleInMenu", "showInInventory", "_showInInventory" }, value: true);
					TrySetBoolField(_clonedTool, new string[6] { "isDiscovered", "_isDiscovered", "discovered", "_discovered", "revealed", "_revealed" }, value: true);
				}
				if (<injected>5__2)
				{
					ManualLogSource logS = LogS;
					if (logS != null)
					{
						logS.LogDebug((object)"[FisherpinTool] InjectorLoop: ensured clone present.");
					}
				}
				<>2__current = <wait>5__1;
				<>1__state = 1;
				return true;
			}

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

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

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

			private object <>2__current;

			public IdlePin idle;

			public int facing;

			public int index;

			public AttackDirection dirMode;

			public FisherpinFollowerViaLabPlugin <>4__this;

			private GameObject <hero>5__1;

			private Vector3 <spawnPos>5__2;

			private Vector2 <dir>5__3;

			private GameObject <proj>5__4;

			private Rigidbody2D <rb>5__5;

			private float <startZ>5__6;

			private float <endZ>5__7;

			private float <t>5__8;

			private float <z>5__9;

			private Exception <e>5__10;

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

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

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

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

			private bool MoveNext()
			{
				//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0076: Unknown result type (might be due to invalid IL or missing references)
				//IL_007c: Invalid comparison between Unknown and I4
				//IL_0167: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b0: Expected O, but got Unknown
				//IL_01dd: Unknown result type (might be due to invalid IL or missing references)