Decompiled source of COLLECT v1.0.5

plugins/Collection.dll

Decompiled 4 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using IL;
using LegendAPI;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyCompany("Collection")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+7e92ec4bb030cff3554beba9edf3950958c286d2")]
[assembly: AssemblyProduct("Collection")]
[assembly: AssemblyTitle("Collection")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Collect;

[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("xyz.yekoc.wizardoflegend.Collection", "COLLECT", "1.0.5")]
public class Collection : BaseUnityPlugin
{
	public static ManualLogSource logger;

	public void Awake()
	{
		logger = ((BaseUnityPlugin)this).Logger;
		NoxOutfit.Register();
		CollectorOutfit.Register();
		CourierOutfit.Register();
		BlackFlame.Register();
		BadApple.Register();
	}

	public static void recursebull(Transform transform, int acc = 0)
	{
		string text = "";
		for (int i = 0; i < acc; i++)
		{
			text += "-";
		}
		Debug.Log((object)(text + ((object)transform)?.ToString() + " : " + ((Component)transform).gameObject.layer));
		Component[] components = ((Component)transform).gameObject.GetComponents<Component>();
		for (int j = 0; j < components.Length; j++)
		{
			Debug.Log((object)(text + "-  -" + (object)components[j]));
		}
		for (int k = 0; k < transform.childCount; k++)
		{
			recursebull(transform.GetChild(k), acc + 1);
		}
	}

	public static bool PlayerIsWearing(Player p, string outfitID)
	{
		return Object.op_Implicit((Object)(object)p) && (p.outfitID == outfitID || (p.outfitID == Outfit.normalID && Outfits.shadowSource == outfitID));
	}

	public void Start()
	{
		BlueBlood.Register();
		ForgedPapers.Register();
	}
}
public class BadApple : Item
{
	public class Grazebox : MonoBehaviour
	{
		public Player parentPlayer;

		public Transform parent;

		public List<GameObject> list;

		public ParticleSystem[] emitters;

		public void Start()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			parent = ((Entity)(parentPlayer?)).hurtBoxTransform;
			list = new List<GameObject>();
			ParticleSystem obj = emitters[0];
			if (obj != null)
			{
				GameObject gameObject = ((Component)obj).gameObject;
				if (gameObject != null)
				{
					gameObject.SetActive(true);
				}
			}
			ParticleSystem[] array = emitters;
			foreach (ParticleSystem val in array)
			{
				MainModule main = val.main;
				((MainModule)(ref main)).loop = false;
				((MainModule)(ref main)).duration = Mathf.Min(((MainModule)(ref main)).duration, 0.5f);
			}
		}

		public void OnTriggerEnter2D(Collider2D proj)
		{
			Transform transform = ((Component)proj).transform;
			object obj;
			if (transform == null)
			{
				obj = null;
			}
			else
			{
				Transform obj2 = transform.parent;
				obj = ((obj2 != null) ? ((Component)obj2).GetComponent<Projectile>() : null);
			}
			Projectile val = (Projectile)obj;
			object obj3;
			if (!Object.op_Implicit((Object)(object)val))
			{
				Transform transform2 = ((Component)proj).transform;
				obj3 = ((transform2 != null) ? ((Component)transform2).GetComponent<Attack>() : null);
			}
			else
			{
				obj3 = val.attackBox;
			}
			Attack val2 = (Attack)obj3;
			if ((Object.op_Implicit((Object)(object)val) || Object.op_Implicit((Object)(object)val2)) && val2.atkInfo != null && val2.atkInfo.targetNames != null && (val2.atkInfo.targetNames.Contains(Globals.allyHBStr) || val2.atkInfo.targetNames.Contains(Globals.allyFCStr)))
			{
				list.Add(((Component)proj).gameObject);
			}
		}

		public void OnTriggerExit2D(Collider2D proj)
		{
			if (Object.op_Implicit((Object)(object)((proj != null) ? ((Component)proj).gameObject : null)) && list.Contains(((Component)proj).gameObject))
			{
				((Entity)parentPlayer).health.RestoreHealth(1, true, true, false, true);
				Player obj = parentPlayer;
				obj.OverdriveProgress += 5f;
				list.Remove(((Component)proj).gameObject);
				ParticleSystem[] array = emitters;
				foreach (ParticleSystem val in array)
				{
					val.Play();
				}
			}
		}

		public void FixedUpdate()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)parent))
			{
				((Component)this).transform.position = parent.position;
				((Component)emitters[0]).transform.position = ((Component)this).transform.position;
				((Component)emitters[1]).transform.position = ((Component)this).transform.position;
			}
		}
	}

	public class GrazeFailBox : MonoBehaviour
	{
		public Grazebox grazebox;

		public void OnTriggerEnter2D(Collider2D coll)
		{
			grazebox?.list?.Remove(((Component)coll).gameObject);
		}
	}

	public static string staticID;

	public static Sprite icon;

	public static GameObject prefab;

	public GameObject hitbox;

	public BadApple()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		base.ID = staticID;
		base.category = (Category)1;
	}

	static BadApple()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Expected O, but got Unknown
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Expected O, but got Unknown
		staticID = "collect::BuffOnProjectileGraze";
		Texture2D val = new Texture2D(2, 2);
		val.LoadImage(File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "Assets/BadApple.png")));
		icon = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).height, (float)((Texture)val).width), new Vector2(0.5f, 0.5f), 55f);
		((Object)icon).name = staticID + "icon";
		((Object)icon.texture).name = staticID + "texture";
		((Texture)icon.texture).filterMode = (FilterMode)0;
		prefab = new GameObject("Grazebox");
		prefab.SetActive(false);
		((Behaviour)prefab.AddComponent<BoxCollider2D>()).enabled = false;
		prefab.AddComponent<Grazebox>();
		Object.DontDestroyOnLoad((Object)(object)prefab);
	}

	public static void Register()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		ItemInfo val = new ItemInfo();
		val.item = (Item)(object)new BadApple();
		val.text.displayName = "Badly Monochromed Apple";
		val.text.itemID = val.item.ID;
		val.text.description = "Grazing attacks provides signature charge and healing.";
		val.priceMultiplier = 5;
		val.icon = icon;
		Items.Register(val);
	}

	public override void Activate()
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: 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)
		if (((Item)this).SetParentAsPlayer())
		{
			BoxCollider2D val = Globals.ChaosInst<BoxCollider2D>(prefab, base.parentPlayer.playerObjTrans, (Vector3?)((Entity)base.parentPlayer).hurtBoxTransform.position, (Quaternion?)null);
			hitbox = ((Component)val).gameObject;
			hitbox.SetActive(true);
			((Collider2D)val).isTrigger = true;
			((Behaviour)val).enabled = true;
			val.size = ((BoxCollider2D)((Entity)base.parentPlayer).hurtBoxCollider).size + new Vector2(0.5f, 0.5f);
			Grazebox component = hitbox.GetComponent<Grazebox>();
			component.parentPlayer = base.parentPlayer;
			hitbox.layer = ((Component)ProjectileNegateShield.Prefab.transform.GetChild(2)).gameObject.layer;
			component.emitters = Globals.ChaosInst<OverdriveEffects>(OverdriveEffects.Prefab, base.parentPlayer.playerObjTrans, (Vector3?)((Entity)base.parentPlayer).hurtBoxTransform.position, (Quaternion?)null).overdriveAuraEmitters;
			((Component)((Entity)base.parentPlayer).hurtBoxTransform).gameObject.AddComponent<GrazeFailBox>().grazebox = component;
		}
	}

	public override void Deactivate()
	{
		if (Object.op_Implicit((Object)(object)hitbox))
		{
			Object.Destroy((Object)(object)hitbox);
			Object.Destroy((Object)(object)((Component)((Entity)base.parentPlayer).hurtBoxTransform).GetComponent<GrazeFailBox>());
		}
	}
}
public class BlackFlame : Item
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static Func<Instruction, bool> <>9__7_2;

		public static Func<Instruction, bool> <>9__7_3;

		public static Func<Instruction, bool> <>9__7_4;

		public static Func<bool, OverheadNumberPool, bool> <>9__7_1;

		public static SkillApplyCondition <>9__9_0;

		public static SkillApplyCondition <>9__10_0;

		internal void <.cctor>b__7_0(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			FieldReference val2 = default(FieldReference);
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(DisplayQueueObject).GetField("fillColor")),
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, ref val2),
				(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(DisplayQueueObject).GetField("fillColor"))
			}))
			{
				return;
			}
			int index = val.Index;
			val.Index = index + 1;
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<bool, OverheadNumberPool, bool>>((Func<bool, OverheadNumberPool, bool>)delegate(bool b, OverheadNumberPool pool)
			{
				//IL_000f: 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_0054: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: 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_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: Unknown result type (might be due to invalid IL or missing references)
				//IL_008b: Unknown result type (might be due to invalid IL or missing references)
				if (b)
				{
					if (OverheadNumberPool.currentNum.fillColor == Color.white)
					{
						OverheadNumberPool.currentNum.fillColor = OverheadNumberPool.incomingNum.fillColor;
						OverheadNumberPool.currentNum.icon = OverheadNumberPool.incomingNum.icon;
						return false;
					}
					if (OverheadNumberPool.incomingNum.fillColor == Color.white)
					{
						OverheadNumberPool.incomingNum.fillColor = OverheadNumberPool.currentNum.fillColor;
						OverheadNumberPool.incomingNum.icon = OverheadNumberPool.currentNum.icon;
						return false;
					}
				}
				return b;
			});
		}

		internal bool <.cctor>b__7_2(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdfld(x, typeof(DisplayQueueObject).GetField("fillColor"));
		}

		internal bool <.cctor>b__7_3(Instruction x)
		{
			FieldReference val = default(FieldReference);
			return ILPatternMatchingExt.MatchLdsfld(x, ref val);
		}

		internal bool <.cctor>b__7_4(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdfld(x, typeof(DisplayQueueObject).GetField("fillColor"));
		}

		internal bool <.cctor>b__7_1(bool b, OverheadNumberPool pool)
		{
			//IL_000f: 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_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			if (b)
			{
				if (OverheadNumberPool.currentNum.fillColor == Color.white)
				{
					OverheadNumberPool.currentNum.fillColor = OverheadNumberPool.incomingNum.fillColor;
					OverheadNumberPool.currentNum.icon = OverheadNumberPool.incomingNum.icon;
					return false;
				}
				if (OverheadNumberPool.incomingNum.fillColor == Color.white)
				{
					OverheadNumberPool.incomingNum.fillColor = OverheadNumberPool.currentNum.fillColor;
					OverheadNumberPool.incomingNum.icon = OverheadNumberPool.currentNum.icon;
					return false;
				}
			}
			return b;
		}

		internal bool <Activate>b__9_0(SkillState s)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			return (int)s.element == 0;
		}

		internal bool <Deactivate>b__10_0(SkillState s)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			return (int)s.element == 0;
		}
	}

	public static string staticID;

	public static Sprite icon;

	public NumVarStatMod kbMod = new NumVarStatMod(staticID, 1.5f, 10, (VarStatModType)4, false);

	private AttackInfo phyAtkInf;

	public override string ExtraInfo => Globals.PercentToStr(0.5f, "");

	public BlackFlame()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		base.ID = staticID;
		base.category = (Category)0;
	}

	static BlackFlame()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Expected O, but got Unknown
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Expected O, but got Unknown
		staticID = "collect::FlameAttackBisect";
		Texture2D val = new Texture2D(2, 2);
		val.LoadImage(File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "Assets/BlackFlame.png")));
		icon = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).height, (float)((Texture)val).width), new Vector2(0.5f, 0.5f), 55f);
		((Object)icon).name = staticID + "icon";
		((Object)icon.texture).name = staticID + "texture";
		((Texture)icon.texture).filterMode = (FilterMode)0;
		OverheadNumberPool.SumAllNumbers += (Manipulator)delegate(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val2 = new ILCursor(il);
			FieldReference val3 = default(FieldReference);
			if (val2.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(DisplayQueueObject).GetField("fillColor")),
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, ref val3),
				(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(DisplayQueueObject).GetField("fillColor"))
			}))
			{
				int index = val2.Index;
				val2.Index = index + 1;
				val2.Emit(OpCodes.Ldarg_0);
				val2.EmitDelegate<Func<bool, OverheadNumberPool, bool>>((Func<bool, OverheadNumberPool, bool>)delegate(bool b, OverheadNumberPool pool)
				{
					//IL_000f: 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_0054: Unknown result type (might be due to invalid IL or missing references)
					//IL_0059: Unknown result type (might be due to invalid IL or missing references)
					//IL_002d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0032: Unknown result type (might be due to invalid IL or missing references)
					//IL_0041: 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_0072: Unknown result type (might be due to invalid IL or missing references)
					//IL_0077: Unknown result type (might be due to invalid IL or missing references)
					//IL_0086: Unknown result type (might be due to invalid IL or missing references)
					//IL_008b: Unknown result type (might be due to invalid IL or missing references)
					if (b)
					{
						if (OverheadNumberPool.currentNum.fillColor == Color.white)
						{
							OverheadNumberPool.currentNum.fillColor = OverheadNumberPool.incomingNum.fillColor;
							OverheadNumberPool.currentNum.icon = OverheadNumberPool.incomingNum.icon;
							return false;
						}
						if (OverheadNumberPool.incomingNum.fillColor == Color.white)
						{
							OverheadNumberPool.incomingNum.fillColor = OverheadNumberPool.currentNum.fillColor;
							OverheadNumberPool.incomingNum.icon = OverheadNumberPool.currentNum.icon;
							return false;
						}
					}
					return b;
				});
			}
		};
	}

	public static void Register()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		ItemInfo val = new ItemInfo();
		val.item = (Item)(object)new BlackFlame();
		val.text.displayName = "Black Flame";
		val.text.itemID = val.item.ID;
		val.text.description = "Fire Arcana deal part of their damage as physical and have increased knockback";
		val.priceMultiplier = 4;
		val.icon = icon;
		Items.Register(val);
	}

	public override void Activate()
	{
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Expected O, but got Unknown
		if (!((Item)this).SetParentAsPlayer())
		{
			return;
		}
		SetEventHandlers(givenStatus: true);
		NumVarStatMod obj = kbMod;
		Player parentPlayer = base.parentPlayer;
		object obj2 = <>c.<>9__9_0;
		if (obj2 == null)
		{
			SkillApplyCondition val = (SkillState s) => (int)s.element == 0;
			<>c.<>9__9_0 = val;
			obj2 = (object)val;
		}
		Player.ModifySkills(obj, parentPlayer, "knockbackMultiplier", (SkillApplyCondition)obj2, true);
	}

	public override void Deactivate()
	{
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Expected O, but got Unknown
		if (!((Item)this).SetParentAsPlayer())
		{
			return;
		}
		SetEventHandlers(givenStatus: false);
		NumVarStatMod obj = kbMod;
		Player parentPlayer = base.parentPlayer;
		object obj2 = <>c.<>9__10_0;
		if (obj2 == null)
		{
			SkillApplyCondition val = (SkillState s) => (int)s.element == 0;
			<>c.<>9__10_0 = val;
			obj2 = (object)val;
		}
		Player.ModifySkills(obj, parentPlayer, "knockbackMultiplier", (SkillApplyCondition)obj2, false);
	}

	private void SetEventHandlers(bool givenStatus)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Expected O, but got Unknown
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Expected O, but got Unknown
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Expected O, but got Unknown
		Health.globalTakeDamageEnterHandlers = (GlobalOnTakeDamageHandler)Delegate.Remove((Delegate?)(object)Health.globalTakeDamageEnterHandlers, (Delegate?)new GlobalOnTakeDamageHandler(HandleBisection));
		if (givenStatus)
		{
			Health.globalTakeDamageEnterHandlers = (GlobalOnTakeDamageHandler)Delegate.Combine((Delegate?)(object)Health.globalTakeDamageEnterHandlers, (Delegate?)new GlobalOnTakeDamageHandler(HandleBisection));
		}
	}

	private void HandleBisection(AttackInfo givenInfo, Entity atkEntity, Entity hurtEntity)
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Invalid comparison between Unknown and I4
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Expected O, but got Unknown
		//IL_00e4: 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 (!((Object)(object)base.parentPlayer != (Object)null) || !((Object)(object)hurtEntity != (Object)null) || !((Object)(object)atkEntity == (Object)(object)base.parentPlayer) || ((int)givenInfo.elementType != 0 && (int)givenInfo.subElementType != 0))
		{
			return;
		}
		givenInfo.isCritical = givenInfo.isCritical || (!hurtEntity.health.evadeCrit && Random.value < givenInfo.critHitChance);
		if (givenInfo.isCritical)
		{
			if (Attack.globalCritEventHandlers != null)
			{
				Attack.globalCritEventHandlers.Invoke(givenInfo, givenInfo.entity, ((ComponentBase)hurtEntity.health).entityScript);
			}
			givenInfo.damage = Mathf.FloorToInt(givenInfo.critDmgModifier * (float)givenInfo.damage);
		}
		givenInfo.damage /= 2;
		phyAtkInf = new AttackInfo(givenInfo);
		phyAtkInf.elementType = (ElementType)5;
		phyAtkInf.subElementType = (ElementType)5;
		hurtEntity.health.TakeDamage(phyAtkInf, base.parentEntity, true);
		hurtEntity.health.currentAtkInfo = givenInfo;
	}
}
public class BlueBlood : Item
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static Func<Instruction, bool> <>9__4_2;

		public static Func<Instruction, bool> <>9__4_3;

		public static Func<PoolType, PoolType> <>9__4_1;

		public static Manipulator <>9__4_0;

		internal void <Register>b__4_0(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			FieldReference val2 = default(FieldReference);
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, ref val2),
				(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1)
			}))
			{
				val.EmitDelegate<Func<PoolType, PoolType>>((Func<PoolType, PoolType>)((PoolType h) => (PoolType)(Inventory.EitherPlayerHasItem(staticID) ? 2 : ((int)h))));
			}
		}

		internal bool <Register>b__4_2(Instruction x)
		{
			FieldReference val = default(FieldReference);
			return ILPatternMatchingExt.MatchLdsfld(x, ref val);
		}

		internal bool <Register>b__4_3(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdcI4(x, 1);
		}

		internal PoolType <Register>b__4_1(PoolType h)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			return (PoolType)(Inventory.EitherPlayerHasItem(staticID) ? 2 : ((int)h));
		}
	}

	public static string staticID;

	public static Sprite icon;

	public BlueBlood()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		base.ID = staticID;
		base.category = (Category)2;
		base.isCursed = true;
	}

	static BlueBlood()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Expected O, but got Unknown
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		staticID = "collect::HealthOrbSignature";
		Texture2D val = new Texture2D(2, 2);
		val.LoadImage(File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "Assets/BlueBlood.png")));
		icon = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).height, (float)((Texture)val).width), new Vector2(0.5f, 0.5f), 55f);
		((Object)icon).name = staticID + "icon";
		((Object)icon.texture).name = staticID + "texture";
		((Texture)icon.texture).filterMode = (FilterMode)0;
	}

	public static void Register()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Expected O, but got Unknown
		ItemInfo val = new ItemInfo();
		val.item = (Item)(object)new BlueBlood();
		val.text.displayName = "BlueBlood Pen";
		val.text.itemID = val.item.ID;
		val.text.description = "Health Orb drops spawn Mana Orbs instead.";
		val.icon = icon;
		val.priceMultiplier = 0;
		Items.Register(val);
		object obj = <>c.<>9__4_0;
		if (obj == null)
		{
			Manipulator val2 = delegate(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val3 = new ILCursor(il);
				FieldReference val4 = default(FieldReference);
				if (val3.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, ref val4),
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1)
				}))
				{
					val3.EmitDelegate<Func<PoolType, PoolType>>((Func<PoolType, PoolType>)((PoolType h) => (PoolType)(Inventory.EitherPlayerHasItem(staticID) ? 2 : ((int)h))));
				}
			};
			<>c.<>9__4_0 = val2;
			obj = (object)val2;
		}
		LootManager.DropHealth += (Manipulator)obj;
	}

	public override void Activate()
	{
	}

	public override void Deactivate()
	{
	}
}
public class ForgedPapers : Item
{
	public static string staticID;

	public static Sprite icon;

	private int currentSkillIn = 0;

	public ForgedPapers()
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		base.ID = staticID;
		base.category = (Category)2;
	}

	static ForgedPapers()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Expected O, but got Unknown
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Expected O, but got Unknown
		staticID = "collect::MultiSignature";
		Texture2D val = new Texture2D(2, 2);
		val.LoadImage(File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "Assets/Forged.png")));
		icon = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).height, (float)((Texture)val).width), new Vector2(0.5f, 0.5f), 55f);
		((Object)icon).name = staticID + "icon";
		((Object)icon.texture).name = staticID + "texture";
		((Texture)icon.texture).filterMode = (FilterMode)0;
		Player.HandleOverdrive += (Manipulator)delegate(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val2 = new ILCursor(il);
			if (val2.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchRet(x)
			}) && val2.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)typeof(Player).GetMethod("GetSignatureSkill")),
				(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(Player).GetField("overdriveSkillRef", (BindingFlags)(-1)))
			}))
			{
				ILLabel val3 = val2.MarkLabel();
				if (val2.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0),
					(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(Player).GetField("overdriveTimedOut", (BindingFlags)(-1)))
				}))
				{
					val2.MoveAfterLabels();
					val2.Emit(OpCodes.Ldarg_0);
					val2.EmitDelegate<Func<Player, bool>>((Func<Player, bool>)delegate(Player player)
					{
						ForgedPapers forgedPapers = (ForgedPapers)(object)((Entity)player).inventory.GetItem(staticID);
						if (forgedPapers == null || !player.overdriveReady || player.OverdriveProgress <= player.overdriveMinValue)
						{
							return false;
						}
						SkillState val4 = null;
						while (forgedPapers.currentSkillIn < player.assignedSkills.Length)
						{
							val4 = player.assignedSkills[forgedPapers.currentSkillIn];
							if (val4 != null && val4.hasSignatureVariant && !val4.isSignature && val4 != player.overdriveSkillRef)
							{
								player.overdriveSkillRef = val4;
								return true;
							}
							forgedPapers.currentSkillIn++;
						}
						forgedPapers.currentSkillIn = 0;
						player.overdriveSkillRef = null;
						return false;
					});
					val2.Emit(OpCodes.Brtrue, (object)val3);
				}
			}
		};
	}

	public static void Register()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		ItemInfo val = new ItemInfo();
		val.item = (Item)(object)new ForgedPapers();
		val.text.displayName = "Forged Papers";
		val.text.itemID = val.item.ID;
		val.text.description = "Your signature charge can be spent on any viable arcana.";
		val.icon = icon;
		val.tier = 3;
		val.priceMultiplier = 8;
		Items.Register(val);
	}
}
public class OniChain : Item
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static Func<Instruction, bool> <>9__6_2;

		public static Action <>9__6_1;

		public static Manipulator <>9__6_0;

		public static Func<Instruction, bool> <>9__11_1;

		public static Action <>9__11_0;

		internal void <Activate>b__6_0(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(BossRoomEventHandler).GetField("triggerWall", (BindingFlags)(-1)))
			}))
			{
				return;
			}
			val.EmitDelegate<Action>((Action)delegate
			{
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				Player[] activePlayers = GameController.activePlayers;
				foreach (Player val2 in activePlayers)
				{
					if (Object.op_Implicit((Object)(object)val2) && ((Entity)val2).inventory != null)
					{
						(((Entity)val2).inventory.GetItem(staticID) as OniChain)?.OnEnterSurvival(((Component)val2).transform.position);
					}
				}
			});
		}

		internal bool <Activate>b__6_2(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdfld(x, typeof(BossRoomEventHandler).GetField("triggerWall", (BindingFlags)(-1)));
		}

		internal void <Activate>b__6_1()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			Player[] activePlayers = GameController.activePlayers;
			foreach (Player val in activePlayers)
			{
				if (Object.op_Implicit((Object)(object)val) && ((Entity)val).inventory != null)
				{
					(((Entity)val).inventory.GetItem(staticID) as OniChain)?.OnEnterSurvival(((Component)val).transform.position);
				}
			}
		}

		internal bool <BossCleanup>b__11_1(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld(x, typeof(BossRoomEventHandler).GetField("exitSpawned", (BindingFlags)(-1)));
		}

		internal void <BossCleanup>b__11_0()
		{
			Player[] activePlayers = GameController.activePlayers;
			foreach (Player val in activePlayers)
			{
				if (Object.op_Implicit((Object)(object)val) && ((Entity)val).inventory != null)
				{
					(((Entity)val).inventory.GetItem(staticID) as OniChain)?.OnExitSurvival();
				}
			}
		}
	}

	public static string staticID;

	public static Sprite icon;

	public bool hooked = false;

	public OniChain()
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		base.ID = staticID;
		base.category = (Category)1;
	}

	static OniChain()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Expected O, but got Unknown
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		staticID = "collect::LockedInHere";
		Texture2D val = new Texture2D(2, 2);
		val.LoadImage(File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "Assets/Forged.png")));
		icon = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).height, (float)((Texture)val).width), new Vector2(0.5f, 0.5f), 55f);
		((Object)icon).name = staticID + "icon";
		((Object)icon.texture).name = staticID + "texture";
		((Texture)icon.texture).filterMode = (FilterMode)0;
	}

	public static void Register()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		ItemInfo val = new ItemInfo();
		val.item = (Item)(object)new OniChain();
		val.text.displayName = "Oni's Chains";
		val.text.itemID = val.item.ID;
		val.text.description = "While locked into a room,negate the first hit you would have taken.";
		val.icon = icon;
		val.tier = 3;
		val.priceMultiplier = 5;
		Items.Register(val);
	}

	public override void Activate()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Expected O, but got Unknown
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Expected O, but got Unknown
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Expected O, but got Unknown
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Expected O, but got Unknown
		//IL_0080: 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_008b: Expected O, but got Unknown
		if (!((Item)this).SetParentAsPlayer())
		{
			return;
		}
		Player parentPlayer = base.parentPlayer;
		parentPlayer.onSurvivalRoomEnterHandlers = (OnSurvivalRoomEnterEventHandler)Delegate.Combine((Delegate?)(object)parentPlayer.onSurvivalRoomEnterHandlers, (Delegate?)new OnSurvivalRoomEnterEventHandler(OnEnterSurvival));
		SurvivalRoom.onSurvivalRoomClearEventHandlers = (OnSurvivalRoomClearEventHandler)Delegate.Combine((Delegate?)(object)SurvivalRoom.onSurvivalRoomClearEventHandlers, (Delegate?)new OnSurvivalRoomClearEventHandler(OnExitSurvival));
		((Item)this).UpdateItemBar((ItemState)1);
		if (hooked)
		{
			return;
		}
		object obj = <>c.<>9__6_0;
		if (obj == null)
		{
			Manipulator val = delegate(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val2 = new ILCursor(il);
				if (val2.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(BossRoomEventHandler).GetField("triggerWall", (BindingFlags)(-1)))
				}))
				{
					val2.EmitDelegate<Action>((Action)delegate
					{
						//IL_004b: Unknown result type (might be due to invalid IL or missing references)
						Player[] activePlayers = GameController.activePlayers;
						foreach (Player val3 in activePlayers)
						{
							if (Object.op_Implicit((Object)(object)val3) && ((Entity)val3).inventory != null)
							{
								(((Entity)val3).inventory.GetItem(staticID) as OniChain)?.OnEnterSurvival(((Component)val3).transform.position);
							}
						}
					});
				}
			};
			<>c.<>9__6_0 = val;
			obj = (object)val;
		}
		BossRoomEventHandler.OnTriggerEnter2D += (Manipulator)obj;
		BossRoomEventHandler.Update += new Manipulator(BossCleanup);
		FinalBossRoomEventHandler.Update += new Manipulator(BossCleanup);
		hooked = true;
	}

	public override void Deactivate()
	{
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Expected O, but got Unknown
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Expected O, but got Unknown
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Expected O, but got Unknown
		if (((Item)this).SetParentAsPlayer())
		{
			Player parentPlayer = base.parentPlayer;
			parentPlayer.onSurvivalRoomEnterHandlers = (OnSurvivalRoomEnterEventHandler)Delegate.Remove((Delegate?)(object)parentPlayer.onSurvivalRoomEnterHandlers, (Delegate?)new OnSurvivalRoomEnterEventHandler(OnEnterSurvival));
			SurvivalRoom.onSurvivalRoomClearEventHandlers = (OnSurvivalRoomClearEventHandler)Delegate.Remove((Delegate?)(object)SurvivalRoom.onSurvivalRoomClearEventHandlers, (Delegate?)new OnSurvivalRoomClearEventHandler(OnExitSurvival));
			((Item)this).RemoveFromItemBar();
		}
	}

	public void OnEnterSurvival(Vector3 pos)
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Expected O, but got Unknown
		((Item)this).UpdateItemBar((ItemState)2);
		Health health = ((Entity)base.parentPlayer).health;
		health.takeDamageEnterHandlers = (OnTakeDamageHandler)Delegate.Combine((Delegate?)(object)health.takeDamageEnterHandlers, (Delegate?)new OnTakeDamageHandler(OnTakeDamage));
	}

	public void OnExitSurvival()
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Expected O, but got Unknown
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Expected O, but got Unknown
		Health health = ((Entity)base.parentPlayer).health;
		health.takeDamageEnterHandlers = (OnTakeDamageHandler)Delegate.Remove((Delegate?)(object)health.takeDamageEnterHandlers, (Delegate?)new OnTakeDamageHandler(OnTakeDamage));
		((Item)this).UpdateItemBar((ItemState)1);
	}

	public void OnTakeDamage(AttackInfo attack, Entity attacker)
	{
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Expected O, but got Unknown
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Expected O, but got Unknown
		if (!((Entity)base.parentPlayer).health.GuardNextAtk)
		{
			((Entity)base.parentPlayer).health.GuardNextAtk = true;
			((Item)this).UpdateItemBar((ItemState)0);
			Health health = ((Entity)base.parentPlayer).health;
			health.takeDamageEnterHandlers = (OnTakeDamageHandler)Delegate.Remove((Delegate?)(object)health.takeDamageEnterHandlers, (Delegate?)new OnTakeDamageHandler(OnTakeDamage));
		}
	}

	public void BossCleanup(ILContext il)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		ILCursor val = new ILCursor(il);
		if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
		{
			(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(BossRoomEventHandler).GetField("exitSpawned", (BindingFlags)(-1)))
		}))
		{
			return;
		}
		val.EmitDelegate<Action>((Action)delegate
		{
			Player[] activePlayers = GameController.activePlayers;
			foreach (Player val2 in activePlayers)
			{
				if (Object.op_Implicit((Object)(object)val2) && ((Entity)val2).inventory != null)
				{
					(((Entity)val2).inventory.GetItem(staticID) as OniChain)?.OnExitSurvival();
				}
			}
		});
	}
}
public class TicketToRide : Item
{
	public static string staticID;

	public static Sprite icon;

	private int currentSkillIn = 0;

	public TicketToRide()
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		base.ID = staticID;
		base.category = (Category)2;
	}

	static TicketToRide()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Expected O, but got Unknown
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Expected O, but got Unknown
		staticID = "collect::RoomShortcut";
		Texture2D val = new Texture2D(2, 2);
		val.LoadImage(File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "Assets/Forged.png")));
		icon = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).height, (float)((Texture)val).width), new Vector2(0.5f, 0.5f), 55f);
		((Object)icon).name = staticID + "icon";
		((Object)icon.texture).name = staticID + "texture";
		((Texture)icon.texture).filterMode = (FilterMode)0;
		Player.HandleOverdrive += (Manipulator)delegate(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val2 = new ILCursor(il);
			if (val2.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchRet(x)
			}) && val2.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)typeof(Player).GetMethod("GetSignatureSkill")),
				(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(Player).GetField("overdriveSkillRef", (BindingFlags)(-1)))
			}))
			{
				ILLabel val3 = val2.MarkLabel();
				if (val2.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0),
					(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(Player).GetField("overdriveTimedOut", (BindingFlags)(-1)))
				}))
				{
					val2.MoveAfterLabels();
					val2.Emit(OpCodes.Ldarg_0);
					val2.EmitDelegate<Func<Player, bool>>((Func<Player, bool>)delegate(Player player)
					{
						TicketToRide ticketToRide = (TicketToRide)(object)((Entity)player).inventory.GetItem(staticID);
						if (ticketToRide == null || !player.overdriveReady || player.OverdriveProgress <= player.overdriveMinValue)
						{
							return false;
						}
						SkillState val4 = null;
						while (ticketToRide.currentSkillIn < player.assignedSkills.Length)
						{
							val4 = player.assignedSkills[ticketToRide.currentSkillIn];
							if (val4 != null && val4.hasSignatureVariant && !val4.isSignature && val4 != player.overdriveSkillRef)
							{
								player.overdriveSkillRef = val4;
								return true;
							}
							ticketToRide.currentSkillIn++;
						}
						ticketToRide.currentSkillIn = 0;
						player.overdriveSkillRef = null;
						return false;
					});
					val2.Emit(OpCodes.Brtrue, (object)val3);
				}
			}
		};
	}

	public static void Register()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		ItemInfo val = new ItemInfo();
		val.item = (Item)(object)new TicketToRide();
		val.text.displayName = "Permit of Travel";
		val.text.itemID = val.item.ID;
		val.text.description = "Completed rooms can be skipped via portal.";
		val.icon = icon;
		val.tier = 3;
		val.priceMultiplier = 8;
		Items.Register(val);
	}
}
internal static class CollectorOutfit
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static orig_AnnounceItemEvent <>9__4_2;

		public static Action<Player, bool, bool, OutfitModStat> <>9__4_0;

		public static Func<bool, OutfitModStat, string> <>9__4_1;

		internal void <Register>b__4_0(Player p, bool b1, bool b2, OutfitModStat mod)
		{
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Expected O, but got Unknown
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Expected O, but got Unknown
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Expected O, but got Unknown
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Expected O, but got Unknown
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Expected O, but got Unknown
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Expected O, but got Unknown
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			//IL_0092: 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)
			//IL_009d: Expected O, but got Unknown
			if (b1)
			{
				ItemStoreItem.spawnEventHandlers = (SpawnEventHandler)Delegate.Combine((Delegate?)(object)ItemStoreItem.spawnEventHandlers, (Delegate?)new SpawnEventHandler(ItemStore));
				SkillStoreItem.spawnEventHandlers = (SpawnEventHandler)Delegate.Combine((Delegate?)(object)SkillStoreItem.spawnEventHandlers, (Delegate?)new SpawnEventHandler(SkillStore));
				p.skillChangedEventHandlers = (SkillEventHandler)Delegate.Combine((Delegate?)(object)p.skillChangedEventHandlers, (Delegate?)new SkillEventHandler(OnSkillChange));
				Inventory.AnnounceItemEvent += new hook_AnnounceItemEvent(OnInventoryChange);
				object obj = <>9__4_2;
				if (obj == null)
				{
					orig_AnnounceItemEvent val = delegate
					{
					};
					<>9__4_2 = val;
					obj = (object)val;
				}
				OnInventoryChange((orig_AnnounceItemEvent)obj, ((Entity)p).inventory, ((Entity)p).inventory.GetRandomItem(false), b1);
			}
			else
			{
				ItemStoreItem.spawnEventHandlers = (SpawnEventHandler)Delegate.Remove((Delegate?)(object)ItemStoreItem.spawnEventHandlers, (Delegate?)new SpawnEventHandler(ItemStore));
				SkillStoreItem.spawnEventHandlers = (SpawnEventHandler)Delegate.Remove((Delegate?)(object)SkillStoreItem.spawnEventHandlers, (Delegate?)new SpawnEventHandler(SkillStore));
				p.skillChangedEventHandlers = (SkillEventHandler)Delegate.Remove((Delegate?)(object)p.skillChangedEventHandlers, (Delegate?)new SkillEventHandler(OnSkillChange));
			}
		}

		internal void <Register>b__4_2(Inventory a, Item b, bool c)
		{
		}

		internal string <Register>b__4_1(bool b, OutfitModStat m)
		{
			return "- Relics and Arcana that can <color=#00FFFF>combine</color> with ones you hold are cheaper.";
		}
	}

	public static OutfitInfo info = new OutfitInfo();

	internal static NumVarStatMod discount;

	internal static NumVarStatMod completeDiscount;

	internal static OutfitModStat speed;

	internal static void Register()
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Expected O, but got Unknown
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Expected O, but got Unknown
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Expected O, but got Unknown
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Expected O, but got Unknown
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_014e: Expected O, but got Unknown
		info.name = "Collection";
		speed = new OutfitModStat((OutfitModType)2, 0f, 0f, 0f, false);
		speed.hasMultiValue = true;
		speed.isIncrease = true;
		List<OutfitModStat> list = new List<OutfitModStat>
		{
			speed,
			new OutfitModStat(Outfits.CustomModType, 0f, 0f, 0f, false),
			new OutfitModStat((OutfitModType)18, 0f, 0f, 0f, false)
		};
		list[1].multiModifier.modValue = 0.25f;
		info.outfit = new Outfit("COLLECT::collector", 18, list, true, false);
		info.customMod = delegate(Player p, bool b1, bool b2, OutfitModStat mod)
		{
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Expected O, but got Unknown
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Expected O, but got Unknown
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Expected O, but got Unknown
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Expected O, but got Unknown
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Expected O, but got Unknown
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Expected O, but got Unknown
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			//IL_0092: 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)
			//IL_009d: Expected O, but got Unknown
			if (b1)
			{
				ItemStoreItem.spawnEventHandlers = (SpawnEventHandler)Delegate.Combine((Delegate?)(object)ItemStoreItem.spawnEventHandlers, (Delegate?)new SpawnEventHandler(ItemStore));
				SkillStoreItem.spawnEventHandlers = (SpawnEventHandler)Delegate.Combine((Delegate?)(object)SkillStoreItem.spawnEventHandlers, (Delegate?)new SpawnEventHandler(SkillStore));
				p.skillChangedEventHandlers = (SkillEventHandler)Delegate.Combine((Delegate?)(object)p.skillChangedEventHandlers, (Delegate?)new SkillEventHandler(OnSkillChange));
				Inventory.AnnounceItemEvent += new hook_AnnounceItemEvent(OnInventoryChange);
				object obj = <>c.<>9__4_2;
				if (obj == null)
				{
					orig_AnnounceItemEvent val = delegate
					{
					};
					<>c.<>9__4_2 = val;
					obj = (object)val;
				}
				OnInventoryChange((orig_AnnounceItemEvent)obj, ((Entity)p).inventory, ((Entity)p).inventory.GetRandomItem(false), b1);
			}
			else
			{
				ItemStoreItem.spawnEventHandlers = (SpawnEventHandler)Delegate.Remove((Delegate?)(object)ItemStoreItem.spawnEventHandlers, (Delegate?)new SpawnEventHandler(ItemStore));
				SkillStoreItem.spawnEventHandlers = (SpawnEventHandler)Delegate.Remove((Delegate?)(object)SkillStoreItem.spawnEventHandlers, (Delegate?)new SpawnEventHandler(SkillStore));
				p.skillChangedEventHandlers = (SkillEventHandler)Delegate.Remove((Delegate?)(object)p.skillChangedEventHandlers, (Delegate?)new SkillEventHandler(OnSkillChange));
			}
		};
		info.customDesc = (bool b, OutfitModStat m) => "- Relics and Arcana that can <color=#00FFFF>combine</color> with ones you hold are cheaper.";
		Outfits.Register(info);
		discount = new NumVarStatMod("CollectorsDealItemSale", -0.25f, 10, (VarStatModType)2, false);
		completeDiscount = new NumVarStatMod("CollectorsDealItemSaleToComplete", -0.5f, 10, (VarStatModType)2, false);
	}

	internal static void OnOutfitChange(Player p, string outfitID)
	{
	}

	internal static void ItemStore(ItemStoreItem storeItem)
	{
		//IL_014e: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)storeItem) || ((StoreItem)storeItem).Cost == 0 || !GameController.inGameScene)
		{
			return;
		}
		((VarStat<float>)(object)((StoreItem)storeItem).costStat).RemoveMod((VarStatMod<float>)(object)discount);
		Item val = LootManager.completeItemDict[storeItem.itemID];
		Player[] activePlayers = GameController.activePlayers;
		foreach (Player val2 in activePlayers)
		{
			if (Collection.PlayerIsWearing(val2, info.outfit.outfitID) && ((Entity)val2).inventory.CheckItemCombine(val))
			{
				Collection.logger.LogDebug((object)("Is that a collectors edition " + storeItem.itemID + "?!?"));
				if (val.isGroupItem && ((GroupItem)/*isinst with value type is only supported in some contexts*/).Count == GroupItemManager.groupsDict[val.parentGroupID].Count - 1)
				{
					((VarStat<float>)(object)((StoreItem)storeItem).costStat).AddMod((VarStatMod<float>)(object)completeDiscount);
					((StoreItem)storeItem).topText.text = "!!COLLECT!!";
				}
				else
				{
					((VarStat<float>)(object)((StoreItem)storeItem).costStat).AddMod((VarStatMod<float>)(object)discount);
					((StoreItem)storeItem).topText.text = "COLLECT";
				}
				((Graphic)((StoreItem)storeItem).topText).color = new Color(0f, 1f, 1f);
				((StoreItem)storeItem).UpdatePrice((string)null);
			}
		}
	}

	internal static void SkillStore(SkillStoreItem item)
	{
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)item) || !GameController.inGameScene)
		{
			return;
		}
		((VarStat<float>)(object)((StoreItem)item).costStat).RemoveMod((VarStatMod<float>)(object)discount);
		Player[] activePlayers = GameController.activePlayers;
		foreach (Player val in activePlayers)
		{
			if (Collection.PlayerIsWearing(val, info.outfit.outfitID) && val.HasSkill(UseDragonGrade.staticID) && item.skillID != UseRisingDragon.staticID && (item.skillID == ShootFireArc.staticID || item.skillID.Contains("Dragon")))
			{
				((VarStat<float>)(object)((StoreItem)item).costStat).AddMod((VarStatMod<float>)(object)discount);
				Collection.logger.LogDebug((object)("That " + item.skillID + " is exactly what I need for my Dragon Deck!"));
				((StoreItem)item).topText.text = "COLLECT";
				((Graphic)((StoreItem)item).topText).color = new Color(0f, 1f, 1f);
				((StoreItem)item).UpdatePrice((string)null);
			}
		}
	}

	internal static void OnInventoryChange(orig_AnnounceItemEvent orig, Inventory self, Item item, bool status)
	{
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Expected O, but got Unknown
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		orig.Invoke(self, item, status);
		if (!(self.parentEntity is Player) || !Collection.PlayerIsWearing((Player)self.parentEntity, info.outfit.outfitID))
		{
			return;
		}
		foreach (ItemStoreItem currentItem in ItemStoreItem.currentItems)
		{
			ItemStore(currentItem);
		}
		speed = Outfit.OutfitDict[((Player)self.parentEntity).outfitID].modList[0];
		speed.isIncrease = true;
		speed.multiModifier.modValue = 0f;
		foreach (KeyValuePair<string, Item> item2 in self.itemDict)
		{
			if (item2.Key == DamageUpClearInventory.staticID)
			{
				NumVarStatMod multiModifier = speed.multiModifier;
				ref float modValue = ref multiModifier.modValue;
				float modValue2 = multiModifier.modValue;
				Item value = item2.Value;
				modValue = modValue2 + (float)((DamageUpClearInventory)((value is DamageUpClearInventory) ? value : null)).itemCount;
			}
			else if (item2.Value.isGroupItem)
			{
				NumVarStatMod multiModifier2 = speed.multiModifier;
				ref float modValue3 = ref multiModifier2.modValue;
				float modValue4 = multiModifier2.modValue;
				Item value2 = item2.Value;
				modValue3 = modValue4 + (float)((GroupItem)((value2 is GroupItem) ? value2 : null)).Count;
			}
			else
			{
				NumVarStatMod multiModifier3 = speed.multiModifier;
				multiModifier3.modValue += 1f;
			}
		}
		speed.multiModifier.modValue = Mathf.Min(speed.multiModifier.modValue / 36f, 0.55f);
		speed.SetModStatus(item.parentPlayer, true, true);
	}

	internal static void OnSkillChange(SkillState givenSkill)
	{
		if (givenSkill == null || !(givenSkill.skillID == UseDragonGrade.staticID))
		{
			return;
		}
		foreach (SkillStoreItem currentSkill in SkillStoreItem.currentSkills)
		{
			SkillStore(currentSkill);
		}
	}
}
internal static class CourierOutfit
{
	private class DummyDash : State<Player>
	{
		public static string staticID = "CourierNoCooldownDash";

		public bool showEffects = true;

		public bool playSFX = true;

		public bool cooldownReady;

		public bool prevCDWasReady;

		public bool finishedDashing;

		public float dashDuration = 0.125f;

		public NumVarStatMod dashDurationMod;

		public BoolVarStat forceEvadeStat;

		public NumVarStatMod evadeMod;

		public BoolVarStatMod airborneMod;

		public DummyDash(FSM fsm, Player parentPlayer)
			: base(staticID, fsm, parentPlayer)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Expected O, but got Unknown
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Expected O, but got Unknown
			forceEvadeStat = new BoolVarStat(false);
			evadeMod = new NumVarStatMod("DashEvade", 1f, 10, (VarStatModType)0, false);
			airborneMod = new BoolVarStatMod(staticID, true, 10);
			dashDurationMod = new NumVarStatMod("dashOverride", dashDuration, 10, (VarStatModType)1, false);
		}

		public bool Transition()
		{
			if (!((Entity)base.parent).MovementEnabled)
			{
				return false;
			}
			base.fsm.ChangeState(staticID, true);
			return true;
		}

		public override void OnEnter()
		{
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: 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_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
			SkillState val = base.parent.skillsDict["Dash"];
			forceEvadeStat = ((BaseDashState)((val is BaseDashState) ? val : null)).forceEvadeStat;
			if (base.parent.dashSlideIgnored)
			{
				cooldownReady = prevCDWasReady;
			}
			else
			{
				prevCDWasReady = cooldownReady;
			}
			base.parent.dashSlideIgnored = false;
			if (base.parent.skillEnterEventHandlers != null)
			{
				base.parent.skillEnterEventHandlers.Invoke(val);
			}
			if (base.fsm.previousState is SkillState)
			{
				IState previousState = base.fsm.previousState;
				SkillState val2 = (SkillState)(object)((previousState is SkillState) ? previousState : null);
				if (val2.isBasic && base.parent.cancelFromBasicEventHandlers != null)
				{
					base.parent.cancelFromBasicEventHandlers.Invoke(val, val2);
				}
				else if (base.parent.cancelToDashEventHandlers != null)
				{
					base.parent.cancelToDashEventHandlers.Invoke(val, val2);
				}
			}
			if (((VarStat<bool>)(object)forceEvadeStat).CurrentValue)
			{
				((VarStat<float>)(object)((Entity)base.parent).health.evadeStat).AddMod((VarStatMod<float>)(object)evadeMod);
			}
			finishedDashing = false;
			dashDurationMod.modValue = dashDuration;
			((VarStat<float>)(object)((Entity)base.parent).movement.dashDurationStat).AddMod((VarStatMod<float>)(object)dashDurationMod);
			((Entity)base.parent).movement.dashTimer = dashDuration;
			Vector2 val3 = ((base.parent.inputDevice == null) ? Vector2.zero : ((!base.parent.inputDevice.IsMouseDash) ? base.parent.GetInputVector(true, ((int)base.parent.inputDevice.inputScheme == 0 && ChaosInputDevice.lockControllerAim) ? true : false, true) : base.parent.GetInputVector(true, true, true)));
			((Entity)base.parent).movement.dashVector = val3;
			((Entity)base.parent).anim.Play(base.parent.DashAnimStr);
			if (showEffects && !cooldownReady)
			{
				PoolManager.GetPoolItem<DashAirBurst>().Burst(base.parent.attackOriginTrans.position, Vector2.op_Implicit(val3), true);
				base.parent.dustEmitter.EmitDirBurst(15, Globals.GetRotationVector(Vector2.op_Implicit(-val3)).z, -1f, -1f, -1f, (Vector3?)null);
				base.parent.dashTrails.SetActive(true);
			}
			if (playSFX)
			{
				SoundManager.PlayWithDistAndSPR("StandardDash", Vector2.op_Implicit(((Component)base.parent).transform.position), 1f);
			}
			((Entity)base.parent).TogglePreventFallCollider(false);
			base.parent.ToggleEnemyFloorCollisions(false);
			((VarStat<bool>)(object)((Entity)base.parent).airborneStat).AddMod((VarStatMod<bool>)(object)airborneMod);
		}

		public override void Update()
		{
			if (finishedDashing)
			{
				ExitTransition();
			}
		}

		public override void FixedUpdate()
		{
			if (!finishedDashing)
			{
				finishedDashing = ((Entity)base.parent).movement.DashToTarget((Vector2?)null, false, false, true);
			}
		}

		public override void OnExit()
		{
			base.OnExit();
			((VarStat<float>)(object)((Entity)base.parent).movement.dashDurationStat).RemoveMod(((VarStatMod<float>)(object)dashDurationMod).ID);
			DashFinished();
			if (((VarStat<bool>)(object)forceEvadeStat).CurrentValue)
			{
				((VarStat<float>)(object)((Entity)base.parent).health.evadeStat).RemoveMod((VarStatMod<float>)(object)evadeMod);
			}
		}

		public virtual void DashFinished()
		{
			base.parent.dashTrails.SetActive(false);
			((Entity)base.parent).TogglePreventFallCollider(true);
			((VarStat<bool>)(object)((Entity)base.parent).airborneStat).RemoveMod((VarStatMod<bool>)(object)airborneMod);
			base.parent.ToggleEnemyFloorCollisions(true);
			((Entity)base.parent).movement.EndMovement();
		}

		public virtual void ExitTransition()
		{
			base.fsm.ChangeState(SlideState.staticID, false);
		}
	}

	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static hook_Transition <>9__2_8;

		public static hook_AssignSkillSlot <>9__2_9;

		public static Action<Player, bool, bool, OutfitModStat> <>9__2_0;

		public static Func<bool, OutfitModStat, string> <>9__2_1;

		public static hook_SetEquipSlots <>9__2_2;

		public static Func<SkillState, bool> <>9__3_0;

		public static Func<Instruction, bool> <>9__5_1;

		public static Func<Instruction, bool> <>9__5_2;

		public static Func<Instruction, bool> <>9__5_3;

		public static Func<KeyValuePair<string, SkillState>, bool> <>9__5_4;

		public static Func<KeyValuePair<string, SkillState>, string> <>9__5_5;

		public static Func<List<string>, Player, List<string>> <>9__5_0;

		public static SkillApplyCondition <>9__7_0;

		internal void <Register>b__2_0(Player p, bool b1, bool b2, OutfitModStat mod)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Expected O, but got Unknown
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Expected O, but got Unknown
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Expected O, but got Unknown
			//IL_00a6: 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_00b1: Expected O, but got Unknown
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Expected O, but got Unknown
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Expected O, but got Unknown
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Expected O, but got Unknown
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Expected O, but got Unknown
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Expected O, but got Unknown
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Expected O, but got Unknown
			<>c__DisplayClass2_0 CS$<>8__locals0 = new <>c__DisplayClass2_0();
			CS$<>8__locals0.p = p;
			CS$<>8__locals0.run = (RunState)((Entity)CS$<>8__locals0.p).fsm.GetState("Run");
			hook_Update val = (hook_Update)delegate(orig_Update orig, Fall s)
			{
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Expected O, but got Unknown
				//IL_0082: Unknown result type (might be due to invalid IL or missing references)
				if (((ComponentBase)s).entityScript is Player && ((object)(Player)((ComponentBase)s).entityScript).Equals((object?)CS$<>8__locals0.p) && ((Entity)CS$<>8__locals0.p).fsm.currentStateName == "Run" && CS$<>8__locals0.run.moveSpeedApplied && s.CheckOnPit())
				{
					PoolManager.GetPoolItem<AirWalkEmitter>().EmitSingle((int?)1, (Vector3?)new Vector3((float)((ComponentBase)s).entityScript.lastTileCol, 0f - (float)((ComponentBase)s).entityScript.lastTileRow), (ParticleSystemOverride)null, (Vector3?)null, 0f, (float?)null);
				}
				else
				{
					orig.Invoke(s);
				}
			};
			hook_Update val2 = (hook_Update)delegate(orig_Update orig, RunState runstate)
			{
				orig.Invoke(runstate);
				if (((object)((State<Player>)(object)runstate).parent).Equals((object?)CS$<>8__locals0.p))
				{
					((Component)((Entity)((State<Player>)(object)runstate).parent).preventFallCollider).gameObject.SetActive(!runstate.moveSpeedApplied);
				}
			};
			hook_OnExit val3 = (hook_OnExit)delegate(orig_OnExit orig, RunState runstate)
			{
				orig.Invoke(runstate);
				if (((object)((State<Player>)(object)CS$<>8__locals0.run).parent).Equals((object?)CS$<>8__locals0.p))
				{
					((Component)((Entity)((State<Player>)(object)runstate).parent).preventFallCollider).gameObject.SetActive(true);
				}
			};
			hook_LoadInfoSkills val4 = (hook_LoadInfoSkills)delegate(orig_LoadInfoSkills orig, SpellBookUI self, SkillEquipType skill, ElementType elem)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_0004: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Invalid comparison between Unknown and I4
				//IL_006e: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self, skill, elem);
				if ((int)skill == 1 && (Object)(object)self.player == (Object)(object)CS$<>8__locals0.p)
				{
					foreach (SkillState value in self.player.skillsDict.Values)
					{
						if (!value.isDash && value.isMovementSkill && !value.isBasic)
						{
							self.AddSkillToInfoSkills(value, elem);
						}
					}
				}
			};
			hook_AssignPlayerSkill val5 = (hook_AssignPlayerSkill)delegate(orig_AssignPlayerSkill orig, SpellBookUI self, SBFocus focus)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Invalid comparison between Unknown and I4
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				if ((int)self.playerInfoSelectedType == 1 && (Object)(object)self.player == (Object)(object)CS$<>8__locals0.p && self.currentSkill.isMovementSkill)
				{
					ModifySkill(self.currentSkill, status: true);
				}
				return orig.Invoke(self, focus);
			};
			object obj = <>9__2_8;
			if (obj == null)
			{
				hook_Transition val6 = delegate(orig_Transition orig, SkillState self)
				{
					bool flag = orig.Invoke(self);
					if (!flag && self.isDash && !self.cooldownRef.Ready)
					{
						flag = ((DummyDash)(object)((Entity)((State<Player>)(object)self).parent).fsm.states[DummyDash.staticID]).Transition();
					}
					return flag;
				};
				<>9__2_8 = val6;
				obj = (object)val6;
			}
			hook_Transition val7 = (hook_Transition)obj;
			object obj2 = <>9__2_9;
			if (obj2 == null)
			{
				hook_AssignSkillSlot val8 = delegate(orig_AssignSkillSlot orig, Player self, int slot, string skill, bool setsig, bool sig)
				{
					if (self.assignedSkills[slot] != null && self.assignedSkills[slot].isDash && !(self.assignedSkills[slot] is BaseDashState))
					{
						ModifySkill(self.assignedSkills[slot], status: false);
					}
					orig.Invoke(self, slot, skill, setsig, sig);
				};
				<>9__2_9 = val8;
				obj2 = (object)val8;
			}
			hook_AssignSkillSlot val9 = (hook_AssignSkillSlot)obj2;
			if (b1)
			{
				if (!((Entity)CS$<>8__locals0.p).fsm.states.ContainsKey(DummyDash.staticID))
				{
					((Entity)CS$<>8__locals0.p).fsm.AddState((IState)(object)new DummyDash(((Entity)CS$<>8__locals0.p).fsm, CS$<>8__locals0.p));
				}
				Fall.Update += val;
				RunState.Update += val2;
				RunState.OnExit += val3;
				SpellBookUI.LoadInfoSkills += val4;
				SpellBookUI.AssignPlayerSkill += val5;
				SkillState.Transition += val7;
				Player.AssignSkillSlot += val9;
				Player.AnnounceSkillChanged += new hook_AnnounceSkillChanged(OnSkillChange);
				EnhanceDash.SetEventHandlers += new hook_SetEventHandlers(EmpowerDash);
				Player.RandomizeBuild += new Manipulator(RandomBuildCompat);
				FixSkillsToDash(CS$<>8__locals0.p);
				return;
			}
			Fall.Update -= val;
			RunState.Update -= val2;
			RunState.OnExit -= val3;
			SpellBookUI.LoadInfoSkills -= val4;
			SpellBookUI.AssignPlayerSkill -= val5;
			SkillState.Transition -= val7;
			Player.AssignSkillSlot -= val9;
			Player.AnnounceSkillChanged -= new hook_AnnounceSkillChanged(OnSkillChange);
			EnhanceDash.SetEventHandlers -= new hook_SetEventHandlers(EmpowerDash);
			Player.RandomizeBuild -= new Manipulator(RandomBuildCompat);
			int num = PlayerRoomUI.currentUI.spellBooks[CS$<>8__locals0.p.playerID].sbRef.skillEquipSlots[(SkillEquipType)1];
			if (PlayerRoomUI.CurrentUIExists && !(CS$<>8__locals0.p.assignedSkills[num] is BaseDashState))
			{
				ModifySkill(CS$<>8__locals0.p.assignedSkills[num], status: false);
				CS$<>8__locals0.p.AssignSkillSlot(num, DashState.staticID, false, false);
				CS$<>8__locals0.p.lowerHUD.cooldownUI.RefreshEntries();
				CS$<>8__locals0.p.newItemNoticeUI.Display(TextManager.GetSkillName(DashState.staticID), IconManager.GetSkillIcon(DashState.staticID), CooldownUI.GetKeySpriteFromSkillSlot(num, CS$<>8__locals0.p.inputDevice), true, false, false, true);
			}
		}

		internal bool <Register>b__2_8(orig_Transition orig, SkillState self)
		{
			bool flag = orig.Invoke(self);
			if (!flag && self.isDash && !self.cooldownRef.Ready)
			{
				flag = ((DummyDash)(object)((Entity)((State<Player>)(object)self).parent).fsm.states[DummyDash.staticID]).Transition();
			}
			return flag;
		}

		internal void <Register>b__2_9(orig_AssignSkillSlot orig, Player self, int slot, string skill, bool setsig, bool sig)
		{
			if (self.assignedSkills[slot] != null && self.assignedSkills[slot].isDash && !(self.assignedSkills[slot] is BaseDashState))
			{
				ModifySkill(self.assignedSkills[slot], status: false);
			}
			orig.Invoke(self, slot, skill, setsig, sig);
		}

		internal string <Register>b__2_1(bool b, OutfitModStat m)
		{
			return "- While at full speed,you can run over pits.\n- Your dash slot can hold any movement arcana.";
		}

		internal void <Register>b__2_2(orig_SetEquipSlots orig, SpellBookUI self, Player player)
		{
			orig.Invoke(self, player);
		}

		internal bool <FixSkillsToDash>b__3_0(SkillState s)
		{
			return s?.isDash ?? false;
		}

		internal bool <RandomBuildCompat>b__5_1(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdfld(x, typeof(Player).GetField("randSkillsDict"));
		}

		internal bool <RandomBuildCompat>b__5_2(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdcI4(x, 1);
		}

		internal bool <RandomBuildCompat>b__5_3(Instruction x)
		{
			MethodReference val = default(MethodReference);
			return ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val);
		}

		internal List<string> <RandomBuildCompat>b__5_0(List<string> list, Player player)
		{
			if (Collection.PlayerIsWearing(player, info.outfit.outfitID))
			{
				list.AddRange(from k in player.skillsDict
					where !k.Value.isDash && !k.Value.isBasic && k.Value.isMovementSkill
					select k into kvp
					select kvp.Key);
			}
			return list;
		}

		internal bool <RandomBuildCompat>b__5_4(KeyValuePair<string, SkillState> k)
		{
			return !k.Value.isDash && !k.Value.isBasic && k.Value.isMovementSkill;
		}

		internal string <RandomBuildCompat>b__5_5(KeyValuePair<string, SkillState> kvp)
		{
			return kvp.Key;
		}

		internal bool <EmpowerDash>b__7_0(SkillState s)
		{
			return s.isDash && !((State<Player>)(object)s).name.Contains("Dash");
		}
	}

	[CompilerGenerated]
	private sealed class <>c__DisplayClass2_0
	{
		public Player p;

		public RunState run;

		internal void <Register>b__3(orig_Update orig, Fall s)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			if (((ComponentBase)s).entityScript is Player && ((object)(Player)((ComponentBase)s).entityScript).Equals((object?)p) && ((Entity)p).fsm.currentStateName == "Run" && run.moveSpeedApplied && s.CheckOnPit())
			{
				PoolManager.GetPoolItem<AirWalkEmitter>().EmitSingle((int?)1, (Vector3?)new Vector3((float)((ComponentBase)s).entityScript.lastTileCol, 0f - (float)((ComponentBase)s).entityScript.lastTileRow), (ParticleSystemOverride)null, (Vector3?)null, 0f, (float?)null);
			}
			else
			{
				orig.Invoke(s);
			}
		}

		internal void <Register>b__4(orig_Update orig, RunState runstate)
		{
			orig.Invoke(runstate);
			if (((object)((State<Player>)(object)runstate).parent).Equals((object?)p))
			{
				((Component)((Entity)((State<Player>)(object)runstate).parent).preventFallCollider).gameObject.SetActive(!runstate.moveSpeedApplied);
			}
		}

		internal void <Register>b__5(orig_OnExit orig, RunState runstate)
		{
			orig.Invoke(runstate);
			if (((object)((State<Player>)(object)run).parent).Equals((object?)p))
			{
				((Component)((Entity)((State<Player>)(object)runstate).parent).preventFallCollider).gameObject.SetActive(true);
			}
		}

		internal void <Register>b__6(orig_LoadInfoSkills orig, SpellBookUI self, SkillEquipType skill, ElementType elem)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Invalid comparison between Unknown and I4
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, skill, elem);
			if ((int)skill != 1 || !((Object)(object)self.player == (Object)(object)p))
			{
				return;
			}
			foreach (SkillState value in self.player.skillsDict.Values)
			{
				if (!value.isDash && value.isMovementSkill && !value.isBasic)
				{
					self.AddSkillToInfoSkills(value, elem);
				}
			}
		}

		internal bool <Register>b__7(orig_AssignPlayerSkill orig, SpellBookUI self, SBFocus focus)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			if ((int)self.playerInfoSelectedType == 1 && (Object)(object)self.player == (Object)(object)p && self.currentSkill.isMovementSkill)
			{
				ModifySkill(self.currentSkill, status: true);
			}
			return orig.Invoke(self, focus);
		}
	}

	public static OutfitInfo info = new OutfitInfo();

	internal static List<string> chargeList = new List<string>();

	internal static void Register()
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Expected O, but got Unknown
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Expected O, but got Unknown
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Expected O, but got Unknown
		//IL_00f4: 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_00ff: Expected O, but got Unknown
		info.name = "Delivery";
		List<OutfitModStat> list = new List<OutfitModStat>
		{
			new OutfitModStat(Outfits.CustomModType, 0f, 0f, 0f, false),
			new OutfitModStat((OutfitModType)18, 0f, 0f, 0f, false)
		};
		list[1].multiModifier.modValue = 0.25f;
		info.outfit = new Outfit("COLLECT::courier", 3, list, true, false);
		info.customMod = delegate(Player p, bool b1, bool b2, OutfitModStat mod)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Expected O, but got Unknown
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Expected O, but got Unknown
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Expected O, but got Unknown
			//IL_00a6: 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_00b1: Expected O, but got Unknown
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Expected O, but got Unknown
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Expected O, but got Unknown
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Expected O, but got Unknown
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Expected O, but got Unknown
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Expected O, but got Unknown
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Expected O, but got Unknown
			RunState run = (RunState)((Entity)p).fsm.GetState("Run");
			hook_Update val2 = (hook_Update)delegate(orig_Update orig, Fall s)
			{
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Expected O, but got Unknown
				//IL_0082: Unknown result type (might be due to invalid IL or missing references)
				if (((ComponentBase)s).entityScript is Player && ((object)(Player)((ComponentBase)s).entityScript).Equals((object?)p) && ((Entity)p).fsm.currentStateName == "Run" && run.moveSpeedApplied && s.CheckOnPit())
				{
					PoolManager.GetPoolItem<AirWalkEmitter>().EmitSingle((int?)1, (Vector3?)new Vector3((float)((ComponentBase)s).entityScript.lastTileCol, 0f - (float)((ComponentBase)s).entityScript.lastTileRow), (ParticleSystemOverride)null, (Vector3?)null, 0f, (float?)null);
				}
				else
				{
					orig.Invoke(s);
				}
			};
			hook_Update val3 = (hook_Update)delegate(orig_Update orig, RunState runstate)
			{
				orig.Invoke(runstate);
				if (((object)((State<Player>)(object)runstate).parent).Equals((object?)p))
				{
					((Component)((Entity)((State<Player>)(object)runstate).parent).preventFallCollider).gameObject.SetActive(!runstate.moveSpeedApplied);
				}
			};
			hook_OnExit val4 = (hook_OnExit)delegate(orig_OnExit orig, RunState runstate)
			{
				orig.Invoke(runstate);
				if (((object)((State<Player>)(object)run).parent).Equals((object?)p))
				{
					((Component)((Entity)((State<Player>)(object)runstate).parent).preventFallCollider).gameObject.SetActive(true);
				}
			};
			hook_LoadInfoSkills val5 = (hook_LoadInfoSkills)delegate(orig_LoadInfoSkills orig, SpellBookUI self, SkillEquipType skill, ElementType elem)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_0004: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Invalid comparison between Unknown and I4
				//IL_006e: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self, skill, elem);
				if ((int)skill == 1 && (Object)(object)self.player == (Object)(object)p)
				{
					foreach (SkillState value in self.player.skillsDict.Values)
					{
						if (!value.isDash && value.isMovementSkill && !value.isBasic)
						{
							self.AddSkillToInfoSkills(value, elem);
						}
					}
				}
			};
			hook_AssignPlayerSkill val6 = (hook_AssignPlayerSkill)delegate(orig_AssignPlayerSkill orig, SpellBookUI self, SBFocus focus)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Invalid comparison between Unknown and I4
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				if ((int)self.playerInfoSelectedType == 1 && (Object)(object)self.player == (Object)(object)p && self.currentSkill.isMovementSkill)
				{
					ModifySkill(self.currentSkill, status: true);
				}
				return orig.Invoke(self, focus);
			};
			object obj2 = <>c.<>9__2_8;
			if (obj2 == null)
			{
				hook_Transition val7 = delegate(orig_Transition orig, SkillState self)
				{
					bool flag = orig.Invoke(self);
					if (!flag && self.isDash && !self.cooldownRef.Ready)
					{
						flag = ((DummyDash)(object)((Entity)((State<Player>)(object)self).parent).fsm.states[DummyDash.staticID]).Transition();
					}
					return flag;
				};
				<>c.<>9__2_8 = val7;
				obj2 = (object)val7;
			}
			hook_Transition val8 = (hook_Transition)obj2;
			object obj3 = <>c.<>9__2_9;
			if (obj3 == null)
			{
				hook_AssignSkillSlot val9 = delegate(orig_AssignSkillSlot orig, Player self, int slot, string skill, bool setsig, bool sig)
				{
					if (self.assignedSkills[slot] != null && self.assignedSkills[slot].isDash && !(self.assignedSkills[slot] is BaseDashState))
					{
						ModifySkill(self.assignedSkills[slot], status: false);
					}
					orig.Invoke(self, slot, skill, setsig, sig);
				};
				<>c.<>9__2_9 = val9;
				obj3 = (object)val9;
			}
			hook_AssignSkillSlot val10 = (hook_AssignSkillSlot)obj3;
			if (b1)
			{
				if (!((Entity)p).fsm.states.ContainsKey(DummyDash.staticID))
				{
					((Entity)p).fsm.AddState((IState)(object)new DummyDash(((Entity)p).fsm, p));
				}
				Fall.Update += val2;
				RunState.Update += val3;
				RunState.OnExit += val4;
				SpellBookUI.LoadInfoSkills += val5;
				SpellBookUI.AssignPlayerSkill += val6;
				SkillState.Transition += val8;
				Player.AssignSkillSlot += val10;
				Player.AnnounceSkillChanged += new hook_AnnounceSkillChanged(OnSkillChange);
				EnhanceDash.SetEventHandlers += new hook_SetEventHandlers(EmpowerDash);
				Player.RandomizeBuild += new Manipulator(RandomBuildCompat);
				FixSkillsToDash(p);
			}
			else
			{
				Fall.Update -= val2;
				RunState.Update -= val3;
				RunState.OnExit -= val4;
				SpellBookUI.LoadInfoSkills -= val5;
				SpellBookUI.AssignPlayerSkill -= val6;
				SkillState.Transition -= val8;
				Player.AssignSkillSlot -= val10;
				Player.AnnounceSkillChanged -= new hook_AnnounceSkillChanged(OnSkillChange);
				EnhanceDash.SetEventHandlers -= new hook_SetEventHandlers(EmpowerDash);
				Player.RandomizeBuild -= new Manipulator(RandomBuildCompat);
				int num = PlayerRoomUI.currentUI.spellBooks[p.playerID].sbRef.skillEquipSlots[(SkillEquipType)1];
				if (PlayerRoomUI.CurrentUIExists && !(p.assignedSkills[num] is BaseDashState))
				{
					ModifySkill(p.assignedSkills[num], status: false);
					p.AssignSkillSlot(num, DashState.staticID, false, false);
					p.lowerHUD.cooldownUI.RefreshEntries();
					p.newItemNoticeUI.Display(TextManager.GetSkillName(DashState.staticID), IconManager.GetSkillIcon(DashState.staticID), CooldownUI.GetKeySpriteFromSkillSlot(num, p.inputDevice), true, false, false, true);
				}
			}
		};
		info.customDesc = (bool b, OutfitModStat m) => "- While at full speed,you can run over pits.\n- Your dash slot can hold any movement arcana.";
		Outfits.Register(info);
		object obj = <>c.<>9__2_2;
		if (obj == null)
		{
			hook_SetEquipSlots val = delegate(orig_SetEquipSlots orig, SpellBookUI self, Player player)
			{
				orig.Invoke(self, player);
			};
			<>c.<>9__2_2 = val;
			obj = (object)val;
		}
		SpellBookUI.SetEquipSlots += (hook_SetEquipSlots)obj;
	}

	internal static void FixSkillsToDash(Player p)
	{
		if (!Object.op_Implicit((Object)(object)p) || p.assignedSkills == null || p.assignedSkills.Any((SkillState s) => s?.isDash ?? false))
		{
			return;
		}
		for (int i = 0; i < 6; i++)
		{
			if (p.assignedSkills[i].isMovementSkill)
			{
				ModifySkill(p.assignedSkills[i], status: true);
				break;
			}
		}
	}

	internal static void ModifySkill(SkillState s, bool status)
	{
		if (status)
		{
			s.isDash = true;
			if (!s.isChargeSkill)
			{
				s.InitChargeSkillSettings(1, 0f, s.skillData, s);
				chargeList.Add(((State<Player>)(object)s).name);
			}
		}
		else
		{
			s.isDash = false;
			if (chargeList.Contains(((State<Player>)(object)s).name) && s.cooldownRef.MaxChargeCount == 1)
			{
				s.isChargeSkill = false;
			}
		}
	}

	internal static void RandomBuildCompat(ILContext il)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		ILCursor val = new ILCursor(il);
		MethodReference val2 = default(MethodReference);
		if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3]
		{
			(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(Player).GetField("randSkillsDict")),
			(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1),
			(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val2)
		}))
		{
			return;
		}
		val.Emit(OpCodes.Ldarg_0);
		val.EmitDelegate<Func<List<string>, Player, List<string>>>((Func<List<string>, Player, List<string>>)delegate(List<string> list, Player player)
		{
			if (Collection.PlayerIsWearing(player, info.outfit.outfitID))
			{
				list.AddRange(from k in player.skillsDict
					where !k.Value.isDash && !k.Value.isBasic && k.Value.isMovementSkill
					select k into kvp
					select kvp.Key);
			}
			return list;
		});
	}

	internal static void OnSkillChange(orig_AnnounceSkillChanged orig, Player self, SkillState skill)
	{
		orig.Invoke(self, skill);
		if (Collection.PlayerIsWearing(self, info.outfit.outfitID))
		{
			FixSkillsToDash(self);
		}
	}

	internal static void EmpowerDash(orig_SetEventHandlers orig, EnhanceDash self, bool status)
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Expected O, but got Unknown
		orig.Invoke(self, status);
		NumVarStatMod cdMod = self.cdMod;
		Player parentPlayer = ((Item)self).parentPlayer;
		object obj = <>c.<>9__7_0;
		if (obj == null)
		{
			SkillApplyCondition val = (SkillState s) => s.isDash && !((State<Player>)(object)s).name.Contains("Dash");
			<>c.<>9__7_0 = val;
			obj = (object)val;
		}
		Player.ModifySkills(cdMod, parentPlayer, "cooldown", (SkillApplyCondition)obj, status);
	}
}
internal static class NoxOutfit
{
	public static OutfitInfo info = new OutfitInfo();

	internal static hook_IsUnlocked unquestioner = (hook_IsUnlocked)((orig_IsUnlocked orig, string s, bool b) => orig.Invoke(s, b) || LootManager.completeItemDict[s].isCursed);

	internal static hook_RemoveItem dropper = (hook_RemoveItem)delegate(orig_RemoveItem orig, Inventory self, string s, bool b3, bool b4)
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Expected O, but got Unknown
		if (!b3 && LootManager.completeItemDict[s].isCursed && self.parentEntity is Player && Collection.PlayerIsWearing((Player)self.parentEntity, "collect::nox"))
		{
			b3 = true;
		}
		return orig.Invoke(self, s, b3, b4);
	};

	internal static Manipulator giver = (Manipulator)delegate(ILContext il)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		ILCursor val3 = new ILCursor(il);
		ILLabel val4 = default(ILLabel);
		if (val3.TryGotoNext(new Func<Instruction, bool>[2]
		{
			(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(Item).GetField("isCursed", (BindingFlags)(-1))),
			(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val4)
		}))
		{
			int index2 = val3.Index;
			val3.Index = index2 + 1;
			val3.Emit(OpCodes.Ldarg_0);
			val3.EmitDelegate<Func<bool, Player, bool>>((Func<bool, Player, bool>)((bool b, Player p) => b && Object.op_Implicit((Object)(object)p) && !Collection.PlayerIsWearing(p, "collect::nox")));
		}
	};

	internal static Manipulator bossRush = (Manipulator)delegate(ILContext il)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Expected O, but got Unknown
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		ILCursor val = new ILCursor(il);
		int playerIndex = -1;
		ILLabel val2 = default(ILLabel);
		if (val.TryGotoNext(new Func<Instruction, bool>[2]
		{
			(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref playerIndex),
			(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(Entity), "inventory")
		}) && val.TryGotoNext(new Func<Instruction, bool>[2]
		{
			(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(Item), "isCursed"),
			(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val2)
		}))
		{
			val.Emit(OpCodes.Dup);
			int index = val.Index;
			val.Index = index + 1;
			val.Emit(OpCodes.Ldloc, playerIndex);
			val.EmitDelegate<Func<Item, bool, Player, bool>>((Func<Item, bool, Player, bool>)((Item item, bool cursed, Player player) => cursed && (!Collection.PlayerIsWearing(player, "collect::nox") || item.ID != player.designatedItemID)));
		}
	};

	internal static void Register()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Expected O, but got Unknown
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Expected O, but got Unknown
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Expected O, but got Unknown
		info.name = "Risk";
		info.outfit = new Outfit("collect::nox", 21, new List<OutfitModStat>
		{
			new OutfitModStat(Outfits.CustomModType, 0f, 0f, 0f, false),
			new OutfitModStat((OutfitModType)18, 0f, 0f, 0f, false)
		}, true, false);
		info.customMod = delegate(Player p, bool b1, bool b2, OutfitModStat modifier)
		{
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Expected O, but got Unknown
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Expected O, but got Unknown
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			if (b1)
			{
				RelicChestUI.LoadPlayerRelics += new hook_LoadPlayerRelics(NoxHook);
				Item.IsUnlocked += unquestioner;
				Inventory.RemoveItem += dropper;
				RushRunMod.OnLevelWasLoaded += bossRush;
				Player.GiveDesignatedItem += giver;
				LootManager.cursedItemIDList.Remove(BankLoan.staticID);
				Player.outfitEquipActualEventHandlers = (OutfitEquipActualEventHandler)Delegate.Combine((Delegate?)(object)Player.outfitEquipActualEventHandlers, (Delegate?)new OutfitEquipActualEventHandler(OnOutfitChange));
			}
			else
			{
				RelicChestUI.LoadPlayerRelics -= new hook_LoadPlayerRelics(NoxHook);
				Item.IsUnlocked -= unquestioner;
				Inventory.RemoveItem -= dropper;
				RushRunMod.OnLevelWasLoaded -= bossRush;
				Player.GiveDesignatedItem -= giver;
				LootManager.cursedItemIDList.Add(BankLoan.staticID);
				Player.outfitEquipActualEventHandlers = (OutfitEquipActualEventHandler)Delegate.Remove((Delegate?)(object)Player.outfitEquipActualEventHandlers, (Delegate?)new OutfitEquipActualEventHandler(OnOutfitChange));
			}
		};
		info.customDesc = (bool b, OutfitModStat m) => "Allows you to choose <color=#FF0000>cursed</color> relics from Mimi and also drop <color=#FF0000>cursed</color> relics at will!";
		Outfits.Register(info);
	}

	internal static void OnOutfitChange(Player p, string outfitID)
	{
		if (Item.IsCursedItem(p.designatedItemID) && outfitID != info.outfit.outfitID && !RunData.runStarted)
		{
			((Entity)p).inventory.RemoveItem(p.designatedItemID, true, true);
			p.GiveDesignatedItem("default");
			p.newItemNoticeUI.Display(TextManager.GetItemName(p.designatedItemID), IconManager.GetItemIcon(p.designatedItemID), (Sprite)null, false, false, false, true);
		}
	}

	internal static void NoxHook(orig_LoadPlayerRelics orig, RelicChestUI self)
	{
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: 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_00ed: 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_012a: Unknown result type (might be due to invalid IL or missing references)
		orig.Invoke(self);
		if (!Collection.PlayerIsWearing(self.currentPlayer, "collect::nox"))
		{
			return;
		}
		foreach (string cursedItemID in LootManager.cursedItemIDList)
		{
			Category category = LootManager.completeItemDict[cursedItemID].category;
			if (!self.categoryInfoDict[category].idList.Contains(cursedItemID))
			{
				self.categoryInfoDict[category].idList.Add(cursedItemID);
				CategoryInfo obj = self.categoryInfoDict[category];
				obj.unlockedCount++;
			}
		}
		foreach (string cursedHubOnlyItemID in LootManager.cursedHubOnlyItemIDList)
		{
			Category category2 = LootManager.completeItemDict[cursedHubOnlyItemID].category;
			if (!self.categoryInfoDict[category2].idList.Contains(cursedHubOnlyItemID))
			{
				self.categoryInfoDict[category2].idList.Add(cursedHubOnlyItemID);
				CategoryInfo obj2 = self.categoryInfoDict[category2];
				obj2.unlockedCount++;
			}
		}
	}
}