Decompiled source of FraudLace v1.0.0

FraudLace.dll

Decompiled 2 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using FraudLace.Modifiers;
using FraudLace.Patches;
using HarmonyLib;
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;
using JetBrains.Annotations;
using Microsoft.CodeAnalysis;
using Silksong.FsmUtil.Actions;
using TMProOld;
using TeamCherry.Localization;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

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

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace Silksong.FsmUtil.Actions
{
	public class DelegateAction<TArg> : FsmStateAction
	{
		public Action<TArg>? Method;

		public TArg? Arg;

		public override void Reset()
		{
			Method = null;
			((FsmStateAction)this).Reset();
		}

		public override void OnEnter()
		{
			if (Method != null && Arg != null)
			{
				Method(Arg);
			}
			if (!((object)Arg is Action action) || action != new Action(base.Finish))
			{
				((FsmStateAction)this).Finish();
			}
		}
	}
}
namespace FraudLace
{
	internal static class AssetManager
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass6_0
		{
			public string prefabName;

			internal bool <LoadScenePrefabs>b__0(Transform obj)
			{
				return ((Object)obj).name == prefabName;
			}
		}

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

			private object <>2__current;

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

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

			[DebuggerHidden]
			public <Init>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 = LoadScenePrefabs();
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					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 <LoadBundleAssets>d__7 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			private string <platformFolder>5__1;

			private string <bundlesPath>5__2;

			private RuntimePlatform <>s__3;

			private Dictionary<string, string[]>.Enumerator <>s__4;

			private string <bundleName>5__5;

			private string[] <assetNames>5__6;

			private bool <bundleAlreadyLoaded>5__7;

			private string <bundlePath>5__8;

			private AssetBundleCreateRequest <bundleLoadRequest>5__9;

			private AssetBundle <bundle>5__10;

			private IEnumerator<AssetBundle> <>s__11;

			private AssetBundle <loadedBundle>5__12;

			private string[] <>s__13;

			private int <>s__14;

			private string <assetPath>5__15;

			private string[] <>s__16;

			private int <>s__17;

			private string <assetName>5__18;

			private AssetBundleRequest <loadAssetRequest>5__19;

			private Object <loadedAsset>5__20;

			private string[] <>s__21;

			private int <>s__22;

			private string <assetPath>5__23;

			private string[] <>s__24;

			private int <>s__25;

			private string <assetName>5__26;

			private AssetBundleRequest <assetLoadRequest>5__27;

			private Object <loadedAsset>5__28;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				int num = <>1__state;
				if ((uint)(num - -4) <= 1u || (uint)(num - 1) <= 2u)
				{
					try
					{
						if (num == -4 || num == 1)
						{
							try
							{
							}
							finally
							{
								<>m__Finally2();
							}
						}
					}
					finally
					{
						<>m__Finally1();
					}
				}
				<platformFolder>5__1 = null;
				<bundlesPath>5__2 = null;
				<>s__4 = default(Dictionary<string, string[]>.Enumerator);
				<bundleName>5__5 = null;
				<assetNames>5__6 = null;
				<bundlePath>5__8 = null;
				<bundleLoadRequest>5__9 = null;
				<bundle>5__10 = null;
				<>s__11 = null;
				<loadedBundle>5__12 = null;
				<>s__13 = null;
				<assetPath>5__15 = null;
				<>s__16 = null;
				<assetName>5__18 = null;
				<loadAssetRequest>5__19 = null;
				<loadedAsset>5__20 = null;
				<>s__21 = null;
				<assetPath>5__23 = null;
				<>s__24 = null;
				<assetName>5__26 = null;
				<assetLoadRequest>5__27 = null;
				<loadedAsset>5__28 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0040: 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_004f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0054: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Invalid comparison between Unknown and I4
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Invalid comparison between Unknown and I4
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Invalid comparison between Unknown and I4
				try
				{
					string key;
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
					{
						<>1__state = -1;
						<>s__3 = Application.platform;
						if (1 == 0)
						{
						}
						RuntimePlatform val = <>s__3;
						key = (((int)val == 1) ? "StandaloneOSX" : (((int)val == 2) ? "StandaloneWindows64" : (((int)val != 13) ? "" : "StandaloneLinux64")));
						if (1 == 0)
						{
						}
						<platformFolder>5__1 = key;
						<bundlesPath>5__2 = Path.Combine(Addressables.RuntimePath, <platformFolder>5__1);
						<>s__4 = BundleAssets.GetEnumerator();
						<>1__state = -3;
						goto IL_04bf;
					}
					case 1:
						<>1__state = -4;
						<loadedAsset>5__20 = <loadAssetRequest>5__19.asset;
						AssetManager.TryAdd<Object>(<loadedAsset>5__20);
						Debug.Log((object)<loadedAsset>5__20.name);
						goto IL_023c;
					case 2:
						<>1__state = -3;
						<bundle>5__10 = <bundleLoadRequest>5__9.assetBundle;
						_manuallyLoadedBundles.Add(<bundle>5__10);
						<>s__21 = <bundle>5__10.GetAllAssetNames();
						<>s__22 = 0;
						goto IL_0481;
					case 3:
						{
							<>1__state = -3;
							<loadedAsset>5__28 = <assetLoadRequest>5__27.asset;
							AssetManager.TryAdd<Object>(<loadedAsset>5__28);
							<assetLoadRequest>5__27 = null;
							<loadedAsset>5__28 = null;
							goto IL_043b;
						}
						IL_0481:
						if (<>s__22 < <>s__21.Length)
						{
							<assetPath>5__23 = <>s__21[<>s__22];
							<>s__24 = <assetNames>5__6;
							<>s__25 = 0;
							goto IL_0451;
						}
						<>s__21 = null;
						<bundlePath>5__8 = null;
						<bundleLoadRequest>5__9 = null;
						<bundle>5__10 = null;
						<bundleName>5__5 = null;
						<assetNames>5__6 = null;
						goto IL_04bf;
						IL_023c:
						<>s__16 = null;
						if (<bundleAlreadyLoaded>5__7)
						{
							goto IL_027b;
						}
						<assetPath>5__15 = null;
						<>s__14++;
						goto IL_0268;
						IL_027b:
						<>s__13 = null;
						if (<bundleAlreadyLoaded>5__7)
						{
							goto IL_02a9;
						}
						<loadedBundle>5__12 = null;
						goto IL_0299;
						IL_0451:
						if (<>s__25 < <>s__24.Length)
						{
							<assetName>5__26 = <>s__24[<>s__25];
							if (<assetPath>5__23.GetAssetRoot() == <assetName>5__26)
							{
								<assetLoadRequest>5__27 = <bundle>5__10.LoadAssetAsync(<assetPath>5__23);
								<>2__current = <assetLoadRequest>5__27;
								<>1__state = 3;
								return true;
							}
							goto IL_043b;
						}
						<>s__24 = null;
						<assetPath>5__23 = null;
						<>s__22++;
						goto IL_0481;
						IL_0268:
						if (<>s__14 < <>s__13.Length)
						{
							<assetPath>5__15 = <>s__13[<>s__14];
							<>s__16 = <assetNames>5__6;
							for (<>s__17 = 0; <>s__17 < <>s__16.Length; <>s__17++)
							{
								<assetName>5__18 = <>s__16[<>s__17];
								if (<assetPath>5__15.GetAssetRoot() == <assetName>5__18)
								{
									<bundleAlreadyLoaded>5__7 = true;
									<loadAssetRequest>5__19 = <loadedBundle>5__12.LoadAssetAsync(<assetPath>5__15);
									<>2__current = <loadAssetRequest>5__19;
									<>1__state = 1;
									return true;
								}
								<assetName>5__18 = null;
							}
							goto IL_023c;
						}
						goto IL_027b;
						IL_0299:
						if (<>s__11.MoveNext())
						{
							<loadedBundle>5__12 = <>s__11.Current;
							<>s__13 = <loadedBundle>5__12.GetAllAssetNames();
							<>s__14 = 0;
							goto IL_0268;
						}
						goto IL_02a9;
						IL_043b:
						<assetName>5__26 = null;
						<>s__25++;
						goto IL_0451;
						IL_02a9:
						<>m__Finally2();
						<>s__11 = null;
						if (<bundleAlreadyLoaded>5__7)
						{
							Debug.Log((object)("Bundle " + <bundleName>5__5 + " already loaded!"));
							goto IL_04bf;
						}
						<bundlePath>5__8 = Path.Combine(<bundlesPath>5__2, <bundleName>5__5 + ".bundle");
						<bundleLoadRequest>5__9 = AssetBundle.LoadFromFileAsync(<bundlePath>5__8);
						<>2__current = <bundleLoadRequest>5__9;
						<>1__state = 2;
						return true;
						IL_04bf:
						if (<>s__4.MoveNext())
						{
							<>s__4.Current.Deconstruct(out key, out string[] value);
							<bundleName>5__5 = key;
							<assetNames>5__6 = value;
							<bundleAlreadyLoaded>5__7 = false;
							<>s__11 = AssetBundle.GetAllLoadedAssetBundles().GetEnumerator();
							<>1__state = -4;
							goto IL_0299;
						}
						<>m__Finally1();
						<>s__4 = default(Dictionary<string, string[]>.Enumerator);
						return false;
					}
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

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

			private void <>m__Finally1()
			{
				<>1__state = -1;
				((IDisposable)<>s__4).Dispose();
			}

			private void <>m__Finally2()
			{
				<>1__state = -3;
				if (<>s__11 != null)
				{
					<>s__11.Dispose();
				}
			}

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

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

			private object <>2__current;

			private Dictionary<string, string[]>.Enumerator <>s__1;

			private string <sceneName>5__2;

			private string[] <prefabNames>5__3;

			private string <loadScenePath>5__4;

			private AsyncOperationHandle<SceneInstance> <loadSceneHandle>5__5;

			private AsyncOperationHandle<SceneInstance> <unloadSceneHandle>5__6;

			private SceneInstance <sceneInstance>5__7;

			private Scene <scene>5__8;

			private GameObject[] <>s__9;

			private int <>s__10;

			private GameObject <rootObj>5__11;

			private string[] <>s__12;

			private int <>s__13;

			private <>c__DisplayClass6_0 <>8__14;

			private GameObject <prefab>5__15;

			private GameObject <prefabCopy>5__16;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				if (num == -3 || (uint)(num - 1) <= 1u)
				{
					try
					{
					}
					finally
					{
						<>m__Finally1();
					}
				}
				<>s__1 = default(Dictionary<string, string[]>.Enumerator);
				<sceneName>5__2 = null;
				<prefabNames>5__3 = null;
				<loadScenePath>5__4 = null;
				<loadSceneHandle>5__5 = default(AsyncOperationHandle<SceneInstance>);
				<unloadSceneHandle>5__6 = default(AsyncOperationHandle<SceneInstance>);
				<sceneInstance>5__7 = default(SceneInstance);
				<>s__9 = null;
				<rootObj>5__11 = null;
				<>s__12 = null;
				<>8__14 = null;
				<prefab>5__15 = null;
				<prefabCopy>5__16 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e2: Invalid comparison between Unknown and I4
				//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f3: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_0106: Unknown result type (might be due to invalid IL or missing references)
				//IL_010b: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00aa: 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_02a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b7: 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)
				try
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						AudioManager.BlockAudioChange = true;
						<>s__1 = ScenePrefabs.GetEnumerator();
						<>1__state = -3;
						break;
					case 1:
						<>1__state = -3;
						if ((int)<loadSceneHandle>5__5.Status == 1)
						{
							<sceneInstance>5__7 = <loadSceneHandle>5__5.Result;
							<scene>5__8 = ((SceneInstance)(ref <sceneInstance>5__7)).Scene;
							<>s__9 = ((Scene)(ref <scene>5__8)).GetRootGameObjects();
							for (<>s__10 = 0; <>s__10 < <>s__9.Length; <>s__10++)
							{
								<rootObj>5__11 = <>s__9[<>s__10];
								<>s__12 = <prefabNames>5__3;
								for (<>s__13 = 0; <>s__13 < <>s__12.Length; <>s__13++)
								{
									<>8__14 = new <>c__DisplayClass6_0();
									<>8__14.prefabName = <>s__12[<>s__13];
									Transform? obj2 = ((IEnumerable<Transform>)<rootObj>5__11.GetComponentsInChildren<Transform>(true)).FirstOrDefault((Func<Transform, bool>)((Transform obj) => ((Object)obj).name == <>8__14.prefabName));
									<prefab>5__15 = ((obj2 != null) ? ((Component)obj2).gameObject : null);
									if (Object.op_Implicit((Object)(object)<prefab>5__15))
									{
										<prefab>5__15.SetActive(false);
										<prefabCopy>5__16 = Object.Instantiate<GameObject>(<prefab>5__15);
										((Object)<prefabCopy>5__16).name = <>8__14.prefabName;
										Object.DontDestroyOnLoad((Object)(object)<prefabCopy>5__16);
										AssetManager.TryAdd<GameObject>(<prefabCopy>5__16);
										<prefabCopy>5__16 = null;
									}
									<prefab>5__15 = null;
									<>8__14 = null;
								}
								<>s__12 = null;
								<rootObj>5__11 = null;
							}
							<>s__9 = null;
							<sceneInstance>5__7 = default(SceneInstance);
						}
						else
						{
							Debug.Log((object)<loadSceneHandle>5__5.OperationException);
						}
						<unloadSceneHandle>5__6 = Addressables.UnloadSceneAsync(<loadSceneHandle>5__5, true);
						<>2__current = <unloadSceneHandle>5__6;
						<>1__state = 2;
						return true;
					case 2:
						<>1__state = -3;
						<loadScenePath>5__4 = null;
						<loadSceneHandle>5__5 = default(AsyncOperationHandle<SceneInstance>);
						<unloadSceneHandle>5__6 = default(AsyncOperationHandle<SceneInstance>);
						<sceneName>5__2 = null;
						<prefabNames>5__3 = null;
						break;
					}
					if (<>s__1.MoveNext())
					{
						<>s__1.Current.Deconstruct(out string key, out string[] value);
						<sceneName>5__2 = key;
						<prefabNames>5__3 = value;
						<loadScenePath>5__4 = "Scenes/" + <sceneName>5__2;
						<loadSceneHandle>5__5 = Addressables.LoadSceneAsync((object)<loadScenePath>5__4, (LoadSceneMode)1, true, 100, (SceneReleaseMode)0);
						<>2__current = <loadSceneHandle>5__5;
						<>1__state = 1;
						return true;
					}
					<>m__Finally1();
					<>s__1 = default(Dictionary<string, string[]>.Enumerator);
					AudioManager.BlockAudioChange = false;
					return false;
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

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

			private void <>m__Finally1()
			{
				<>1__state = -1;
				((IDisposable)<>s__1).Dispose();
			}

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

		private static readonly Dictionary<string, string[]> ScenePrefabs = new Dictionary<string, string[]>
		{
			["Cradle_03"] = new string[1] { "Boss Scene" },
			["Bone_Steel_Servant"] = new string[1] { "Abyss Mass" }
		};

		private static readonly Dictionary<string, string[]> BundleAssets = new Dictionary<string, string[]>
		{
			["blackthread_assets_all"] = new string[1] { "Black Thread Start Enemy Effect" },
			["animations_assets_areacradle"] = new string[1] { "abyss_water_70_percent0001" },
			["tk2danimations_assets_areabone"] = new string[1] { "Abyss Mass Anim" },
			["sfxstatic_assets_areacradle"] = new string[2] { "silk_boss_web_attack_buildup", "silk_boss_web_attack_burst" }
		};

		private static List<AssetBundle> _manuallyLoadedBundles = new List<AssetBundle>();

		private static readonly Dictionary<Type, Dictionary<string, Object>> Assets = new Dictionary<Type, Dictionary<string, Object>>();

		internal static string GetAssetRoot(this string assetPath)
		{
			return assetPath.Split("/").Last().Replace(".asset", "")
				.Replace(".prefab", "")
				.Replace(".wav", "")
				.Replace(".controller", "");
		}

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

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

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

		private static bool Has(string assetName)
		{
			foreach (var (_, dictionary2) in Assets)
			{
				foreach (var (text2, val2) in dictionary2)
				{
					if (assetName == text2 && Object.op_Implicit(val2))
					{
						return true;
					}
				}
			}
			return false;
		}

		private static void TryAdd<T>(T asset) where T : Object
		{
			string name = ((Object)asset).name;
			if (Has(name))
			{
				Debug.Log((object)("Asset \"" + name + "\" has already been loaded!"));
				return;
			}
			Type type = ((object)asset).GetType();
			if (Assets.ContainsKey(type))
			{
				Dictionary<string, Object> dictionary = Assets[type];
				if (dictionary != null)
				{
					if (dictionary.ContainsKey(name))
					{
						Object val = dictionary[name];
						if (val != (Object)null)
						{
							Debug.Log((object)$"There is already an asset \"{name}\" of type \"{type}\"!");
							return;
						}
						Debug.Log((object)$"Key \"{name}\" for sub-dictionary of type \"{type}\" exists, but its value is null; Replacing with new asset...");
						Assets[type][name] = (Object)(object)asset;
					}
					else
					{
						Debug.Log((object)$"Adding asset \"{name}\" of type \"{type}\".");
						Assets[type].Add(name, (Object)(object)asset);
					}
				}
				else
				{
					Debug.Log((object)$"Failed to get sub-dictionary of type \"{type}\"!");
					Assets.Add(type, new Dictionary<string, Object>());
				}
			}
			else
			{
				Assets.Add(type, new Dictionary<string, Object> { [name] = (Object)(object)asset });
				Debug.Log((object)$"Added new sub-dictionary of type \"{type}\" with initial asset \"{name}\".");
			}
		}

		internal static void UnloadAll()
		{
			foreach (Dictionary<string, Object> value in Assets.Values)
			{
				foreach (Object value2 in value.Values)
				{
					Object.DestroyImmediate(value2);
				}
			}
			Assets.Clear();
			GC.Collect();
		}

		internal static void UnloadManualBundles()
		{
			foreach (AssetBundle manuallyLoadedBundle in _manuallyLoadedBundles)
			{
				string bundleName = ((Object)manuallyLoadedBundle).name;
				AssetBundleUnloadOperation val = manuallyLoadedBundle.UnloadAsync(true);
				((AsyncOperation)val).completed += delegate
				{
					Debug.Log((object)("Successfully unloaded bundle \"" + bundleName + "\""));
				};
			}
			_manuallyLoadedBundles.Clear();
			foreach (KeyValuePair<string, Object> item in Assets[typeof(GameObject)])
			{
				item.Deconstruct(out var _, out var value);
				Object val2 = value;
				GameObject val3 = (GameObject)(object)((val2 is GameObject) ? val2 : null);
				if (val3 != null && val3.activeSelf)
				{
					Debug.Log((object)("Recycling all instances of prefab \"" + ((Object)val3).name + "\""));
					ObjectPoolExtensions.RecycleAll(val3);
				}
			}
		}

		internal static T? Get<T>(string assetName) where T : Object
		{
			Type typeFromHandle = typeof(T);
			if (Assets.ContainsKey(typeFromHandle))
			{
				Dictionary<string, Object> dictionary = Assets[typeFromHandle];
				if (dictionary != null)
				{
					if (dictionary.ContainsKey(assetName))
					{
						Object val = dictionary[assetName];
						if (val != (Object)null)
						{
							return (T)(object)((val is T) ? val : null);
						}
						Debug.Log((object)("Failed to get asset \"" + assetName + "\"; asset is null!"));
						return default(T);
					}
					Debug.Log((object)$"Sub-dictionary for type \"{typeFromHandle}\" does not contain key \"{assetName}\"!");
					return default(T);
				}
				Debug.Log((object)$"Failed to get asset \"{assetName}\"; sub-dictionary of key \"{typeFromHandle}\" is null!");
				return default(T);
			}
			Debug.Log((object)$"Could not find a sub-dictionary of type \"{typeFromHandle}\"!");
			return default(T);
		}
	}
	public static class Constants
	{
		public static int LLHP1 => 3600;

		public static int LLHP2 => 3000;

		public static int LLHP3 => 2200;

		public static int LLHP4 => 1200;

		public static int globcount => 7;

		public static int tendrilcount => 6;

		public static float commondelay => 0.1f;

		public static float chargedelay => 0.4f;

		public static float bulletdelay => 0.02f;

		public static float fasterfall => 3f;

		public static string FraudLaceNotes_EN => "This pretentious crybaby covered herself in void and claims herself to be the final boss. I shall beat her out of this emo phase.";
	}
	internal static class ActionUtil
	{
		public static FsmOwnerDefault GOtoFOD(FsmGameObject target)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			return new FsmOwnerDefault
			{
				ownerOption = (OwnerDefaultOption)1,
				gameObject = target
			};
		}

		public static void ClearActionsAfter(this FsmState source, int index)
		{
			FsmStateAction[] array = source.Actions;
			if (index < 0 || index >= array.Length)
			{
				throw new ArgumentOutOfRangeException("index", "Index is out of range of the actions array.");
			}
			Array.Resize(ref array, index + 1);
			source.Actions = array;
		}

		public static void CloneActionsAndTransitions(FsmState source, FsmState target)
		{
			FsmStateAction[] actions = source.Actions;
			FsmTransition[] transitions = source.Transitions;
			target.Actions = (FsmStateAction[])(object)new FsmStateAction[actions.Length];
			target.Transitions = (FsmTransition[])(object)new FsmTransition[transitions.Length];
			for (int i = 0; i < actions.Length; i++)
			{
				FsmStateAction originalActions = actions[i];
				target.Actions[i] = CloneAction(originalActions);
			}
			for (int j = 0; j < transitions.Length; j++)
			{
				FsmTransition originaltransitions = transitions[j];
				target.Transitions[j] = CloneTransition(originaltransitions);
			}
		}

		internal static FsmStateAction CloneAction(FsmStateAction originalActions)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			Type type = ((object)originalActions).GetType();
			FsmStateAction val = (FsmStateAction)Activator.CreateInstance(type);
			FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			FieldInfo[] array = fields;
			foreach (FieldInfo fieldInfo in array)
			{
				fieldInfo.SetValue(val, fieldInfo.GetValue(originalActions));
			}
			return val;
		}

		private static FsmTransition CloneTransition(FsmTransition originaltransitions)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			Type type = ((object)originaltransitions).GetType();
			FsmTransition val = (FsmTransition)Activator.CreateInstance(type);
			FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			FieldInfo[] array = fields;
			foreach (FieldInfo fieldInfo in array)
			{
				fieldInfo.SetValue(val, fieldInfo.GetValue(originaltransitions));
			}
			return val;
		}

		internal static FsmStateAction RandomFloatAdder(FsmFloat target, float min, float max)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: 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)
			//IL_0026: Expected O, but got Unknown
			return (FsmStateAction)new FloatAddRandom
			{
				floatVariable = target,
				addMin = FsmFloat.op_Implicit(min),
				addMax = FsmFloat.op_Implicit(max)
			};
		}

		internal static FsmStateAction RandomFloatSetter(FsmFloat target, float min, float max)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			return (FsmStateAction)new RandomFloat
			{
				min = FsmFloat.op_Implicit(min),
				max = FsmFloat.op_Implicit(max),
				storeResult = target
			};
		}

		internal static FsmStateAction FloatAdder(FsmFloat target, float value)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			return (FsmStateAction)new FloatAdd
			{
				floatVariable = target,
				add = FsmFloat.op_Implicit(value)
			};
		}

		internal static FsmStateAction FloatSetter(FsmFloat target, FsmFloat value)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			return (FsmStateAction)new SetFloatValue
			{
				floatVariable = target,
				floatValue = value,
				everyFrame = false
			};
		}

		internal static FsmStateAction RandomIntSetter(FsmInt target, int min, int max)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			return (FsmStateAction)new RandomInt
			{
				min = FsmInt.op_Implicit(min),
				max = FsmInt.op_Implicit(max),
				storeResult = target
			};
		}

		internal static FsmStateAction IntAdder(FsmInt target, int value)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			return (FsmStateAction)new IntAdd
			{
				intVariable = target,
				add = FsmInt.op_Implicit(value)
			};
		}

		internal static FsmStateAction IntSetter(FsmInt target, FsmInt value)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			return (FsmStateAction)new SetIntValue
			{
				intVariable = target,
				intValue = value,
				everyFrame = false
			};
		}

		internal static FsmStateAction IntComparer(FsmInt Int1, FsmInt Int2, FsmEvent greatevent, FsmEvent equalevent, FsmEvent lessevent)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			return (FsmStateAction)new IntCompare
			{
				integer1 = Int1,
				integer2 = Int2,
				equal = equalevent,
				greaterThan = greatevent,
				lessThan = lessevent,
				everyFrame = false
			};
		}

		internal static FsmStateAction BoolSetter(FsmBool target, bool value)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: 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)
			//IL_0021: Expected O, but got Unknown
			return (FsmStateAction)new SetBoolValue
			{
				boolVariable = target,
				boolValue = FsmBool.op_Implicit(value),
				everyFrame = false
			};
		}

		internal static FsmStateAction BoolSender(GameObject target, string name, FsmBool value)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: 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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			return (FsmStateAction)new SetFsmBool
			{
				gameObject = GOtoFOD(FsmGameObject.op_Implicit(target)),
				fsmName = FsmString.op_Implicit("Control"),
				variableName = FsmString.op_Implicit(name),
				setValue = value,
				everyFrame = false
			};
		}

		internal static FsmStateAction FloatSender(GameObject target, string name, FsmFloat num)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: 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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			return (FsmStateAction)new SetFsmFloat
			{
				gameObject = GOtoFOD(FsmGameObject.op_Implicit(target)),
				fsmName = FsmString.op_Implicit("Control"),
				variableName = FsmString.op_Implicit(name),
				setValue = num,
				everyFrame = false
			};
		}

		internal static FsmStateAction EventSender(FsmGameObject target, FsmString pinevent)
		{
			return EventSenderWithDelay(target, pinevent, 0f);
		}

		internal static FsmStateAction EventSenderWithDelay(FsmGameObject target, FsmString pinevent, float delay)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0024: 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_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			return (FsmStateAction)new SendEventByName
			{
				eventTarget = new FsmEventTarget
				{
					target = (EventTarget)1,
					gameObject = GOtoFOD(target)
				},
				sendEvent = pinevent,
				delay = FsmFloat.op_Implicit(delay),
				everyFrame = false
			};
		}

		internal static FsmStateAction SelfEventSender(FsmString pinevent)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: 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_0037: Expected O, but got Unknown
			return (FsmStateAction)new SendEventByName
			{
				eventTarget = new FsmEventTarget
				{
					target = (EventTarget)0
				},
				sendEvent = pinevent,
				delay = FsmFloat.op_Implicit(0f),
				everyFrame = false
			};
		}

		internal static FsmStateAction SelfAnimatorPosition(FsmFloat x, FsmFloat y, FsmFloat z)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			return (FsmStateAction)new AnimatePositionTo
			{
				gameObject = new FsmOwnerDefault
				{
					OwnerOption = (OwnerDefaultOption)0
				},
				toValue = new FsmVector3
				{
					UseVariable = true,
					Value = new Vector3(x.value, y.value, z.value)
				},
				objectTransform = null,
				localSpace = false,
				time = FsmFloat.op_Implicit(2f),
				finishEvent = FsmEvent.Finished
			};
		}

		internal static FsmStateAction Waiter(float seconds)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			return (FsmStateAction)new Wait
			{
				time = FsmFloat.op_Implicit(seconds),
				finishEvent = FsmEvent.Finished
			};
		}

		internal static FsmStateAction WaiterWithEvent(float seconds, FsmEvent waitevent)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			return (FsmStateAction)new Wait
			{
				time = FsmFloat.op_Implicit(seconds),
				finishEvent = waitevent
			};
		}

		internal static FsmStateAction PositionGetter(FsmGameObject target, FsmFloat x, FsmFloat y)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			return (FsmStateAction)new GetPosition
			{
				gameObject = GOtoFOD(target),
				vector = FsmVector3.op_Implicit(new Vector3(0f, 0f, 0f)),
				x = x,
				y = y,
				z = FsmFloat.op_Implicit(0f),
				everyFrame = false,
				space = (Space)0
			};
		}

		internal static FsmStateAction GOActivator(GameObject target, bool sw)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			return (FsmStateAction)new ActivateGameObject
			{
				gameObject = GOtoFOD(FsmGameObject.op_Implicit(target)),
				activate = FsmBool.op_Implicit(sw),
				recursive = FsmBool.op_Implicit(false),
				resetOnExit = false,
				everyFrame = false
			};
		}

		internal static FsmStateAction SimpleRandomEvent(FsmEvent[] events, FsmFloat[] weights, FsmInt[] eventmax, FsmInt[] missedmax, FsmBool active)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			return (FsmStateAction)new SendRandomEventV4
			{
				events = events,
				weights = weights,
				eventMax = eventmax,
				missedMax = missedmax,
				activeBool = active
			};
		}
	}
	public static class FsmUtil
	{
		[PublicAPI]
		public static PlayMakerFSM? GetFsmPreprocessed(this GameObject go, string fsmName)
		{
			PlayMakerFSM[] components = go.GetComponents<PlayMakerFSM>();
			foreach (PlayMakerFSM val in components)
			{
				if (val.FsmName == fsmName)
				{
					val.Preprocess();
					return val;
				}
			}
			return null;
		}

		private static TVal? GetItemFromArray<TVal>(TVal[] origArray, Func<TVal, bool> isItemCheck) where TVal : class
		{
			foreach (TVal val in origArray)
			{
				if (isItemCheck(val))
				{
					return val;
				}
			}
			return null;
		}

		private static TVal[] GetItemsFromArray<TVal>(TVal[] origArray, Func<TVal, bool> isItemCheck) where TVal : class
		{
			int num = 0;
			foreach (TVal arg in origArray)
			{
				if (isItemCheck(arg))
				{
					num++;
				}
			}
			if (num == origArray.Length)
			{
				return origArray;
			}
			if (num == 0)
			{
				return Array.Empty<TVal>();
			}
			TVal[] array = new TVal[num];
			int num2 = 0;
			foreach (TVal val in origArray)
			{
				if (isItemCheck(val))
				{
					array[num2] = val;
					num2++;
				}
			}
			return array;
		}

		[PublicAPI]
		public static FsmState? GetState(this PlayMakerFSM fsm, string stateName)
		{
			string stateName2 = stateName;
			return GetItemFromArray(fsm.FsmStates, (FsmState x) => x.Name == stateName2);
		}

		[PublicAPI]
		public static FsmState? GetState(this Fsm fsm, string stateName)
		{
			string stateName2 = stateName;
			return GetItemFromArray(fsm.States, (FsmState x) => x.Name == stateName2);
		}

		[PublicAPI]
		public static FsmTransition? GetTransition(this PlayMakerFSM fsm, string stateName, string eventName)
		{
			return fsm.GetState(stateName).GetTransition(eventName);
		}

		[PublicAPI]
		public static FsmTransition? GetTransition(this Fsm fsm, string stateName, string eventName)
		{
			return fsm.GetState(stateName).GetTransition(eventName);
		}

		[PublicAPI]
		public static FsmTransition? GetTransition(this FsmState state, string eventName)
		{
			string eventName2 = eventName;
			return GetItemFromArray(state.Transitions, (FsmTransition x) => x.EventName == eventName2);
		}

		[PublicAPI]
		public static FsmTransition? GetGlobalTransition(this PlayMakerFSM fsm, string globalEventName)
		{
			return fsm.Fsm.GetGlobalTransition(globalEventName);
		}

		[PublicAPI]
		public static FsmTransition? GetGlobalTransition(this Fsm fsm, string globalEventName)
		{
			string globalEventName2 = globalEventName;
			return GetItemFromArray(fsm.GlobalTransitions, (FsmTransition x) => x.EventName == globalEventName2);
		}

		[PublicAPI]
		public static TAction? GetAction<TAction>(this PlayMakerFSM fsm, string stateName, int index) where TAction : FsmStateAction
		{
			return fsm.GetState(stateName).GetAction<TAction>(index);
		}

		[PublicAPI]
		public static TAction? GetAction<TAction>(this Fsm fsm, string stateName, int index) where TAction : FsmStateAction
		{
			return fsm.GetState(stateName).GetAction<TAction>(index);
		}

		[PublicAPI]
		public static TAction? GetAction<TAction>(this FsmState state, int index) where TAction : FsmStateAction
		{
			FsmStateAction obj = state.Actions[index];
			return (TAction)(object)((obj is TAction) ? obj : null);
		}

		[PublicAPI]
		public static FsmStateAction? GetStateAction(this PlayMakerFSM fsm, string stateName, int index)
		{
			return fsm.GetState(stateName).GetStateAction(index);
		}

		[PublicAPI]
		public static FsmStateAction? GetStateAction(this Fsm fsm, string stateName, int index)
		{
			return fsm.GetState(stateName).GetStateAction(index);
		}

		[PublicAPI]
		public static FsmStateAction? GetStateAction(this FsmState state, int index)
		{
			return state.Actions[index];
		}

		[PublicAPI]
		public static TAction[] GetActionsOfType<TAction>(this PlayMakerFSM fsm, string stateName) where TAction : FsmStateAction
		{
			return fsm.GetState(stateName).GetActionsOfType<TAction>();
		}

		[PublicAPI]
		public static TAction[] GetActionsOfType<TAction>(this Fsm fsm, string stateName) where TAction : FsmStateAction
		{
			return fsm.GetState(stateName).GetActionsOfType<TAction>();
		}

		[PublicAPI]
		public static TAction[] GetActionsOfType<TAction>(this FsmState state) where TAction : FsmStateAction
		{
			return Array.ConvertAll(GetItemsFromArray(state.Actions, (FsmStateAction x) => x is TAction), (FsmStateAction x) => (TAction)(object)x);
		}

		[PublicAPI]
		public static TAction? GetFirstActionOfType<TAction>(this PlayMakerFSM fsm, string stateName) where TAction : FsmStateAction
		{
			return fsm.GetState(stateName).GetFirstActionOfType<TAction>();
		}

		[PublicAPI]
		public static TAction? GetFirstActionOfType<TAction>(this Fsm fsm, string stateName) where TAction : FsmStateAction
		{
			return fsm.GetState(stateName).GetFirstActionOfType<TAction>();
		}

		[PublicAPI]
		public static TAction? GetFirstActionOfType<TAction>(this FsmState state) where TAction : FsmStateAction
		{
			int num = -1;
			for (int i = 0; i < state.Actions.Length; i++)
			{
				if (state.Actions[i] is TAction)
				{
					num = i;
					break;
				}
			}
			if (num == -1)
			{
				return default(TAction);
			}
			return state.GetAction<TAction>(num);
		}

		[PublicAPI]
		public static TAction? GetLastActionOfType<TAction>(this PlayMakerFSM fsm, string stateName) where TAction : FsmStateAction
		{
			return fsm.GetState(stateName).GetLastActionOfType<TAction>();
		}

		[PublicAPI]
		public static TAction? GetLastActionOfType<TAction>(this Fsm fsm, string stateName) where TAction : FsmStateAction
		{
			return fsm.GetState(stateName).GetLastActionOfType<TAction>();
		}

		[PublicAPI]
		public static TAction? GetLastActionOfType<TAction>(this FsmState state) where TAction : FsmStateAction
		{
			int num = -1;
			for (int num2 = state.Actions.Length - 1; num2 >= 0; num2--)
			{
				if (state.Actions[num2] is TAction)
				{
					num = num2;
					break;
				}
			}
			if (num == -1)
			{
				return default(TAction);
			}
			return state.GetAction<TAction>(num);
		}

		private static TVal[] AddItemToArray<TVal>(TVal[] origArray, TVal value)
		{
			TVal[] array = new TVal[origArray.Length + 1];
			origArray.CopyTo(array, 0);
			array[origArray.Length] = value;
			return array;
		}

		[PublicAPI]
		public static FsmState AddState(this PlayMakerFSM fsm, string stateName)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			return fsm.Fsm.AddState(new FsmState(fsm.Fsm)
			{
				Name = stateName
			});
		}

		[PublicAPI]
		public static FsmState AddState(this Fsm fsm, string stateName)
		{
			//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_0014: Expected O, but got Unknown
			return fsm.AddState(new FsmState(fsm)
			{
				Name = stateName
			});
		}

		[PublicAPI]
		public static FsmState AddState(this PlayMakerFSM fsm, FsmState state)
		{
			return fsm.Fsm.AddState(state);
		}

		[PublicAPI]
		public static FsmState AddState(this Fsm fsm, FsmState state)
		{
			FsmState[] states = fsm.States;
			FsmState[] array2 = (fsm.States = AddItemToArray(states, state));
			fsm.SaveActions();
			return array2[states.Length];
		}

		[PublicAPI]
		public static FsmState CopyState(this PlayMakerFSM fsm, string fromState, string toState)
		{
			return fsm.Fsm.CopyState(fromState, toState);
		}

		[PublicAPI]
		public static FsmState CopyState(this Fsm fsm, string fromState, string toState)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			FsmState state = fsm.GetState(fromState);
			if (state != null)
			{
				state.SaveActions();
			}
			FsmState val = new FsmState(state)
			{
				Name = toState
			};
			FsmTransition[] transitions = val.Transitions;
			foreach (FsmTransition val2 in transitions)
			{
				val2.ToFsmState = fsm.GetState(val2.ToState);
			}
			fsm.AddState(val);
			return val;
		}

		[PublicAPI]
		public static FsmEvent AddTransition(this PlayMakerFSM fsm, string stateName, string eventName, string toState)
		{
			return fsm.GetState(stateName).AddTransition(eventName, toState);
		}

		[PublicAPI]
		public static FsmEvent AddTransition(this Fsm fsm, string stateName, string eventName, string toState)
		{
			return fsm.GetState(stateName).AddTransition(eventName, toState);
		}

		[PublicAPI]
		public static FsmEvent AddTransition(this FsmState state, string eventName, string toState)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			FsmEvent fsmEvent = FsmEvent.GetFsmEvent(eventName);
			FsmTransition[] transitions = AddItemToArray(state.Transitions, new FsmTransition
			{
				ToState = toState,
				ToFsmState = state.Fsm.GetState(toState),
				FsmEvent = fsmEvent
			});
			state.Transitions = transitions;
			return fsmEvent;
		}

		[PublicAPI]
		public static FsmEvent AddGlobalTransition(this PlayMakerFSM fsm, string globalEventName, string toState)
		{
			return fsm.Fsm.AddGlobalTransition(globalEventName, toState);
		}

		[PublicAPI]
		public static FsmEvent AddGlobalTransition(this Fsm fsm, string globalEventName, string toState)
		{
			//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_0010: Expected O, but got Unknown
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			FsmEvent val = new FsmEvent(globalEventName)
			{
				IsGlobal = true
			};
			FsmTransition[] globalTransitions = AddItemToArray(fsm.GlobalTransitions, new FsmTransition
			{
				ToState = toState,
				ToFsmState = fsm.GetState(toState),
				FsmEvent = val
			});
			fsm.GlobalTransitions = globalTransitions;
			return val;
		}

		[PublicAPI]
		public static void AddAction(this PlayMakerFSM fsm, string stateName, FsmStateAction action)
		{
			fsm.GetState(stateName).AddAction(action);
		}

		[PublicAPI]
		public static void AddAction(this Fsm fsm, string stateName, FsmStateAction action)
		{
			fsm.GetState(stateName).AddAction(action);
		}

		[PublicAPI]
		public static void AddAction(this FsmState state, FsmStateAction action)
		{
			FsmStateAction[] actions = AddItemToArray(state.Actions, action);
			state.Actions = actions;
			action.Init(state);
		}

		[PublicAPI]
		public static void AddActions(this PlayMakerFSM fsm, string stateName, params FsmStateAction[] actions)
		{
			fsm.GetState(stateName).AddActions(actions);
		}

		[PublicAPI]
		public static void AddActions(this Fsm fsm, string stateName, params FsmStateAction[] actions)
		{
			fsm.GetState(stateName).AddActions(actions);
		}

		[PublicAPI]
		public static void AddActions(this FsmState state, params FsmStateAction[] actions)
		{
			foreach (FsmStateAction action in actions)
			{
				state.AddAction(action);
			}
		}

		[PublicAPI]
		public static void AddMethod(this PlayMakerFSM fsm, string stateName, Action<FsmStateAction> method)
		{
			fsm.GetState(stateName).AddMethod(method);
		}

		[PublicAPI]
		public static void AddMethod(this Fsm fsm, string stateName, Action<FsmStateAction> method)
		{
			fsm.GetState(stateName).AddMethod(method);
		}

		[PublicAPI]
		public static void AddMethod(this FsmState state, Action<FsmStateAction> method)
		{
			DelegateAction<FsmStateAction> delegateAction = new DelegateAction<FsmStateAction>
			{
				Method = method
			};
			delegateAction.Arg = (FsmStateAction?)(object)delegateAction;
			state.AddAction((FsmStateAction)(object)delegateAction);
		}

		[PublicAPI]
		public static void AddLambdaMethod(this PlayMakerFSM fsm, string stateName, Action<Action> method)
		{
			fsm.GetState(stateName).AddLambdaMethod(method);
		}

		[PublicAPI]
		public static void AddLambdaMethod(this Fsm fsm, string stateName, Action<Action> method)
		{
			fsm.GetState(stateName).AddLambdaMethod(method);
		}

		[PublicAPI]
		public static void AddLambdaMethod(this FsmState state, Action<Action> method)
		{
			DelegateAction<Action> delegateAction = new DelegateAction<Action>
			{
				Method = method
			};
			delegateAction.Arg = ((FsmStateAction)delegateAction).Finish;
			state.AddAction((FsmStateAction)(object)delegateAction);
		}

		private static TVal[] InsertItemIntoArray<TVal>(TVal[] origArray, TVal value, int index)
		{
			int num = origArray.Length;
			if (index < 0 || index > num + 1)
			{
				throw new ArgumentOutOfRangeException($"Index {index} was out of range for array with length {num}!");
			}
			TVal[] array = new TVal[num + 1];
			for (int i = 0; i < index; i++)
			{
				array[i] = origArray[i];
			}
			array[index] = value;
			for (int i = index; i < num; i++)
			{
				array[i + 1] = origArray[i];
			}
			return array;
		}

		[PublicAPI]
		public static void InsertAction(this PlayMakerFSM fsm, string stateName, FsmStateAction action, int index)
		{
			fsm.GetState(stateName).InsertAction(index, action);
		}

		[PublicAPI]
		public static void InsertAction(this PlayMakerFSM fsm, string stateName, int index, FsmStateAction action)
		{
			fsm.GetState(stateName).InsertAction(index, action);
		}

		[PublicAPI]
		public static void InsertAction(this Fsm fsm, string stateName, FsmStateAction action, int index)
		{
			fsm.GetState(stateName).InsertAction(index, action);
		}

		[PublicAPI]
		public static void InsertAction(this Fsm fsm, string stateName, int index, FsmStateAction action)
		{
			fsm.GetState(stateName).InsertAction(index, action);
		}

		[PublicAPI]
		public static void InsertAction(this FsmState state, FsmStateAction action, int index)
		{
			state.InsertAction(index, action);
		}

		[PublicAPI]
		public static void InsertAction(this FsmState state, int index, FsmStateAction action)
		{
			FsmStateAction[] actions = InsertItemIntoArray(state.Actions, action, index);
			state.Actions = actions;
			action.Init(state);
		}

		[PublicAPI]
		public static void InsertActions(this PlayMakerFSM fsm, string stateName, int index, params FsmStateAction[] actions)
		{
			fsm.GetState(stateName).InsertActions(index, actions);
		}

		[PublicAPI]
		public static void InsertActions(this Fsm fsm, string stateName, int index, params FsmStateAction[] actions)
		{
			fsm.GetState(stateName).InsertActions(index, actions);
		}

		[PublicAPI]
		public static void InsertActions(this FsmState state, int index, params FsmStateAction[] actions)
		{
			foreach (FsmStateAction action in actions)
			{
				state.InsertAction(action, index);
				index++;
			}
		}

		[PublicAPI]
		public static void InsertMethod(this PlayMakerFSM fsm, string stateName, Action<FsmStateAction> method, int index)
		{
			fsm.GetState(stateName).InsertMethod(index, method);
		}

		[PublicAPI]
		public static void InsertMethod(this PlayMakerFSM fsm, string stateName, int index, Action<FsmStateAction> method)
		{
			fsm.GetState(stateName).InsertMethod(index, method);
		}

		[PublicAPI]
		public static void InsertMethod(this Fsm fsm, string stateName, Action<FsmStateAction> method, int index)
		{
			fsm.GetState(stateName).InsertMethod(index, method);
		}

		[PublicAPI]
		public static void InsertMethod(this Fsm fsm, string stateName, int index, Action<FsmStateAction> method)
		{
			fsm.GetState(stateName).InsertMethod(index, method);
		}

		[PublicAPI]
		public static void InsertMethod(this FsmState state, Action<FsmStateAction> method, int index)
		{
			state.InsertMethod(index, method);
		}

		[PublicAPI]
		public static void InsertMethod(this FsmState state, int index, Action<FsmStateAction> method)
		{
			DelegateAction<FsmStateAction> delegateAction = new DelegateAction<FsmStateAction>
			{
				Method = method
			};
			delegateAction.Arg = (FsmStateAction?)(object)delegateAction;
			state.InsertAction((FsmStateAction)(object)delegateAction, index);
		}

		[PublicAPI]
		public static void InsertLambdaMethod(this PlayMakerFSM fsm, string stateName, Action<Action> method, int index)
		{
			fsm.GetState(stateName).InsertLambdaMethod(index, method);
		}

		[PublicAPI]
		public static void InsertLambdaMethod(this PlayMakerFSM fsm, string stateName, int index, Action<Action> method)
		{
			fsm.GetState(stateName).InsertLambdaMethod(index, method);
		}

		[PublicAPI]
		public static void InsertLambdaMethod(this Fsm fsm, string stateName, Action<Action> method, int index)
		{
			fsm.GetState(stateName).InsertLambdaMethod(index, method);
		}

		[PublicAPI]
		public static void InsertLambdaMethod(this Fsm fsm, string stateName, int index, Action<Action> method)
		{
			fsm.GetState(stateName).InsertLambdaMethod(index, method);
		}

		[PublicAPI]
		public static void InsertLambdaMethod(this FsmState state, Action<Action> method, int index)
		{
			state.InsertLambdaMethod(index, method);
		}

		[PublicAPI]
		public static void InsertLambdaMethod(this FsmState state, int index, Action<Action> method)
		{
			DelegateAction<Action> delegateAction = new DelegateAction<Action>
			{
				Method = method
			};
			delegateAction.Arg = ((FsmStateAction)delegateAction).Finish;
			state.InsertAction((FsmStateAction)(object)delegateAction, index);
		}

		[PublicAPI]
		public static void ReplaceAction(this PlayMakerFSM fsm, string stateName, FsmStateAction action, int index)
		{
			fsm.GetState(stateName).ReplaceAction(index, action);
		}

		[PublicAPI]
		public static void ReplaceAction(this PlayMakerFSM fsm, string stateName, int index, FsmStateAction action)
		{
			fsm.GetState(stateName).ReplaceAction(index, action);
		}

		[PublicAPI]
		public static void ReplaceAction(this Fsm fsm, string stateName, FsmStateAction action, int index)
		{
			fsm.GetState(stateName).ReplaceAction(index, action);
		}

		[PublicAPI]
		public static void ReplaceAction(this Fsm fsm, string stateName, int index, FsmStateAction action)
		{
			fsm.GetState(stateName).ReplaceAction(index, action);
		}

		[PublicAPI]
		public static void ReplaceAction(this FsmState state, FsmStateAction action, int index)
		{
			state.ReplaceAction(index, action);
		}

		[PublicAPI]
		public static void ReplaceAction(this FsmState state, int index, FsmStateAction action)
		{
			state.Actions[index] = action;
			action.Init(state);
		}

		[PublicAPI]
		public static void ReplaceAllActions(this PlayMakerFSM fsm, string stateName, params FsmStateAction[] actions)
		{
			fsm.GetState(stateName).ReplaceAllActions(actions);
		}

		[PublicAPI]
		public static void ReplaceAllActions(this Fsm fsm, string stateName, params FsmStateAction[] actions)
		{
			fsm.GetState(stateName).ReplaceAllActions(actions);
		}

		[PublicAPI]
		public static void ReplaceAllActions(this FsmState state, params FsmStateAction[] actions)
		{
			state.Actions = actions;
			foreach (FsmStateAction val in actions)
			{
				val.Init(state);
			}
		}

		[PublicAPI]
		public static bool ChangeTransition(this PlayMakerFSM fsm, string stateName, string eventName, string toState)
		{
			return fsm.GetState(stateName).ChangeTransition(eventName, toState);
		}

		[PublicAPI]
		public static bool ChangeTransition(this Fsm fsm, string stateName, string eventName, string toState)
		{
			return fsm.GetState(stateName).ChangeTransition(eventName, toState);
		}

		[PublicAPI]
		public static bool ChangeTransition(this FsmState state, string eventName, string toState)
		{
			FsmTransition transition = state.GetTransition(eventName);
			if (transition == null)
			{
				return false;
			}
			transition.ToState = toState;
			transition.ToFsmState = state.Fsm.GetState(toState);
			return true;
		}

		[PublicAPI]
		public static bool ChangeGlobalTransition(this PlayMakerFSM fsm, string globalEventName, string toState)
		{
			return fsm.Fsm.ChangeGlobalTransition(globalEventName, toState);
		}

		[PublicAPI]
		public static bool ChangeGlobalTransition(this Fsm fsm, string globalEventName, string toState)
		{
			FsmTransition globalTransition = fsm.GetGlobalTransition(globalEventName);
			if (globalTransition == null)
			{
				return false;
			}
			globalTransition.ToState = toState;
			globalTransition.ToFsmState = fsm.GetState(toState);
			return true;
		}

		private static TVal[] RemoveItemsFromArray<TVal>(TVal[] origArray, Func<TVal, bool> shouldBeRemovedCallback)
		{
			int num = 0;
			foreach (TVal arg in origArray)
			{
				if (shouldBeRemovedCallback(arg))
				{
					num++;
				}
			}
			if (num == 0)
			{
				return origArray;
			}
			TVal[] array = new TVal[origArray.Length - num];
			for (int num2 = origArray.Length - 1; num2 >= 0; num2--)
			{
				TVal val = origArray[num2];
				if (shouldBeRemovedCallback(val))
				{
					num--;
				}
				else
				{
					array[num2 - num] = val;
				}
			}
			return array;
		}

		[PublicAPI]
		public static void RemoveState(this PlayMakerFSM fsm, string stateName)
		{
			fsm.Fsm.RemoveState(stateName);
		}

		[PublicAPI]
		public static void RemoveState(this Fsm fsm, string stateName)
		{
			string stateName2 = stateName;
			fsm.States = RemoveItemsFromArray(fsm.States, (FsmState x) => x.Name == stateName2);
		}

		[PublicAPI]
		public static void RemoveTransition(this PlayMakerFSM fsm, string stateName, string eventName)
		{
			fsm.GetState(stateName).RemoveTransition(eventName);
		}

		[PublicAPI]
		public static void RemoveTransition(this Fsm fsm, string stateName, string eventName)
		{
			fsm.GetState(stateName).RemoveTransition(eventName);
		}

		[PublicAPI]
		public static void RemoveTransition(this FsmState state, string eventName)
		{
			string eventName2 = eventName;
			state.Transitions = RemoveItemsFromArray(state.Transitions, (FsmTransition x) => x.EventName == eventName2);
		}

		[PublicAPI]
		public static void RemoveGlobalTransition(this PlayMakerFSM fsm, string globalEventName)
		{
			fsm.Fsm.RemoveGlobalTransition(globalEventName);
		}

		[PublicAPI]
		public static void RemoveGlobalTransition(this Fsm fsm, string globalEventName)
		{
			string globalEventName2 = globalEventName;
			fsm.GlobalTransitions = RemoveItemsFromArray(fsm.GlobalTransitions, (FsmTransition x) => x.EventName == globalEventName2);
		}

		[PublicAPI]
		public static void RemoveTransitionsTo(this PlayMakerFSM fsm, string toState)
		{
			fsm.Fsm.RemoveTransitionsTo(toState);
		}

		[PublicAPI]
		public static void RemoveTransitionsTo(this Fsm fsm, string toState)
		{
			FsmState[] states = fsm.States;
			foreach (FsmState state in states)
			{
				state.RemoveTransitionsTo(toState);
			}
		}

		[PublicAPI]
		public static void RemoveTransitionsTo(this PlayMakerFSM fsm, string stateName, string toState)
		{
			fsm.GetState(stateName).RemoveTransitionsTo(toState);
		}

		[PublicAPI]
		public static void RemoveTransitionsTo(this Fsm fsm, string stateName, string toState)
		{
			fsm.GetState(stateName).RemoveTransitionsTo(toState);
		}

		[PublicAPI]
		public static void RemoveTransitionsTo(this FsmState state, string toState)
		{
			string toState2 = toState;
			state.Transitions = RemoveItemsFromArray(state.Transitions, (FsmTransition x) => x.ToState == toState2);
		}

		[PublicAPI]
		public static void RemoveTransitions(this PlayMakerFSM fsm, string stateName)
		{
			fsm.GetState(stateName).RemoveTransitions();
		}

		[PublicAPI]
		public static void RemoveTransitions(this Fsm fsm, string stateName)
		{
			fsm.GetState(stateName).RemoveTransitions();
		}

		[PublicAPI]
		public static void RemoveTransitions(this FsmState state)
		{
			state.Transitions = Array.Empty<FsmTransition>();
		}

		[PublicAPI]
		public static bool RemoveAction(this PlayMakerFSM fsm, string stateName, int index)
		{
			return fsm.GetState(stateName).RemoveAction(index);
		}

		[PublicAPI]
		public static bool RemoveAction(this Fsm fsm, string stateName, int index)
		{
			return fsm.GetState(stateName).RemoveAction(index);
		}

		[PublicAPI]
		public static bool RemoveAction(this FsmState state, int index)
		{
			FsmStateAction[] actions = state.Actions;
			if (index < 0 || index >= actions.Length)
			{
				return false;
			}
			FsmStateAction[] array = (FsmStateAction[])(object)new FsmStateAction[actions.Length - 1];
			int num = array.Length;
			for (int i = 0; i < index; i++)
			{
				array[i] = actions[i];
			}
			for (int i = index; i < num; i++)
			{
				array[i] = actions[i + 1];
			}
			state.Actions = array;
			return true;
		}

		[PublicAPI]
		public static void RemoveActionsOfType<TAction>(this PlayMakerFSM fsm)
		{
			fsm.Fsm.RemoveActionsOfType<TAction>();
		}

		[PublicAPI]
		public static void RemoveActionsOfType<TAction>(this Fsm fsm)
		{
			FsmState[] states = fsm.States;
			foreach (FsmState state in states)
			{
				state.RemoveActionsOfType<TAction>();
			}
		}

		[PublicAPI]
		public static void RemoveActionsOfType<TAction>(this PlayMakerFSM fsm, string stateName)
		{
			fsm.GetState(stateName).RemoveActionsOfType<TAction>();
		}

		[PublicAPI]
		public static void RemoveActionsOfType<TAction>(this Fsm fsm, string stateName)
		{
			fsm.GetState(stateName).RemoveActionsOfType<TAction>();
		}

		[PublicAPI]
		public static void RemoveActionsOfType<TAction>(this FsmState state)
		{
			state.Actions = RemoveItemsFromArray(state.Actions, (FsmStateAction x) => x is TAction);
		}

		[PublicAPI]
		public static void RemoveFirstActionOfType<TAction>(this PlayMakerFSM fsm, string stateName)
		{
			fsm.GetState(stateName).RemoveFirstActionOfType<TAction>();
		}

		[PublicAPI]
		public static void RemoveFirstActionOfType<TAction>(this Fsm fsm, string stateName)
		{
			fsm.GetState(stateName).RemoveFirstActionOfType<TAction>();
		}

		[PublicAPI]
		public static void RemoveFirstActionOfType<TAction>(this FsmState state)
		{
			int num = -1;
			for (int i = 0; i < state.Actions.Length; i++)
			{
				if (state.Actions[i] is TAction)
				{
					num = i;
					break;
				}
			}
			if (num != -1)
			{
				state.RemoveAction(num);
			}
		}

		[PublicAPI]
		public static void RemoveLastActionOfType<TAction>(this PlayMakerFSM fsm, string stateName)
		{
			fsm.GetState(stateName).RemoveLastActionOfType<TAction>();
		}

		[PublicAPI]
		public static void RemoveLastActionOfType<TAction>(this Fsm fsm, string stateName)
		{
			fsm.GetState(stateName).RemoveLastActionOfType<TAction>();
		}

		[PublicAPI]
		public static void RemoveLastActionOfType<TAction>(this FsmState state)
		{
			int num = -1;
			for (int num2 = state.Actions.Length - 1; num2 >= 0; num2--)
			{
				if (state.Actions[num2] is TAction)
				{
					num = num2;
					break;
				}
			}
			if (num != -1)
			{
				state.RemoveAction(num);
			}
		}

		[PublicAPI]
		public static bool DisableAction(this PlayMakerFSM fsm, string stateName, int index)
		{
			return fsm.GetState(stateName).DisableAction(index);
		}

		[PublicAPI]
		public static bool DisableAction(this Fsm fsm, string stateName, int index)
		{
			return fsm.GetState(stateName).DisableAction(index);
		}

		[PublicAPI]
		public static bool DisableAction(this FsmState state, int index)
		{
			if (index < 0 || index >= state.Actions.Length)
			{
				return false;
			}
			state.Actions[index].Enabled = false;
			return true;
		}

		[PublicAPI]
		public static bool DisableActions(this PlayMakerFSM fsm, string stateName, params int[] indices)
		{
			return fsm.GetState(stateName).DisableActions(indices);
		}

		[PublicAPI]
		public static bool DisableActions(this Fsm fsm, string stateName, params int[] indices)
		{
			return fsm.GetState(stateName).DisableActions(indices);
		}

		[PublicAPI]
		public static bool DisableActions(this FsmState state, params int[] indices)
		{
			bool flag = true;
			foreach (int index in indices)
			{
				flag = flag && state.DisableAction(index);
			}
			return flag;
		}

		[PublicAPI]
		public static void DisableActionsOfType<TAction>(this PlayMakerFSM fsm)
		{
			fsm.Fsm.DisableActionsOfType<TAction>();
		}

		[PublicAPI]
		public static void DisableActionsOfType<TAction>(this Fsm fsm)
		{
			FsmState[] states = fsm.States;
			foreach (FsmState state in states)
			{
				state.DisableActionsOfType<TAction>();
			}
		}

		[PublicAPI]
		public static void DisableActionsOfType<TAction>(this PlayMakerFSM fsm, string stateName)
		{
			fsm.GetState(stateName).DisableActionsOfType<TAction>();
		}

		[PublicAPI]
		public static void DisableActionsOfType<TAction>(this Fsm fsm, string stateName)
		{
			fsm.GetState(stateName).DisableActionsOfType<TAction>();
		}

		[PublicAPI]
		public static void DisableActionsOfType<TAction>(this FsmState state)
		{
			FsmStateAction[] actions = state.Actions;
			foreach (FsmStateAction val in actions)
			{
				if (val is TAction)
				{
					val.Enabled = false;
				}
			}
		}

		private static TVar[] MakeNewVariableArray<TVar>(TVar[] orig, string name) where TVar : NamedVariable, new()
		{
			TVar[] array = new TVar[orig.Length + 1];
			orig.CopyTo(array, 0);
			int num = orig.Length;
			TVar val = new TVar();
			((NamedVariable)val).name = name;
			array[num] = val;
			return array;
		}

		[PublicAPI]
		public static FsmFloat AddFloatVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.AddFloatVariable(name);
		}

		[PublicAPI]
		public static FsmFloat AddFloatVariable(this Fsm fsm, string name)
		{
			FsmFloat[] array = MakeNewVariableArray<FsmFloat>(fsm.Variables.FloatVariables, name);
			fsm.Variables.FloatVariables = array;
			return array[^1];
		}

		[PublicAPI]
		public static FsmInt AddIntVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.AddIntVariable(name);
		}

		[PublicAPI]
		public static FsmInt AddIntVariable(this Fsm fsm, string name)
		{
			FsmInt[] array = MakeNewVariableArray<FsmInt>(fsm.Variables.IntVariables, name);
			fsm.Variables.IntVariables = array;
			return array[^1];
		}

		[PublicAPI]
		public static FsmBool AddBoolVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.AddBoolVariable(name);
		}

		[PublicAPI]
		public static FsmBool AddBoolVariable(this Fsm fsm, string name)
		{
			FsmBool[] array = MakeNewVariableArray<FsmBool>(fsm.Variables.BoolVariables, name);
			fsm.Variables.BoolVariables = array;
			return array[^1];
		}

		[PublicAPI]
		public static FsmString AddStringVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.AddStringVariable(name);
		}

		[PublicAPI]
		public static FsmString AddStringVariable(this Fsm fsm, string name)
		{
			FsmString[] array = MakeNewVariableArray<FsmString>(fsm.Variables.StringVariables, name);
			fsm.Variables.StringVariables = array;
			return array[^1];
		}

		[PublicAPI]
		public static FsmVector2 AddVector2Variable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.AddVector2Variable(name);
		}

		[PublicAPI]
		public static FsmVector2 AddVector2Variable(this Fsm fsm, string name)
		{
			FsmVector2[] array = MakeNewVariableArray<FsmVector2>(fsm.Variables.Vector2Variables, name);
			fsm.Variables.Vector2Variables = array;
			return array[^1];
		}

		[PublicAPI]
		public static FsmVector3 AddVector3Variable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.AddVector3Variable(name);
		}

		[PublicAPI]
		public static FsmVector3 AddVector3Variable(this Fsm fsm, string name)
		{
			FsmVector3[] array = MakeNewVariableArray<FsmVector3>(fsm.Variables.Vector3Variables, name);
			fsm.Variables.Vector3Variables = array;
			return array[^1];
		}

		[PublicAPI]
		public static FsmColor AddColorVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.AddColorVariable(name);
		}

		[PublicAPI]
		public static FsmColor AddColorVariable(this Fsm fsm, string name)
		{
			FsmColor[] array = MakeNewVariableArray<FsmColor>(fsm.Variables.ColorVariables, name);
			fsm.Variables.ColorVariables = array;
			return array[^1];
		}

		[PublicAPI]
		public static FsmRect AddRectVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.AddRectVariable(name);
		}

		[PublicAPI]
		public static FsmRect AddRectVariable(this Fsm fsm, string name)
		{
			FsmRect[] array = MakeNewVariableArray<FsmRect>(fsm.Variables.RectVariables, name);
			fsm.Variables.RectVariables = array;
			return array[^1];
		}

		[PublicAPI]
		public static FsmQuaternion AddQuaternionVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.AddQuaternionVariable(name);
		}

		[PublicAPI]
		public static FsmQuaternion AddQuaternionVariable(this Fsm fsm, string name)
		{
			FsmQuaternion[] array = MakeNewVariableArray<FsmQuaternion>(fsm.Variables.QuaternionVariables, name);
			fsm.Variables.QuaternionVariables = array;
			return array[^1];
		}

		[PublicAPI]
		public static FsmGameObject AddGameObjectVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.AddGameObjectVariable(name);
		}

		[PublicAPI]
		public static FsmGameObject AddGameObjectVariable(this Fsm fsm, string name)
		{
			FsmGameObject[] array = MakeNewVariableArray<FsmGameObject>(fsm.Variables.GameObjectVariables, name);
			fsm.Variables.GameObjectVariables = array;
			return array[^1];
		}

		private static TVar? FindInVariableArray<TVar>(TVar[] orig, string name) where TVar : NamedVariable, new()
		{
			foreach (TVar val in orig)
			{
				if (((NamedVariable)val).Name == name)
				{
					return val;
				}
			}
			return default(TVar);
		}

		[PublicAPI]
		public static FsmFloat? FindFloatVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.FindFloatVariable(name);
		}

		[PublicAPI]
		public static FsmFloat? FindFloatVariable(this Fsm fsm, string name)
		{
			return FindInVariableArray<FsmFloat>(fsm.Variables.FloatVariables, name);
		}

		[PublicAPI]
		public static FsmInt? FindIntVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.FindIntVariable(name);
		}

		[PublicAPI]
		public static FsmInt? FindIntVariable(this Fsm fsm, string name)
		{
			return FindInVariableArray<FsmInt>(fsm.Variables.IntVariables, name);
		}

		[PublicAPI]
		public static FsmBool? FindBoolVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.FindBoolVariable(name);
		}

		[PublicAPI]
		public static FsmBool? FindBoolVariable(this Fsm fsm, string name)
		{
			return FindInVariableArray<FsmBool>(fsm.Variables.BoolVariables, name);
		}

		[PublicAPI]
		public static FsmString? FindStringVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.FindStringVariable(name);
		}

		[PublicAPI]
		public static FsmString? FindStringVariable(this Fsm fsm, string name)
		{
			return FindInVariableArray<FsmString>(fsm.Variables.StringVariables, name);
		}

		[PublicAPI]
		public static FsmVector2? FindVector2Variable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.FindVector2Variable(name);
		}

		[PublicAPI]
		public static FsmVector2? FindVector2Variable(this Fsm fsm, string name)
		{
			return FindInVariableArray<FsmVector2>(fsm.Variables.Vector2Variables, name);
		}

		[PublicAPI]
		public static FsmVector3? FindVector3Variable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.FindVector3Variable(name);
		}

		[PublicAPI]
		public static FsmVector3? FindVector3Variable(this Fsm fsm, string name)
		{
			return FindInVariableArray<FsmVector3>(fsm.Variables.Vector3Variables, name);
		}

		[PublicAPI]
		public static FsmColor? FindColorVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.FindColorVariable(name);
		}

		[PublicAPI]
		public static FsmColor? FindColorVariable(this Fsm fsm, string name)
		{
			return FindInVariableArray<FsmColor>(fsm.Variables.ColorVariables, name);
		}

		[PublicAPI]
		public static FsmRect? FindRectVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.FindRectVariable(name);
		}

		[PublicAPI]
		public static FsmRect? FindRectVariable(this Fsm fsm, string name)
		{
			return FindInVariableArray<FsmRect>(fsm.Variables.RectVariables, name);
		}

		[PublicAPI]
		public static FsmQuaternion? FindQuaternionVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.FindQuaternionVariable(name);
		}

		[PublicAPI]
		public static FsmQuaternion? FindQuaternionVariable(this Fsm fsm, string name)
		{
			return FindInVariableArray<FsmQuaternion>(fsm.Variables.QuaternionVariables, name);
		}

		[PublicAPI]
		public static FsmGameObject? FindGameObjectVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.FindGameObjectVariable(name);
		}

		[PublicAPI]
		public static FsmGameObject? FindGameObjectVariable(this Fsm fsm, string name)
		{
			return FindInVariableArray<FsmGameObject>(fsm.Variables.GameObjectVariables, name);
		}

		[PublicAPI]
		public static FsmFloat GetFloatVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.GetFloatVariable(name);
		}

		[PublicAPI]
		public static FsmFloat GetFloatVariable(this Fsm fsm, string name)
		{
			FsmFloat val = fsm.FindFloatVariable(name);
			if (val != null)
			{
				return val;
			}
			return fsm.AddFloatVariable(name);
		}

		[PublicAPI]
		public static FsmInt GetIntVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.GetIntVariable(name);
		}

		[PublicAPI]
		public static FsmInt GetIntVariable(this Fsm fsm, string name)
		{
			FsmInt val = fsm.FindIntVariable(name);
			if (val != null)
			{
				return val;
			}
			return fsm.AddIntVariable(name);
		}

		[PublicAPI]
		public static FsmBool GetBoolVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.GetBoolVariable(name);
		}

		[PublicAPI]
		public static FsmBool GetBoolVariable(this Fsm fsm, string name)
		{
			FsmBool val = fsm.FindBoolVariable(name);
			if (val != null)
			{
				return val;
			}
			return fsm.AddBoolVariable(name);
		}

		[PublicAPI]
		public static FsmString GetStringVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.GetStringVariable(name);
		}

		[PublicAPI]
		public static FsmString GetStringVariable(this Fsm fsm, string name)
		{
			FsmString val = fsm.FindStringVariable(name);
			if (val != null)
			{
				return val;
			}
			return fsm.AddStringVariable(name);
		}

		[PublicAPI]
		public static FsmVector2 GetVector2Variable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.GetVector2Variable(name);
		}

		[PublicAPI]
		public static FsmVector2 GetVector2Variable(this Fsm fsm, string name)
		{
			FsmVector2 val = fsm.FindVector2Variable(name);
			if (val != null)
			{
				return val;
			}
			return fsm.AddVector2Variable(name);
		}

		[PublicAPI]
		public static FsmVector3 GetVector3Variable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.GetVector3Variable(name);
		}

		[PublicAPI]
		public static FsmVector3 GetVector3Variable(this Fsm fsm, string name)
		{
			FsmVector3 val = fsm.FindVector3Variable(name);
			if (val != null)
			{
				return val;
			}
			return fsm.AddVector3Variable(name);
		}

		[PublicAPI]
		public static FsmColor GetColorVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.GetColorVariable(name);
		}

		[PublicAPI]
		public static FsmColor GetColorVariable(this Fsm fsm, string name)
		{
			FsmColor val = fsm.FindColorVariable(name);
			if (val != null)
			{
				return val;
			}
			return fsm.AddColorVariable(name);
		}

		[PublicAPI]
		public static FsmRect GetRectVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.GetRectVariable(name);
		}

		[PublicAPI]
		public static FsmRect GetRectVariable(this Fsm fsm, string name)
		{
			FsmRect val = fsm.FindRectVariable(name);
			if (val != null)
			{
				return val;
			}
			return fsm.AddRectVariable(name);
		}

		[PublicAPI]
		public static FsmQuaternion GetQuaternionVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.GetQuaternionVariable(name);
		}

		[PublicAPI]
		public static FsmQuaternion GetQuaternionVariable(this Fsm fsm, string name)
		{
			FsmQuaternion val = fsm.FindQuaternionVariable(name);
			if (val != null)
			{
				return val;
			}
			return fsm.AddQuaternionVariable(name);
		}

		[PublicAPI]
		public static FsmGameObject GetGameObjectVariable(this PlayMakerFSM fsm, string name)
		{
			return fsm.Fsm.GetGameObjectVariable(name);
		}

		[PublicAPI]
		public static FsmGameObject GetGameObjectVariable(this Fsm fsm, string name)
		{
			FsmGameObject val = fsm.FindGameObjectVariable(name);
			if (val != null)
			{
				return val;
			}
			return fsm.AddGameObjectVariable(name);
		}
	}
	internal static class ImageUtil
	{
		public static byte[] GetBytesFromResources(this Assembly asm, string fileName)
		{
			string[] manifestResourceNames = asm.GetManifestResourceNames();
			string[] array = manifestResourceNames;
			foreach (string text in array)
			{
				if (!text.EndsWith(fileName))
				{
					continue;
				}
				using Stream stream = asm.GetManifestResourceStream(text);
				if (stream == null)
				{
					continue;
				}
				byte[] array2 = new byte[stream.Length];
				stream.Read(array2, 0, array2.Length);
				stream.Dispose();
				return array2;
			}
			return null;
		}

		public static Texture2D GetTextureFromResources(string fileName)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Expected O, but got Unknown
			Texture2D val = new Texture2D(2, 2);
			byte[] bytesFromResources = Assembly.GetCallingAssembly().GetBytesFromResources(fileName);
			if (bytesFromResources == null)
			{
				return null;
			}
			ImageConversion.LoadImage(val, bytesFromResources);
			val.Apply();
			return val;
		}
	}
	public class InvokeCoroutine : FsmStateAction
	{
		[CompilerGenerated]
		private sealed class <Coroutine>d__3 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public InvokeCoroutine <>4__this;

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

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

			[DebuggerHidden]
			public <Coroutine>d__3(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 = <>4__this._coroutine();
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					((FsmStateAction)<>4__this).Finish();
					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 readonly Func<IEnumerator> _coroutine;

		private readonly bool _wait;

		public InvokeCoroutine(Func<IEnumerator> coroutine, bool wait)
		{
			_coroutine = coroutine;
			_wait = wait;
		}

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

		public override void OnEnter()
		{
			((FsmStateAction)this).Fsm.Owner.StartCoroutine(_wait ? Coroutine() : _coroutine());
			if (!_wait)
			{
				((FsmStateAction)this).Finish();
			}
		}
	}
	public class InvokeMethod : FsmStateAction
	{
		private readonly Action _action;

		public InvokeMethod(Action action)
		{
			_action = action;
		}

		public override void OnEnter()
		{
			_action();
			((FsmStateAction)this).Finish();
		}
	}
	public class Audioplayer
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_0
		{
			public GameObject audio;

			public Vector3 origin;

			public AudioClip clip;

			public float delay;
		}

		public void PlayOneShotDelay(GameObject audio, Vector3 origin, AudioClip clip, float delay)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			<>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0();
			CS$<>8__locals0.audio = audio;
			CS$<>8__locals0.origin = origin;
			CS$<>8__locals0.clip = clip;
			CS$<>8__locals0.delay = delay;
			((MonoBehaviour)GameManager.instance).StartCoroutine(PlayAndRecycle());
			[IteratorStateMachine(typeof(<>c__DisplayClass0_0.<<PlayOneShotDelay>g__PlayAndRecycle|0>d))]
			IEnumerator PlayAndRecycle()
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <>c__DisplayClass0_0.<<PlayOneShotDelay>g__PlayAndRecycle|0>d(0)
				{
					<>4__this = CS$<>8__locals0
				};
			}
		}

		public void PlayOneShot(GameObject audio, Vector3 origin, AudioClip clip)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			PlayOneShotDelay(audio, origin, clip, 0.1f);
		}
	}
	[RequireComponent(typeof(tk2dSpriteAnimator))]
	[RequireComponent(typeof(PlayMakerFSM))]
	internal class FraudLaceBoss : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <Health>d__19 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public FraudLaceBoss <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.5f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					((Component)<>4__this).gameObject.GetComponent<HealthManager>().hp = Constants.LLHP1;
					<>4__this._control.fsm.GetFsmInt("P2 HP").Value = Constants.LLHP2;
					<>4__this._control.fsm.GetFsmInt("P3 HP").Value = Constants.LLHP3;
					<>4__this._control.fsm.GetFsmInt("P4 HP").Value = Constants.LLHP4;
					<>4__this._phase.fsm.GetFsmInt("P2 HP").Value = Constants.LLHP2;
					<>4__this._phase.fsm.GetFsmInt("P3 HP").Value = Constants.LLHP3;
					<>4__this._phase.GetState("Can Die?").AddMethod(delegate
					{
						if (Object.op_Implicit((Object)(object)<>4__this.voidhole1))
						{
							Object.Destroy((Object)(object)<>4__this.voidhole1);
						}
					});
					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 tk2dSpriteAnimator? LLaceAnim;

		private PlayMakerFSM? _control;

		private PlayMakerFSM? _bullet;

		private PlayMakerFSM? _phase;

		private PlayMakerFSM? _title;

		private GameObject? LLace;

		private GameObject? title;

		private GameObject? scene;

		private GameObject? abysswave;

		private GameObject? whipG;

		private GameObject? whipA;

		private GameObject? glob;

		private GameObject? voidhole1;

		private GameObject? web;

		private List<ModifierBase>? AllModifiers;

		private void Awake()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).gameObject.transform.localScale = new Vector3(1.2f, 1.2f, 1.2f);
			ComponentGetter();
			((MonoBehaviour)this).StartCoroutine(Health());
			ApplyAllModifiers();
		}

		private void ComponentGetter()
		{
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			LLaceAnim = ((Component)this).GetComponent<tk2dSpriteAnimator>();
			_control = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Control");
			_bullet = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Summon Bullets");
			_phase = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Death Control");
			scene = ((Component)((Component)this).gameObject.transform.parent).gameObject;
			LLace = ((Component)this).gameObject;
			whipG = ((Component)((Component)this).gameObject.transform.Find("Whip Attack G")).gameObject;
			whipA = ((Component)((Component)this).gameObject.transform.Find("Whip Attack A")).gameObject;
			web = ((Component)scene.transform.Find("Black Thread Attack (deprecated)")).gameObject;
			FsmState? state = _control.GetState("Vomit Fire");
			glob = ((state != null) ? state.GetAction<SpawnObjectFromGlobalPool>(4).gameObject.Value : null);
			voidhole1 = VoidholeSetup(new Vector3(30f, 16f, 0f));
			title = ((Component)scene.transform.Find("Boss Title")).gameObject;
			abysswave = ((Component)scene.transform.Find("Abyss Wave")).gameObject;
			_title = FSMUtility.LocateMyFSM(title, "Title Control");
		}

		private GameObject VoidholeSetup(Vector3 pos)
		{
			//IL_0006: 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_0036: 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_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(ImportLoader.GetVoidHole(), pos, Quaternion.Euler(0f, 0f, -90f));
			val.transform.localScale = new Vector3(2.5f, 2.5f, 2.5f);
			GameObject val2 = Object.Instantiate<GameObject>(ImportLoader.GetVoidAura(), pos + new Vector3(-2f, 2.5f, 0f), Quaternion.Euler(0f, 0f, 180f));
			GameObject val3 = Object.Instantiate<GameObject>(ImportLoader.GetVoidAura(), pos + new Vector3(-2f, -2f, 0f), Quaternion.identity);
			GameObject[] array = (GameObject[])(object)new GameObject[2] { val2, val3 };
			foreach (GameObject val4 in array)
			{
				val4.transform.localScale = new Vector3(0.23f, 2f, 2f);
				Object.Destroy((Object)(object)((Component)val4.transform.Find("Edge R")).gameObject);
				Object.Destroy((Object)(object)((Component)val4.transform.Find("Edge L")).gameObject);
				val4.transform.SetParent(val.transform);
				val4.SetActive(true);
			}
			return val;
		}

		private void ApplyAllModifiers()
		{
			AllModifiers = new List<ModifierBase>(14)
			{
				new SpeedModifier(_control, LLaceAnim),
				new TripleSlashModifier(_control, voidhole1),
				new WhipsModifier(_control, whipG, whipA, voidhole1),
				new GroundTendrilsModifier(_control),
				new AttackChoiceModifier(_control),
				new JumpSlashModifier(_control, LLace, glob),
				new ChargeModifier(_control, voidhole1),
				new CircleSlashModifier(_control, _bullet),
				new SpitModifier(_control, voidhole1),
				new ShootModifier(_control, _bullet, voidhole1),
				new TitleModifier(_title, title),
				new VoidHole(voidhole1),
				new VoidRain(_control, glob, abysswave),
				new VoidWebs(_control, web)
			};
			foreach (ModifierBase allModifier in AllModifiers)
			{
				allModifier.StartModifier();
			}
			_control.GetState("P2 Shift 1").AddMethod(delegate
			{
				foreach (ModifierBase allModifier2 in AllModifiers)
				{
					allModifier2.Phase2Modifier();
				}
			});
			_control.GetState("P3 Roar").AddMethod(delegate
			{
				foreach (ModifierBase allModifier3 in AllModifiers)
				{
					allModifier3.Phase3Modifier();
				}
			});
			_control.GetState("P4 Shift 1").AddMethod(delegate
			{
				foreach (ModifierBase allModifier4 in AllModifiers)
				{
					allModifier4.Phase4Modifier();
				}
			});
		}

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

			private object <>2__current;

			public ImportLoader <>4__this;

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

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

			[DebuggerHidden]
			public <Start>d__8(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 = AssetManager.LoadBundleAssets();
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					voidaura = ((Component)AssetManager.Get<GameObject>("Boss Scene").transform.Find("Soul_Snare").Find("Void Portal").Find("Hole")).gameObject;
					voidsound = AssetManager.Get<GameObject>("Black Thread Start Enemy Effect");
					voidhole = AssetManager.Get<GameObject>("Abyss Mass");
					voidholeanim = AssetManager.Get<GameObject>("Abyss Mass Anim");
					webaudio = AssetManager.Get<AudioClip>("silk_boss_web_attack_buildup");
					webaudio2 = AssetManager.Get<AudioClip>("silk_boss_web_attack_burst");
					Object.Destroy((Object)(object)((Component)voidaura.transform.Find("Hole")).gameObject);
					Object.Destroy((Object)(object)((Component)voidaura.transform.Find("Pt Shade")).gameObject);
					Object.Destroy((Object)(object)((Component)voidaura.transform.Find("abyss_water_top")).gameObject);
					Object.Destroy((Object)(object)((Component)voidhole.transform.Find("Enemy Physics Pusher (Abyss Mass)")).gameObject);
					Object.Destroy((Object)(object)voidhole.GetComponent<Recoil>());
					voidauraanim = AssetManager.Get<RuntimeAnimatorController>("abyss_water_70_percent0001");
					voidaura.GetComponent<Animator>().runtimeAnimatorController = voidauraanim;
					voidhole.GetComponent<tk2dSpriteAnimator>().Library = voidholeanim.GetComponent<tk2dSpriteAnimation>();
					<>4__this.ApplyTextureToTk2dSprite(voidhole, holeTex);
					Debug.Log((object)"EVERYTHING loaded in!");
					return false;
				}
			}

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

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

		internal static GameObject? voidaura;

		internal static GameObject? voidsound;

		internal static GameObject? voidhole;

		internal static GameObject voidholeanim;

		internal static AudioClip webaudio;

		internal static AudioClip webaudio2;

		internal static RuntimeAnimatorController voidauraanim;

		internal static Texture2D holeTex = ImageUtil.GetTextureFromResources("voidhole.png");

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

		internal static GameObject GetVoidAura()
		{
			return voidaura;