Decompiled source of InnerEigong v0.5.0

InnerEigong.dll

Decompiled 9 months 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.ExceptionServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading;
using BepInEx;
using BepInEx.Logging;
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.CompilerServices;
using HarmonyLib;
using I2.Loc;
using Microsoft.CodeAnalysis;
using MonsterLove.StateMachine;
using RCGFSM.Animation;
using RCGMaker.Core;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("InnerEigong")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Mods the true final boss to be more difficult.")]
[assembly: AssemblyFileVersion("0.5.0.0")]
[assembly: AssemblyInformationalVersion("0.5.0+a42a068d5ee43e111f96dd0d4ca49f780fbaa26c")]
[assembly: AssemblyProduct("InnerEigong")]
[assembly: AssemblyTitle("InnerEigong")]
[assembly: AssemblyVersion("0.5.0.0")]
[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 InnerEigong
{
	internal static class AssetManager
	{
		[StructLayout(LayoutKind.Auto)]
		[CompilerGenerated]
		private struct <Load>d__1 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncUniTaskMethodBuilder <>t__builder;

			private Assembly <assembly>5__2;

			private string[] <>7__wrap2;

			private int <>7__wrap3;

			private Stream <stream>5__5;

			private object <>7__wrap5;

			private int <>7__wrap6;

			private AssetBundleRequestAllAssetsAwaiter <>u__1;

			private ValueTaskAwaiter <>u__2;

			private void MoveNext()
			{
				//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: Unknown result type (might be due to invalid IL or missing references)
				//IL_008b: Unknown result type (might be due to invalid IL or missing references)
				//IL_008e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0093: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				try
				{
					if (num == 0)
					{
						goto IL_0068;
					}
					if (num != 1)
					{
						<assembly>5__2 = Assembly.GetExecutingAssembly();
						<>7__wrap2 = <assembly>5__2.GetManifestResourceNames();
						<>7__wrap3 = 0;
						goto IL_02a4;
					}
					ValueTaskAwaiter awaiter = <>u__2;
					<>u__2 = default(ValueTaskAwaiter);
					num = (<>1__state = -1);
					goto IL_0251;
					IL_0251:
					awaiter.GetResult();
					goto IL_0258;
					IL_0258:
					object obj = <>7__wrap5;
					if (obj != null)
					{
						ExceptionDispatchInfo.Capture((obj as Exception) ?? throw obj).Throw();
					}
					int num2 = <>7__wrap6;
					if (num2 != 1)
					{
						<>7__wrap5 = null;
						<stream>5__5 = null;
					}
					<>7__wrap3++;
					goto IL_02a4;
					IL_02a4:
					if (<>7__wrap3 < <>7__wrap2.Length)
					{
						string name = <>7__wrap2[<>7__wrap3];
						<stream>5__5 = <assembly>5__2.GetManifestResourceStream(name);
						<>7__wrap5 = null;
						<>7__wrap6 = 0;
						goto IL_0068;
					}
					<>7__wrap2 = null;
					goto end_IL_0007;
					IL_0068:
					try
					{
						AssetBundleRequestAllAssetsAwaiter awaiter2;
						if (num == 0)
						{
							awaiter2 = <>u__1;
							<>u__1 = default(AssetBundleRequestAllAssetsAwaiter);
							num = (<>1__state = -1);
							goto IL_00dc;
						}
						if (<stream>5__5 != null)
						{
							AssetBundleRequestAllAssetsAwaiter val = UnityAsyncExtensions.AwaitForAllAssets(AssetBundle.LoadFromStream(<stream>5__5).LoadAllAssetsAsync());
							awaiter2 = ((AssetBundleRequestAllAssetsAwaiter)(ref val)).GetAwaiter();
							if (!((AssetBundleRequestAllAssetsAwaiter)(ref awaiter2)).IsCompleted)
							{
								num = (<>1__state = 0);
								<>u__1 = awaiter2;
								((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<AssetBundleRequestAllAssetsAwaiter, <Load>d__1>(ref awaiter2, ref this);
								return;
							}
							goto IL_00dc;
						}
						<>7__wrap6 = 1;
						goto end_IL_0068;
						IL_00dc:
						Object[] result = ((AssetBundleRequestAllAssetsAwaiter)(ref awaiter2)).GetResult();
						foreach (Object val2 in result)
						{
							if (!Object.op_Implicit(val2))
							{
								continue;
							}
							Type type = ((object)val2).GetType();
							if (_assets.ContainsKey(type))
							{
								if (_assets[type].TryAdd(val2.name, val2))
								{
									Log.Info($"Added asset {val2.name} of type {type}");
								}
								else
								{
									Log.Error($"Failed to add {val2.name} of type {type}!");
								}
							}
							else if (_assets.TryAdd(type, new Dictionary<string, Object> { [val2.name] = val2 }))
							{
								Log.Info($"Added new sub-dictionary of type {type} with initial asset {val2.name}");
							}
							else
							{
								Log.Error($"Failed to add new sub-dictionary of type {type} with initial asset {type} {val2.name}!");
							}
						}
						end_IL_0068:;
					}
					catch (object obj2)
					{
						<>7__wrap5 = obj2;
					}
					if (<stream>5__5 != null)
					{
						awaiter = <stream>5__5.DisposeAsync().GetAwaiter();
						if (!awaiter.IsCompleted)
						{
							num = (<>1__state = 1);
							<>u__2 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<ValueTaskAwaiter, <Load>d__1>(ref awaiter, ref this);
							return;
						}
						goto IL_0251;
					}
					goto IL_0258;
					end_IL_0007:;
				}
				catch (Exception exception)
				{
					<>1__state = -2;
					<assembly>5__2 = null;
					((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception);
					return;
				}
				<>1__state = -2;
				<assembly>5__2 = null;
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult();
			}

			void IAsyncStateMachine.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				this.MoveNext();
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine);
			}

			void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine)
			{
				//ILSpy generated this explicit interface implementation from .override directive in SetStateMachine
				this.SetStateMachine(stateMachine);
			}
		}

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

		[AsyncStateMachine(typeof(<Load>d__1))]
		internal static UniTask Load()
		{
			//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_0029: Unknown result type (might be due to invalid IL or missing references)
			<Load>d__1 <Load>d__ = default(<Load>d__1);
			<Load>d__.<>t__builder = AsyncUniTaskMethodBuilder.Create();
			<Load>d__.<>1__state = -1;
			((AsyncUniTaskMethodBuilder)(ref <Load>d__.<>t__builder)).Start<<Load>d__1>(ref <Load>d__);
			return ((AsyncUniTaskMethodBuilder)(ref <Load>d__.<>t__builder)).Task;
		}

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

		internal static bool TryGet<T>(string assetName, out T? asset) where T : Object
		{
			if (_assets.TryGetValue(typeof(T), out Dictionary<string, Object> value))
			{
				if (value.TryGetValue(assetName, out var value2))
				{
					asset = (T)(object)((value2 is T) ? value2 : null);
					return true;
				}
				Log.Error("Failed to asset " + assetName);
				asset = default(T);
				return false;
			}
			Log.Error($"Failed to get sub-dictionary of type {typeof(T)}");
			asset = default(T);
			return false;
		}

		internal static T? Inst<T>(string assetName, Transform? parent) where T : Object
		{
			if (TryGet<T>(assetName, out T asset))
			{
				return Object.Instantiate<T>(asset, parent);
			}
			throw new NullReferenceException("Failed to get asset " + assetName + ": asset is null!");
		}

		internal static T? Inst<T>(string assetName, Vector2 position) where T : Object
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			if (TryGet<T>(assetName, out T asset))
			{
				return Object.Instantiate<T>(asset, Vector2.op_Implicit(position), Quaternion.identity);
			}
			throw new NullReferenceException("Failed to get asset " + assetName + ": asset is null!");
		}
	}
	[RequireComponent(typeof(SpriteRenderer))]
	public class ColorKeyOverlayer : MonoBehaviour
	{
		private SpriteRenderer _spriteRenderer;

		private static readonly int OverlayScaleID = Shader.PropertyToID("_OverlayScale");

		private static readonly int ToleranceID = Shader.PropertyToID("_Tolerance");

		private static readonly int SmoothingID = Shader.PropertyToID("_Smoothing");

		internal float Tolerance
		{
			get
			{
				return ((Renderer)_spriteRenderer).material.GetFloat(ToleranceID);
			}
			set
			{
				((Renderer)_spriteRenderer).material.SetFloat(ToleranceID, value);
			}
		}

		internal float Smoothing
		{
			get
			{
				return ((Renderer)_spriteRenderer).material.GetFloat(SmoothingID);
			}
			set
			{
				((Renderer)_spriteRenderer).material.SetFloat(SmoothingID, value);
			}
		}

		internal float OverlayScale
		{
			get
			{
				return ((Renderer)_spriteRenderer).material.GetFloat(OverlayScaleID);
			}
			set
			{
				((Renderer)_spriteRenderer).material.SetFloat(OverlayScaleID, value);
			}
		}

		private void Awake()
		{
			((Component)this).TryGetComponent<SpriteRenderer>(ref _spriteRenderer);
			if (AssetManager.TryGet<Material>("_2dxFX_ColorKeyOverlay", out Material asset))
			{
				((Renderer)_spriteRenderer).material = asset;
			}
		}
	}
	internal static class Constants
	{
		internal const string BossSceneName = "A11_S0_Boss_YiGung";

		internal const string BossName = "Boss_Yi Gung";

		internal const States GunMonsterState = 138;
	}
	internal class Eigong : MonoBehaviour
	{
		[StructLayout(LayoutKind.Auto)]
		[CompilerGenerated]
		private struct <FireGun>d__12 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncUniTaskMethodBuilder <>t__builder;

			public Eigong <>4__this;

			private Animator <animator>5__2;

			private RuntimeAnimatorController <oldController>5__3;

			private Awaiter <>u__1;

			private void MoveNext()
			{
				//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_014e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0153: Unknown result type (might be due to invalid IL or missing references)
				//IL_015a: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0253: Unknown result type (might be due to invalid IL or missing references)
				//IL_0258: Unknown result type (might be due to invalid IL or missing references)
				//IL_025f: Unknown result type (might be due to invalid IL or missing references)
				//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0358: Unknown result type (might be due to invalid IL or missing references)
				//IL_035d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0364: Unknown result type (might be due to invalid IL or missing references)
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				//IL_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0093: Unknown result type (might be due to invalid IL or missing references)
				//IL_0098: Unknown result type (might be due to invalid IL or missing references)
				//IL_0112: Unknown result type (might be due to invalid IL or missing references)
				//IL_0117: Unknown result type (might be due to invalid IL or missing references)
				//IL_011b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0120: Unknown result type (might be due to invalid IL or missing references)
				//IL_018f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0194: Unknown result type (might be due to invalid IL or missing references)
				//IL_0198: Unknown result type (might be due to invalid IL or missing references)
				//IL_019d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0217: Unknown result type (might be due to invalid IL or missing references)
				//IL_021c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0220: Unknown result type (might be due to invalid IL or missing references)
				//IL_0225: Unknown result type (might be due to invalid IL or missing references)
				//IL_0294: Unknown result type (might be due to invalid IL or missing references)
				//IL_0299: Unknown result type (might be due to invalid IL or missing references)
				//IL_029d: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_031c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0321: Unknown result type (might be due to invalid IL or missing references)
				//IL_0325: Unknown result type (might be due to invalid IL or missing references)
				//IL_032a: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_0134: Unknown result type (might be due to invalid IL or missing references)
				//IL_0135: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0239: Unknown result type (might be due to invalid IL or missing references)
				//IL_023a: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b6: 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_033e: Unknown result type (might be due to invalid IL or missing references)
				//IL_033f: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				Eigong eigong = <>4__this;
				try
				{
					UniTask val;
					Awaiter awaiter;
					switch (num)
					{
					default:
						<animator>5__2 = ((Actor)eigong._monster).animator;
						<oldController>5__3 = <animator>5__2.runtimeAnimatorController;
						<animator>5__2.runtimeAnimatorController = eigong._newController;
						<animator>5__2.Play(0);
						eigong.RestartArmFollow();
						val = UniTask.Delay(TimeSpan.FromSeconds(1.75), false, (PlayerLoopTiming)8, default(CancellationToken));
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 0);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <FireGun>d__12>(ref awaiter, ref this);
							return;
						}
						goto IL_00e1;
					case 0:
						awaiter = <>u__1;
						<>u__1 = default(Awaiter);
						num = (<>1__state = -1);
						goto IL_00e1;
					case 1:
						awaiter = <>u__1;
						<>u__1 = default(Awaiter);
						num = (<>1__state = -1);
						goto IL_0169;
					case 2:
						awaiter = <>u__1;
						<>u__1 = default(Awaiter);
						num = (<>1__state = -1);
						goto IL_01e6;
					case 3:
						awaiter = <>u__1;
						<>u__1 = default(Awaiter);
						num = (<>1__state = -1);
						goto IL_026e;
					case 4:
						awaiter = <>u__1;
						<>u__1 = default(Awaiter);
						num = (<>1__state = -1);
						goto IL_02eb;
					case 5:
						{
							awaiter = <>u__1;
							<>u__1 = default(Awaiter);
							num = (<>1__state = -1);
							break;
						}
						IL_01e6:
						((Awaiter)(ref awaiter)).GetResult();
						eigong.StopArmFollow();
						((MonsterBase)eigong._monster).FacePlayer();
						val = UniTask.Delay(TimeSpan.FromSeconds(0.10000000149011612), false, (PlayerLoopTiming)8, default(CancellationToken));
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 3);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <FireGun>d__12>(ref awaiter, ref this);
							return;
						}
						goto IL_026e;
						IL_00e1:
						((Awaiter)(ref awaiter)).GetResult();
						eigong.StopArmFollow();
						((MonsterBase)eigong._monster).FacePlayer();
						val = UniTask.Delay(TimeSpan.FromSeconds(0.5), false, (PlayerLoopTiming)8, default(CancellationToken));
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 1);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <FireGun>d__12>(ref awaiter, ref this);
							return;
						}
						goto IL_0169;
						IL_02eb:
						((Awaiter)(ref awaiter)).GetResult();
						eigong.StopArmFollow();
						((MonsterBase)eigong._monster).FacePlayer();
						val = UniTask.Delay(TimeSpan.FromSeconds(1.0), false, (PlayerLoopTiming)8, default(CancellationToken));
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 5);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <FireGun>d__12>(ref awaiter, ref this);
							return;
						}
						break;
						IL_0169:
						((Awaiter)(ref awaiter)).GetResult();
						eigong.RestartArmFollow();
						val = UniTask.Delay(TimeSpan.FromSeconds(0.5), false, (PlayerLoopTiming)8, default(CancellationToken));
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 2);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <FireGun>d__12>(ref awaiter, ref this);
							return;
						}
						goto IL_01e6;
						IL_026e:
						((Awaiter)(ref awaiter)).GetResult();
						eigong.RestartArmFollow();
						val = UniTask.Delay(TimeSpan.FromSeconds(0.15000000596046448), false, (PlayerLoopTiming)8, default(CancellationToken));
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 4);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <FireGun>d__12>(ref awaiter, ref this);
							return;
						}
						goto IL_02eb;
					}
					((Awaiter)(ref awaiter)).GetResult();
					<animator>5__2.runtimeAnimatorController = <oldController>5__3;
					((MonsterBase)eigong._monster).ChangeStateIfValid((States)3);
					eigong.RestartArmFollow();
				}
				catch (Exception exception)
				{
					<>1__state = -2;
					<animator>5__2 = null;
					<oldController>5__3 = null;
					((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception);
					return;
				}
				<>1__state = -2;
				<animator>5__2 = null;
				<oldController>5__3 = null;
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult();
			}

			void IAsyncStateMachine.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				this.MoveNext();
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine);
			}

			void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine)
			{
				//ILSpy generated this explicit interface implementation from .override directive in SetStateMachine
				this.SetStateMachine(stateMachine);
			}
		}

		private StealthGameMonster _monster;

		private RuntimeAnimatorController _newController;

		private StateMachine<States> _stateMachine;

		private const string GunStateAnimation = "Gun Prepare";

		private LaserAttackController _laserAttack;

		private OldPivotRotate _armRotate;

		private void Awake()
		{
			((Component)this).TryGetComponent<StealthGameMonster>(ref _monster);
			((MonsterBase)_monster).OverrideWanderingIdleTime(0f);
			((MonsterBase)_monster).StartingPhaseIndex = 1;
			_ = ((MonsterBase)_monster).monsterCore;
			AssetManager.TryGet<RuntimeAnimatorController>("Inner Eigong Controller", out _newController);
			SetupGunAttack();
			ResetMonster();
			Log.Debug("DONE AWAKE");
		}

		private async void Start()
		{
			await UniTask.WaitUntil((Func<bool>)(() => ((MonsterBase)_monster).fsm != null), (PlayerLoopTiming)8, default(CancellationToken));
			_stateMachine = ((MonsterBase)_monster).fsm;
			_ = _stateMachine.runner;
			((MonsterBase)_monster).GetState((States)101);
			((MonsterBase)_monster).GetState((States)103);
			((MonsterBase)_monster).GetState((States)105);
			((MonsterBase)_monster).GetState((States)107);
			((MonsterBase)_monster).GetState((States)109);
			((MonsterBase)_monster).GetState((States)127);
			((MonsterBase)_monster).GetState((States)129);
			((MonsterBase)_monster).GetState((States)159);
			((MonsterBase)_monster).GetState((States)160);
			((MonsterBase)_monster).GetState((States)161);
			((MonsterBase)_monster).GetState((States)171);
			((MonsterBase)_monster).GetState((States)172);
			((MonsterBase)_monster).GetState((States)204);
			((MonsterBase)_monster).GetState((States)205);
			((MonsterBase)_monster).GetState((States)206);
			((MonsterBase)_monster).GetState((States)207);
			((MonsterBase)_monster).GetState((States)208);
			((MonsterBase)_monster).GetState((States)209);
			((MonsterBase)_monster).GetState((States)210);
			((MonsterBase)_monster).GetState((States)211);
		}

		private void CreateTrackingSlashes()
		{
			AssetManager.Inst<GameObject>("Tracking Slashes", (Transform?)null);
		}

		private void SetupGunAttack()
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_0338: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0363: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_0376: Unknown result type (might be due to invalid IL or missing references)
			//IL_038d: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e8: Invalid comparison between Unknown and I4
			//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f1: Invalid comparison between Unknown and I4
			//IL_04cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fc: Invalid comparison between Unknown and I4
			//IL_0423: Unknown result type (might be due to invalid IL or missing references)
			Transform parent = ((Component)((MonsterBase)_monster).monsterCore).transform.Find("Animator(Proxy)/Animator/View/YiGung/Body");
			GameObject val = AssetManager.Inst<GameObject>("Arm", parent);
			((Object)val).name = ((Object)val).name.Replace("(Clone)", "");
			val.transform.localPosition = Vector2.op_Implicit(new Vector2(20f, -20f));
			SpriteRenderer component = val.GetComponent<SpriteRenderer>();
			((Renderer)component).sortingLayerName = "Monster";
			ColorKeyOverlayer colorKeyOverlayer = val.AddComponent<ColorKeyOverlayer>();
			colorKeyOverlayer.OverlayScale = 100f;
			colorKeyOverlayer.Tolerance = 0.1f;
			colorKeyOverlayer.Smoothing = 0.05f;
			_armRotate = val.AddComponent<OldPivotRotate>();
			_armRotate.inverseAngle = true;
			_armRotate.KeepLookAtPlayer = true;
			_armRotate.minRotate = -360f;
			_armRotate.maxRotate = 360f;
			_armRotate.offset = 0f;
			_armRotate.referenceActor = (Actor)(object)_monster;
			if (!PreloadManager.TryGet("Sniper", out GameObject obj))
			{
				return;
			}
			GameObject val2 = Object.Instantiate<GameObject>(((Component)obj.transform.Find("Dragon_Sniper/DragonSniper/RotateRArm/RArm/Bow/SniperLaserCore")).gameObject, val.transform);
			((Object)val2).name = ((Object)val2).name.Replace("(Clone)", "");
			val2.transform.localPosition = Vector2.op_Implicit(new Vector2(-38f, 5.3f));
			val2.transform.localScale = new Vector3(-1f, 1f, 1f);
			Renderer[] componentsInChildren = val2.GetComponentsInChildren<Renderer>(true);
			foreach (Renderer obj2 in componentsInChildren)
			{
				obj2.sortingLayerName = "Monster";
				obj2.sortingOrder = ((Renderer)component).sortingOrder - 100;
			}
			val2.AddComponent<GeneralParriableOwner>();
			_laserAttack = val2.GetComponentInChildren<LaserAttackController>(true);
			ParriableAttackEffect val3 = ((Component)_laserAttack).gameObject.AddComponent<ParriableAttackEffect>();
			val3.param = new ParryParam
			{
				knockBackType = (KnockBackType)3,
				knockBackValue = 500f,
				LiftYForce = 100f,
				hurtLiftType = (HurtType)3
			};
			((Component)_laserAttack).gameObject.SetActive(true);
			DamageDealer componentInChildren = ((Component)_laserAttack).GetComponentInChildren<DamageDealer>(true);
			componentInChildren.damageAmount = 100f;
			componentInChildren.attacker = ((Component)this).GetComponentInChildren<Health>();
			componentInChildren.bindingParry = val3;
			val3.bindDamage = componentInChildren;
			((MonoBehaviour)((Component)_laserAttack).GetComponentInChildren<TriggerDetector>(true)).Invoke("Awake", 0f);
			val2.SetActive(true);
			((Component)_laserAttack).GetComponentInChildren<EffectDealer>();
			((Component)val2.GetComponentInChildren<LaserViewController>(true)).gameObject.SetActive(true);
			val.SetActive(false);
			Transform val4 = ((Component)this).transform.Find("States/Attacks");
			GameObject val5 = new GameObject($"[{138}] Gun");
			val5.transform.SetParent(val4);
			BossGeneralState val6 = val5.AddComponent<BossGeneralState>();
			((MonsterState)val6).BindingAnimation = "Gun Prepare";
			val6.state = (States)138;
			AssetManager.TryGet<AnimationClip>("Gun Prepare", out ((MonsterState)val6).clip);
			Transform transform = val5.transform;
			GameObject val7 = new GameObject("weight");
			val7.transform.SetParent(transform);
			LinkNextMoveStateWeight obj3 = val7.AddComponent<LinkNextMoveStateWeight>();
			AttackWeight item = new AttackWeight
			{
				state = (MonsterState)(object)val6,
				weight = 1
			};
			StealthEngaging componentInChildren2 = ((Component)_monster).GetComponentInChildren<StealthEngaging>();
			AttackWeight item2 = new AttackWeight
			{
				state = (MonsterState)(object)componentInChildren2,
				weight = 1
			};
			obj3.stateWeightList = new List<AttackWeight>(1) { item2 };
			BossGeneralState[] componentsInChildren2 = ((Component)val4).GetComponentsInChildren<BossGeneralState>(true);
			LinkNextMoveStateWeight[] componentsInChildren3;
			foreach (BossGeneralState val8 in componentsInChildren2)
			{
				if (!((object)(States)(ref val8.state)).ToString().Contains("Attack"))
				{
					continue;
				}
				States state = val8.state;
				if (((int)state != 105 && (int)state != 161 && state - 206 > 1) || 1 == 0)
				{
					componentsInChildren3 = ((Component)val8).GetComponentsInChildren<LinkNextMoveStateWeight>(true);
					for (int j = 0; j < componentsInChildren3.Length; j++)
					{
						componentsInChildren3[j].stateWeightList.Add(item);
					}
				}
			}
			GameObject obj4 = Object.Instantiate<GameObject>(((Component)obj.transform.Find("LogicRoot/Audio/EnemySFX_Sniper_Attack")).gameObject, ((MonsterBase)_monster).monsterCore.logicRoot.Find("Audio"));
			((Object)obj4).name = ((Object)obj4).name.Replace("(Clone)", "");
			SoundPlayer component2 = obj4.GetComponent<SoundPlayer>();
			AkBankManager.LoadBank("Dragon_Sniper", false, false, (MonoBehaviour)(object)component2);
			component2.EnterLevelReset();
			componentsInChildren3 = ((Component)componentInChildren2).GetComponentsInChildren<LinkNextMoveStateWeight>(true);
			for (int i = 0; i < componentsInChildren3.Length; i++)
			{
				componentsInChildren3[i].stateWeightList.Add(item);
			}
		}

		private void StopArmFollow()
		{
			_armRotate.KeepLookAtPlayer = false;
		}

		private void RestartArmFollow()
		{
			_armRotate.KeepLookAtPlayer = true;
		}

		[AsyncStateMachine(typeof(<FireGun>d__12))]
		internal UniTask FireGun()
		{
			//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_0031: Unknown result type (might be due to invalid IL or missing references)
			<FireGun>d__12 <FireGun>d__ = default(<FireGun>d__12);
			<FireGun>d__.<>t__builder = AsyncUniTaskMethodBuilder.Create();
			<FireGun>d__.<>4__this = this;
			<FireGun>d__.<>1__state = -1;
			((AsyncUniTaskMethodBuilder)(ref <FireGun>d__.<>t__builder)).Start<<FireGun>d__12>(ref <FireGun>d__);
			return ((AsyncUniTaskMethodBuilder)(ref <FireGun>d__.<>t__builder)).Task;
		}

		private void ResetMonster()
		{
			AutoAttributeManager.AutoReferenceAllChildren(((Component)this).gameObject);
			Traverse.Create((object)_monster).Field("_inited").SetValue((object)false);
			((MonoBehaviour)_monster).Invoke("CheckInit", 0f);
			((PhysicsMover)_monster).EnterLevelReset();
		}
	}
	internal class FireTrail : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <Start>d__6 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public FireTrail <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Expected O, but got Unknown
				int num = <>1__state;
				FireTrail CS$<>8__locals0 = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitUntil((Func<bool>)delegate
					{
						CS$<>8__locals0._firePool = ((IEnumerable<ObjectPool>)SingletonBehaviour<PoolManager>.Instance.allPools).FirstOrDefault((Func<ObjectPool, bool>)((ObjectPool pool) => ((Object)pool._prefab).name == "Fire_FX_damage_Long jiechuan"));
						return CS$<>8__locals0._firePool != null;
					});
					<>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();
			}
		}

		public float flameSpacing = 35f;

		private ActorBody _body;

		private Collider2D _collider;

		private ObjectPool _firePool;

		private readonly List<PoolObject> _flames = new List<PoolObject>();

		private void Awake()
		{
			_body = ((Component)this).GetComponentInChildren<ActorBody>(true);
			_collider = ((Component)_body).GetComponent<Collider2D>();
		}

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

		private void Update()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: 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_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			if (!_body.actor.IsOnGround || _firePool == null)
			{
				return;
			}
			Bounds bounds = _collider.bounds;
			float x = ((Bounds)(ref bounds)).center.x;
			bounds = _collider.bounds;
			float y = ((Bounds)(ref bounds)).min.y;
			if (_flames.Count > 0)
			{
				PoolObject val = _flames.Aggregate(_flames[0], delegate(PoolObject closest, PoolObject nextFlame)
				{
					//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_002c: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					float num4 = Mathf.Abs(((Component)nextFlame).transform.position.x - ((Component)this).transform.position.x);
					float num5 = Mathf.Abs(((Component)closest).transform.position.x - ((Component)this).transform.position.x);
					return (!(num4 < num5)) ? closest : nextFlame;
				});
				float num = ((Component)this).transform.position.x - ((Component)val).transform.position.x;
				if (!(Mathf.Abs(num) <= flameSpacing))
				{
					float num2 = Mathf.Sign(num);
					float num3 = ((Component)val).transform.position.x + flameSpacing * num2;
					bool flag = ((num2 > 0f) ? (num3 <= x) : (num3 >= x));
					Vector2 position = default(Vector2);
					while (flag)
					{
						((Vector2)(ref position))..ctor(num3, y);
						SpawnFlame(position);
						num3 += flameSpacing * num2;
						flag = ((num2 > 0f) ? (num3 <= x) : (num3 >= x));
					}
				}
			}
			else
			{
				Vector2 position2 = default(Vector2);
				((Vector2)(ref position2))..ctor(x, y);
				SpawnFlame(position2);
			}
		}

		public void SpawnFlame(Vector2 position)
		{
			//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)
			PoolObject val = _firePool.Borrow(Vector2.op_Implicit(position), Quaternion.identity, (Transform)null, (Action<PoolObject>)null);
			if (!Object.op_Implicit((Object)(object)val))
			{
				return;
			}
			((UnityEvent<PoolObject>)(object)val.OnReturnEvent).AddListener((UnityAction<PoolObject>)delegate(PoolObject obj)
			{
				if (_flames.Contains(obj))
				{
					_flames.Remove(obj);
				}
			});
			_flames.Add(val);
		}

		public void ResetFlames()
		{
			_flames.Clear();
		}
	}
	internal static class Log
	{
		private static ManualLogSource? logSource;

		internal static void Init(ManualLogSource logSource)
		{
			Log.logSource = logSource;
		}

		internal static void Debug(object data)
		{
			ManualLogSource? obj = logSource;
			if (obj != null)
			{
				obj.LogDebug(data);
			}
		}

		internal static void Error(object data)
		{
			ManualLogSource? obj = logSource;
			if (obj != null)
			{
				obj.LogError(data);
			}
		}

		internal static void Fatal(object data)
		{
			ManualLogSource? obj = logSource;
			if (obj != null)
			{
				obj.LogFatal(data);
			}
		}

		internal static void Info(object data)
		{
			ManualLogSource? obj = logSource;
			if (obj != null)
			{
				obj.LogInfo(data);
			}
		}

		internal static void Message(object data)
		{
			ManualLogSource? obj = logSource;
			if (obj != null)
			{
				obj.LogMessage(data);
			}
		}

		internal static void Warning(object data)
		{
			ManualLogSource? obj = logSource;
			if (obj != null)
			{
				obj.LogWarning(data);
			}
		}
	}
	[BepInPlugin("InnerEigong", "InnerEigong", "0.5.0")]
	public class Mod : BaseUnityPlugin
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass3_0
		{
			public GeneralFSMContext fsmContext;

			internal bool <StartEigongFight>b__1()
			{
				return Object.op_Implicit((Object)(object)((StateMachineContext<GeneralState, GeneralState>)(object)fsmContext).currentStateType);
			}
		}

		[StructLayout(LayoutKind.Auto)]
		[CompilerGenerated]
		private struct <InitializeAssets>d__5 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncUniTaskMethodBuilder <>t__builder;

			private Awaiter <>u__1;

			private void MoveNext()
			{
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				//IL_0047: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: 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)
				//IL_0012: 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_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				try
				{
					Awaiter awaiter;
					if (num != 0)
					{
						UniTask val = AssetManager.Load();
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 0);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <InitializeAssets>d__5>(ref awaiter, ref this);
							return;
						}
					}
					else
					{
						awaiter = <>u__1;
						<>u__1 = default(Awaiter);
						num = (<>1__state = -1);
					}
					((Awaiter)(ref awaiter)).GetResult();
					if (AssetManager.TryGet<GameObject>("Tracking Slashes", out GameObject asset) && asset != null)
					{
						asset.AddComponent<TrackingSlashes>();
					}
				}
				catch (Exception exception)
				{
					<>1__state = -2;
					((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception);
					return;
				}
				<>1__state = -2;
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult();
			}

			void IAsyncStateMachine.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				this.MoveNext();
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine);
			}

			void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine)
			{
				//ILSpy generated this explicit interface implementation from .override directive in SetStateMachine
				this.SetStateMachine(stateMachine);
			}
		}

		[StructLayout(LayoutKind.Auto)]
		[CompilerGenerated]
		private struct <StartEigongFight>d__3 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncUniTaskMethodBuilder <>t__builder;

			private <>c__DisplayClass3_0 <>8__1;

			private Awaiter <>u__1;

			private Awaiter<bool> <>u__2;

			private AsyncOperationAwaiter <>u__3;

			private void MoveNext()
			{
				//IL_009d: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0109: Unknown result type (might be due to invalid IL or missing references)
				//IL_010e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0116: Unknown result type (might be due to invalid IL or missing references)
				//IL_016c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0171: Unknown result type (might be due to invalid IL or missing references)
				//IL_0179: Unknown result type (might be due to invalid IL or missing references)
				//IL_0208: Unknown result type (might be due to invalid IL or missing references)
				//IL_020d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0214: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0137: Unknown result type (might be due to invalid IL or missing references)
				//IL_013c: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01da: 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)
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0151: Unknown result type (might be due to invalid IL or missing references)
				//IL_0153: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_0083: Unknown result type (might be due to invalid IL or missing references)
				//IL_0084: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				try
				{
					UniTask val;
					Awaiter awaiter;
					Awaiter<bool> awaiter3;
					AsyncOperationAwaiter awaiter2;
					StateMachineOwner val2;
					SaveManager instance;
					switch (num)
					{
					default:
						<>8__1 = new <>c__DisplayClass3_0();
						RuntimeInitHandler.LoadCore();
						ScriptableObjectSingleton<GameConfig>.Instance.InstantiateGameCore();
						val = UniTask.WaitUntil((Func<bool>)(() => Object.op_Implicit((Object)(object)SingletonBehaviour<SaveManager>.Instance)), (PlayerLoopTiming)8, default(CancellationToken));
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 0);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <StartEigongFight>d__3>(ref awaiter, ref this);
							return;
						}
						goto IL_00b8;
					case 0:
						awaiter = <>u__1;
						<>u__1 = default(Awaiter);
						num = (<>1__state = -1);
						goto IL_00b8;
					case 1:
						awaiter3 = <>u__2;
						<>u__2 = default(Awaiter<bool>);
						num = (<>1__state = -1);
						goto IL_0125;
					case 2:
						awaiter2 = <>u__3;
						<>u__3 = default(AsyncOperationAwaiter);
						num = (<>1__state = -1);
						goto IL_0188;
					case 3:
						{
							awaiter = <>u__1;
							<>u__1 = default(Awaiter);
							num = (<>1__state = -1);
							break;
						}
						IL_0188:
						((AsyncOperationAwaiter)(ref awaiter2)).GetResult();
						val2 = MonoNodeExtension.TryGetComp<StateMachineOwner>(GameObject.Find("General Boss Fight FSM Object Variant"));
						<>8__1.fsmContext = val2.FsmContext;
						val = UniTask.WaitUntil((Func<bool>)(() => Object.op_Implicit((Object)(object)((StateMachineContext<GeneralState, GeneralState>)(object)<>8__1.fsmContext).currentStateType)), (PlayerLoopTiming)8, default(CancellationToken));
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 3);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <StartEigongFight>d__3>(ref awaiter, ref this);
							return;
						}
						break;
						IL_00b8:
						((Awaiter)(ref awaiter)).GetResult();
						instance = SingletonBehaviour<SaveManager>.Instance;
						instance.SavePlayerPref();
						awaiter3 = instance.LoadSaveAtSlot(4).GetAwaiter();
						if (!awaiter3.IsCompleted)
						{
							num = (<>1__state = 1);
							<>u__2 = awaiter3;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter<bool>, <StartEigongFight>d__3>(ref awaiter3, ref this);
							return;
						}
						goto IL_0125;
						IL_0125:
						awaiter3.GetResult();
						awaiter2 = UnityAsyncExtensions.GetAwaiter(SceneManager.LoadSceneAsync("A11_S0_Boss_YiGung"));
						if (!((AsyncOperationAwaiter)(ref awaiter2)).IsCompleted)
						{
							num = (<>1__state = 2);
							<>u__3 = awaiter2;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<AsyncOperationAwaiter, <StartEigongFight>d__3>(ref awaiter2, ref this);
							return;
						}
						goto IL_0188;
					}
					((Awaiter)(ref awaiter)).GetResult();
					ICutScene cutscene = ((Component)((StateMachineContext<GeneralState, GeneralState>)(object)<>8__1.fsmContext).currentStateType).GetComponentInChildren<CutScenePlayAction>(true).cutscene;
					SimpleCutsceneManager val3 = (SimpleCutsceneManager)(object)((cutscene is SimpleCutsceneManager) ? cutscene : null);
					if (val3 != null)
					{
						val3.TrySkip();
					}
				}
				catch (Exception exception)
				{
					<>1__state = -2;
					<>8__1 = null;
					((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception);
					return;
				}
				<>1__state = -2;
				<>8__1 = null;
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult();
			}

			void IAsyncStateMachine.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				this.MoveNext();
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine);
			}

			void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine)
			{
				//ILSpy generated this explicit interface implementation from .override directive in SetStateMachine
				this.SetStateMachine(stateMachine);
			}
		}

		private static Harmony _harmony;

		private void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			Log.Init(((BaseUnityPlugin)this).Logger);
			_harmony = new Harmony("InnerEigong");
			_harmony.PatchAll(typeof(Patches));
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin InnerEigong is loaded!");
		}

		private async void Start()
		{
			await InitializeAssets();
			await PreloadManager.Initialize();
		}

		[AsyncStateMachine(typeof(<StartEigongFight>d__3))]
		private static UniTask StartEigongFight()
		{
			//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_0029: Unknown result type (might be due to invalid IL or missing references)
			<StartEigongFight>d__3 <StartEigongFight>d__ = default(<StartEigongFight>d__3);
			<StartEigongFight>d__.<>t__builder = AsyncUniTaskMethodBuilder.Create();
			<StartEigongFight>d__.<>1__state = -1;
			((AsyncUniTaskMethodBuilder)(ref <StartEigongFight>d__.<>t__builder)).Start<<StartEigongFight>d__3>(ref <StartEigongFight>d__);
			return ((AsyncUniTaskMethodBuilder)(ref <StartEigongFight>d__.<>t__builder)).Task;
		}

		private void OnDestroy()
		{
			AssetManager.Unload();
			_harmony.UnpatchSelf();
		}

		[AsyncStateMachine(typeof(<InitializeAssets>d__5))]
		private static UniTask InitializeAssets()
		{
			//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_0029: Unknown result type (might be due to invalid IL or missing references)
			<InitializeAssets>d__5 <InitializeAssets>d__ = default(<InitializeAssets>d__5);
			<InitializeAssets>d__.<>t__builder = AsyncUniTaskMethodBuilder.Create();
			<InitializeAssets>d__.<>1__state = -1;
			((AsyncUniTaskMethodBuilder)(ref <InitializeAssets>d__.<>t__builder)).Start<<InitializeAssets>d__5>(ref <InitializeAssets>d__);
			return ((AsyncUniTaskMethodBuilder)(ref <InitializeAssets>d__.<>t__builder)).Task;
		}
	}
	internal static class Patches
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(StealthGameMonster), "Awake")]
		private static void ModifyEigong(StealthGameMonster __instance)
		{
			if (!(((Object)((Component)__instance).gameObject).name != "Boss_Yi Gung"))
			{
				PhantomManager.Initialize(((Component)__instance).gameObject);
				MonoNodeExtension.TryGetCompOrAdd<Eigong>((Component)(object)__instance);
				_2dxFX_ColorRGB[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<_2dxFX_ColorRGB>(true);
				foreach (_2dxFX_ColorRGB obj in componentsInChildren)
				{
					Object.Destroy((Object)(object)obj);
					ColorKeyOverlayer colorKeyOverlayer = MonoNodeExtension.TryGetCompOrAdd<ColorKeyOverlayer>((Component)(object)obj);
					colorKeyOverlayer.OverlayScale = 100f;
					colorKeyOverlayer.Tolerance = 0.1f;
					colorKeyOverlayer.Smoothing = 0.05f;
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(MonsterBase), "ChangeStateIfValid", new Type[]
		{
			typeof(States),
			typeof(States)
		})]
		private static async void CheckSpawnPhantom(MonsterBase __instance)
		{
			if (((Object)__instance).name != "Boss_Yi Gung" || new Random((int)Time.timeSinceLevelLoad).Next(2) != 0)
			{
				return;
			}
			States state = __instance.fsm.State;
			StealthGameMonster val = (StealthGameMonster)(object)((__instance is StealthGameMonster) ? __instance : null);
			bool flag = val != null;
			bool flag2;
			if (flag)
			{
				if ((int)state <= 107)
				{
					if ((int)state == 101 || (int)state == 105 || (int)state == 107)
					{
						goto IL_00a3;
					}
				}
				else if ((int)state <= 172)
				{
					if ((int)state == 127 || (int)state == 172)
					{
						goto IL_00a3;
					}
				}
				else if ((int)state == 204 || (int)state == 209)
				{
					goto IL_00a3;
				}
				flag2 = false;
				goto IL_00ab;
			}
			goto IL_00ae;
			IL_00ab:
			flag = flag2;
			goto IL_00ae;
			IL_00a3:
			flag2 = true;
			goto IL_00ab;
			IL_00ae:
			if (flag)
			{
				await PhantomManager.SpawnPhantoms((MonsterBase)(object)val);
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(TeleportBinding), "Teleport")]
		private static void ResetFlamesOnTeleport(TeleportBinding __instance)
		{
			((Component)((Component)__instance).transform.root).GetComponentInChildren<FireTrail>()?.ResetFlames();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(LocalizationManager), "GetTranslation")]
		private static void GetInnerEigongTranslation(string Term, ref string __result)
		{
			if (Term != "Characters/NameTag_YiKong")
			{
				return;
			}
			string currentLanguageCode = LocalizationManager.CurrentLanguageCode;
			if (currentLanguageCode == null)
			{
				goto IL_0280;
			}
			int length = currentLanguageCode.Length;
			string text;
			if (length != 2)
			{
				if (length != 5)
				{
					if (length != 7 || !(currentLanguageCode == "fr-FR  "))
					{
						goto IL_0280;
					}
					text = __result + ", Vision";
				}
				else
				{
					switch (currentLanguageCode[3])
					{
					case 'D':
						break;
					case 'U':
						goto IL_00c1;
					case 'E':
						goto IL_00e6;
					case 'B':
						goto IL_00fb;
					case 'C':
						if (currentLanguageCode == "zh-CN")
						{
							goto IL_0271;
						}
						goto IL_0280;
					case 'T':
						if (currentLanguageCode == "zh-TW")
						{
							goto IL_0271;
						}
						goto IL_0280;
					default:
						goto IL_0280;
						IL_0271:
						text = "心中的" + __result;
						goto IL_0283;
					}
					if (!(currentLanguageCode == "de-DE"))
					{
						goto IL_0280;
					}
					text = __result;
				}
			}
			else
			{
				switch (currentLanguageCode[0])
				{
				case 'i':
					break;
				case 'j':
					goto IL_0164;
				case 'k':
					goto IL_0179;
				case 'p':
					goto IL_018e;
				case 'r':
					goto IL_01a3;
				case 'u':
					goto IL_01b8;
				default:
					goto IL_0280;
				}
				if (!(currentLanguageCode == "it"))
				{
					goto IL_0280;
				}
				text = __result + " interiore";
			}
			goto IL_0283;
			IL_00e6:
			if (currentLanguageCode == "es-ES")
			{
				goto IL_01e7;
			}
			goto IL_0280;
			IL_01e7:
			text = __result + " interior";
			goto IL_0283;
			IL_018e:
			if (!(currentLanguageCode == "pl"))
			{
				goto IL_0280;
			}
			text = "Wewnętrzny " + __result;
			goto IL_0283;
			IL_0280:
			text = __result;
			goto IL_0283;
			IL_00fb:
			if (!(currentLanguageCode == "pt-BR"))
			{
				goto IL_0280;
			}
			text = __result + " Interior";
			goto IL_0283;
			IL_01b8:
			if (!(currentLanguageCode == "uk"))
			{
				goto IL_0280;
			}
			text = "Інакша " + __result;
			goto IL_0283;
			IL_01a3:
			if (!(currentLanguageCode == "ru"))
			{
				goto IL_0280;
			}
			text = "Иная " + __result;
			goto IL_0283;
			IL_00c1:
			if (!(currentLanguageCode == "en-US"))
			{
				if (currentLanguageCode == "es-US")
				{
					goto IL_01e7;
				}
				goto IL_0280;
			}
			text = "Inner " + __result;
			goto IL_0283;
			IL_0179:
			if (!(currentLanguageCode == "ko"))
			{
				goto IL_0280;
			}
			text = "마음속" + __result;
			goto IL_0283;
			IL_0164:
			if (!(currentLanguageCode == "ja"))
			{
				goto IL_0280;
			}
			text = "心中の" + __result;
			goto IL_0283;
			IL_0283:
			__result = text;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(MonsterBase), "ChangeStateIfValid", new Type[]
		{
			typeof(States),
			typeof(States)
		})]
		private static async void HandleLaserFire(MonsterBase __instance, States targetState)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			Eigong eigong = default(Eigong);
			if (((Component)__instance).TryGetComponent<Eigong>(ref eigong) && (int)targetState == 138)
			{
				await eigong.FireGun();
			}
		}
	}
	internal class Phantom : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass3_0
		{
			public Phantom <>4__this;

			public States currentState;

			internal bool <Spawn>b__0()
			{
				//IL_000b: 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)
				return <>4__this._monster.CurrentState != currentState;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass4_0
		{
			public Phantom <>4__this;

			public float alpha;

			public float fadeStartTime;

			public float fadeTimeSec;

			internal bool <FadeIn>b__0()
			{
				_2dxFX_ColorRGB[] componentsInChildren = ((Component)<>4__this).GetComponentsInChildren<_2dxFX_ColorRGB>(true);
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					componentsInChildren[i]._Alpha = alpha;
				}
				_2dxFX_Negative[] componentsInChildren2 = ((Component)<>4__this).GetComponentsInChildren<_2dxFX_Negative>(true);
				for (int i = 0; i < componentsInChildren2.Length; i++)
				{
					componentsInChildren2[i]._Alpha = alpha;
				}
				alpha = (Time.timeSinceLevelLoad - fadeStartTime) / fadeTimeSec;
				return alpha >= 1f;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass5_0
		{
			public Phantom <>4__this;

			public float alpha;

			public float fadeStartTime;

			public float fadeTimeSec;

			internal bool <FadeOut>b__0()
			{
				_2dxFX_ColorRGB[] componentsInChildren = ((Component)<>4__this).GetComponentsInChildren<_2dxFX_ColorRGB>(true);
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					componentsInChildren[i]._Alpha = alpha;
				}
				_2dxFX_Negative[] componentsInChildren2 = ((Component)<>4__this).GetComponentsInChildren<_2dxFX_Negative>(true);
				for (int i = 0; i < componentsInChildren2.Length; i++)
				{
					componentsInChildren2[i]._Alpha = alpha;
				}
				alpha = 1f - (Time.timeSinceLevelLoad - fadeStartTime) / fadeTimeSec;
				return alpha <= 0f;
			}
		}

		[StructLayout(LayoutKind.Auto)]
		[CompilerGenerated]
		private struct <FadeIn>d__4 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncUniTaskMethodBuilder <>t__builder;

			public Phantom <>4__this;

			public float fadeTimeSec;

			public CancellationToken fadeCancelToken;

			private Awaiter <>u__1;

			private void MoveNext()
			{
				//IL_0087: Unknown result type (might be due to invalid IL or missing references)
				//IL_008c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0093: 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_0057: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0070: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				try
				{
					Awaiter awaiter;
					if (num != 0)
					{
						UniTask val = UniTask.WaitUntil((Func<bool>)new <>c__DisplayClass4_0
						{
							<>4__this = <>4__this,
							fadeTimeSec = fadeTimeSec,
							fadeStartTime = Time.timeSinceLevelLoad,
							alpha = 0f
						}.<FadeIn>b__0, (PlayerLoopTiming)8, fadeCancelToken);
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 0);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <FadeIn>d__4>(ref awaiter, ref this);
							return;
						}
					}
					else
					{
						awaiter = <>u__1;
						<>u__1 = default(Awaiter);
						num = (<>1__state = -1);
					}
					((Awaiter)(ref awaiter)).GetResult();
				}
				catch (Exception exception)
				{
					<>1__state = -2;
					((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception);
					return;
				}
				<>1__state = -2;
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult();
			}

			void IAsyncStateMachine.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				this.MoveNext();
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine);
			}

			void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine)
			{
				//ILSpy generated this explicit interface implementation from .override directive in SetStateMachine
				this.SetStateMachine(stateMachine);
			}
		}

		[StructLayout(LayoutKind.Auto)]
		[CompilerGenerated]
		private struct <FadeOut>d__5 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncUniTaskMethodBuilder <>t__builder;

			public Phantom <>4__this;

			public float fadeTimeSec;

			public CancellationToken fadeCancelToken;

			private Awaiter <>u__1;

			private void MoveNext()
			{
				//IL_008e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0093: Unknown result type (might be due to invalid IL or missing references)
				//IL_009a: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0063: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_0078: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				Phantom phantom = <>4__this;
				try
				{
					Awaiter awaiter;
					if (num != 0)
					{
						UniTask val = UniTask.WaitUntil((Func<bool>)new <>c__DisplayClass5_0
						{
							<>4__this = <>4__this,
							fadeTimeSec = fadeTimeSec,
							alpha = 1f,
							fadeStartTime = Time.timeSinceLevelLoad
						}.<FadeOut>b__0, (PlayerLoopTiming)8, fadeCancelToken);
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 0);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <FadeOut>d__5>(ref awaiter, ref this);
							return;
						}
					}
					else
					{
						awaiter = <>u__1;
						<>u__1 = default(Awaiter);
						num = (<>1__state = -1);
					}
					((Awaiter)(ref awaiter)).GetResult();
					phantom._monster.Hide();
				}
				catch (Exception exception)
				{
					<>1__state = -2;
					((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception);
					return;
				}
				<>1__state = -2;
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult();
			}

			void IAsyncStateMachine.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				this.MoveNext();
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine);
			}

			void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine)
			{
				//ILSpy generated this explicit interface implementation from .override directive in SetStateMachine
				this.SetStateMachine(stateMachine);
			}
		}

		[StructLayout(LayoutKind.Auto)]
		[CompilerGenerated]
		private struct <Spawn>d__3 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncUniTaskMethodBuilder <>t__builder;

			public Phantom <>4__this;

			public MonsterBase refMonster;

			public float spawnDelaySeconds;

			public CancellationToken spawnCancelToken;

			private <>c__DisplayClass3_0 <>8__1;

			private Awaiter <>u__1;

			private void MoveNext()
			{
				//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0173: Unknown result type (might be due to invalid IL or missing references)
				//IL_0178: Unknown result type (might be due to invalid IL or missing references)
				//IL_017f: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_024f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0254: Unknown result type (might be due to invalid IL or missing references)
				//IL_025b: 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_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: Unknown result type (might be due to invalid IL or missing references)
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				//IL_008d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0092: Unknown result type (might be due to invalid IL or missing references)
				//IL_0120: Unknown result type (might be due to invalid IL or missing references)
				//IL_0138: Unknown result type (might be due to invalid IL or missing references)
				//IL_013d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0140: Unknown result type (might be due to invalid IL or missing references)
				//IL_0145: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_0217: Unknown result type (might be due to invalid IL or missing references)
				//IL_021c: Unknown result type (might be due to invalid IL or missing references)
				//IL_021f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0224: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0159: Unknown result type (might be due to invalid IL or missing references)
				//IL_015a: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_0238: Unknown result type (might be due to invalid IL or missing references)
				//IL_0239: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				Phantom phantom = <>4__this;
				try
				{
					UniTask val;
					Awaiter awaiter;
					switch (num)
					{
					default:
						<>8__1 = new <>c__DisplayClass3_0();
						<>8__1.<>4__this = <>4__this;
						((Component)phantom).transform.position = ((Component)refMonster).transform.position;
						<>8__1.currentState = refMonster.CurrentState;
						val = UniTask.Delay(TimeSpan.FromSeconds(spawnDelaySeconds), false, (PlayerLoopTiming)8, spawnCancelToken);
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 0);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <Spawn>d__3>(ref awaiter, ref this);
							return;
						}
						goto IL_00db;
					case 0:
						awaiter = <>u__1;
						<>u__1 = default(Awaiter);
						num = (<>1__state = -1);
						goto IL_00db;
					case 1:
						awaiter = <>u__1;
						<>u__1 = default(Awaiter);
						num = (<>1__state = -1);
						goto IL_018e;
					case 2:
						awaiter = <>u__1;
						<>u__1 = default(Awaiter);
						num = (<>1__state = -1);
						goto IL_0203;
					case 3:
						{
							awaiter = <>u__1;
							<>u__1 = default(Awaiter);
							num = (<>1__state = -1);
							break;
						}
						IL_018e:
						((Awaiter)(ref awaiter)).GetResult();
						val = UniTask.WaitUntil((Func<bool>)(() => <>8__1.<>4__this._monster.CurrentState != <>8__1.currentState), (PlayerLoopTiming)8, spawnCancelToken);
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 2);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <Spawn>d__3>(ref awaiter, ref this);
							return;
						}
						goto IL_0203;
						IL_00db:
						((Awaiter)(ref awaiter)).GetResult();
						phantom._monster.Show();
						phantom._monster.health.SetReceiversActivate(false);
						phantom._monster.health.BecomeInvincible((Object)(object)phantom._monster);
						phantom._monster.ChangeStateIfValid(<>8__1.currentState);
						val = phantom.FadeIn(spawnCancelToken, spawnDelaySeconds);
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 1);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <Spawn>d__3>(ref awaiter, ref this);
							return;
						}
						goto IL_018e;
						IL_0203:
						((Awaiter)(ref awaiter)).GetResult();
						val = phantom.FadeOut(spawnCancelToken, spawnDelaySeconds);
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 3);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <Spawn>d__3>(ref awaiter, ref this);
							return;
						}
						break;
					}
					((Awaiter)(ref awaiter)).GetResult();
				}
				catch (Exception exception)
				{
					<>1__state = -2;
					<>8__1 = null;
					((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception);
					return;
				}
				<>1__state = -2;
				<>8__1 = null;
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult();
			}

			void IAsyncStateMachine.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				this.MoveNext();
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine);
			}

			void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine)
			{
				//ILSpy generated this explicit interface implementation from .override directive in SetStateMachine
				this.SetStateMachine(stateMachine);
			}
		}

		private MonsterBase _monster;

		private void Start()
		{
			AutoAttributeManager.AutoReferenceAllChildren(((Component)this).gameObject);
			((Component)this).TryGetComponent<MonsterBase>(ref _monster);
			((PhysicsMover)_monster).EnterLevelAwake();
			((PhysicsMover)_monster).EnterLevelReset();
			SpriteRenderer[] componentsInChildren = ((Component)this).GetComponentsInChildren<SpriteRenderer>();
			foreach (SpriteRenderer val in componentsInChildren)
			{
				if (!((Object)val).name.Contains("Shadow"))
				{
					MonoNodeExtension.TryGetCompOrAdd<_2dxFX_ColorRGB>((Component)(object)val);
					MonoNodeExtension.TryGetCompOrAdd<_2dxFX_Negative>((Component)(object)val);
				}
			}
			_monster.Hide();
		}

		internal void ScrambleGuid(int seed)
		{
			GuidComponent guidComponent = GuidExtension.GetGuidComponent(((Component)this).gameObject);
			Type type = ((object)guidComponent).GetType();
			byte[] array = new byte[16];
			new Random(seed).NextBytes(array);
			Guid value = new Guid(array);
			Traverse obj = Traverse.Create(type);
			obj.Field<Guid>("guid").Value = value;
			obj.Field<byte[]>("serializedGuid").Value = value.ToByteArray();
			((MonoBehaviour)guidComponent).Invoke("CreateGuid", 0f);
		}

		[AsyncStateMachine(typeof(<Spawn>d__3))]
		internal UniTask Spawn(MonsterBase refMonster, CancellationToken spawnCancelToken, float spawnDelaySeconds = 0.25f)
		{
			//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_0049: Unknown result type (might be due to invalid IL or missing references)
			<Spawn>d__3 <Spawn>d__ = default(<Spawn>d__3);
			<Spawn>d__.<>t__builder = AsyncUniTaskMethodBuilder.Create();
			<Spawn>d__.<>4__this = this;
			<Spawn>d__.refMonster = refMonster;
			<Spawn>d__.spawnCancelToken = spawnCancelToken;
			<Spawn>d__.spawnDelaySeconds = spawnDelaySeconds;
			<Spawn>d__.<>1__state = -1;
			((AsyncUniTaskMethodBuilder)(ref <Spawn>d__.<>t__builder)).Start<<Spawn>d__3>(ref <Spawn>d__);
			return ((AsyncUniTaskMethodBuilder)(ref <Spawn>d__.<>t__builder)).Task;
		}

		[AsyncStateMachine(typeof(<FadeIn>d__4))]
		private UniTask FadeIn(CancellationToken fadeCancelToken, float fadeTimeSec = 0.25f)
		{
			//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_0041: Unknown result type (might be due to invalid IL or missing references)
			<FadeIn>d__4 <FadeIn>d__ = default(<FadeIn>d__4);
			<FadeIn>d__.<>t__builder = AsyncUniTaskMethodBuilder.Create();
			<FadeIn>d__.<>4__this = this;
			<FadeIn>d__.fadeCancelToken = fadeCancelToken;
			<FadeIn>d__.fadeTimeSec = fadeTimeSec;
			<FadeIn>d__.<>1__state = -1;
			((AsyncUniTaskMethodBuilder)(ref <FadeIn>d__.<>t__builder)).Start<<FadeIn>d__4>(ref <FadeIn>d__);
			return ((AsyncUniTaskMethodBuilder)(ref <FadeIn>d__.<>t__builder)).Task;
		}

		[AsyncStateMachine(typeof(<FadeOut>d__5))]
		internal UniTask FadeOut(CancellationToken fadeCancelToken, float fadeTimeSec = 0.25f)
		{
			//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_0041: Unknown result type (might be due to invalid IL or missing references)
			<FadeOut>d__5 <FadeOut>d__ = default(<FadeOut>d__5);
			<FadeOut>d__.<>t__builder = AsyncUniTaskMethodBuilder.Create();
			<FadeOut>d__.<>4__this = this;
			<FadeOut>d__.fadeCancelToken = fadeCancelToken;
			<FadeOut>d__.fadeTimeSec = fadeTimeSec;
			<FadeOut>d__.<>1__state = -1;
			((AsyncUniTaskMethodBuilder)(ref <FadeOut>d__.<>t__builder)).Start<<FadeOut>d__5>(ref <FadeOut>d__);
			return ((AsyncUniTaskMethodBuilder)(ref <FadeOut>d__.<>t__builder)).Task;
		}
	}
	internal static class PhantomManager
	{
		[StructLayout(LayoutKind.Auto)]
		[CompilerGenerated]
		private struct <SpawnPhantoms>d__3 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncUniTaskMethodBuilder <>t__builder;

			public float spawnLengthSec;

			public MonsterBase refMonster;

			private float <spawnInterval>5__2;

			private List<UniTask> <spawnTasks>5__3;

			private int <i>5__4;

			private Awaiter <>u__1;

			private void MoveNext()
			{
				//IL_0118: Unknown result type (might be due to invalid IL or missing references)
				//IL_0138: Unknown result type (might be due to invalid IL or missing references)
				//IL_013d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0141: Unknown result type (might be due to invalid IL or missing references)
				//IL_0146: Unknown result type (might be due to invalid IL or missing references)
				//IL_0174: Unknown result type (might be due to invalid IL or missing references)
				//IL_0179: Unknown result type (might be due to invalid IL or missing references)
				//IL_0180: Unknown result type (might be due to invalid IL or missing references)
				//IL_015a: Unknown result type (might be due to invalid IL or missing references)
				//IL_015b: Unknown result type (might be due to invalid IL or missing references)
				//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0201: Unknown result type (might be due to invalid IL or missing references)
				//IL_0208: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				try
				{
					Awaiter awaiter;
					if (num != 0)
					{
						if (num != 1)
						{
							<spawnInterval>5__2 = spawnLengthSec / (float)_phantoms.Count;
							if (_spawnCancelSrcs == null)
							{
								_spawnCancelSrcs = new List<CancellationTokenSource>(_phantoms.Count);
							}
							<spawnTasks>5__3 = new List<UniTask>(_phantoms.Count);
							<i>5__4 = 0;
							goto IL_01a8;
						}
						awaiter = <>u__1;
						<>u__1 = default(Awaiter);
						num = (<>1__state = -1);
						goto IL_0217;
					}
					awaiter = <>u__1;
					<>u__1 = default(Awaiter);
					num = (<>1__state = -1);
					goto IL_018f;
					IL_01a8:
					UniTask val;
					if (<i>5__4 < _phantoms.Count)
					{
						Phantom phantom = _phantoms[<i>5__4];
						CancellationTokenSource cancellationTokenSource;
						if (_spawnCancelSrcs.Count > <i>5__4)
						{
							cancellationTokenSource = _spawnCancelSrcs[<i>5__4];
							if (cancellationTokenSource != null)
							{
								cancellationTokenSource.Cancel();
								_spawnCancelSrcs.Remove(cancellationTokenSource);
							}
						}
						cancellationTokenSource = new CancellationTokenSource();
						_spawnCancelSrcs.Insert(<i>5__4, cancellationTokenSource);
						try
						{
							<spawnTasks>5__3.Add(phantom.Spawn(refMonster, cancellationTokenSource.Token, <spawnInterval>5__2));
						}
						catch (OperationCanceledException)
						{
							cancellationTokenSource.Cancel();
							<spawnTasks>5__3.RemoveAt(<i>5__4);
							<spawnTasks>5__3.Add(phantom.FadeOut(cancellationTokenSource.Token, <spawnInterval>5__2));
						}
						val = UniTask.Delay(TimeSpan.FromSeconds(<spawnInterval>5__2), false, (PlayerLoopTiming)8, cancellationTokenSource.Token);
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 0);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <SpawnPhantoms>d__3>(ref awaiter, ref this);
							return;
						}
						goto IL_018f;
					}
					val = UniTask.WhenAll((IEnumerable<UniTask>)<spawnTasks>5__3);
					awaiter = ((UniTask)(ref val)).GetAwaiter();
					if (!((Awaiter)(ref awaiter)).IsCompleted)
					{
						num = (<>1__state = 1);
						<>u__1 = awaiter;
						((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <SpawnPhantoms>d__3>(ref awaiter, ref this);
						return;
					}
					goto IL_0217;
					IL_018f:
					((Awaiter)(ref awaiter)).GetResult();
					<i>5__4++;
					goto IL_01a8;
					IL_0217:
					((Awaiter)(ref awaiter)).GetResult();
				}
				catch (Exception exception)
				{
					<>1__state = -2;
					<spawnTasks>5__3 = null;
					((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception);
					return;
				}
				<>1__state = -2;
				<spawnTasks>5__3 = null;
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult();
			}

			void IAsyncStateMachine.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				this.MoveNext();
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine);
			}

			void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine)
			{
				//ILSpy generated this explicit interface implementation from .override directive in SetStateMachine
				this.SetStateMachine(stateMachine);
			}
		}

		private static List<Phantom> _phantoms;

		private static List<CancellationTokenSource> _spawnCancelSrcs = new List<CancellationTokenSource>();

		internal static void Initialize(GameObject refObj, int numPhantoms = 1)
		{
			//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)
			_phantoms = new List<Phantom>(numPhantoms);
			for (int i = 0; i < numPhantoms; i++)
			{
				GameObject obj = Object.Instantiate<GameObject>(refObj, refObj.transform.position, Quaternion.identity);
				obj.SetActive(false);
				Phantom phantom = obj.AddComponent<Phantom>();
				phantom.ScrambleGuid(i);
				obj.SetActive(true);
				_phantoms.Add(phantom);
			}
		}

		[AsyncStateMachine(typeof(<SpawnPhantoms>d__3))]
		internal static UniTask SpawnPhantoms(MonsterBase refMonster, float spawnLengthSec = 0.25f)
		{
			//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_0039: Unknown result type (might be due to invalid IL or missing references)
			<SpawnPhantoms>d__3 <SpawnPhantoms>d__ = default(<SpawnPhantoms>d__3);
			<SpawnPhantoms>d__.<>t__builder = AsyncUniTaskMethodBuilder.Create();
			<SpawnPhantoms>d__.refMonster = refMonster;
			<SpawnPhantoms>d__.spawnLengthSec = spawnLengthSec;
			<SpawnPhantoms>d__.<>1__state = -1;
			((AsyncUniTaskMethodBuilder)(ref <SpawnPhantoms>d__.<>t__builder)).Start<<SpawnPhantoms>d__3>(ref <SpawnPhantoms>d__);
			return ((AsyncUniTaskMethodBuilder)(ref <SpawnPhantoms>d__.<>t__builder)).Task;
		}
	}
	internal class PreloadManager
	{
		[StructLayout(LayoutKind.Auto)]
		[CompilerGenerated]
		private struct <Initialize>d__2 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncUniTaskMethodBuilder <>t__builder;

			private Awaiter <>u__1;

			private void MoveNext()
			{
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				//IL_0047: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: 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)
				//IL_0012: 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_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				try
				{
					Awaiter awaiter;
					if (num != 0)
					{
						UniTask val = Preload();
						awaiter = ((UniTask)(ref val)).GetAwaiter();
						if (!((Awaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 0);
							<>u__1 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <Initialize>d__2>(ref awaiter, ref this);
							return;
						}
					}
					else
					{
						awaiter = <>u__1;
						<>u__1 = default(Awaiter);
						num = (<>1__state = -1);
					}
					((Awaiter)(ref awaiter)).GetResult();
				}
				catch (Exception exception)
				{
					<>1__state = -2;
					((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception);
					return;
				}
				<>1__state = -2;
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult();
			}

			void IAsyncStateMachine.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				this.MoveNext();
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine);
			}

			void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine)
			{
				//ILSpy generated this explicit interface implementation from .override directive in SetStateMachine
				this.SetStateMachine(stateMachine);
			}
		}

		[StructLayout(LayoutKind.Auto)]
		[CompilerGenerated]
		private struct <Preload>d__5 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncUniTaskMethodBuilder <>t__builder;

			private Dictionary<string, Dictionary<string, string>>.Enumerator <>7__wrap1;

			private Awaiter<bool> <>u__1;

			private AsyncOperationAwaiter <>u__2;

			private void MoveNext()
			{
				//IL_011c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0121: Unknown result type (might be due to invalid IL or missing references)
				//IL_0129: Unknown result type (might be due to invalid IL or missing references)
				//IL_0145: Unknown result type (might be due to invalid IL or missing references)
				//IL_014a: Unknown result type (might be due to invalid IL or missing references)
				//IL_017a: Unknown result type (might be due to invalid IL or missing references)
				//IL_017f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0187: Unknown result type (might be due to invalid IL or missing references)
				//IL_015f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0161: Unknown result type (might be due to invalid IL or missing references)
				//IL_00de: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
				//IL_0101: Unknown result type (might be due to invalid IL or missing references)
				//IL_0103: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				try
				{
					string key;
					if ((uint)num > 1u)
					{
						DestroyAllGameObjects.DestroyingAll = true;
						Dictionary<string, Dictionary<string, string>> dictionary = new Dictionary<string, Dictionary<string, string>>();
						Dictionary<string, (string, string)>.Enumerator enumerator = PreloadedObjectMap.GetEnumerator();
						try
						{
							while (enumerator.MoveNext())
							{
								enumerator.Current.Deconstruct(out key, out var value);
								(string, string) tuple = value;
								string text = key;
								var (key2, value2) = tuple;
								if (dictionary.ContainsKey(key2))
								{
									dictionary[key2].Add(text, value2);
									continue;
								}
								Dictionary<string, string> dictionary2 = new Dictionary<string, string>();
								key = text;
								dictionary2[key] = value2;
								dictionary.Add(key2, dictionary2);
							}
						}
						finally
						{
							if (num < 0)
							{
								((IDisposable)enumerator).Dispose();
							}
						}
						<>7__wrap1 = dictionary.GetEnumerator();
					}
					try
					{
						AsyncOperationAwaiter awaiter;
						if (num != 0)
						{
							if (num != 1)
							{
								goto IL_019d;
							}
							awaiter = <>u__2;
							<>u__2 = default(AsyncOperationAwaiter);
							num = (<>1__state = -1);
							goto IL_0196;
						}
						Awaiter<bool> awaiter2 = <>u__1;
						<>u__1 = default(Awaiter<bool>);
						num = (<>1__state = -1);
						goto IL_0138;
						IL_0138:
						awaiter2.GetResult();
						awaiter = UnityAsyncExtensions.GetAwaiter(Resources.UnloadUnusedAssets());
						if (!((AsyncOperationAwaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 1);
							<>u__2 = awaiter;
							((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<AsyncOperationAwaiter, <Preload>d__5>(ref awaiter, ref this);
							return;
						}
						goto IL_0196;
						IL_0196:
						((AsyncOperationAwaiter)(ref awaiter)).GetResult();
						goto IL_019d;
						IL_019d:
						if (<>7__wrap1.MoveNext())
						{
							<>7__wrap1.Current.Deconstruct(out key, out Dictionary<string, string> value3);
							string sceneName = key;
							Dictionary<string, string> objMap = value3;
							awaiter2 = PreloadScene(sceneName, objMap).GetAwaiter();
							if (!awaiter2.IsCompleted)
							{
								num = (<>1__state = 0);
								<>u__1 = awaiter2;
								((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter<bool>, <Preload>d__5>(ref awaiter2, ref this);
								return;
							}
							goto IL_0138;
						}
					}
					finally
					{
						if (num < 0)
						{
							((IDisposable)<>7__wrap1).Dispose();
						}
					}
					<>7__wrap1 = default(Dictionary<string, Dictionary<string, string>>.Enumerator);
					DestroyAllGameObjects.DestroyingAll = false;
				}
				catch (Exception exception)
				{
					<>1__state = -2;
					((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception);
					return;
				}
				<>1__state = -2;
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult();
			}

			void IAsyncStateMachine.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				this.MoveNext();
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
				((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine);
			}

			void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine)
			{
				//ILSpy generated this explicit interface implementation from .override directive in SetStateMachine
				this.SetStateMachine(stateMachine);
			}
		}

		[StructLayout(LayoutKind.Auto)]
		[CompilerGenerated]
		private struct <PreloadScene>d__4 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncUniTaskMethodBuilder<bool> <>t__builder;

			public string sceneName;

			public Dictionary<string, string> objMap;

			private AsyncOperationAwaiter <>u__1;

			private void MoveNext()
			{
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0079: Unknown result type (might be due to invalid IL or missing references)
				//IL_0095: Unknown result type (might be due to invalid IL or missing references)
				//IL_009a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: 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_0053: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				bool result;
				try
				{
					AsyncOperationAwaiter awaiter;
					if (num == 0)
					{
						awaiter = <>u__1;
						<>u__1 = default(AsyncOperationAwaiter);
						num = (<>1__state = -1);
						goto IL_0088;
					}
					AsyncOperation val = SceneManager.LoadSceneAsync(sceneName, (LoadSceneMode)1);
					if (val != null)
					{
						awaiter = UnityAsyncExtensions.GetAwaiter(val);
						if (!((AsyncOperationAwaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 0);
							<>u__1 = awaiter;
							<>t__builder.AwaitUnsafeOnCompleted<AsyncOperationAwaiter, <PreloadScene>d__4>(ref awaiter, ref this);
							return;
						}
						goto IL_0088;
					}
					Log.Error("Error loading scene: " + sceneName);
					result = false;
					goto end_IL_0007;
					IL_0088:
					((AsyncOperationAwaiter)(ref awaiter)).GetResult();
					Scene sceneByName = SceneManager.GetSceneByName(sceneName);
					bool flag = true;
					try
					{
						GameObject[] rootGameObjects = ((Scene)(ref sceneByName)).GetRootGameObjects();
						GameObject[] array = rootGameObjects;
						for (int i = 0; i < array.Length; i++)
						{
							array[i].SetActive(false);
						}
						Dictionary<string, string>.Enumerator enumerator = objMap.GetEnumerator();
						try
						{
							while (enumerator.MoveNext())
							{
								enumerator.Current.Deconstruct(out var key, out var value);
								string text = key;
								string text2 = value;
								GameObject gameObjectFromArray = GetGameObjectFromArray(rootGameObjects, text2);
								if ((Object)(object)gameObjectFromArray != (Object)null)
								{
									GameObject val2 = Object.Instantiate<GameObject>(gameObjectFromArray);
									((Object)val2).name = ((Object)val2).name.Replace("(Clone)", "");
									val2.SetActive(false);
									Object.DontDestroyOnLoad((Object)(object)val2);
									AutoAttributeManager.AutoReferenceAllChildren(val2);
									if (!_preloadedObjects.TryAdd(text, val2))
									{
										Log.Error("Failed to key " + text + " to preloaded game object " + ((Object)val2).name + "!");
									}
								}
								else
								{
									Log.Error("Failed to find game object in scene " + sceneName + " at path " + text2 + "!");
									flag = false;
								}
							}
						}
						finally
						{
							if (num < 0)
							{
								((IDisposable)enumerator).Dispose();
							}
						}
					}
					catch (Exception data)
					{
						Log.Error(data);
					}
					if (SceneManager.UnloadSceneAsync(sceneName, (UnloadSceneOptions)1) == null)
					{
						Log.Error("Error unloading scene: " + sceneName);
						result = false;
					}
					else
					{
						result = flag;
					}
					end_IL_0007:;
				}
				catch (Exception exception)
				{
					<>1__state = -2;
					<>t__builder.SetException(exception);
					return;
				}
				<>1__state = -2;
				<>t__builder.SetResult(result);
			}

			void IAsyncStateMachine.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				this.MoveNext();
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
				<>t__builder.SetStateMachine(stateMachine);
			}

			void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine)
			{
				//ILSpy generated this explicit interface implementation from .override directive in SetStateMachine
				this.SetStateMachine(stateMachine);
			}
		}

		private static readonly Dictionary<string, (string, string)> PreloadedObjectMap = new Dictionary<string, (string, string)> { ["Sniper"] = ("A5_S4_CastleMid_Remake_5wei", "A5_S4/Room/SniperTeleportGroup (1)/StealthGameMonster_Sniper (1)/MonsterCore/Animator(Proxy)/Animator") };

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

		[AsyncStateMachine(typeof(<Initialize>d__2))]
		internal static UniTask Initialize()
		{
			//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_0029: Unknown result type (might be due to invalid IL or missing references)
			<Initialize>d__2 <Initialize>d__ = default(<Initialize>d__2);
			<Initialize>d__.<>t__builder = AsyncUniTaskMethodBuilder.Create();
			<Initialize>d__.<>1__state = -1;
			((AsyncUniTaskMethodBuilder)(ref <Initialize>d__.<>t__builder)).Start<<Initialize>d__2>(ref <Initialize>d__);
			return ((AsyncUniTaskMethodBuilder)(ref <Initialize>d__.<>t__builder)).Task;
		}

		internal static bool TryGet(string key, out GameObject? obj)
		{
			if (_preloadedObjects.TryGetValue(key, out obj))
			{
				return true;
			}
			Log.Error("Failed to fetch preloaded game object from key \"" + key + "\"!");
			return false;
		}

		[AsyncStateMachine(typeof(<PreloadScene>d__4))]
		private static UniTask<bool> PreloadScene(string sceneName, Dictionary<string, string> objMap)
		{
			//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_0039: Unknown result type (might be due to invalid IL or missing references)
			<PreloadScene>d__4 <PreloadScene>d__ = default(<PreloadScene>d__4);
			<PreloadScene>d__.<>t__builder = AsyncUniTaskMethodBuilder<bool>.Create();
			<PreloadScene>d__.sceneName = sceneName;
			<PreloadScene>d__.objMap = objMap;
			<PreloadScene>d__.<>1__state = -1;
			<PreloadScene>d__.<>t__builder.Start<<PreloadScene>d__4>(ref <PreloadScene>d__);
			return <PreloadScene>d__.<>t__builder.Task;
		}

		[AsyncStateMachine(typeof(<Preload>d__5))]
		private static UniTask Preload()
		{
			//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_0029: Unknown result type (might be due to invalid IL or missing references)
			<Preload>d__5 <Preload>d__ = default(<Preload>d__5);
			<Preload>d__.<>t__builder = AsyncUniTaskMethodBuilder.Create();
			<Preload>d__.<>1__state = -1;
			((AsyncUniTaskMethodBuilder)(ref <Preload>d__.<>t__builder)).Start<<Preload>d__5>(ref <Preload>d__);
			return ((AsyncUniTaskMethodBuilder)(ref <Preload>d__.<>t__builder)).Task;
		}

		internal static void Unload()
		{
			foreach (GameObject value in _preloadedObjects.Values)
			{
				Object.DestroyImmediate((Object)(object)value);
			}
			_preloadedObjects.Clear();
		}

		private static GameObject? GetGameObjectFromArray(GameObject[] objects, string objPath)