Decompiled source of Naseong v1.1.0

Naseong.dll

Decompiled 6 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Alexandria.BreakableAPI;
using Alexandria.CharacterAPI;
using Alexandria.EnemyAPI;
using Alexandria.ItemAPI;
using Alexandria.Misc;
using Alexandria.SoundAPI;
using Alexandria.VisualAPI;
using Alexandria.cAPI;
using BepInEx;
using Dungeonator;
using Gungeon;
using InControl;
using MonoMod.RuntimeDetour;
using NaSeong;
using Naseong;
using Pathfinding;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Naseong")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Naseong")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("5069a4ac-a360-451c-8d38-179b79625c23")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace NaSeong
{
	internal class SkullCrusher : GunBehaviour
	{
		internal delegate void Action<T1, T2, T3, T4, T5, T6>(T1 arg, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);

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

			private object <>2__current;

			public Gun gun;

			public AIActor target;

			private Transform <copySprite>5__1;

			private Vector3 <startPosition>5__2;

			private float <elapsed>5__3;

			private float <duration>5__4;

			private Vector3 <position>5__5;

			private float <t>5__6;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a7: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00df: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
				//IL_0110: 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_0131: 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_0150: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<copySprite>5__1 = CreateEmptySprite(target);
					<startPosition>5__2 = ((Component)<copySprite>5__1).transform.position;
					<elapsed>5__3 = 0f;
					<duration>5__4 = 0.5f;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (<elapsed>5__3 < <duration>5__4)
				{
					<elapsed>5__3 += BraveTime.DeltaTime;
					if (Object.op_Implicit((Object)(object)gun) && Object.op_Implicit((Object)(object)<copySprite>5__1))
					{
						<position>5__5 = gun.PrimaryHandAttachPoint.position;
						<t>5__6 = <elapsed>5__3 / <duration>5__4 * (<elapsed>5__3 / <duration>5__4);
						<copySprite>5__1.position = Vector3.Lerp(<startPosition>5__2, <position>5__5, <t>5__6);
						<copySprite>5__1.rotation = Quaternion.Euler(0f, 0f, 360f * BraveTime.DeltaTime) * <copySprite>5__1.rotation;
						<copySprite>5__1.localScale = Vector3.Lerp(Vector3.one, new Vector3(0.1f, 0.1f, 0.1f), <t>5__6);
					}
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				if (Object.op_Implicit((Object)(object)<copySprite>5__1))
				{
					Object.Destroy((Object)(object)((Component)<copySprite>5__1).gameObject);
				}
				return false;
			}

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

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

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

			private object <>2__current;

			public Gun gun;

			private Transform <copySprite>5__1;

			private Vector3 <startPosition>5__2;

			private float <elapsed>5__3;

			private float <duration>5__4;

			private Vector3 <position>5__5;

			private float <t>5__6;

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

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

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

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

			private bool MoveNext()
			{
				//IL_003b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00da: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_010b: 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_011b: Unknown result type (might be due to invalid IL or missing references)
				//IL_012c: 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_014b: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<copySprite>5__1 = CreateEmptySprite(null);
					<startPosition>5__2 = ((Component)<copySprite>5__1).transform.position;
					<elapsed>5__3 = 0f;
					<duration>5__4 = 0.5f;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (<elapsed>5__3 < <duration>5__4)
				{
					<elapsed>5__3 += BraveTime.DeltaTime;
					if (Object.op_Implicit((Object)(object)gun) && Object.op_Implicit((Object)(object)<copySprite>5__1))
					{
						<position>5__5 = gun.PrimaryHandAttachPoint.position;
						<t>5__6 = <elapsed>5__3 / <duration>5__4 * (<elapsed>5__3 / <duration>5__4);
						<copySprite>5__1.position = Vector3.Lerp(<startPosition>5__2, <position>5__5, <t>5__6);
						<copySprite>5__1.rotation = Quaternion.Euler(0f, 0f, 360f * BraveTime.DeltaTime) * <copySprite>5__1.rotation;
						<copySprite>5__1.localScale = Vector3.Lerp(Vector3.one, new Vector3(0.1f, 0.1f, 0.1f), <t>5__6);
					}
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				if (Object.op_Implicit((Object)(object)<copySprite>5__1))
				{
					Object.Destroy((Object)(object)((Component)<copySprite>5__1).gameObject);
				}
				return false;
			}

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

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

		private bool HasReloaded;

		private static Dictionary<string, List<Projectile>> skullProjectileDict = new Dictionary<string, List<Projectile>>();

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

		private static List<string> activeSkullNames = new List<string>();

		private static string currentSkullName = "lich";

		private static bool fullyActivated = false;

		private static int numCrushedSkulls = 0;

		public bool FullyActivated => fullyActivated;

		public int RemainingSkulls => Math.Max(5 - activeSkullNames.Count, 0);

		public int NumCrushedSkulls => numCrushedSkulls;

		public static void Add(string guid)
		{
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_06dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0736: Unknown result type (might be due to invalid IL or missing references)
			//IL_0796: Unknown result type (might be due to invalid IL or missing references)
			//IL_079c: Expected O, but got Unknown
			//IL_07c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cf: Expected O, but got Unknown
			//IL_07fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0802: Expected O, but got Unknown
			//IL_05dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e4: Expected O, but got Unknown
			Gun val = Databases.Items.NewGun("Skull Crusher", "skull_crusher");
			Game.Items.Rename("outdated_gun_mods:skull_crusher", "naseong:skull_crusher");
			((Component)val).gameObject.AddComponent<SkullCrusher>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Rip... and... tear!!");
			GunExt.SetLongDescription((PickupObject)(object)val, "Starting weapon of Naseong. This lethal weapon shoots bone fragments by crushing the gundead's skull. Circulate the type of skulls on reloading. Soak and instantly kill nearby skull-like gundeads and append the skull in the reloading loop on empty clip reloading. If you collect total 5 different skulls in the loop, soak, increase 1 curse, and instantly kill nearby the lord of the jammed and append it in the reloading loop on empty clip reloading.\n\nGrinds bone into shrapnel. Reload to remix your kill list—every skull tells a story, now it's ammo");
			GunExt.SetName((PickupObject)(object)val, (GungeonSupportedLanguages)8, "본헤이터");
			GunExt.SetShortDescription((PickupObject)(object)val, (GungeonSupportedLanguages)8, "찢고... 죽여라...!");
			GunExt.SetLongDescription((PickupObject)(object)val, (GungeonSupportedLanguages)8, "나성의 시 무기입니다. 이 치명적인 무기는 건데드의 해골을 으깨 뼛조각을 발사합니다. 재장전할 때 해골의 종류가 순환되며, 빈 탄창에서 재장전 시 근처의 해골형 건데드를 흡수해 즉시 처치하고 해당 해골을 로테이션에 추가합니다. 만약 총 5개의 해골을 로테이션에 모은다면, 빈 탄창에서 재장전 시 근처의 궁지에 몰린 자들의 지배자 흡수해 즉시 처치하고 저주를 1 증가하며 로테이션에 추가합니다.\n\n오늘도 리치는 진정한 총굴의 주인에게 패배합니다.");
			GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "skull_crusher_lich_empty_001", 8);
			List<string> list = new List<string> { "lich", "megalich", "infinilich", "shelleton", "skullet", "sreaper" };
			foreach (string item in list)
			{
				val.idleAnimation = GunExt.UpdateAnimationAddClipsLater(val, item + "_idle", (tk2dSpriteCollectionData)null, false, (List<tk2dSpriteAnimationClip>)null);
				val.shootAnimation = GunExt.UpdateAnimationAddClipsLater(val, item + "_fire", (tk2dSpriteCollectionData)null, true, (List<tk2dSpriteAnimationClip>)null);
				val.reloadAnimation = GunExt.UpdateAnimationAddClipsLater(val, item + "_reload", (tk2dSpriteCollectionData)null, true, (List<tk2dSpriteAnimationClip>)null);
				val.emptyAnimation = GunExt.UpdateAnimationAddClipsLater(val, item + "_empty", (tk2dSpriteCollectionData)null, false, (List<tk2dSpriteAnimationClip>)null);
				((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.shootAnimation).frames[0].eventAudio = "Play_WPN_skullgun_shot_01";
				((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.shootAnimation).frames[0].triggerEvent = true;
				((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.reloadAnimation).frames[4].eventAudio = "Play_WPN_saw_grinding";
				((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.reloadAnimation).frames[4].triggerEvent = true;
			}
			val.idleAnimation = "skull_crusher_lich_idle";
			val.shootAnimation = "skull_crusher_lich_fire";
			val.reloadAnimation = "skull_crusher_lich_reload";
			val.emptyAnimation = "skull_crusher_lich_empty";
			GunExt.SetAnimationFPS(val, val.idleAnimation, 4);
			GunExt.SetAnimationFPS(val, val.shootAnimation, 8);
			GunExt.SetAnimationFPS(val, val.reloadAnimation, 8);
			GunExt.SetAnimationFPS(val, val.emptyAnimation, 8);
			PickupObject byId = PickupObjectDatabase.GetById(86);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			foreach (ProjectileModule projectile in val.Volley.projectiles)
			{
				projectile.ammoCost = 1;
				projectile.shootStyle = (ShootStyle)0;
				projectile.sequenceStyle = (ProjectileSequenceStyle)0;
				projectile.ammoType = (AmmoType)14;
				projectile.cooldownTime = 0.2f;
				projectile.angleVariance = 7.5f;
				projectile.numberOfShotsInClip = 8;
				projectile.projectiles.Clear();
			}
			((Component)val.barrelOffset).transform.localPosition = new Vector3(1.25f, 0.5625f, 0f);
			foreach (string item2 in list)
			{
				CustomClipAmmoTypeToolbox.AddCustomAmmoType("SkullCrusher" + item2 + "Ammo", "Naseong/Resources/SkullCrusher/skull_crusher_" + item2 + "_ammo_fg", "Naseong/Resources/SkullCrusher/skull_crusher_ammo_bg");
				List<string> list2 = new List<string>
				{
					"skull_crusher_" + item2 + "_projectile_001",
					"skull_crusher_" + item2 + "_projectile_002",
					"skull_crusher_" + item2 + "_projectile_003",
					"skull_crusher_" + item2 + "_projectile_004",
					"skull_crusher_" + item2 + "_projectile_005",
					"skull_crusher_" + item2 + "_projectile_006",
					"skull_crusher_" + item2 + "_projectile_007",
					"skull_crusher_" + item2 + "_projectile_008"
				};
				List<Projectile> list3 = new List<Projectile>();
				foreach (string item3 in list2)
				{
					PickupObject byId2 = PickupObjectDatabase.GetById(86);
					Projectile val2 = Object.Instantiate<Projectile>(((Gun)((byId2 is Gun) ? byId2 : null)).DefaultModule.projectiles[0]);
					((Component)val2).gameObject.SetActive(false);
					FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject);
					Object.DontDestroyOnLoad((Object)(object)val2);
					val2.baseData.damage = 5f;
					val2.baseData.range = 30f;
					val2.baseData.speed = 23f;
					val2.baseData.force = 9f;
					GunTools.SetProjectileSpriteRight(val2, item3, 8, 8, true, (Anchor)4, (int?)6, (int?)6, true, false, (int?)null, (int?)null, (Projectile)null);
					ref VFXPool enemy = ref val2.hitEffects.enemy;
					PickupObject byId3 = PickupObjectDatabase.GetById(143);
					enemy = ((Gun)((byId3 is Gun) ? byId3 : null)).Volley.projectiles[3].projectiles[0].hitEffects.enemy;
					((BraveBehaviour)val2).transform.parent = val.barrelOffset;
					list3.Add(val2);
				}
				skullProjectileDict.Add(item2, list3);
				DebrisObject val3 = BreakableAPIToolbox.GenerateDebrisObject("Naseong/Resources/SkullCrusher/skull_crusher_" + item2 + "_debris.png", true, 1f, 1f, 700f, 100f, (tk2dSprite)null, 1f, "Play_WPN_magnum_shells_01", (GameObject)null, 0, false, (GoopDefinition)null, 1f);
				GameObject val4 = new GameObject("SkullCrusher" + item2 + "Debris");
				Object.DontDestroyOnLoad((Object)(object)val4);
				FakePrefab.MarkAsFakePrefab(val4);
				val4.SetActive(false);
				skullDebrisDict.Add(item2, ((Component)val3).gameObject);
			}
			val.DefaultModule.customAmmoType = "SkullCrusherlichAmmo";
			val.DefaultModule.projectiles = skullProjectileDict["lich"];
			val.shellCasing = skullDebrisDict["lich"];
			val.shellsToLaunchOnFire = 0;
			val.shellsToLaunchOnReload = 4;
			val.reloadShellLaunchFrame = 5;
			activeSkullNames.Add("lich");
			activeSkullNames.Add("megalich");
			activeSkullNames.Add("infinilich");
			val.reloadTime = 1f;
			val.SetBaseMaxAmmo(350);
			val.gunClass = (GunClass)10;
			val.InfiniteAmmo = true;
			((PickupObject)val).quality = (ItemQuality)(-100);
			((BraveBehaviour)val).encounterTrackable.EncounterGuid = "Skull Crusher";
			List<string> list4 = new List<string> { "Naseong/Resources/VFX/skull_crusher_muzzleflash_001.png", "Naseong/Resources/VFX/skull_crusher_muzzleflash_002.png", "Naseong/Resources/VFX/skull_crusher_muzzleflash_003.png", "Naseong/Resources/VFX/skull_crusher_muzzleflash_004.png" };
			val.muzzleFlashEffects = VFXBuilder.CreateVFXPool("Skull Crusher Muzzleflash", list4, 30, new IntVector2(11, 12), (Anchor)3, false, 0f, false, (VFXAlignment)0, -1f, (Color?)null, (Assembly)null);
			((Component)val).gameObject.AddComponent<SkullCrusherAmmoDisplay>();
			Hook val5 = new Hook((MethodBase)typeof(Gun).GetMethod("Reload", BindingFlags.Instance | BindingFlags.Public), typeof(SkullCrusher).GetMethod("BeforeReloadHook", BindingFlags.Static | BindingFlags.NonPublic));
			Hook val6 = new Hook((MethodBase)typeof(EncounterTrackable).GetMethod("GetModifiedDisplayName", BindingFlags.Instance | BindingFlags.Public), typeof(SkullCrusher).GetMethod("GetModifiedDisplayNameHook", BindingFlags.Static | BindingFlags.NonPublic));
			Hook val7 = new Hook((MethodBase)typeof(GameUIRoot).GetMethod("UpdateGunDataInternal", BindingFlags.Instance | BindingFlags.NonPublic), typeof(SkullCrusher).GetMethod("UpdateGunDataInternalHook", BindingFlags.Static | BindingFlags.NonPublic));
			Databases.Items.Add(val, (tk2dSpriteCollectionData)null, "ANY");
			Debug.Log((object)"Finish Building Skull Crusher.");
		}

		public override void OnInitializedWithOwner(GameActor actor)
		{
			currentSkullName = "lich";
			activeSkullNames = new List<string> { "lich", "megalich", "infinilich" };
			numCrushedSkulls = 0;
			fullyActivated = false;
			((GunBehaviour)this).OnInitializedWithOwner(actor);
		}

		private void OnGunChanged(Gun previous, Gun current, bool newGun)
		{
			if ((Object)(object)current != (Object)null && ((BraveBehaviour)current).encounterTrackable.EncounterGuid == "Skull Crusher")
			{
				SetNewSkull(current, currentSkullName);
			}
		}

		public override void OnPlayerPickup(PlayerController playerOwner)
		{
			if ((Object)(object)playerOwner != (Object)null && (Object)(object)((GameActor)playerOwner).CurrentGun != (Object)null && ((BraveBehaviour)((GameActor)playerOwner).CurrentGun).encounterTrackable.EncounterGuid == "Skull Crusher")
			{
				SetNewSkull(((GameActor)playerOwner).CurrentGun, currentSkullName);
				playerOwner.GunChanged += OnGunChanged;
			}
			((GunBehaviour)this).OnPlayerPickup(playerOwner);
		}

		public override void Update()
		{
			if (Object.op_Implicit((Object)(object)base.gun.CurrentOwner))
			{
				if (!base.gun.PreventNormalFireAudio)
				{
					base.gun.PreventNormalFireAudio = true;
				}
				if (!base.gun.IsReloading && !HasReloaded)
				{
					HasReloaded = true;
				}
			}
		}

		public override void OnDroppedByPlayer(PlayerController player)
		{
			if ((Object)(object)player != (Object)null && (Object)(object)((GameActor)player).CurrentGun != (Object)null && ((BraveBehaviour)((GameActor)player).CurrentGun).encounterTrackable.EncounterGuid == "Skull Crusher")
			{
				player.GunChanged -= OnGunChanged;
			}
			((GunBehaviour)this).OnDroppedByPlayer(player);
		}

		public override void OnReloadPressed(PlayerController player, Gun gun, bool bSOMETHING)
		{
			if (gun.IsReloading && HasReloaded)
			{
				HasReloaded = false;
				AkSoundEngine.PostEvent("Stop_WPN_All", ((Component)this).gameObject);
				((GunBehaviour)this).OnReloadPressed(player, gun, bSOMETHING);
			}
		}

		private static void SetNewSkull(Gun gun, string skullName)
		{
			gun.idleAnimation = "skull_crusher_" + skullName + "_idle";
			gun.shootAnimation = "skull_crusher_" + skullName + "_fire";
			gun.reloadAnimation = "skull_crusher_" + skullName + "_reload";
			gun.emptyAnimation = "skull_crusher_" + skullName + "_empty";
			GunExt.SetAnimationFPS(gun, gun.idleAnimation, 4);
			GunExt.SetAnimationFPS(gun, gun.shootAnimation, 8);
			GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 8);
			GunExt.SetAnimationFPS(gun, gun.emptyAnimation, 8);
			gun.DefaultModule.customAmmoType = "SkullCrusher" + skullName + "Ammo";
			gun.DefaultModule.projectiles = skullProjectileDict[skullName];
			gun.shellCasing = skullDebrisDict[skullName];
		}

		private static bool BeforeReloadHook(Func<Gun, bool> orig, Gun self)
		{
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: 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_01ea: 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_01f2: 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_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Expected O, but got Unknown
			if (((BraveBehaviour)self).encounterTrackable.EncounterGuid == "Skull Crusher")
			{
				FieldInfo field = typeof(Gun).GetField("m_isReloading", BindingFlags.Instance | BindingFlags.NonPublic);
				bool flag = (bool)field.GetValue(self);
				MethodInfo method = typeof(Gun).GetMethod("HaveAmmoToReloadWith", BindingFlags.Instance | BindingFlags.NonPublic);
				if (!flag && self.RuntimeModuleData[self.DefaultModule].numberShotsFired != 0 && (bool)method.Invoke(self, null))
				{
					if (self.ClipShotsRemaining == 0 && (Object)(object)self.CurrentOwner != (Object)null && ((DungeonPlaceableBehaviour)self.CurrentOwner).GetAbsoluteParentRoom() != null)
					{
						bool isEnemySucked = false;
						string text = currentSkullName;
						Action<AIActor, float> @object = delegate(AIActor target, float distance)
						{
							if (Object.op_Implicit((Object)(object)target) && Object.op_Implicit((Object)(object)((BraveBehaviour)target).healthHaver) && !((BraveBehaviour)target).healthHaver.IsBoss && AlexandriaTags.HasTag(target, "skeleton"))
							{
								((MonoBehaviour)GameManager.Instance.Dungeon).StartCoroutine(HandleEnemySuck(self, target));
								target.EraseFromExistence(false);
								numCrushedSkulls++;
								string item3 = ((!(target.EnemyGuid == "21dd14e5ca2a4a388adab5b11b69a1e1")) ? "skullet" : "shelleton");
								if (!activeSkullNames.Contains(item3))
								{
									activeSkullNames.Add(item3);
								}
								if (!isEnemySucked)
								{
									currentSkullName = item3;
									SetNewSkull(self, currentSkullName);
									isEnemySucked = true;
									if (!fullyActivated && activeSkullNames.Count == 5)
									{
										fullyActivated = true;
									}
								}
							}
						};
						((DungeonPlaceableBehaviour)self.CurrentOwner).GetAbsoluteParentRoom().ApplyActionToNearbyEnemies(self.CurrentOwner.CenterPosition, 5f, (Action<AIActor, float>)@object.Invoke);
						if (fullyActivated && (Object)(object)SuperReaperController.Instance != (Object)null && Vector2.Distance(((BraveBehaviour)SuperReaperController.Instance).specRigidbody.UnitCenter, ((BraveBehaviour)self.CurrentOwner).specRigidbody.UnitCenter) < 5f)
						{
							((MonoBehaviour)GameManager.Instance.Dungeon).StartCoroutine(HandleSuperReaperSuck(self));
							SuperReaperController.PreventShooting = true;
							StatModifier item = new StatModifier
							{
								statToBoost = (StatType)14,
								modifyType = (ModifyMethod)0,
								amount = 1f
							};
							GameActor currentOwner = self.CurrentOwner;
							((PlayerController)((currentOwner is PlayerController) ? currentOwner : null)).ownerlessStatModifiers.Add(item);
							GameActor currentOwner2 = self.CurrentOwner;
							? val = ((PlayerController)((currentOwner2 is PlayerController) ? currentOwner2 : null)).stats;
							GameActor currentOwner3 = self.CurrentOwner;
							((PlayerStats)val).RecalculateStats((PlayerController)(object)((currentOwner3 is PlayerController) ? currentOwner3 : null), false, false);
							ItemBuilder.AddCurrentGunStatModifier(self, (StatType)14, 1f, (ModifyMethod)0);
							Object.Destroy((Object)(object)((Component)SuperReaperController.Instance).gameObject);
							numCrushedSkulls++;
							string item2 = "sreaper";
							if (!activeSkullNames.Contains(item2))
							{
								activeSkullNames.Add(item2);
							}
							currentSkullName = item2;
							SetNewSkull(self, currentSkullName);
						}
						else if (text == currentSkullName)
						{
							List<string> list = new List<string>();
							foreach (string activeSkullName in activeSkullNames)
							{
								if (activeSkullName != currentSkullName)
								{
									list.Add(activeSkullName);
								}
							}
							currentSkullName = BraveUtility.RandomElement<string>(list);
							SetNewSkull(self, currentSkullName);
						}
					}
					else
					{
						List<string> list2 = new List<string>();
						foreach (string activeSkullName2 in activeSkullNames)
						{
							if (activeSkullName2 != currentSkullName)
							{
								list2.Add(activeSkullName2);
							}
						}
						currentSkullName = BraveUtility.RandomElement<string>(list2);
						SetNewSkull(self, currentSkullName);
					}
				}
			}
			return orig(self);
		}

		private static IEnumerator HandleEnemySuck(Gun gun, AIActor target)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <HandleEnemySuck>d__23(0)
			{
				gun = gun,
				target = target
			};
		}

		private static IEnumerator HandleSuperReaperSuck(Gun gun)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <HandleSuperReaperSuck>d__24(0)
			{
				gun = gun
			};
		}

		private static Transform CreateEmptySprite(AIActor target)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_012e: 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_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("suck image");
			GameObject val2 = new GameObject("image parent");
			if ((Object)(object)target == (Object)null)
			{
				val.layer = ((Component)SuperReaperController.Instance).gameObject.layer;
				tk2dSprite val3 = val.AddComponent<tk2dSprite>();
				val.transform.parent = SpawnManager.Instance.VFX;
				((tk2dBaseSprite)val3).SetSprite(((BraveBehaviour)SuperReaperController.Instance).sprite.Collection, ((BraveBehaviour)SuperReaperController.Instance).sprite.spriteId);
				((BraveBehaviour)val3).transform.position = ((BraveBehaviour)((BraveBehaviour)SuperReaperController.Instance).sprite).transform.position;
				val2.transform.position = Vector2.op_Implicit(((tk2dBaseSprite)val3).WorldCenter);
				((BraveBehaviour)val3).transform.parent = val2.transform;
			}
			else
			{
				val.layer = ((Component)target).gameObject.layer;
				tk2dSprite val4 = val.AddComponent<tk2dSprite>();
				val.transform.parent = SpawnManager.Instance.VFX;
				((tk2dBaseSprite)val4).SetSprite(((BraveBehaviour)target).sprite.Collection, ((BraveBehaviour)target).sprite.spriteId);
				((BraveBehaviour)val4).transform.position = ((BraveBehaviour)((BraveBehaviour)target).sprite).transform.position;
				val2.transform.position = Vector2.op_Implicit(((tk2dBaseSprite)val4).WorldCenter);
				((BraveBehaviour)val4).transform.parent = val2.transform;
				if ((Object)(object)target.optionalPalette != (Object)null)
				{
					((BraveBehaviour)val4).renderer.material.SetTexture("_PaletteTex", (Texture)(object)target.optionalPalette);
				}
			}
			return val2.transform;
		}

		private static string GetModifiedDisplayNameHook(Func<EncounterTrackable, string> orig, EncounterTrackable self)
		{
			string text = orig(self);
			if ((Object)(object)((Component)self).gameObject.GetComponent<Gun>() != (Object)null && (Object)(object)((Component)self).gameObject.GetComponent<Gun>().CurrentOwner != (Object)null && ((Component)self).gameObject.GetComponent<Gun>().CurrentOwner is PlayerController)
			{
				SkullCrusher component = ((Component)self).gameObject.GetComponent<SkullCrusher>();
				if (component != null)
				{
					if (!component.FullyActivated)
					{
						string arg = ((component.RemainingSkulls <= 1) ? "#ff9933" : "#ffcc00");
						text = $"[color {arg}]{component.RemainingSkulls} Remains[/color]\n{text}";
					}
					else
					{
						text = "[color #ff3300]Satisfied[/color]\n" + text;
					}
				}
			}
			return text;
		}

		private static void UpdateGunDataInternalHook(Action<GameUIRoot, PlayerController, GunInventory, int, GameUIAmmoController, int> orig, GameUIRoot self, PlayerController targetPlayer, GunInventory inventory, int inventoryShift, GameUIAmmoController targetAmmoController, int labelTarget)
		{
			if (GameUIRoot.HasInstance)
			{
				for (int i = 0; i < 2; i++)
				{
					if (!GameUIRoot.Instance.gunNameLabels[i].ProcessMarkup)
					{
						GameUIRoot.Instance.gunNameLabels[i].ProcessMarkup = true;
					}
					if (!GameUIRoot.Instance.gunNameLabels[i].AutoHeight)
					{
						GameUIRoot.Instance.gunNameLabels[i].AutoHeight = true;
					}
				}
			}
			orig(self, targetPlayer, inventory, inventoryShift, targetAmmoController, labelTarget);
		}
	}
	public class SkullCrusherAmmoDisplay : CustomAmmoDisplay
	{
		private Gun gun;

		private SkullCrusher skullCrusher;

		private PlayerController owner;

		private void Start()
		{
			gun = ((Component)this).GetComponent<Gun>();
			skullCrusher = ((Component)gun).GetComponent<SkullCrusher>();
			ref PlayerController reference = ref owner;
			GameActor currentOwner = gun.CurrentOwner;
			reference = (PlayerController)(object)((currentOwner is PlayerController) ? currentOwner : null);
		}

		public override bool DoCustomAmmoDisplay(GameUIAmmoController uic)
		{
			if (!Object.op_Implicit((Object)(object)owner) || !Object.op_Implicit((Object)(object)skullCrusher))
			{
				return false;
			}
			uic.GunAmmoCountLabel.Text = $"[color #669999]{skullCrusher.NumCrushedSkulls} Crushed[/color]\n{CustomAmmoDisplayExtensions.VanillaAmmoDisplay(owner)}";
			return true;
		}
	}
	public static class Tools
	{
		public static tk2dSpriteDefinition CopyDefinitionFrom(this tk2dSpriteDefinition other)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: 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_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Expected O, but got Unknown
			//IL_012b: 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_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: 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_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: 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_01e9: 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_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: 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_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: 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_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: 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_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Expected O, but got Unknown
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_0389: 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_0397: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_040d: Unknown result type (might be due to invalid IL or missing references)
			//IL_041b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0427: Unknown result type (might be due to invalid IL or missing references)
			tk2dSpriteDefinition val = new tk2dSpriteDefinition
			{
				boundsDataCenter = new Vector3
				{
					x = other.boundsDataCenter.x,
					y = other.boundsDataCenter.y,
					z = other.boundsDataCenter.z
				},
				boundsDataExtents = new Vector3
				{
					x = other.boundsDataExtents.x,
					y = other.boundsDataExtents.y,
					z = other.boundsDataExtents.z
				},
				colliderConvex = other.colliderConvex,
				colliderSmoothSphereCollisions = other.colliderSmoothSphereCollisions,
				colliderType = other.colliderType,
				colliderVertices = other.colliderVertices,
				collisionLayer = other.collisionLayer,
				complexGeometry = other.complexGeometry,
				extractRegion = other.extractRegion,
				flipped = other.flipped,
				indices = other.indices,
				material = new Material(other.material),
				materialId = other.materialId,
				materialInst = new Material(other.materialInst),
				metadata = other.metadata,
				name = other.name,
				normals = other.normals,
				physicsEngine = other.physicsEngine,
				position0 = new Vector3
				{
					x = other.position0.x,
					y = other.position0.y,
					z = other.position0.z
				},
				position1 = new Vector3
				{
					x = other.position1.x,
					y = other.position1.y,
					z = other.position1.z
				},
				position2 = new Vector3
				{
					x = other.position2.x,
					y = other.position2.y,
					z = other.position2.z
				},
				position3 = new Vector3
				{
					x = other.position3.x,
					y = other.position3.y,
					z = other.position3.z
				},
				regionH = other.regionH,
				regionW = other.regionW,
				regionX = other.regionX,
				regionY = other.regionY,
				tangents = other.tangents,
				texelSize = new Vector2
				{
					x = other.texelSize.x,
					y = other.texelSize.y
				},
				untrimmedBoundsDataCenter = new Vector3
				{
					x = other.untrimmedBoundsDataCenter.x,
					y = other.untrimmedBoundsDataCenter.y,
					z = other.untrimmedBoundsDataCenter.z
				},
				untrimmedBoundsDataExtents = new Vector3
				{
					x = other.untrimmedBoundsDataExtents.x,
					y = other.untrimmedBoundsDataExtents.y,
					z = other.untrimmedBoundsDataExtents.z
				}
			};
			List<Vector2> list = new List<Vector2>();
			Vector2[] uvs = other.uvs;
			foreach (Vector2 val2 in uvs)
			{
				list.Add(new Vector2
				{
					x = val2.x,
					y = val2.y
				});
			}
			val.uvs = list.ToArray();
			List<Vector3> list2 = new List<Vector3>();
			Vector3[] colliderVertices = other.colliderVertices;
			foreach (Vector3 val3 in colliderVertices)
			{
				list2.Add(new Vector3
				{
					x = val3.x,
					y = val3.y,
					z = val3.z
				});
			}
			val.colliderVertices = list2.ToArray();
			return val;
		}

		public static void SetProjectileSpriteRight(this Projectile proj, string name, int pixelWidth, int pixelHeight, int? overrideColliderPixelWidth = null, int? overrideColliderPixelHeight = null)
		{
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: 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_011b: 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_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: 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_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: 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_01a2: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				if (!overrideColliderPixelWidth.HasValue)
				{
					overrideColliderPixelWidth = pixelWidth;
				}
				if (!overrideColliderPixelHeight.HasValue)
				{
					overrideColliderPixelHeight = pixelHeight;
				}
				float num = (float)pixelWidth / 16f;
				float num2 = (float)pixelHeight / 16f;
				float x = (float)overrideColliderPixelWidth.Value / 16f;
				float y = (float)overrideColliderPixelHeight.Value / 16f;
				ETGMod.GetAnySprite((BraveBehaviour)(object)proj).spriteId = Databases.Items.ProjectileCollection.inst.GetSpriteIdByName(name);
				tk2dSpriteDefinition[] spriteDefinitions = Databases.Items.ProjectileCollection.inst.spriteDefinitions;
				PickupObject byId = PickupObjectDatabase.GetById(12);
				tk2dSpriteDefinition val = spriteDefinitions[ETGMod.GetAnySprite((BraveBehaviour)(object)((Gun)((byId is Gun) ? byId : null)).DefaultModule.projectiles[0]).spriteId].CopyDefinitionFrom();
				val.boundsDataCenter = new Vector3(num / 2f, num2 / 2f, 0f);
				val.boundsDataExtents = new Vector3(num, num2, 0f);
				val.untrimmedBoundsDataCenter = new Vector3(num / 2f, num2 / 2f, 0f);
				val.untrimmedBoundsDataExtents = new Vector3(num, num2, 0f);
				val.position0 = new Vector3(0f, 0f, 0f);
				val.position1 = new Vector3(0f + num, 0f, 0f);
				val.position2 = new Vector3(0f, 0f + num2, 0f);
				val.position3 = new Vector3(0f + num, 0f + num2, 0f);
				val.colliderVertices[1].x = x;
				val.colliderVertices[1].y = y;
				val.name = name;
				Databases.Items.ProjectileCollection.inst.spriteDefinitions[ETGMod.GetAnySprite((BraveBehaviour)(object)proj).spriteId] = val;
				proj.baseData.force = 0f;
			}
			catch (Exception ex)
			{
				ETGModConsole.Log((object)"Ooops! Seems like something got very, Very, VERY wrong. Here's the exception:", false);
				ETGModConsole.Log((object)ex.ToString(), false);
			}
		}
	}
	public class GameActorSleepyEffect : GameActorEffect
	{
		[CompilerGenerated]
		private sealed class <HandleSleepyEffect>d__11 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public GameActor actor;

			public RuntimeGameActorEffectData effectData;

			public GameActorSleepyEffect <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				int num = <>1__state;
				if (num != 0)
				{
					if (num != 1)
					{
						return false;
					}
					<>1__state = -1;
				}
				else
				{
					<>1__state = -1;
					if (effectData == null)
					{
						goto IL_00cb;
					}
				}
				if ((double)effectData.elapsed < (double)((GameActorEffect)<>4__this).duration - 0.5)
				{
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				if ((((Object)(object)actor != (Object)null) & (actor.GetEffect("sleepy") != null)) && (Object)(object)effectData.instanceOverheadVFX != (Object)null)
				{
					((Component)effectData.instanceOverheadVFX).GetComponent<tk2dSpriteAnimator>().PlayAndDestroyObject("sleepy_vfx_out", (Action)null);
				}
				goto IL_00cb;
				IL_00cb:
				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 SleepDuration;

		public float SpeedMultiplier;

		public float CooldownMultiplier;

		private float m_modifiedSpeedMultiplier;

		private float m_cachedCooldownScale;

		private float m_cachedFireRate;

		private GameObject m_SleepyOverheadVFX;

		public GameActorSleepyEffect()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			base.TintColor = Color.cyan;
			base.DeathTintColor = Color.cyan;
			base.AppliesTint = true;
			base.AppliesDeathTint = true;
			base.AffectsPlayers = true;
			base.AffectsEnemies = true;
			base.effectIdentifier = "sleepy";
			base.stackMode = (EffectStackingMode)0;
			SleepDuration = base.duration;
			SpeedMultiplier = 1f;
			CooldownMultiplier = 1f;
			m_SleepyOverheadVFX = SharedStaticVFX.SleepyOverheadVFX;
			base.OverheadVFX = m_SleepyOverheadVFX;
		}

		public override void OnEffectApplied(GameActor actor, RuntimeGameActorEffectData effectData, float partialAmount = 1f)
		{
			if ((Object)(object)((BraveBehaviour)effectData.actor).healthHaver != (Object)null && ((BraveBehaviour)effectData.actor).healthHaver.IsBoss)
			{
				effectData.actor.RemoveEffect((GameActorEffect)(object)this);
				return;
			}
			if (SpeedMultiplier != 1f)
			{
				((BraveBehaviour)actor).specRigidbody.OnPreMovement = (Action<SpeculativeRigidbody>)Delegate.Combine(((BraveBehaviour)actor).specRigidbody.OnPreMovement, new Action<SpeculativeRigidbody>(ModifyVelocity));
			}
			if (CooldownMultiplier != 1f && Object.op_Implicit((Object)(object)((BraveBehaviour)actor).behaviorSpeculator))
			{
				m_cachedCooldownScale = ((BraveBehaviour)actor).behaviorSpeculator.CooldownScale;
			}
			else if (CooldownMultiplier != 1f && actor is PlayerController)
			{
				m_cachedFireRate = ((PlayerController)((actor is PlayerController) ? actor : null)).stats.GetBaseStatValue((StatType)1);
			}
			((MonoBehaviour)GameManager.Instance).StartCoroutine(HandleSleepyEffect(actor, effectData));
		}

		public override void EffectTick(GameActor actor, RuntimeGameActorEffectData effectData)
		{
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: 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)
			if (SpeedMultiplier != 1f)
			{
				m_modifiedSpeedMultiplier = SpeedMultiplier - effectData.elapsed * 0.1f;
			}
			if (CooldownMultiplier != 1f && Object.op_Implicit((Object)(object)((BraveBehaviour)actor).behaviorSpeculator))
			{
				((BraveBehaviour)actor).behaviorSpeculator.CooldownScale = m_cachedCooldownScale * (CooldownMultiplier - effectData.elapsed * 0.1f);
			}
			else if (CooldownMultiplier != 1f && actor is PlayerController)
			{
				((PlayerController)((actor is PlayerController) ? actor : null)).stats.SetBaseStatValue((StatType)1, m_cachedFireRate * (CooldownMultiplier - effectData.elapsed * 0.1f), (PlayerController)(object)((actor is PlayerController) ? actor : null));
			}
			if (base.AppliesTint)
			{
				Color tintColor = base.TintColor;
				tintColor.a *= effectData.elapsed / base.duration;
				actor.RegisterOverrideColor(tintColor, base.effectIdentifier);
			}
		}

		public override void OnEffectRemoved(GameActor actor, RuntimeGameActorEffectData effectData)
		{
			if ((Object)(object)effectData.actor != (Object)null && (Object)(object)((BraveBehaviour)effectData.actor).healthHaver != (Object)null && !((BraveBehaviour)effectData.actor).healthHaver.IsBoss)
			{
				if (SpeedMultiplier != 1f)
				{
					((BraveBehaviour)actor).specRigidbody.OnPreMovement = (Action<SpeculativeRigidbody>)Delegate.Remove(((BraveBehaviour)actor).specRigidbody.OnPreMovement, new Action<SpeculativeRigidbody>(ModifyVelocity));
				}
				if (CooldownMultiplier != 1f && Object.op_Implicit((Object)(object)((BraveBehaviour)actor).behaviorSpeculator))
				{
					((BraveBehaviour)actor).behaviorSpeculator.CooldownScale = m_cachedCooldownScale;
				}
				else if (CooldownMultiplier != 1f && actor is PlayerController)
				{
					((PlayerController)((actor is PlayerController) ? actor : null)).stats.SetBaseStatValue((StatType)1, m_cachedFireRate, (PlayerController)(object)((actor is PlayerController) ? actor : null));
				}
				actor.ApplyEffect((GameActorEffect)(object)new GameActorSleepEffect
				{
					duration = SleepDuration
				}, 1f, (Projectile)null);
			}
		}

		private IEnumerator HandleSleepyEffect(GameActor actor, RuntimeGameActorEffectData effectData)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <HandleSleepyEffect>d__11(0)
			{
				<>4__this = this,
				actor = actor,
				effectData = effectData
			};
		}

		public void ModifyVelocity(SpeculativeRigidbody myRigidbody)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			myRigidbody.Velocity *= m_modifiedSpeedMultiplier;
		}
	}
	public class GameActorSleepEffect : GameActorEffect
	{
		private GameObject m_SleepOverheadVFX;

		private bool m_cachedCanTargetPlayers;

		private GameActor m_lastActor;

		public GameActorSleepEffect()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			base.TintColor = Color.cyan;
			base.DeathTintColor = Color.cyan;
			base.AppliesTint = true;
			base.AppliesDeathTint = true;
			base.AffectsPlayers = true;
			base.AffectsEnemies = true;
			base.effectIdentifier = "sleep";
			m_SleepOverheadVFX = SharedStaticVFX.SleepOverheadVFX;
			base.OverheadVFX = m_SleepOverheadVFX;
		}

		public override void OnEffectApplied(GameActor actor, RuntimeGameActorEffectData effectData, float partialAmount = 1f)
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Expected O, but got Unknown
			if (actor is AIActor)
			{
				m_cachedCanTargetPlayers = ((BraveBehaviour)actor).aiActor.CanTargetPlayers;
				((BraveBehaviour)actor).aiActor.CanTargetPlayers = false;
				if ((Object)(object)((BraveBehaviour)((BraveBehaviour)actor).aiActor).behaviorSpeculator != (Object)null)
				{
					((BraveBehaviour)((BraveBehaviour)actor).aiActor).behaviorSpeculator.InterruptAndDisable();
				}
			}
			else if (actor is PlayerController)
			{
				PlayerController val = (PlayerController)(object)((actor is PlayerController) ? actor : null);
			}
			m_lastActor = actor;
			((BraveBehaviour)actor).healthHaver.OnDamaged += new OnDamagedEvent(ForceRemoveEffect);
		}

		public override void EffectTick(GameActor actor, RuntimeGameActorEffectData effectData)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			((BraveBehaviour)actor).specRigidbody.Velocity = Vector2.zero;
			actor.RegisterOverrideColor(base.TintColor, base.effectIdentifier);
			if (actor is AIActor)
			{
				((BraveBehaviour)actor).aiActor.ClearPath();
				if ((Object)(object)((BraveBehaviour)((BraveBehaviour)actor).aiActor).behaviorSpeculator != (Object)null)
				{
					((BraveBehaviour)((BraveBehaviour)actor).aiActor).behaviorSpeculator.Interrupt();
				}
			}
			else if (actor is PlayerController)
			{
				PlayerController val = (PlayerController)(object)((actor is PlayerController) ? actor : null);
				val.ZeroVelocityThisFrame = true;
				val.SetInputOverride(base.effectIdentifier);
			}
		}

		public override void OnEffectRemoved(GameActor actor, RuntimeGameActorEffectData effectData)
		{
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			if (actor is AIActor)
			{
				((BraveBehaviour)actor).aiActor.CanTargetPlayers = m_cachedCanTargetPlayers;
				if ((Object)(object)((BraveBehaviour)((BraveBehaviour)actor).aiActor).behaviorSpeculator != (Object)null)
				{
					((Behaviour)((BraveBehaviour)((BraveBehaviour)actor).aiActor).behaviorSpeculator).enabled = true;
				}
			}
			else if (actor is PlayerController)
			{
				PlayerController val = (PlayerController)(object)((actor is PlayerController) ? actor : null);
				val.ZeroVelocityThisFrame = false;
				val.ClearInputOverride(base.effectIdentifier);
			}
			((BraveBehaviour)actor).healthHaver.OnDamaged -= new OnDamagedEvent(ForceRemoveEffect);
		}

		private void ForceRemoveEffect(float resultValue, float maxValue, CoreDamageTypes damageTypes, DamageCategory damageCategory, Vector2 damageDirection)
		{
			if ((Object)(object)m_lastActor != (Object)null)
			{
				m_lastActor.RemoveEffect((GameActorEffect)(object)this);
			}
		}
	}
	public class SleepGoop : SpecialGoopBehaviourDoer
	{
		public static GoopDefinition sleepGoop;

		public static float sleepTime = 10f;

		public static float sleepyTime = 3f;

		public static void Init()
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Expected O, but got Unknown
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Expected O, but got Unknown
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Expected O, but got Unknown
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: 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_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Expected O, but got Unknown
			sleepGoop = ScriptableObject.CreateInstance<GoopDefinition>();
			sleepGoop.CanBeIgnited = false;
			sleepGoop.CanBeElectrified = false;
			sleepGoop.CanBeFrozen = false;
			sleepGoop.baseColor32 = Color32.op_Implicit(new Color(0.101960786f, 46f / 51f, 1f, 1f));
			sleepGoop.lifespan = sleepyTime + sleepTime;
			sleepGoop.lifespanRadialReduction = 0f;
			((Object)sleepGoop).name = "sleepgoop";
			sleepGoop.eternal = true;
			sleepGoop.usesWorldTextureByDefault = true;
			sleepGoop.usesWaterVfx = false;
			Hook val = new Hook((MethodBase)typeof(DeadlyDeadlyGoopManager).GetMethod("InitialGoopEffect", BindingFlags.Instance | BindingFlags.Public), typeof(SleepGoop).GetMethod("InitialGoopEffectHook", BindingFlags.Static | BindingFlags.NonPublic));
			Hook val2 = new Hook((MethodBase)typeof(DeadlyDeadlyGoopManager).GetMethod("EndGoopEffect", BindingFlags.Instance | BindingFlags.Public), typeof(SleepGoop).GetMethod("EndGoopEffectHook", BindingFlags.Static | BindingFlags.NonPublic));
			Hook val3 = new Hook((MethodBase)typeof(DeadlyDeadlyGoopManager).GetMethod("ProcessGameActor", BindingFlags.Instance | BindingFlags.Public), typeof(SleepGoop).GetMethod("ProcessGameActorHook", BindingFlags.Static | BindingFlags.NonPublic));
			sleepGoop.goopDamageTypeInteractions = new List<GoopDamageTypeInteraction>
			{
				new GoopDamageTypeInteraction
				{
					freezesGoop = false,
					electrifiesGoop = false,
					ignitionMode = (GoopIgnitionMode)0,
					damageType = (CoreDamageTypes)0
				}
			};
			GoopUtility.RegisterComponentToGoopDefinition(sleepGoop, typeof(SleepGoop));
		}

		private static void InitialGoopEffectHook(Action<DeadlyDeadlyGoopManager, GameActor> orig, DeadlyDeadlyGoopManager self, GameActor actor)
		{
			orig(self, actor);
			if (Object.op_Implicit((Object)(object)self.goopDefinition) && (Object)(object)self.goopDefinition == (Object)(object)sleepGoop)
			{
				actor.ApplyEffect((GameActorEffect)(object)new GameActorSleepyEffect
				{
					duration = sleepyTime,
					SleepDuration = sleepTime,
					SpeedMultiplier = 0.7f,
					CooldownMultiplier = 0.5f
				}, 1f, (Projectile)null);
			}
		}

		private static void EndGoopEffectHook(Action<DeadlyDeadlyGoopManager, GameActor> orig, DeadlyDeadlyGoopManager self, GameActor actor)
		{
			if (Object.op_Implicit((Object)(object)self.goopDefinition) && (Object)(object)self.goopDefinition == (Object)(object)sleepGoop)
			{
				actor.RemoveEffect("sleepy");
				actor.RemoveEffect("sleep");
			}
			orig(self, actor);
		}

		private static bool ProcessGameActorHook(Func<DeadlyDeadlyGoopManager, GameActor, bool> orig, DeadlyDeadlyGoopManager self, GameActor actor)
		{
			//IL_0032: 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)
			if (Object.op_Implicit((Object)(object)self.goopDefinition) && (Object)(object)self.goopDefinition == (Object)(object)sleepGoop)
			{
				bool flag = false;
				if (self.IsPositionInGoop(((BraveBehaviour)actor).specRigidbody.UnitCenter) && actor.IsFlying)
				{
					actor.SetIsFlying(false, "innate flight", true, false);
					flag = true;
				}
				bool result = orig(self, actor);
				if (flag)
				{
					actor.SetIsFlying(true, "innate flight", true, false);
				}
				if (self.IsPositionInGoop(((BraveBehaviour)actor).specRigidbody.UnitCenter) && actor.GetEffect("sleep") == null && actor.GetEffect("sleepy") == null)
				{
					actor.ApplyEffect((GameActorEffect)(object)new GameActorSleepyEffect
					{
						duration = sleepyTime,
						SleepDuration = sleepTime,
						SpeedMultiplier = 0.7f,
						CooldownMultiplier = 0.5f
					}, 1f, (Projectile)null);
				}
				return result;
			}
			return orig(self, actor);
		}
	}
	internal class NaseongCharacter
	{
		public static void Init(string guid)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Expected O, but got Unknown
			//IL_0383: Unknown result type (might be due to invalid IL or missing references)
			//IL_0388: Unknown result type (might be due to invalid IL or missing references)
			//IL_0393: Unknown result type (might be due to invalid IL or missing references)
			//IL_039e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c0: Expected O, but got Unknown
			//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d2: 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_03e8: 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_03fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_040a: Expected O, but got Unknown
			//IL_0576: Unknown result type (might be due to invalid IL or missing references)
			//IL_057b: Unknown result type (might be due to invalid IL or missing references)
			//IL_057d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0582: Unknown result type (might be due to invalid IL or missing references)
			//IL_0584: Unknown result type (might be due to invalid IL or missing references)
			//IL_0589: Unknown result type (might be due to invalid IL or missing references)
			//IL_058e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0596: Unknown result type (might be due to invalid IL or missing references)
			//IL_059b: Unknown result type (might be due to invalid IL or missing references)
			//IL_059d: Unknown result type (might be due to invalid IL or missing references)
			//IL_059f: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05da: Unknown result type (might be due to invalid IL or missing references)
			//IL_05df: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0610: Unknown result type (might be due to invalid IL or missing references)
			//IL_062c: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c1: Invalid comparison between Unknown and I4
			string text = "Naseong/Resources/Naseong";
			CustomCharacterData characterData = Loader.BuildCharacter(text, guid, new Vector3(26f, 24f), false, new Vector3(0f, 0f), false, false, false, false, false, (GlowMatDoer)null, (GlowMatDoer)null, 0, false, "");
			tk2dSpriteAnimator spriteAnimator = ((BraveBehaviour)CharacterBuilder.storedCharacters[characterData.nameInternal.ToLower()].Second.GetComponent<PlayerController>()).spriteAnimator;
			tk2dSpriteCollectionData collection = ((BraveBehaviour)CharacterBuilder.storedCharacters[characterData.nameInternal.ToLower()].Second.GetComponent<PlayerController>()).sprite.Collection;
			List<string> list = new List<string>
			{
				Path.Combine(text, "sprites/rogue_select_glasses_001.png"),
				Path.Combine(text, "sprites/rogue_select_glasses_002.png"),
				Path.Combine(text, "sprites/rogue_select_glasses_003.png"),
				Path.Combine(text, "sprites/rogue_select_glasses_004.png")
			};
			SpriteBuilder.AddAnimation(spriteAnimator, collection, list, "select_glasses", (WrapMode)2, 15);
			list = new List<string>
			{
				Path.Combine(text, "sprites/rogue_select_glasses_idle_001.png"),
				Path.Combine(text, "sprites/rogue_select_glasses_idle_002.png")
			};
			SpriteBuilder.AddAnimation(spriteAnimator, collection, list, "select_glasses_idle", (WrapMode)0, 4);
			list = new List<string>
			{
				Path.Combine(text, "sprites/rogue_select_glasses_out_001.png"),
				Path.Combine(text, "sprites/rogue_select_glasses_out_002.png"),
				Path.Combine(text, "sprites/rogue_select_glasses_out_003.png"),
				Path.Combine(text, "sprites/rogue_select_glasses_out_004.png")
			};
			SpriteBuilder.AddAnimation(spriteAnimator, collection, list, "select_glasses_out", (WrapMode)2, 15);
			list = new List<string>
			{
				Path.Combine(text, "sprites/rogue_select_glasses_wipe_001.png"),
				Path.Combine(text, "sprites/rogue_select_glasses_wipe_002.png"),
				Path.Combine(text, "sprites/rogue_select_glasses_wipe_003.png"),
				Path.Combine(text, "sprites/rogue_select_glasses_wipe_004.png"),
				Path.Combine(text, "sprites/rogue_select_glasses_wipe_005.png"),
				Path.Combine(text, "sprites/rogue_select_glasses_wipe_006.png")
			};
			SpriteBuilder.AddAnimation(spriteAnimator, collection, list, "select_glasses_wipe", (WrapMode)0, 8);
			list = new List<string>
			{
				Path.Combine(text, "sprites/rogue_select_pose_001.png"),
				Path.Combine(text, "sprites/rogue_select_pose_002.png"),
				Path.Combine(text, "sprites/rogue_select_pose_003.png"),
				Path.Combine(text, "sprites/rogue_select_pose_004.png"),
				Path.Combine(text, "sprites/rogue_select_pose_005.png")
			};
			SpriteBuilder.AddAnimation(spriteAnimator, collection, list, "select_posture", (WrapMode)2, 15);
			list = new List<string>
			{
				Path.Combine(text, "sprites/rogue_select_pose_idle_001.png"),
				Path.Combine(text, "sprites/rogue_select_pose_idle_002.png")
			};
			SpriteBuilder.AddAnimation(spriteAnimator, collection, list, "select_posture_idle", (WrapMode)0, 4);
			list = new List<string>
			{
				Path.Combine(text, "sprites/rogue_select_pose_dance_001.png"),
				Path.Combine(text, "sprites/rogue_select_pose_dance_002.png"),
				Path.Combine(text, "sprites/rogue_select_pose_dance_003.png")
			};
			SpriteBuilder.AddAnimation(spriteAnimator, collection, list, "select_posture_dance", (WrapMode)0, 8);
			CustomCharacterData obj = characterData;
			CharacterSelectIdleDoer val = new CharacterSelectIdleDoer();
			val.onSelectedAnimation = "select_choose";
			val.coreIdleAnimation = "select_idle";
			val.idleMax = 10f;
			val.idleMin = 4f;
			val.EeveeTex = null;
			val.IsEevee = false;
			val.AnimationLibraries = (tk2dSpriteAnimation[])(object)new tk2dSpriteAnimation[0];
			val.phases = (CharacterSelectIdlePhase[])(object)new CharacterSelectIdlePhase[2]
			{
				new CharacterSelectIdlePhase
				{
					inAnimation = "select_posture",
					holdMin = 2f,
					holdMax = 4f,
					holdAnimation = "select_posture_idle",
					optionalHoldIdleAnimation = "select_posture_dance"
				},
				new CharacterSelectIdlePhase
				{
					inAnimation = "select_glasses",
					holdMin = 3f,
					holdMax = 7f,
					holdAnimation = "select_glasses_idle",
					optionalHoldIdleAnimation = "select_glasses_wipe",
					outAnimation = "select_glasses_out"
				}
			};
			obj.idleDoer = val;
			characterData.pathForSprites = "just for FoyerCharacterHandler IdleDoer setup";
			PunchoutPlayerController player = ((Component)ResourceManager.LoadAssetBundle("enemies_base_001").LoadAsset<GameObject>("MetalGearRat").GetComponent<AIActor>()).GetComponent<MetalGearRatDeathController>().PunchoutMinigamePrefab.GetComponent<PunchoutController>().Player;
			tk2dSpriteAnimation library = ((Component)player).gameObject.GetComponent<tk2dSpriteAnimator>().Library;
			tk2dSpriteCollectionData spriteCollection = library.clips[0].frames[0].spriteCollection;
			IEnumerable<tk2dSpriteDefinition> enumerable = from def in spriteCollection.spriteDefinitions
				where def.name.Contains(characterData.nameShort.ToLower()) && !def.name.Contains("vfx")
				select (def);
			Vector3 val3 = default(Vector3);
			Vector3 val4 = default(Vector3);
			foreach (tk2dSpriteDefinition item in enumerable)
			{
				Texture2D val2 = characterData.punchoutSprites[item.name];
				float num = item.position3.x - item.position0.x;
				float num2 = item.position3.y - item.position0.y;
				float num3 = (float)((Texture)val2).width / 16f;
				float num4 = (float)((Texture)val2).height / 16f;
				((Vector3)(ref val3))..ctor((num3 - num) / 2f, 0f);
				((Vector3)(ref val4))..ctor(0f, (num4 - num2) / 2f);
				item.position0 += -val3 - val4;
				item.position1 += val3 - val4;
				item.position2 += -val3 + val4;
				item.position3 += val3 + val4;
			}
			GameStatsManager.Instance.SetCharacterSpecificFlag(characterData.identity, (CharacterSpecificGungeonFlags)1000, true);
			GameStatsManager.Instance.SetCharacterSpecificFlag(characterData.identity, (CharacterSpecificGungeonFlags)1100, true);
			Databases.Strings.Core.SetComplex("#PLAYER_NAME_" + ((object)(PlayableCharacters)(ref characterData.identity)).ToString().ToUpperInvariant(), new string[1] { "Naseong" });
			Databases.Strings.Core.SetComplex((GungeonSupportedLanguages)8, "#PLAYER_NAME_" + ((object)(PlayableCharacters)(ref characterData.identity)).ToString().ToUpperInvariant(), new string[1] { "나성" });
			Databases.Strings.Core.SetComplex("#PLAYER_NICK_" + ((object)(PlayableCharacters)(ref characterData.identity)).ToString().ToUpperInvariant(), new string[1] { "Naseong" });
			Databases.Strings.Core.SetComplex((GungeonSupportedLanguages)8, "#PLAYER_NICK_" + ((object)(PlayableCharacters)(ref characterData.identity)).ToString().ToUpperInvariant(), new string[1] { "나성" });
			Databases.Strings.UI.Set((dfLanguageCode)37, "#CHAR_NASEONG", "Naseong");
			Databases.Strings.UI.Set((dfLanguageCode)37, "#CHAR_NASEONG_SHORT", "Naseong");
			Databases.Strings.UI.Set((dfLanguageCode)78, "#CHAR_NASEONG", "나성");
			Databases.Strings.UI.Set((dfLanguageCode)78, "#CHAR_NASEONG_SHORT", "나성");
			if ((int)StringTableManager.CurrentLanguage == 8)
			{
				characterData.name = "나성";
				StringHandler.customStringDictionary["#CHAR_NASEONG"] = "나성";
				StringHandler.customStringDictionary["#CHAR_NASEONG_SHORT"] = "나성";
			}
			HatUtility.SetupHatOffsets("PlayerNaseong(Clone)", 0, -6, 0, -10);
			HatUtility.SetupFlippedHatOffsets("PlayerNaseong(Clone)", 0, -6, 0, -10);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_001", 1, 0, (int?)0, (int?)0);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_002", 1, -1, (int?)0, (int?)(-1));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_003", 1, -1, (int?)0, (int?)(-1));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_004", 1, 0, (int?)0, (int?)0);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_backwards_001", 1, 0, (int?)0, (int?)0);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_backwards_002", 1, -1, (int?)0, (int?)(-1));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_backwards_003", 1, -1, (int?)0, (int?)(-1));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_backwards_004", 1, 0, (int?)0, (int?)0);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_back_002", 0, -1, (int?)0, (int?)(-1));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_back_003", 0, -1, (int?)0, (int?)(-1));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_front_001", 0, 0, (int?)0, (int?)0);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_front_002", 0, -2, (int?)0, (int?)(-2));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_front_003", 0, -2, (int?)0, (int?)(-2));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_front_004", 0, -1, (int?)0, (int?)(-1));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_front_005", 0, 0, (int?)0, (int?)0);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_idle_front_006", 0, 0, (int?)0, (int?)0);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_forward_001", 0, -1, (int?)1, (int?)(-1));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_forward_002", -1, 1, (int?)0, (int?)2);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_forward_003", -1, 0, (int?)0, (int?)0);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_forward_004", 0, -1, (int?)1, (int?)(-1));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_forward_005", 1, 2, (int?)2, (int?)3);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_forward_006", 1, 0, (int?)2, (int?)0);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_backward_001", 0, -1, (int?)0, (int?)(-1));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_backward_002", -1, 2, (int?)0, (int?)2);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_backward_003", -1, 0, (int?)0, (int?)0);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_backward_004", 0, -1, (int?)0, (int?)(-1));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_backward_005", 1, 3, (int?)0, (int?)3);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_backward_006", 1, 0, (int?)0, (int?)0);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_front_001", -1, 2, (int?)1, (int?)2);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_front_002", -1, 1, (int?)1, (int?)1);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_front_003", 0, -1, (int?)0, (int?)(-1));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_front_004", 0, 2, (int?)1, (int?)3);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_front_005", 1, 1, (int?)1, (int?)2);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_front_006", 1, -1, (int?)0, (int?)(-1));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_back_001", -1, 3, (int?)0, (int?)3);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_back_002", -1, 2, (int?)0, (int?)2);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_back_003", 0, -1, (int?)0, (int?)(-1));
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_back_004", 2, 2, (int?)0, (int?)2);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_back_005", 2, 1, (int?)0, (int?)1);
			HatUtility.AddHatOffset("PlayerNaseong(Clone)", "rogue_run_back_006", 1, 0, (int?)0, (int?)0);
			Debug.Log((object)"Finish Naseong Character Building.");
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("wgowl.etg.naseong", "NaSeong", "1.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const string GUID = "wgowl.etg.naseong";

		private const string NAME = "NaSeong";

		private const string VERSION = "1.1.0";

		public static string FilePathFolder;

		public static AssetBundle NaseongAssetBundle;

		public void Awake()
		{
			ETGModMainBehaviour.WaitForGameManagerStart((Action<GameManager>)GMStart);
		}

		public void GMStart(GameManager gm)
		{
			SoundManager.LoadSoundbanksFromAssembly((Assembly)null);
			SharedStaticVFX.Init();
			SleepGoop.Init();
			SkullCrusher.Add("wgowl.etg.naseong");
			Bonobother.Init();
			SleepyBullets.Init();
			Slumbercrete.Init();
			NaseongCharacter.Init("wgowl.etg.naseong");
		}
	}
}
namespace Naseong
{
	internal class Bonobother : PassiveItem
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass11_0
		{
			public AIActor actor;

			public Vector2 ownerCenter;

			public float desiredDistance;

			internal bool <HandleSpawn>b__0(IntVector2 c)
			{
				//IL_00d2: 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_00ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: 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)
				for (int i = 0; i < actor.Clearance.x; i++)
				{
					for (int j = 0; j < actor.Clearance.y; j++)
					{
						if (GameManager.Instance.Dungeon.data.isTopWall(c.x + i, c.y + j))
						{
							return false;
						}
						if (!GameManager.Instance.Dungeon.data.CheckInBounds(c.x + i, c.y + j))
						{
							return false;
						}
						if (GameManager.Instance.Dungeon.data.isWall(c.x + i, c.y + j))
						{
							return false;
						}
					}
				}
				if (Vector2.Distance(Pathfinder.GetClearanceOffset(c, actor.Clearance), ownerCenter) < desiredDistance)
				{
					return false;
				}
				return true;
			}

			internal float <HandleSpawn>b__1(IntVector2 c)
			{
				//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
				//IL_0102: Unknown result type (might be due to invalid IL or missing references)
				//IL_0108: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: 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_0097: Unknown result type (might be due to invalid IL or missing references)
				for (int i = 0; i < actor.Clearance.x; i++)
				{
					for (int j = 0; j < actor.Clearance.y; j++)
					{
						if (GameManager.Instance.Dungeon.data.isTopWall(c.x + i, c.y + j))
						{
							return 1000000f;
						}
						if (!GameManager.Instance.Dungeon.data.CheckInBounds(c.x + i, c.y + j))
						{
							return 1000000f;
						}
						if (GameManager.Instance.Dungeon.data.isWall(c.x + i, c.y + j))
						{
							return 1000000f;
						}
					}
				}
				return Vector2.Distance(Pathfinder.GetClearanceOffset(c, actor.Clearance), ownerCenter);
			}
		}

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

			private object <>2__current;

			public float delay;

			public List<AIActor> activeEnemies;

			public Bonobother <>4__this;

			private <>c__DisplayClass11_0 <>8__1;

			private float <elapsed>5__2;

			private CellValidator <cellValidator>5__3;

			private Func<IntVector2, float> <cellWeightFinder>5__4;

			private IntVector2? <spawnPosition>5__5;

			private float <nearestDist>5__6;

			private AIActor <targetActor>5__7;

			private GameObject <spawnVFX>5__8;

			private List<AIActor>.Enumerator <>s__9;

			private AIActor <activeEnemy>5__10;

			private float <dist>5__11;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>8__1 = null;
				<cellValidator>5__3 = null;
				<cellWeightFinder>5__4 = null;
				<targetActor>5__7 = null;
				<spawnVFX>5__8 = null;
				<>s__9 = default(List<AIActor>.Enumerator);
				<activeEnemy>5__10 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00dd: Expected O, but got Unknown
				//IL_0110: Unknown result type (might be due to invalid IL or missing references)
				//IL_0193: Unknown result type (might be due to invalid IL or missing references)
				//IL_019e: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_027e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0283: Unknown result type (might be due to invalid IL or missing references)
				//IL_0286: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>8__1 = new <>c__DisplayClass11_0();
					<>4__this.m_hasSpawned = true;
					<elapsed>5__2 = 0f;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (<elapsed>5__2 < delay)
				{
					<elapsed>5__2 += BraveTime.DeltaTime;
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				<>8__1.desiredDistance = 3f;
				<>8__1.actor = prefab.GetComponent<AIActor>();
				<>8__1.ownerCenter = ((BraveBehaviour)((PassiveItem)<>4__this).Owner).specRigidbody.UnitCenter;
				<cellValidator>5__3 = (CellValidator)delegate(IntVector2 c)
				{
					//IL_00d2: 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_00ee: Unknown result type (might be due to invalid IL or missing references)
					//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
					//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
					//IL_0020: Unknown result type (might be due to invalid IL or missing references)
					//IL_0028: Unknown result type (might be due to invalid IL or missing references)
					//IL_0050: Unknown result type (might be due to invalid IL or missing references)
					//IL_0058: Unknown result type (might be due to invalid IL or missing references)
					//IL_0085: 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)
					for (int k = 0; k < <>8__1.actor.Clearance.x; k++)
					{
						for (int l = 0; l < <>8__1.actor.Clearance.y; l++)
						{
							if (GameManager.Instance.Dungeon.data.isTopWall(c.x + k, c.y + l))
							{
								return false;
							}
							if (!GameManager.Instance.Dungeon.data.CheckInBounds(c.x + k, c.y + l))
							{
								return false;
							}
							if (GameManager.Instance.Dungeon.data.isWall(c.x + k, c.y + l))
							{
								return false;
							}
						}
					}
					return (!(Vector2.Distance(Pathfinder.GetClearanceOffset(c, <>8__1.actor.Clearance), <>8__1.ownerCenter) < <>8__1.desiredDistance)) ? true : false;
				};
				<cellWeightFinder>5__4 = delegate(IntVector2 c)
				{
					//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
					//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
					//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
					//IL_0102: Unknown result type (might be due to invalid IL or missing references)
					//IL_0108: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
					//IL_0020: Unknown result type (might be due to invalid IL or missing references)
					//IL_0028: Unknown result type (might be due to invalid IL or missing references)
					//IL_0055: Unknown result type (might be due to invalid IL or missing references)
					//IL_005d: 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_0097: Unknown result type (might be due to invalid IL or missing references)
					for (int i = 0; i < <>8__1.actor.Clearance.x; i++)
					{
						for (int j = 0; j < <>8__1.actor.Clearance.y; j++)
						{
							if (GameManager.Instance.Dungeon.data.isTopWall(c.x + i, c.y + j))
							{
								return 1000000f;
							}
							if (!GameManager.Instance.Dungeon.data.CheckInBounds(c.x + i, c.y + j))
							{
								return 1000000f;
							}
							if (GameManager.Instance.Dungeon.data.isWall(c.x + i, c.y + j))
							{
								return 1000000f;
							}
						}
					}
					return Vector2.Distance(Pathfinder.GetClearanceOffset(c, <>8__1.actor.Clearance), <>8__1.ownerCenter);
				};
				<spawnPosition>5__5 = ((PassiveItem)<>4__this).Owner.CurrentRoom.GetRandomWeightedAvailableCell((IntVector2?)<>8__1.actor.Clearance, (CellTypes?)(CellTypes)2, false, <cellValidator>5__3, <cellWeightFinder>5__4, 0.1f);
				if (<spawnPosition>5__5.HasValue)
				{
					<nearestDist>5__6 = float.MaxValue;
					<targetActor>5__7 = null;
					<>s__9 = activeEnemies.GetEnumerator();
					IntVector2 value;
					try
					{
						while (<>s__9.MoveNext())
						{
							<activeEnemy>5__10 = <>s__9.Current;
							Vector2 unitCenter = ((BraveBehaviour)<activeEnemy>5__10).specRigidbody.UnitCenter;
							value = <spawnPosition>5__5.Value;
							<dist>5__11 = Vector2.Distance(unitCenter, ((IntVector2)(ref value)).ToVector2());
							if (<dist>5__11 < <nearestDist>5__6)
							{
								<targetActor>5__7 = <activeEnemy>5__10;
								<nearestDist>5__6 = <dist>5__11;
							}
							<activeEnemy>5__10 = null;
						}
					}
					finally
					{
						((IDisposable)<>s__9).Dispose();
					}
					<>s__9 = default(List<AIActor>.Enumerator);
					<spawnVFX>5__8 = Object.Instantiate<GameObject>(SharedStaticVFX.ExclamationPointVFX, ((BraveBehaviour)((BraveBehaviour)((PassiveItem)<>4__this).Owner).specRigidbody).transform);
					<spawnVFX>5__8.transform.parent = ((BraveBehaviour)((BraveBehaviour)((PassiveItem)<>4__this).Owner).specRigidbody).transform;
					Bonobother bonobother = <>4__this;
					PlayerController owner = ((PassiveItem)<>4__this).Owner;
					value = <spawnPosition>5__5.Value;
					bonobother.CreateActor(owner, ((IntVector2)(ref value)).ToVector3(), <targetActor>5__7);
					<targetActor>5__7 = null;
					<spawnVFX>5__8 = null;
				}
				return false;
			}

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

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

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

			private object <>2__current;

			public PlayerController callingPlayer;

			public Bonobother <>4__this;

			private AIActor <actor>5__1;

			private SpeculativeRigidbody <rigidbody>5__2;

			private AIAnimator <animator>5__3;

			private float <elapsed>5__4;

			private float <duration>5__5;

			private BonobotherBehavior <behavior>5__6;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<actor>5__1 = null;
				<rigidbody>5__2 = null;
				<animator>5__3 = null;
				<behavior>5__6 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0084: Unknown result type (might be due to invalid IL or missing references)
				//IL_0089: Unknown result type (might be due to invalid IL or missing references)
				//IL_011a: Unknown result type (might be due to invalid IL or missing references)
				//IL_011f: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<actor>5__1 = <>4__this.m_extantActor.gameObject.GetComponent<AIActor>();
					<actor>5__1.ClearPath();
					((Behaviour)<actor>5__1).enabled = false;
					<rigidbody>5__2 = <>4__this.m_extantActor.gameObject.GetComponent<SpeculativeRigidbody>();
					<rigidbody>5__2.CollideWithOthers = false;
					<rigidbody>5__2.Velocity = Vector2.zero;
					<animator>5__3 = <>4__this.m_extantActor.gameObject.GetComponent<AIAnimator>();
					<elapsed>5__4 = 0f;
					<duration>5__5 = 3f;
					<animator>5__3.PlayUntilCancelled("survive", false, (string)null, -1f, false);
					<behavior>5__6 = <>4__this.m_extantActor.gameObject.GetComponent<BonobotherBehavior>();
					<behavior>5__6.HandleSurviveTextbox();
					LootEngine.SpawnItem(surviveLootTable.SelectByWeight(false), <>4__this.m_extantActor.transform.position, Vector2.zero, 0f, true, true, false);
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (<elapsed>5__4 < <duration>5__5)
				{
					<elapsed>5__4 += BraveTime.DeltaTime;
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				<>4__this.DestroyActor();
				return false;
			}

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

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

		public static GameObject prefab;

		private static GenericLootTable surviveLootTable;

		private static readonly string actorGuid = "naseong_bonobother";

		private GameObject m_extantActor;

		private float m_spawnProb = 0.15f;

		private bool m_hasSpawned = false;

		private bool m_hasTried = false;

		private static string[] spritePaths = new string[91]
		{
			"Naseong/Resources/Bonobother/bonobother_idle_left_001", "Naseong/Resources/Bonobother/bonobother_idle_left_002", "Naseong/Resources/Bonobother/bonobother_idle_left_003", "Naseong/Resources/Bonobother/bonobother_idle_left_004", "Naseong/Resources/Bonobother/bonobother_idle_right_001", "Naseong/Resources/Bonobother/bonobother_idle_right_002", "Naseong/Resources/Bonobother/bonobother_idle_right_003", "Naseong/Resources/Bonobother/bonobother_idle_right_004", "Naseong/Resources/Bonobother/bonobother_move_front_left_001", "Naseong/Resources/Bonobother/bonobother_move_front_left_002",
			"Naseong/Resources/Bonobother/bonobother_move_front_left_003", "Naseong/Resources/Bonobother/bonobother_move_front_left_004", "Naseong/Resources/Bonobother/bonobother_move_front_left_005", "Naseong/Resources/Bonobother/bonobother_move_front_left_006", "Naseong/Resources/Bonobother/bonobother_move_front_left_007", "Naseong/Resources/Bonobother/bonobother_move_front_left_008", "Naseong/Resources/Bonobother/bonobother_move_front_right_001", "Naseong/Resources/Bonobother/bonobother_move_front_right_002", "Naseong/Resources/Bonobother/bonobother_move_front_right_003", "Naseong/Resources/Bonobother/bonobother_move_front_right_004",
			"Naseong/Resources/Bonobother/bonobother_move_front_right_005", "Naseong/Resources/Bonobother/bonobother_move_front_right_006", "Naseong/Resources/Bonobother/bonobother_move_front_right_007", "Naseong/Resources/Bonobother/bonobother_move_front_right_008", "Naseong/Resources/Bonobother/bonobother_move_back_left_001", "Naseong/Resources/Bonobother/bonobother_move_back_left_002", "Naseong/Resources/Bonobother/bonobother_move_back_left_003", "Naseong/Resources/Bonobother/bonobother_move_back_left_004", "Naseong/Resources/Bonobother/bonobother_move_back_left_005", "Naseong/Resources/Bonobother/bonobother_move_back_left_006",
			"Naseong/Resources/Bonobother/bonobother_move_back_left_007", "Naseong/Resources/Bonobother/bonobother_move_back_left_008", "Naseong/Resources/Bonobother/bonobother_move_back_right_001", "Naseong/Resources/Bonobother/bonobother_move_back_right_002", "Naseong/Resources/Bonobother/bonobother_move_back_right_003", "Naseong/Resources/Bonobother/bonobother_move_back_right_004", "Naseong/Resources/Bonobother/bonobother_move_back_right_005", "Naseong/Resources/Bonobother/bonobother_move_back_right_006", "Naseong/Resources/Bonobother/bonobother_move_back_right_007", "Naseong/Resources/Bonobother/bonobother_move_back_right_008",
			"Naseong/Resources/Bonobother/bonobother_run_front_left_001", "Naseong/Resources/Bonobother/bonobother_run_front_left_002", "Naseong/Resources/Bonobother/bonobother_run_front_left_003", "Naseong/Resources/Bonobother/bonobother_run_front_left_004", "Naseong/Resources/Bonobother/bonobother_run_front_left_005", "Naseong/Resources/Bonobother/bonobother_run_front_left_006", "Naseong/Resources/Bonobother/bonobother_run_front_left_007", "Naseong/Resources/Bonobother/bonobother_run_front_left_008", "Naseong/Resources/Bonobother/bonobother_run_front_right_001", "Naseong/Resources/Bonobother/bonobother_run_front_right_002",
			"Naseong/Resources/Bonobother/bonobother_run_front_right_003", "Naseong/Resources/Bonobother/bonobother_run_front_right_004", "Naseong/Resources/Bonobother/bonobother_run_front_right_005", "Naseong/Resources/Bonobother/bonobother_run_front_right_006", "Naseong/Resources/Bonobother/bonobother_run_front_right_007", "Naseong/Resources/Bonobother/bonobother_run_front_right_008", "Naseong/Resources/Bonobother/bonobother_run_back_left_001", "Naseong/Resources/Bonobother/bonobother_run_back_left_002", "Naseong/Resources/Bonobother/bonobother_run_back_left_003", "Naseong/Resources/Bonobother/bonobother_run_back_left_004",
			"Naseong/Resources/Bonobother/bonobother_run_back_left_005", "Naseong/Resources/Bonobother/bonobother_run_back_left_006", "Naseong/Resources/Bonobother/bonobother_run_back_left_007", "Naseong/Resources/Bonobother/bonobother_run_back_left_008", "Naseong/Resources/Bonobother/bonobother_run_back_right_001", "Naseong/Resources/Bonobother/bonobother_run_back_right_002", "Naseong/Resources/Bonobother/bonobother_run_back_right_003", "Naseong/Resources/Bonobother/bonobother_run_back_right_004", "Naseong/Resources/Bonobother/bonobother_run_back_right_005", "Naseong/Resources/Bonobother/bonobother_run_back_right_006",
			"Naseong/Resources/Bonobother/bonobother_run_back_right_007", "Naseong/Resources/Bonobother/bonobother_run_back_right_008", "Naseong/Resources/Bonobother/bonobother_hit_left_001", "Naseong/Resources/Bonobother/bonobother_hit_right_001", "Naseong/Resources/Bonobother/bonobother_death_left_001", "Naseong/Resources/Bonobother/bonobother_death_left_002", "Naseong/Resources/Bonobother/bonobother_death_left_003", "Naseong/Resources/Bonobother/bonobother_death_left_004", "Naseong/Resources/Bonobother/bonobother_death_right_001", "Naseong/Resources/Bonobother/bonobother_death_right_002",
			"Naseong/Resources/Bonobother/bonobother_death_right_003", "Naseong/Resources/Bonobother/bonobother_death_right_004", "Naseong/Resources/Bonobother/bonobother_pitfall_001", "Naseong/Resources/Bonobother/bonobother_pitfall_002", "Naseong/Resources/Bonobother/bonobother_pitfall_003", "Naseong/Resources/Bonobother/bonobother_pitfall_004", "Naseong/Resources/Bonobother/bonobother_pitfall_005", "Naseong/Resources/Bonobother/bonobother_survive_001", "Naseong/Resources/Bonobother/bonobother_survive_002", "Naseong/Resources/Bonobother/bonobother_survive_003",
			"Naseong/Resources/Bonobother/bonobother_survive_004"
		};

		private static tk2dSpriteCollectionData animationCollection;

		public static void Init()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			string text = "Bonobother";
			string text2 = "Naseong/Resources/Bonobother/bonobother_idle_right_001.png";
			GameObject val = new GameObject(text);
			Bonobother bonobother = val.AddComponent<Bonobother>();
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "Adorable but annoying sea otter.";
			string text4 = "Spawns a cute and friendly sea otter when entering a new room with enemies. This otter attracts nearby enemies. If you successfully manage it to survive until clearing the room, it will spawn useful pickups.\n\nSummons a lovely sea otter that lures your enemies with pure vibes. Keep it alive, get the goods. Fail, and feel the guilt.";
			ItemBuilder.SetupItem((PickupObject)(object)bonobother, text3, text4, "naseong");
			GunExt.SetName((PickupObject)(object)bonobother, (GungeonSupportedLanguages)8, "족보단");
			GunExt.SetShortDescription((PickupObject)(object)bonobother, (GungeonSupportedLanguages)8, "나성성님 건전해주세요");
			GunExt.SetLongDescription((PickupObject)(object)bonobother, (GungeonSupportedLanguages)8, "적이 있는 새로운 방에 들어설 때 귀엽고 친근한 족보단을 소환합니다. 이 족보단은 주변 적들을 유인합니다. 방을 클리어할 때까지 족보단이 살아남으면 유용한 픽업 아이템을 드롭합니다.\n\n복제인간 뜨기 기원 1일차.");
			((PickupObject)bonobother).quality = (ItemQuality)(-100);
			BuildPrefab();
			Debug.Log((object)"Finish building Bonobother");
		}

		public static void BuildPrefab()
		{
			//IL_004e: 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_0088: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing r