Decompiled source of AdvancedMovementPack v1.2.1

AdvancedMovementPack/AdvancedMovementPack/AdvancedMovementPack.dll

Decompiled 2 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using AdvancedMovementPack.Cards;
using BepInEx;
using HarmonyLib;
using UnboundLib.Cards;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("AdvancedMovementPack")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AdvancedMovementPack")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1926c2cb-c879-4017-a6a3-1c0717de1dd9")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace AdvancedMovementPack
{
	[BepInPlugin("com.joel.rounds.advancedmovementpack", "Advanced Movement Pack", "1.2.1")]
	[BepInProcess("Rounds.exe")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class AdvancedMovementPack : BaseUnityPlugin
	{
		private const string ModId = "com.joel.rounds.advancedmovementpack";

		private const string ModName = "Advanced Movement Pack";

		private const string ModVersion = "1.2.1";

		private void Awake()
		{
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			CustomCard.BuildCard<SwiftShrink>();
			CustomCard.BuildCard<Geppo>();
			CustomCard.BuildCard<Grapple>();
			CustomCard.BuildCard<Momentum>();
			CustomCard.BuildCard<Hoverboots>();
			CustomCard.BuildCard<BlockStep>();
			CustomCard.BuildCard<Forcefield>();
			CustomCard.BuildCard<Hypno>();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Advanced Movement Pack 1.2.1 loaded");
			string[] manifestResourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames();
			foreach (string text in manifestResourceNames)
			{
				Debug.Log((object)("[AdvancedMovementPack] Resource: " + text));
			}
			new Harmony("com.joel.rounds.advancedmovementpack.forcefield").PatchAll();
		}
	}
}
namespace AdvancedMovementPack.Cards
{
	public class Forcefield : CustomCard
	{
		protected override string GetTitle()
		{
			return "Forcefield";
		}

		protected override string GetDescription()
		{
			return "Blocking creates a 3s forcefield with 500% temporary max HP.";
		}

		public override string GetModName()
		{
			return "Advanced Movement Pack";
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)2;
		}

		protected override GameObject GetCardArt()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AdvancedMovementPack.Resources.Forcefield.png");
			if (stream == null)
			{
				Debug.LogError("[Forcefield] Resource not found!");
				return new GameObject("ForcefieldArt_Missing");
			}
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			ImageConversion.LoadImage(val, array);
			Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f);
			GameObject val2 = new GameObject("ForcefieldArt");
			Image obj = val2.AddComponent<Image>();
			obj.sprite = sprite;
			obj.preserveAspect = true;
			val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width * 1.2f, (float)((Texture)val).height * 1.2f);
			((Object)val2).hideFlags = (HideFlags)61;
			return val2;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats)
		{
			ForcefieldEffect forcefieldEffect = ((Component)player).gameObject.GetComponent<ForcefieldEffect>();
			if ((Object)(object)forcefieldEffect == (Object)null)
			{
				forcefieldEffect = ((Component)player).gameObject.AddComponent<ForcefieldEffect>();
			}
			forcefieldEffect.block = block;
			forcefieldEffect.data = data;
			block.cdAdd += 4f;
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats)
		{
			ForcefieldEffect component = ((Component)player).gameObject.GetComponent<ForcefieldEffect>();
			if ((Object)(object)component != (Object)null)
			{
				component.EndEffect();
				Object.Destroy((Object)(object)component);
			}
			block.cdAdd -= 4f;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "Block cooldown",
					amount = "+4s"
				}
			};
		}
	}
	public class ForcefieldEffect : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <ForcefieldRoutine>d__12 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public ForcefieldEffect <>4__this;

			private float <t>5__2;

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

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

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

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

			private bool MoveNext()
			{
				//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_0104: Unknown result type (might be due to invalid IL or missing references)
				//IL_010a: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				ForcefieldEffect forcefieldEffect = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					forcefieldEffect.originalMaxHP = forcefieldEffect.data.maxHealth;
					forcefieldEffect.hpBefore = forcefieldEffect.data.health;
					forcefieldEffect.data.maxHealth = forcefieldEffect.originalMaxHP * 5f;
					forcefieldEffect.data.health = forcefieldEffect.data.maxHealth;
					if ((Object)(object)forcefieldEffect.bubble == (Object)null)
					{
						forcefieldEffect.bubble = forcefieldEffect.CreateBubbleCircle();
					}
					forcefieldEffect.PlaySaberStart();
					forcefieldEffect.StartHum();
					<t>5__2 = 0f;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (<t>5__2 < 4f && !((Object)(object)forcefieldEffect.bubble == (Object)null))
				{
					forcefieldEffect.bubble.transform.position = ((Component)forcefieldEffect).transform.position;
					float num2 = 1f + Mathf.Sin(Time.time * 6f) * 0.05f;
					forcefieldEffect.bubble.transform.localScale = Vector3.one * 1.2f * num2;
					if (forcefieldEffect.data.dead)
					{
						return false;
					}
					<t>5__2 += Time.deltaTime;
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				forcefieldEffect.EndEffect();
				forcefieldEffect.activeRoutine = null;
				return false;
			}

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

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

		public Block block;

		public CharacterData data;

		private GameObject bubble;

		private Coroutine activeRoutine;

		private AudioSource humSource;

		private const float Duration = 4f;

		private const float VisualBaseScale = 1.2f;

		private float originalMaxHP;

		private float hpBefore;

		private void Start()
		{
			if ((Object)(object)block != (Object)null)
			{
				Block obj = block;
				obj.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(obj.BlockAction, new Action<BlockTriggerType>(OnBlock));
			}
		}

		private void OnDestroy()
		{
			if ((Object)(object)block != (Object)null)
			{
				Block obj = block;
				obj.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(obj.BlockAction, new Action<BlockTriggerType>(OnBlock));
			}
			EndEffect();
		}

		private void OnBlock(BlockTriggerType trigger)
		{
			if (activeRoutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(activeRoutine);
			}
			activeRoutine = ((MonoBehaviour)this).StartCoroutine(ForcefieldRoutine());
		}

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

		public void EndEffect()
		{
			if ((Object)(object)data != (Object)null)
			{
				data.maxHealth = originalMaxHP;
				if (data.health > 0f)
				{
					data.health = Mathf.Min(hpBefore, originalMaxHP);
				}
			}
			if ((Object)(object)bubble != (Object)null)
			{
				Object.Destroy((Object)(object)bubble);
			}
			bubble = null;
			StopHum();
		}

		public void OnDeath()
		{
			if ((Object)(object)data != (Object)null)
			{
				data.maxHealth = originalMaxHP;
			}
			if ((Object)(object)bubble != (Object)null)
			{
				Object.Destroy((Object)(object)bubble);
			}
			bubble = null;
			StopHum();
			if (activeRoutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(activeRoutine);
				activeRoutine = null;
			}
		}

		private GameObject CreateBubbleCircle()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected O, but got Unknown
			//IL_006c: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			GameObject val = new GameObject("ForcefieldBubble");
			val.transform.position = ((Component)this).transform.position;
			SpriteRenderer obj = val.AddComponent<SpriteRenderer>();
			obj.sprite = MakeCircleSprite(128, new Color(0.6f, 0.9f, 1f, 0.9f));
			((Renderer)obj).material = new Material(Shader.Find("Sprites/Default"));
			((Renderer)obj).sortingOrder = 50;
			val.transform.localScale = Vector3.one * 1.2f;
			return val;
		}

		private Sprite MakeCircleSprite(int size, Color color)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(size, size);
			float num = (float)size / 2f;
			for (int i = 0; i < size; i++)
			{
				for (int j = 0; j < size; j++)
				{
					float num2 = (float)j - num;
					float num3 = (float)i - num;
					float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3);
					val.SetPixel(j, i, (num4 <= num) ? color : Color.clear);
				}
			}
			val.Apply();
			return Sprite.Create(val, new Rect(0f, 0f, (float)size, (float)size), new Vector2(0.5f, 0.5f), 100f);
		}

		private void PlaySaberStart()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			GameObject val = new GameObject("Forcefield_Swoosh");
			AudioSource val2 = val.AddComponent<AudioSource>();
			val2.spatialBlend = 0f;
			val2.clip = CreateSwooshClip(0.18f);
			val2.volume = 0.45f;
			val2.Play();
			Object.Destroy((Object)val, val2.clip.length + 0.05f);
		}

		private void StartHum()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			StopHum();
			GameObject val = new GameObject("Forcefield_Hum");
			humSource = val.AddComponent<AudioSource>();
			humSource.spatialBlend = 0f;
			humSource.loop = true;
			humSource.volume = 0.15f;
			humSource.clip = CreateHumClip(0.35f);
			humSource.Play();
		}

		private void StopHum()
		{
			if ((Object)(object)humSource != (Object)null)
			{
				humSource.Stop();
				Object.Destroy((Object)(object)((Component)humSource).gameObject);
				humSource = null;
			}
		}

		private AudioClip CreateSwooshClip(float duration)
		{
			int num = 44100;
			int num2 = Mathf.CeilToInt((float)num * duration);
			float[] array = new float[num2];
			float num3 = 200f;
			float num4 = 1200f;
			for (int i = 0; i < num2; i++)
			{
				float num5 = (float)i / (float)num;
				float num6 = Mathf.Lerp(num3, num4, num5);
				float num7 = Mathf.Clamp01(1f - num5 * 4f);
				array[i] = Mathf.Sin((float)Math.PI * 2f * num6 * num5) * num7 * 0.9f;
			}
			AudioClip obj = AudioClip.Create("FF_Swoosh", num2, 1, num, false);
			obj.SetData(array, 0);
			return obj;
		}

		private AudioClip CreateHumClip(float duration)
		{
			int num = 44100;
			int num2 = Mathf.CeilToInt((float)num * duration);
			float[] array = new float[num2];
			float num3 = 140f;
			float num4 = 280f;
			for (int i = 0; i < num2; i++)
			{
				float num5 = (float)i / (float)num;
				float num6 = Mathf.Sin((float)Math.PI * 2f * num3 * num5);
				float num7 = Mathf.Sin((float)Math.PI * 2f * num4 * num5) * 0.4f;
				float num8 = Mathf.Sin((float)Math.PI * 6f * num5) * 0.15f;
				array[i] = (num6 + num7) * (0.6f + num8);
			}
			AudioClip obj = AudioClip.Create("FF_Hum", num2, 1, num, false);
			obj.SetData(array, 0);
			return obj;
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "RPCA_Die")]
	internal static class Forcefield_DeathPatch
	{
		private static void Prefix(HealthHandler __instance)
		{
			ForcefieldEffect component = ((Component)__instance).GetComponent<ForcefieldEffect>();
			if ((Object)(object)component != (Object)null)
			{
				component.OnDeath();
			}
		}
	}
	public class Geppo : CustomCard
	{
		public class GeppoHandler : MonoBehaviour
		{
			public float originalJump;

			public int cardCount;
		}

		protected override string GetTitle()
		{
			return "Geppo";
		}

		protected override string GetDescription()
		{
			return "Soar! Gain double jump height.";
		}

		protected override GameObject GetCardArt()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AdvancedMovementPack.Resources.Geppo.png");
			if (stream == null)
			{
				Debug.LogError("[Geppo] Resource not found!");
				return new GameObject("GeppoArt_Missing");
			}
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			ImageConversion.LoadImage(val, array);
			Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f);
			GameObject val2 = new GameObject("GeppoArt");
			Image obj = val2.AddComponent<Image>();
			obj.sprite = sprite;
			obj.preserveAspect = true;
			val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width * 1.2f, (float)((Texture)val).height * 1.2f);
			((Object)val2).hideFlags = (HideFlags)61;
			return val2;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)0;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)2;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Jump Height",
					amount = "+60%",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			GeppoHandler geppoHandler = ((Component)player).gameObject.GetComponent<GeppoHandler>();
			if ((Object)(object)geppoHandler == (Object)null)
			{
				geppoHandler = ((Component)player).gameObject.AddComponent<GeppoHandler>();
				geppoHandler.originalJump = characterStats.jump;
			}
			geppoHandler.cardCount++;
			characterStats.jump = geppoHandler.originalJump * Mathf.Pow(1.6f, (float)geppoHandler.cardCount);
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			GeppoHandler component = ((Component)player).gameObject.GetComponent<GeppoHandler>();
			if ((Object)(object)component != (Object)null)
			{
				component.cardCount--;
				if (component.cardCount <= 0)
				{
					characterStats.jump = component.originalJump;
					Object.Destroy((Object)(object)component);
				}
				else
				{
					characterStats.jump = component.originalJump * Mathf.Pow(2f, (float)component.cardCount);
				}
			}
		}

		public override string GetModName()
		{
			return "Advanced Movement Pack";
		}
	}
	public class BlockStep : CustomCard
	{
		protected override string GetTitle()
		{
			return "Block Step";
		}

		protected override string GetDescription()
		{
			return "Blocking creates a temporary ice platform under you.";
		}

		public override string GetModName()
		{
			return "Advanced Movement Pack";
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)2;
		}

		protected override GameObject GetCardArt()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AdvancedMovementPack.Resources.BlockStep.png");
			if (stream == null)
			{
				Debug.LogError("[BlockStep] Resource not found!");
				return new GameObject("BlockStepArt_Missing");
			}
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			ImageConversion.LoadImage(val, array);
			Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f);
			GameObject val2 = new GameObject("BlockStepArt");
			Image obj = val2.AddComponent<Image>();
			obj.sprite = sprite;
			obj.preserveAspect = true;
			val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width * 1.2f, (float)((Texture)val).height * 1.2f);
			((Object)val2).hideFlags = (HideFlags)61;
			return val2;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats)
		{
			((Component)player).gameObject.GetOrAddComponent<BlockStepEffect>().block = block;
			block.cdAdd -= 1f;
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats)
		{
			BlockStepEffect component = ((Component)player).gameObject.GetComponent<BlockStepEffect>();
			if ((Object)(object)component != (Object)null)
			{
				component.Cleanup();
				Object.Destroy((Object)(object)component);
			}
			block.cdAdd += 1f;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Block cooldown",
					amount = "-1s",
					simepleAmount = (SimpleAmount)0
				}
			};
		}
	}
	public class BlockStepEffect : MonoBehaviour
	{
		private class PlatformLifetime : MonoBehaviour
		{
			[CompilerGenerated]
			private sealed class <LifetimeRoutine>d__3 : IEnumerator<object>, IDisposable, IEnumerator
			{
				private int <>1__state;

				private object <>2__current;

				public PlatformLifetime <>4__this;

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

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

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

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

				private bool MoveNext()
				{
					//IL_0045: Unknown result type (might be due to invalid IL or missing references)
					//IL_004f: Expected O, but got Unknown
					int num = <>1__state;
					PlatformLifetime platformLifetime = <>4__this;
					switch (num)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						platformLifetime.parent.PlayPlatformSound(880f, 0.1f);
						<>2__current = (object)new WaitForSeconds(platformLifetime.block.cooldown - 1.5f);
						<>1__state = 1;
						return true;
					case 1:
						<>1__state = -1;
						platformLifetime.parent.PlayPlatformSound(220f, 0.15f);
						Object.Destroy((Object)(object)((Component)platformLifetime).gameObject);
						return false;
					}
				}

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

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

			private Block block;

			private BlockStepEffect parent;

			public void Init(Block block, BlockStepEffect parent)
			{
				this.block = block;
				this.parent = parent;
				((MonoBehaviour)this).StartCoroutine(LifetimeRoutine());
			}

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

		public Block block;

		private GameObject platform;

		private void Start()
		{
			Block obj = block;
			obj.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(obj.BlockAction, new Action<BlockTriggerType>(OnBlock));
		}

		public void Cleanup()
		{
			Block obj = block;
			obj.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(obj.BlockAction, new Action<BlockTriggerType>(OnBlock));
			if ((Object)(object)platform != (Object)null)
			{
				Object.Destroy((Object)(object)platform);
			}
			platform = null;
		}

		private void OnDestroy()
		{
			Cleanup();
		}

		private void OnBlock(BlockTriggerType trigger)
		{
			//IL_0026: 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: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)platform == (Object)null)
			{
				CreatePlatform();
			}
			else
			{
				platform.transform.position = ((Component)this).transform.position + Vector3.down * 0.5f;
			}
		}

		private void CreatePlatform()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Expected O, but got Unknown
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			platform = new GameObject("IcePlatform");
			platform.transform.position = ((Component)this).transform.position + Vector3.down * 0.5f;
			platform.AddComponent<BoxCollider2D>().size = new Vector2(2f, 0.6f);
			platform.AddComponent<Rigidbody2D>().bodyType = (RigidbodyType2D)1;
			SpriteRenderer obj = platform.AddComponent<SpriteRenderer>();
			obj.sprite = MakeRectangleSprite(64, 64);
			((Renderer)obj).material = new Material(Shader.Find("Sprites/Default"));
			obj.color = Color.white;
			platform.AddComponent<PlatformLifetime>().Init(block, this);
		}

		private void PlayPlatformSound(float frequency, float duration)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			GameObject val = new GameObject("PlatformSound");
			AudioSource val2 = val.AddComponent<AudioSource>();
			val2.spatialBlend = 0f;
			int num = 44100;
			int num2 = Mathf.CeilToInt((float)num * duration);
			AudioClip val3 = AudioClip.Create("SineWave", num2, 1, num, false);
			float[] array = new float[num2];
			for (int i = 0; i < num2; i++)
			{
				array[i] = Mathf.Sin((float)Math.PI * 2f * frequency * (float)i / (float)num) * 0.3f;
			}
			val3.SetData(array, 0);
			val2.clip = val3;
			val2.Play();
			Object.Destroy((Object)(object)val, duration + 0.1f);
		}

		private Sprite MakeRectangleSprite(int width, int height)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(width, height);
			for (int i = 0; i < height; i++)
			{
				float num = Mathf.Lerp(0f, 1f, (float)i / (float)(height - 1));
				for (int j = 0; j < width; j++)
				{
					val.SetPixel(j, i, new Color(0.6f, 0.85f, 1f, num));
				}
			}
			val.Apply();
			Rect val2 = default(Rect);
			((Rect)(ref val2))..ctor(0f, 0f, (float)width, (float)height / 2.2f);
			Vector2 val3 = default(Vector2);
			((Vector2)(ref val3))..ctor(0.5f, 0.5f);
			return Sprite.Create(val, val2, val3, 32f);
		}
	}
	public static class ComponentExtensions
	{
		public static T GetOrAddComponent<T>(this GameObject go) where T : Component
		{
			return go.GetComponent<T>() ?? go.AddComponent<T>();
		}
	}
	public class Hoverboots : CustomCard
	{
		protected override string GetTitle()
		{
			return "Hoverboots";
		}

		protected override string GetDescription()
		{
			return "Hold jump in the air to hover and glide. -10% movement speed.";
		}

		protected override GameObject GetCardArt()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AdvancedMovementPack.Resources.Hoverboots.png");
			if (stream == null)
			{
				Debug.LogError("[Hoverboots] Resource not found!");
				return new GameObject("HoverbootsArt_Missing");
			}
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			ImageConversion.LoadImage(val, array);
			Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f);
			GameObject val2 = new GameObject("HoverbootsArt");
			Image obj = val2.AddComponent<Image>();
			obj.sprite = sprite;
			obj.preserveAspect = true;
			val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width * 1.2f, (float)((Texture)val).height * 1.2f);
			((Object)val2).hideFlags = (HideFlags)61;
			return val2;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)2;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)8;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Hover",
					amount = "a bunch of",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Movement Speed",
					amount = "-10%",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if ((Object)(object)((Component)player).gameObject.GetComponent<HoverbootsHandler>() == (Object)null)
			{
				((Component)player).gameObject.AddComponent<HoverbootsHandler>();
			}
			characterStats.movementSpeed *= 0.9f;
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			HoverbootsHandler component = ((Component)player).gameObject.GetComponent<HoverbootsHandler>();
			if ((Object)(object)component != (Object)null)
			{
				if ((Object)(object)component.hoverParticles != (Object)null)
				{
					component.hoverParticles.Stop();
					Object.Destroy((Object)(object)((Component)component.hoverParticles).gameObject);
				}
				if ((Object)(object)gravity != (Object)null)
				{
					gravity.gravityForce = component.originalGravityForce;
				}
				Object.Destroy((Object)(object)component);
			}
		}

		public override string GetModName()
		{
			return "Advanced Movement Pack";
		}
	}
	public class HoverbootsHandler : MonoBehaviour
	{
		private Player player;

		private CharacterData data;

		private Gravity gravity;

		public float originalGravityForce;

		private Traverse velocityTraverse;

		public ParticleSystem hoverParticles;

		private const float particleYOffset = -1.2f;

		private void Start()
		{
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Expected O, but got Unknown
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: 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)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Expected O, but got Unknown
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: 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_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Expected O, but got Unknown
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			player = ((Component)this).GetComponent<Player>();
			data = ((Component)this).GetComponent<CharacterData>();
			gravity = ((Component)this).GetComponent<Gravity>();
			if ((Object)(object)gravity != (Object)null)
			{
				originalGravityForce = gravity.gravityForce;
			}
			if ((Object)(object)data != (Object)null && (Object)(object)data.playerVel != (Object)null)
			{
				velocityTraverse = Traverse.Create((object)data.playerVel).Field("velocity");
			}
			GameObject val = new GameObject("HoverParticles");
			val.transform.SetParent(((Component)this).transform);
			val.transform.localPosition = new Vector3(0f, -1.2f, 0f);
			hoverParticles = val.AddComponent<ParticleSystem>();
			MainModule main = hoverParticles.main;
			((MainModule)(ref main)).startSize = new MinMaxCurve(0.6f, 1.2f);
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.8f);
			((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0.15f);
			((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
			EmissionModule emission = hoverParticles.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(150f);
			ShapeModule shape = hoverParticles.shape;
			((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)5;
			((ShapeModule)(ref shape)).scale = new Vector3(1.2f, 0.3f, 0f);
			ColorOverLifetimeModule colorOverLifetime = hoverParticles.colorOverLifetime;
			((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true;
			Gradient val2 = new Gradient();
			val2.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
			{
				new GradientColorKey(Color.white, 0f),
				new GradientColorKey(Color.gray * 0.6f, 1f)
			}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
			{
				new GradientAlphaKey(0.5f, 0f),
				new GradientAlphaKey(0f, 1f)
			});
			((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val2);
			ParticleSystemRenderer component = ((Component)hoverParticles).GetComponent<ParticleSystemRenderer>();
			component.renderMode = (ParticleSystemRenderMode)0;
			((Renderer)component).material = new Material(Shader.Find("Sprites/Default"));
			((Renderer)component).material.color = Color.white;
			hoverParticles.Stop();
		}

		private void Update()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)player == (Object)null || (Object)(object)data == (Object)null || (Object)(object)gravity == (Object)null)
			{
				return;
			}
			Vector2 val = Vector2.zero;
			if (velocityTraverse != null)
			{
				val = velocityTraverse.GetValue<Vector2>();
			}
			bool flag = false;
			if (!data.isGrounded)
			{
				if (player.data.input.jumpIsPressed)
				{
					flag = true;
					gravity.gravityForce = Mathf.Lerp(gravity.gravityForce, originalGravityForce * 0.1f, Time.deltaTime * 10f);
					if (val.y < -2f)
					{
						val.y = -2f;
						velocityTraverse.SetValue((object)val);
					}
				}
				else
				{
					gravity.gravityForce = Mathf.Lerp(gravity.gravityForce, originalGravityForce, Time.deltaTime * 5f);
				}
			}
			else
			{
				gravity.gravityForce = originalGravityForce;
			}
			if ((Object)(object)hoverParticles != (Object)null)
			{
				if (flag && !hoverParticles.isPlaying)
				{
					hoverParticles.Play();
				}
				else if (!flag && hoverParticles.isPlaying)
				{
					hoverParticles.Stop();
				}
			}
		}
	}
	public class Momentum : CustomCard
	{
		protected override string GetTitle()
		{
			return "Momentum";
		}

		protected override string GetDescription()
		{
			return "Accelerate while moving (up to +100%). Lose the momentum if you stop.";
		}

		protected override GameObject GetCardArt()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AdvancedMovementPack.Resources.Momentum.png");
			if (stream == null)
			{
				Debug.LogError("[Momentum] Resource not found!");
				return new GameObject("MomentumArt_Missing");
			}
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			ImageConversion.LoadImage(val, array);
			Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f);
			GameObject val2 = new GameObject("MomentumArt");
			Image obj = val2.AddComponent<Image>();
			obj.sprite = sprite;
			obj.preserveAspect = true;
			val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width * 1.2f, (float)((Texture)val).height * 1.2f);
			((Object)val2).hideFlags = (HideFlags)61;
			return val2;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Acceleration",
					amount = "+100%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Block Cooldown",
					amount = "+1s",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			MomentumHandler momentumHandler = ((Component)player).gameObject.GetComponent<MomentumHandler>();
			if ((Object)(object)momentumHandler == (Object)null)
			{
				momentumHandler = ((Component)player).gameObject.AddComponent<MomentumHandler>();
			}
			momentumHandler.cardCount++;
			block.cdAdd += 1f;
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			MomentumHandler component = ((Component)player).gameObject.GetComponent<MomentumHandler>();
			if ((Object)(object)component != (Object)null)
			{
				component.cardCount--;
				if (component.cardCount <= 0)
				{
					characterStats.movementSpeed = 1f;
					Object.Destroy((Object)(object)component);
				}
			}
			block.cdAdd -= 1f;
		}

		public override string GetModName()
		{
			return "Advanced Movement Pack";
		}
	}
	public class MomentumHandler : MonoBehaviour
	{
		public int cardCount;

		private Player player;

		private CharacterStatModifiers stats;

		private float currentBoost = 1f;

		private const float accelerationRate = 0.2f;

		private float stopTimer;

		private const float stopThreshold = 0.15f;

		private GameObject particleGO;

		private ParticleSystem ps;

		private EmissionModule emission;

		private void Start()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: 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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Expected O, but got Unknown
			player = ((Component)this).GetComponent<Player>();
			stats = ((Component)this).GetComponent<CharacterStatModifiers>();
			particleGO = new GameObject("MomentumTrail");
			particleGO.transform.SetParent(((Component)this).transform, false);
			particleGO.transform.localPosition = Vector3.zero;
			ps = particleGO.AddComponent<ParticleSystem>();
			MainModule main = ps.main;
			((MainModule)(ref main)).startColor = new MinMaxGradient(Color.red);
			((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.08f);
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.25f);
			((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(6f);
			((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
			((MainModule)(ref main)).maxParticles = 1000;
			ShapeModule shape = ps.shape;
			((ShapeModule)(ref shape)).enabled = true;
			((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)4;
			((ShapeModule)(ref shape)).angle = 25f;
			((ShapeModule)(ref shape)).radius = 0.2f;
			((ShapeModule)(ref shape)).rotation = new Vector3(180f, 0f, 0f);
			emission = ps.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f);
			((Renderer)((Component)ps).GetComponent<ParticleSystemRenderer>()).material = new Material(Shader.Find("Sprites/Default"));
		}

		private void OnDestroy()
		{
			if ((Object)(object)particleGO != (Object)null)
			{
				Object.Destroy((Object)(object)particleGO);
			}
			if ((Object)(object)stats != (Object)null)
			{
				stats.movementSpeed = 1f;
			}
		}

		private void Update()
		{
			//IL_0161: 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)
			if ((Object)(object)player == (Object)null || (Object)(object)stats == (Object)null)
			{
				return;
			}
			bool flag = Mathf.Abs(player.data.input.direction.x) > 0.05f || Mathf.Abs(player.data.input.direction.y) > 0.05f;
			float num = 1f + 1f * (float)cardCount;
			float num2 = (flag ? num : 1f);
			if (flag)
			{
				stopTimer = 0f;
				currentBoost = Mathf.MoveTowards(currentBoost, num2, 0.2f * Time.deltaTime);
			}
			else
			{
				stopTimer += Time.deltaTime;
				if (stopTimer >= 0.15f)
				{
					currentBoost = 1f;
				}
			}
			stats.movementSpeed = currentBoost;
			if (((EmissionModule)(ref emission)).enabled)
			{
				((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit((currentBoost >= num - 0.01f && flag) ? 200f : 0f);
			}
			else
			{
				((EmissionModule)(ref emission)).enabled = true;
			}
			if ((Object)(object)particleGO != (Object)null)
			{
				particleGO.transform.position = ((Component)this).transform.position;
			}
		}
	}
	public class Hypno : CustomCard
	{
		protected override string GetTitle()
		{
			return "Hypno";
		}

		protected override string GetDescription()
		{
			return "Block to hypnotize nearby opponents and scramble their controls.";
		}

		public override string GetModName()
		{
			return "Advanced Movement Pack";
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)4;
		}

		protected override GameObject GetCardArt()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AdvancedMovementPack.Resources.Hypno.png");
			if (stream == null)
			{
				Debug.LogError("[Hypno] Resource not found!");
				return new GameObject("HypnoArt_Missing");
			}
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			ImageConversion.LoadImage(val, array);
			Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f);
			GameObject val2 = new GameObject("HypnoArt");
			Image obj = val2.AddComponent<Image>();
			obj.sprite = sprite;
			obj.preserveAspect = true;
			val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width * 1.2f, (float)((Texture)val).height * 1.2f);
			((Object)val2).hideFlags = (HideFlags)61;
			return val2;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats)
		{
			HypnoEffect hypnoEffect = ((Component)player).gameObject.GetComponent<HypnoEffect>();
			if ((Object)(object)hypnoEffect == (Object)null)
			{
				hypnoEffect = ((Component)player).gameObject.AddComponent<HypnoEffect>();
			}
			hypnoEffect.player = player;
			hypnoEffect.block = block;
			hypnoEffect.stacks++;
			block.cdAdd += 2f;
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats)
		{
			HypnoEffect component = ((Component)player).gameObject.GetComponent<HypnoEffect>();
			if ((Object)(object)component != (Object)null)
			{
				component.stacks--;
				if (component.stacks <= 0)
				{
					Object.Destroy((Object)(object)component);
				}
			}
			HypnoDebuff[] components = ((Component)player).gameObject.GetComponents<HypnoDebuff>();
			for (int i = 0; i < components.Length; i++)
			{
				components[i].Cleanup();
			}
			block.cdAdd -= 2f;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			//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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "duration",
					amount = "+3s"
				},
				new CardInfoStat
				{
					positive = true,
					stat = "range",
					amount = "+100%"
				},
				new CardInfoStat
				{
					positive = false,
					stat = "block cooldown",
					amount = "+2s"
				}
			};
		}
	}
	public class HypnoEffect : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <SpawnExpandingRing>d__7 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public Vector3 position;

			public float targetRadius;

			private GameObject <ring>5__2;

			private float <t>5__3;

			private float <duration>5__4;

			private float <finalScale>5__5;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_002a: Expected O, but got Unknown
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_007e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0088: Expected O, but got Unknown
				//IL_009c: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
				//IL_0127: Unknown result type (might be due to invalid IL or missing references)
				//IL_012d: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
				{
					<>1__state = -1;
					<ring>5__2 = new GameObject("HypnoExpandingRing");
					SpriteRenderer val = <ring>5__2.AddComponent<SpriteRenderer>();
					val.sprite = HypnoDebuff.MakeHollowCircleSprite(128, new Color(0.6f, 0.2f, 1f), new Color(0.6f, 0.2f, 1f, 0.1f));
					((Renderer)val).material = new Material(Shader.Find("Sprites/Default"));
					((Renderer)val).sortingOrder = 100;
					<ring>5__2.transform.position = position;
					<ring>5__2.transform.localScale = Vector3.zero;
					<t>5__3 = 0f;
					<duration>5__4 = 0.3f;
					float num = targetRadius * 2f;
					Bounds bounds = val.sprite.bounds;
					<finalScale>5__5 = num / ((Bounds)(ref bounds)).size.x;
					break;
				}
				case 1:
					<>1__state = -1;
					break;
				}
				if (<t>5__3 < <duration>5__4)
				{
					float num2 = Mathf.Lerp(0f, <finalScale>5__5, <t>5__3 / <duration>5__4);
					<ring>5__2.transform.localScale = Vector3.one * num2;
					<t>5__3 += Time.deltaTime;
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				Object.Destroy((Object)(object)<ring>5__2);
				return false;
			}

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

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

		public Player player;

		public Block block;

		public int stacks;

		private void Start()
		{
			if ((Object)(object)block != (Object)null)
			{
				Block obj = block;
				obj.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(obj.BlockAction, new Action<BlockTriggerType>(OnBlock));
			}
		}

		private void OnDestroy()
		{
			if ((Object)(object)block != (Object)null)
			{
				Block obj = block;
				obj.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(obj.BlockAction, new Action<BlockTriggerType>(OnBlock));
			}
		}

		private void Update()
		{
			if (Input.GetKeyDown((KeyCode)284))
			{
				((Component)player).gameObject.AddComponent<HypnoDebuff>().Apply(3f * (float)stacks);
			}
		}

		private void OnBlock(BlockTriggerType trigger)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			float num = 5f * (float)stacks;
			float duration = 3f * (float)stacks;
			((MonoBehaviour)this).StartCoroutine(SpawnExpandingRing(((Component)player).transform.position, num));
			Collider2D[] array = Physics2D.OverlapCircleAll(Vector2.op_Implicit(((Component)player).transform.position), num);
			for (int i = 0; i < array.Length; i++)
			{
				Player component = ((Component)array[i]).GetComponent<Player>();
				if ((Object)(object)component != (Object)null && component.teamID != player.teamID)
				{
					((Component)component).gameObject.AddComponent<HypnoDebuff>().Apply(duration);
				}
			}
		}

		[IteratorStateMachine(typeof(<SpawnExpandingRing>d__7))]
		private IEnumerator SpawnExpandingRing(Vector3 position, float targetRadius)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <SpawnExpandingRing>d__7(0)
			{
				position = position,
				targetRadius = targetRadius
			};
		}
	}
	public class HypnoDebuff : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <DebuffRoutine>d__4 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public HypnoDebuff <>4__this;

			public float duration;

			private float <t>5__2;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0079: 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_00b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_010d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0112: Unknown result type (might be due to invalid IL or missing references)
				//IL_0113: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				HypnoDebuff hypnoDebuff = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if ((Object)(object)hypnoDebuff.bubble == (Object)null)
					{
						hypnoDebuff.bubble = hypnoDebuff.CreateBubbleCircle();
					}
					((Component)hypnoDebuff).gameObject.AddComponent<HypnoController>();
					<t>5__2 = 0f;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (<t>5__2 < duration && !((Object)(object)hypnoDebuff.bubble == (Object)null))
				{
					hypnoDebuff.bubble.transform.position = ((Component)hypnoDebuff).transform.position;
					float num2 = 1f + Mathf.Sin(Time.time * 6f) * 0.05f;
					hypnoDebuff.bubble.transform.localScale = Vector3.one * 1.2f * num2;
					if (Random.value < 0.015f)
					{
						Vector3 val = default(Vector3);
						((Vector3)(ref val))..ctor(Random.Range(-0.5f, 0.5f), Random.Range(-1f, 1f), 0f);
						GameObject obj = hypnoDebuff.CreateSmallBubble();
						obj.transform.position = ((Component)hypnoDebuff).transform.position + val;
						Object.Destroy((Object)(object)obj, 1.5f);
					}
					<t>5__2 += Time.deltaTime;
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				hypnoDebuff.Cleanup();
				return false;
			}

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

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

		private GameObject bubble;

		private Coroutine routine;

		private Player player;

		public void Apply(float duration)
		{
			player = ((Component)this).GetComponent<Player>();
			if (routine != null)
			{
				((MonoBehaviour)this).StopCoroutine(routine);
			}
			routine = ((MonoBehaviour)this).StartCoroutine(DebuffRoutine(duration));
		}

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

		public void Cleanup()
		{
			if ((Object)(object)bubble != (Object)null)
			{
				Object.Destroy((Object)(object)bubble);
			}
			bubble = null;
			HypnoController component = ((Component)this).GetComponent<HypnoController>();
			if ((Object)(object)component != (Object)null)
			{
				Object.Destroy((Object)(object)component);
			}
			if (routine != null)
			{
				((MonoBehaviour)this).StopCoroutine(routine);
			}
			routine = null;
			Object.Destroy((Object)(object)this);
		}

		public void OnDeath()
		{
			Cleanup();
		}

		private GameObject CreateBubbleCircle()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			//IL_006c: Expected O, but got Unknown
			GameObject val = new GameObject("HypnoBubble");
			val.transform.position = ((Component)this).transform.position;
			SpriteRenderer obj = val.AddComponent<SpriteRenderer>();
			obj.sprite = MakeCircleSprite(128, new Color(0.6f, 0.2f, 1f, 0.6f));
			((Renderer)obj).material = new Material(Shader.Find("Sprites/Default"));
			((Renderer)obj).sortingOrder = 50;
			return val;
		}

		private GameObject CreateSmallBubble()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			//IL_0066: 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_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Expected O, but got Unknown
			GameObject val = new GameObject("HypnoSmallBubble");
			SpriteRenderer obj = val.AddComponent<SpriteRenderer>();
			obj.sprite = MakeHollowCircleSprite(32, new Color(1f, 1f, 1f), new Color(0.6f, 0.2f, 1f, 0.2f));
			((Renderer)obj).material = new Material(Shader.Find("Sprites/Default"));
			((Renderer)obj).sortingOrder = 51;
			Rigidbody2D obj2 = val.AddComponent<Rigidbody2D>();
			obj2.gravityScale = 0f;
			obj2.velocity = Vector2.up * 0.5f;
			return val;
		}

		public static Sprite MakeCircleSprite(int size, Color color)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Expected O, but got Unknown
			//IL_006e: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(size, size, (TextureFormat)5, false);
			float num = (float)size / 2f;
			for (int i = 0; i < size; i++)
			{
				for (int j = 0; j < size; j++)
				{
					float num2 = (float)j - num;
					float num3 = (float)i - num;
					float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3);
					val.SetPixel(j, i, (num4 <= num) ? color : Color.clear);
				}
			}
			val.Apply();
			return Sprite.Create(val, new Rect(0f, 0f, (float)size, (float)size), new Vector2(0.5f, 0.5f), 100f);
		}

		public static Sprite MakeHollowCircleSprite(int size, Color stroke, Color fill)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Expected O, but got Unknown
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(size, size, (TextureFormat)5, false);
			float num = (float)size / 2f;
			for (int i = 0; i < size; i++)
			{
				for (int j = 0; j < size; j++)
				{
					float num2 = (float)j - num;
					float num3 = (float)i - num;
					float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3);
					if (num4 <= num && num4 >= num - 2f)
					{
						val.SetPixel(j, i, stroke);
					}
					else if (num4 < num - 2f)
					{
						val.SetPixel(j, i, fill);
					}
					else
					{
						val.SetPixel(j, i, Color.clear);
					}
				}
			}
			val.Apply();
			return Sprite.Create(val, new Rect(0f, 0f, (float)size, (float)size), new Vector2(0.5f, 0.5f), 100f);
		}
	}
	public class HypnoController : MonoBehaviour
	{
		private CharacterData data;

		private void Awake()
		{
			data = ((Component)this).GetComponent<Player>()?.data;
		}

		private void LateUpdate()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)data == (Object)null))
			{
				GeneralInput input = data.input;
				input.direction = -input.direction;
				data.input = input;
			}
		}

		public void OnDeath()
		{
			Object.Destroy((Object)(object)this);
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "RPCA_Die")]
	internal static class Hypno_DeathPatch
	{
		private static void Prefix(HealthHandler __instance)
		{
			HypnoDebuff[] components = ((Component)__instance).GetComponents<HypnoDebuff>();
			for (int i = 0; i < components.Length; i++)
			{
				components[i].OnDeath();
			}
		}
	}
	public class SwiftShrink : CustomCard
	{
		protected override string GetTitle()
		{
			return "Swift Shrink";
		}

		protected override string GetDescription()
		{
			return "Smaller and quicker — small HP tradeoff.";
		}

		protected override GameObject GetCardArt()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AdvancedMovementPack.Resources.SwiftShrink.png");
			if (stream == null)
			{
				Debug.LogError("[SwiftShrink] Resource not found!");
				return new GameObject("SwiftShrinkArt_Missing");
			}
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			ImageConversion.LoadImage(val, array);
			Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f);
			GameObject val2 = new GameObject("SwiftShrink");
			Image obj = val2.AddComponent<Image>();
			obj.sprite = sprite;
			obj.preserveAspect = true;
			val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width * 1.2f, (float)((Texture)val).height * 1.2f);
			((Object)val2).hideFlags = (HideFlags)61;
			return val2;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)0;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: 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_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Move Speed",
					amount = "+15%",
					simepleAmount = (SimpleAmount)1
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Size reduction",
					amount = "-20%",
					simepleAmount = (SimpleAmount)1
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Health",
					amount = "-10%",
					simepleAmount = (SimpleAmount)6
				}
			};
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			characterStats.movementSpeed *= 1.15f;
			characterStats.sizeMultiplier *= 0.8f;
			characterStats.health *= 0.9f;
		}

		public override void OnRemoveCard()
		{
		}

		public override string GetModName()
		{
			return "Advanced Movement Pack";
		}
	}
	public class Grapple : CustomCard
	{
		protected override string GetTitle()
		{
			return "Grapple";
		}

		protected override string GetDescription()
		{
			return "Grapple yourself to where your bullet lands.";
		}

		protected override GameObject GetCardArt()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AdvancedMovementPack.Resources.Grapple.png");
			if (stream == null)
			{
				Debug.LogError("[Grapple] Resource not found!");
				return new GameObject("GrappleArt_Missing");
			}
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			ImageConversion.LoadImage(val, array);
			Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f);
			GameObject val2 = new GameObject("GrappleArt");
			Image obj = val2.AddComponent<Image>();
			obj.sprite = sprite;
			obj.preserveAspect = true;
			val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width * 1.2f, (float)((Texture)val).height * 1.2f);
			((Object)val2).hideFlags = (HideFlags)61;
			return val2;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)2;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)8;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Grapple",
					amount = "Some",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			GameObject val = new GameObject("GrappleBulletPrefab");
			val.AddComponent<GrappleBullet>().owner = player;
			gun.objectsToSpawn = gun.objectsToSpawn.Append(new ObjectsToSpawn
			{
				AddToProjectile = val
			}).ToArray();
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			gun.objectsToSpawn = gun.objectsToSpawn.Where((ObjectsToSpawn o) => (Object)(object)o.AddToProjectile == (Object)null || ((Object)o.AddToProjectile).name != "GrappleBulletPrefab").ToArray();
		}

		public override string GetModName()
		{
			return "Advanced Movement Pack";
		}
	}
	public class GrappleBullet : MonoBehaviour
	{
		public Player owner;

		private bool grappled;

		private void Start()
		{
			//IL_0036: 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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: 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_0065: 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_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Expected O, but got Unknown
			ProjectileHit componentInParent = ((Component)this).GetComponentInParent<ProjectileHit>();
			if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.ownPlayer != (Object)null)
			{
				owner = componentInParent.ownPlayer;
			}
			ParticleSystem obj = ((Component)this).gameObject.AddComponent<ParticleSystem>();
			MainModule main = obj.main;
			((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(Color.magenta);
			((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.15f);
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.2f);
			((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
			EmissionModule emission = obj.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f);
			((EmissionModule)(ref emission)).rateOverDistance = MinMaxCurve.op_Implicit(40f);
			ShapeModule shape = obj.shape;
			((ShapeModule)(ref shape)).enabled = false;
			((Renderer)((Component)obj).GetComponent<ParticleSystemRenderer>()).material = new Material(Shader.Find("Sprites/Default"));
		}

		private void OnDestroy()
		{
			TryGrapple();
		}

		private void OnDisable()
		{
			TryGrapple();
		}

		private void TryGrapple()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			if (!grappled && !((Object)(object)owner == (Object)null))
			{
				grappled = true;
				((Component)owner).transform.position = ((Component)this).transform.position;
			}
		}
	}
}