Decompiled source of New Spell Card Toolkit v1.2.6

Infiniscryption.Spells.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using DiskCardGame;
using GBC;
using HarmonyLib;
using Infiniscryption.Core.Helpers;
using Infiniscryption.Spells.Patchers;
using Infiniscryption.Spells.Sigils;
using InscryptionAPI.Card;
using InscryptionAPI.Guid;
using InscryptionAPI.Helpers.Extensions;
using Microsoft.CodeAnalysis;
using Pixelplacement;
using TMPro;
using UnityEngine;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("Infiniscryption.Spells")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("An updated version of Infiniscryption's Spell Card Toolkit with new features and general improvements.")]
[assembly: AssemblyFileVersion("1.2.6.0")]
[assembly: AssemblyInformationalVersion("1.2.6+a95c74f4df3fa85b233982a48c61d276a05c9cb8")]
[assembly: AssemblyProduct("Infiniscryption.Spells")]
[assembly: AssemblyTitle("Infiniscryption.Spells")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.2.6.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace NewSpellsAPI
{
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "Infiniscryption.Spells";

		public const string PLUGIN_NAME = "Infiniscryption.Spells";

		public const string PLUGIN_VERSION = "1.2.6";
	}
}
namespace Infiniscryption.Spells
{
	public class SpellSniperVisualiser : ManagedBehaviour
	{
		public List<GameObject> sniperIcons = new List<GameObject>();

		private GameObject sniperIconPrefab;

		private GameObject tempSniperIcon;

		public void VisualizeStartSniperAbility(CardSlot sniperSlot)
		{
		}

		public void VisualizeAimSniperAbility(CardSlot sniperSlot, CardSlot targetSlot)
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)tempSniperIcon != (Object)null)
			{
				CleanUpTargetIcon(tempSniperIcon);
				tempSniperIcon = null;
			}
			if ((Object)(object)sniperIconPrefab == (Object)null)
			{
				sniperIconPrefab = ResourceBank.Get<GameObject>("Prefabs/Cards/SpecificCardModels/CannonTargetIcon");
			}
			GameObject val = Object.Instantiate<GameObject>(sniperIconPrefab, ((Component)targetSlot).transform);
			val.transform.localPosition = new Vector3(0f, 0.25f, 0f);
			val.transform.localRotation = Quaternion.identity;
			tempSniperIcon = val;
		}

		public void CleanUpTargetIcon(GameObject icon)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			Tween.LocalScale(icon.transform, Vector3.zero, 0.1f, 0f, Tween.EaseIn, (LoopType)0, (Action)null, (Action)delegate
			{
				Object.Destroy((Object)(object)icon);
			}, true);
		}

		public void VisualizeConfirmSniperAbility(CardSlot targetSlot)
		{
			//IL_0045: 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)
			if ((Object)(object)sniperIconPrefab == (Object)null)
			{
				sniperIconPrefab = ResourceBank.Get<GameObject>("Prefabs/Cards/SpecificCardModels/CannonTargetIcon");
			}
			GameObject val = Object.Instantiate<GameObject>(sniperIconPrefab, ((Component)targetSlot).transform);
			val.transform.localPosition = new Vector3(0f, 0.25f, 0f);
			val.transform.localRotation = Quaternion.identity;
			sniperIcons.Add(val);
			if ((Object)(object)tempSniperIcon != (Object)null)
			{
				CleanUpTargetIcon(tempSniperIcon);
				tempSniperIcon = null;
			}
		}

		public void VisualizeClearSniperAbility()
		{
			sniperIcons.ForEach(delegate(GameObject x)
			{
				if ((Object)(object)x != (Object)null)
				{
					CleanUpTargetIcon(x);
				}
			});
			sniperIcons.Clear();
			if ((Object)(object)tempSniperIcon != (Object)null)
			{
				CleanUpTargetIcon(tempSniperIcon);
				tempSniperIcon = null;
			}
		}
	}
	[BepInPlugin("zorro.inscryption.infiniscryption.spells", "New Infiniscryption Spells", "1.2.6")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class InfiniscryptionSpellsPlugin : BaseUnityPlugin
	{
		internal const string OriginalPluginGuid = "zorro.infiniscryption.sigils";

		public const string PluginGuid = "zorro.inscryption.infiniscryption.spells";

		internal const string PluginName = "New Infiniscryption Spells";

		internal const string PluginVersion = "1.2.6";

		internal const string CardPrefix = "ZSPL";

		internal static ManualLogSource Log;

		private bool AddCards => ((BaseUnityPlugin)this).Config.Bind<bool>("InfiniscryptionSpells", "AddCards", false, new ConfigDescription("If true, this will add the sample cards to the card pool.", (AcceptableValueBase)null, Array.Empty<object>())).Value;

		private bool AllowStatBoost => ((BaseUnityPlugin)this).Config.Bind<bool>("InfiniscryptionSpells", "AllowStatBoost", true, new ConfigDescription("If true, this will allow stat-showing spells to be buffed at campfires.", (AcceptableValueBase)null, Array.Empty<object>())).Value;

		private bool AllowCardMerge => ((BaseUnityPlugin)this).Config.Bind<bool>("InfiniscryptionSpells", "AllowCardMerge", true, new ConfigDescription("If true, this will allow spell cards to gain and transfer their sigils.", (AcceptableValueBase)null, Array.Empty<object>())).Value;

		internal static bool SpellMerge { get; private set; }

		private void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			Harmony val = new Harmony("zorro.inscryption.infiniscryption.spells");
			SpellMerge = AllowCardMerge;
			val.PatchAll(typeof(SpellBehavior));
			if (AllowStatBoost)
			{
				MethodInfo method = typeof(CardStatBoostSequencer).GetMethod("GetValidCards", BindingFlags.Instance | BindingFlags.NonPublic);
				MethodInfo method2 = typeof(SpellBehavior).GetMethod("AllowStatBoostForSpells");
				val.Patch((MethodBase)method, (HarmonyMethod)null, new HarmonyMethod(method2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			}
			TargetedSpellAbility.Register();
			GlobalSpellAbility.Register();
			InstaGlobalSpellAbility.Register();
			RuntimeHelpers.RunClassConstructor(typeof(SpellBehavior.SpellBackgroundAppearance).TypeHandle);
			RuntimeHelpers.RunClassConstructor(typeof(SpellBehavior.RareSpellBackgroundAppearance).TypeHandle);
			DrawTwoCards.Register();
			DestroyAllCardsOnDeath.Register();
			DirectDamage.Register();
			DirectHeal.Register();
			AttackBuff.Register();
			AttackNerf.Register();
			Fishhook.Register();
			GiveStats.Register();
			GiveSigils.Register();
			GiveStatsSigils.Register();
			if (AddCards)
			{
				SpellCards.RegisterCustomCards();
			}
			CardManager.ModifyCardList += delegate(List<CardInfo> cards)
			{
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0063: Unknown result type (might be due to invalid IL or missing references)
				//IL_007c: 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)
				foreach (CardInfo item in cards.Where((CardInfo x) => x.IsSpell()))
				{
					if (item.IsTargetedSpell() && item.SpecialStatIcon != TargetedSpellAbility.Icon)
					{
						item.SetTargetedSpell();
					}
					else if (item.IsInstaGlobalSpell() && item.specialStatIcon != InstaGlobalSpellAbility.Icon)
					{
						item.SetInstaGlobalSpell();
					}
					else if (item.IsGlobalSpell() && item.specialStatIcon == GlobalSpellAbility.Icon)
					{
						item.SetGlobalSpell();
					}
					if (!item.hideAttackAndHealth && (item.baseHealth != 0 || item.baseAttack != 0))
					{
						if (!CardExtensions.GetExtendedPropertyAsBool(item, "Spells:NegativeStats").HasValue && (item.baseHealth < 0 || item.baseAttack < 0))
						{
							item.SetNegativeStats();
						}
						CardExtensions.SetHideStats(item, false);
					}
				}
				return cards;
			};
			((BaseUnityPlugin)this).Logger.LogInfo((object)"New Infiniscryption Spells is loaded!");
		}
	}
}
namespace Infiniscryption.Spells.Sigils
{
	public class AttackNerf : AbilityBehaviour
	{
		[CompilerGenerated]
		private sealed class <OnResolveOnBoard>d__8 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public AttackNerf <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0046: Expected O, but got Unknown
				//IL_0091: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Expected O, but got Unknown
				int num = <>1__state;
				AttackNerf attackNerf = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
					<>2__current = (object)new WaitForSeconds(0.2f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					foreach (CardSlot slot in Singleton<BoardManager>.Instance.GetSlots(((AbilityBehaviour)attackNerf).Card.OpponentCard))
					{
						if ((Object)(object)slot.Card != (Object)null)
						{
							slot.Card.AddTemporaryMod(new CardModificationInfo(-1, 0));
						}
					}
					<>2__current = ((AbilityBehaviour)attackNerf).LearnAbility(0.5f);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					return false;
				}
			}

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

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

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

			private object <>2__current;

			public CardSlot slot;

			public AttackNerf <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Expected O, but got Unknown
				int num = <>1__state;
				AttackNerf attackNerf = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					slot.Card.AddTemporaryMod(new CardModificationInfo(-1, 0));
					<>2__current = ((AbilityBehaviour)attackNerf).LearnAbility(0.5f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					return false;
				}
			}

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

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

		public override Ability Ability => AbilityID;

		public static Ability AbilityID { get; private set; }

		public override bool RespondsToResolveOnBoard()
		{
			return ((Card)((AbilityBehaviour)this).Card).Info.IsGlobalSpell();
		}

		public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
		{
			if (((Card)((AbilityBehaviour)this).Card).Info.IsSpell() && (Object)(object)slot.Card != (Object)null && slot.Card.Attack > 0)
			{
				return ((AbilityBehaviour)this).Card.OpponentCard != slot.Card.OpponentCard;
			}
			return false;
		}

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

		[IteratorStateMachine(typeof(<OnSlotTargetedForAttack>d__9))]
		public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OnSlotTargetedForAttack>d__9(0)
			{
				<>4__this = this,
				slot = slot
			};
		}

		public static void Register()
		{
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>();
			val.rulebookName = "Attack Down";
			val.rulebookDescription = "Decreases the target's attack for the rest of the battle.";
			val.canStack = true;
			val.powerLevel = 1;
			val.opponentUsable = false;
			val.passive = false;
			val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 };
			AbilityExtensions.SetPixelAbilityIcon(val, AssetHelper.LoadTexture("attack_down_pixel", (FilterMode)0), (FilterMode?)null);
			AbilityID = AbilityManager.Add("zorro.infiniscryption.sigils", val, typeof(AttackNerf), (Texture)(object)AssetHelper.LoadTexture("ability_attack_down", (FilterMode)0)).Id;
		}
	}
	public class AttackBuff : AbilityBehaviour
	{
		[CompilerGenerated]
		private sealed class <OnResolveOnBoard>d__10 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public AttackBuff <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0046: Expected O, but got Unknown
				//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ab: Expected O, but got Unknown
				int num = <>1__state;
				AttackBuff attackBuff = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
					<>2__current = (object)new WaitForSeconds(0.2f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					foreach (CardSlot slot in Singleton<BoardManager>.Instance.GetSlots(CardExtensions.IsPlayerCard(((AbilityBehaviour)attackBuff).Card)))
					{
						if ((Object)(object)slot.Card != (Object)null)
						{
							((Card)slot.Card).Anim.LightNegationEffect();
							slot.Card.AddTemporaryMod(new CardModificationInfo(1, 0));
						}
					}
					<>2__current = ((AbilityBehaviour)attackBuff).LearnAbility(0.5f);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					return false;
				}
			}

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

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

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

			private object <>2__current;

			public AttackBuff <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Expected O, but got Unknown
				int num = <>1__state;
				AttackBuff attackBuff = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
				{
					<>1__state = -1;
					PlayableCard currentSacrificeDemandingCard = Singleton<BoardManager>.Instance.CurrentSacrificeDemandingCard;
					((Card)currentSacrificeDemandingCard).Anim.LightNegationEffect();
					if ((Object)(object)currentSacrificeDemandingCard != (Object)null)
					{
						currentSacrificeDemandingCard.AddTemporaryMod(new CardModificationInfo(1, 0));
					}
					<>2__current = ((AbilityBehaviour)attackBuff).LearnAbility(0.5f);
					<>1__state = 1;
					return true;
				}
				case 1:
					<>1__state = -1;
					return false;
				}
			}

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

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

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

			private object <>2__current;

			public CardSlot slot;

			public AttackBuff <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Expected O, but got Unknown
				int num = <>1__state;
				AttackBuff attackBuff = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					((Card)slot.Card).Anim.LightNegationEffect();
					slot.Card.AddTemporaryMod(new CardModificationInfo(1, 0));
					<>2__current = ((AbilityBehaviour)attackBuff).LearnAbility(0.5f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					return false;
				}
			}

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

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

		public override Ability Ability => AbilityID;

		public static Ability AbilityID { get; private set; }

		public override bool RespondsToSacrifice()
		{
			return true;
		}

		public override bool RespondsToResolveOnBoard()
		{
			return ((Card)((AbilityBehaviour)this).Card).Info.IsGlobalSpell();
		}

		public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
		{
			if (((Card)((AbilityBehaviour)this).Card).Info.IsSpell() && (Object)(object)slot.Card != (Object)null)
			{
				return ((AbilityBehaviour)this).Card.OpponentCard == slot.Card.OpponentCard;
			}
			return false;
		}

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

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

		[IteratorStateMachine(typeof(<OnSlotTargetedForAttack>d__11))]
		public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OnSlotTargetedForAttack>d__11(0)
			{
				<>4__this = this,
				slot = slot
			};
		}

		public static void Register()
		{
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>();
			val.rulebookName = "Attack Up";
			val.rulebookDescription = "Increases the target's attack for the rest of the battle.";
			val.canStack = true;
			val.powerLevel = 1;
			val.opponentUsable = false;
			val.passive = false;
			val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 };
			AbilityExtensions.SetPixelAbilityIcon(val, AssetHelper.LoadTexture("attack_up_pixel", (FilterMode)0), (FilterMode?)null);
			AbilityID = AbilityManager.Add("zorro.infiniscryption.sigils", val, typeof(AttackBuff), (Texture)(object)AssetHelper.LoadTexture("ability_attack_up", (FilterMode)0)).Id;
		}
	}
	public static class CardHelpers
	{
		public static Trait NeverBoostStats = GuidManager.GetEnumValue<Trait>("zorro.infiniscryption.sigils", "NeverBoostStats");

		public static CardInfo SetGlobalSpell(this CardInfo card)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Expected I4, but got Unknown
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected I4, but got Unknown
			card.hideAttackAndHealth = true;
			CardExtensions.SetStatIcon(card, GlobalSpellAbility.Icon);
			if (CardExtensions.HasCardMetaCategory(card, (CardMetaCategory)3))
			{
				CardExtensions.AddAppearances(card, (Appearance[])(object)new Appearance[1] { (Appearance)(int)SpellBehavior.RareSpellBackgroundAppearance.ID });
				card.appearanceBehaviour.Remove((Appearance)7);
			}
			else
			{
				CardExtensions.AddAppearances(card, (Appearance[])(object)new Appearance[1] { (Appearance)(int)SpellBehavior.SpellBackgroundAppearance.ID });
			}
			return card;
		}

		public static CardInfo SetInstaGlobalSpell(this CardInfo card)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Expected I4, but got Unknown
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected I4, but got Unknown
			card.hideAttackAndHealth = true;
			CardExtensions.SetStatIcon(card, InstaGlobalSpellAbility.Icon);
			if (CardExtensions.HasCardMetaCategory(card, (CardMetaCategory)3))
			{
				CardExtensions.AddAppearances(card, (Appearance[])(object)new Appearance[1] { (Appearance)(int)SpellBehavior.RareSpellBackgroundAppearance.ID });
				card.appearanceBehaviour.Remove((Appearance)7);
			}
			else
			{
				CardExtensions.AddAppearances(card, (Appearance[])(object)new Appearance[1] { (Appearance)(int)SpellBehavior.SpellBackgroundAppearance.ID });
			}
			return card;
		}

		public static CardInfo SetTargetedSpell(this CardInfo card)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Expected I4, but got Unknown
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected I4, but got Unknown
			card.hideAttackAndHealth = true;
			CardExtensions.SetStatIcon(card, TargetedSpellAbility.Icon);
			if (CardExtensions.HasCardMetaCategory(card, (CardMetaCategory)3))
			{
				CardExtensions.AddAppearances(card, (Appearance[])(object)new Appearance[1] { (Appearance)(int)SpellBehavior.RareSpellBackgroundAppearance.ID });
				card.appearanceBehaviour.Remove((Appearance)7);
			}
			else
			{
				CardExtensions.AddAppearances(card, (Appearance[])(object)new Appearance[1] { (Appearance)(int)SpellBehavior.SpellBackgroundAppearance.ID });
			}
			return card;
		}

		public static CardInfo SetTargetedSpellStats(this CardInfo card)
		{
			card.SetTargetedSpell();
			card.hideAttackAndHealth = false;
			return card;
		}

		public static CardInfo SetGlobalSpellStats(this CardInfo card)
		{
			card.SetGlobalSpell();
			card.hideAttackAndHealth = false;
			return card;
		}

		public static CardInfo SetInstaGlobalSpellStats(this CardInfo card)
		{
			card.SetInstaGlobalSpell();
			card.hideAttackAndHealth = false;
			return card;
		}

		public static CardInfo SetNeverBoostStats(this CardInfo card)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected I4, but got Unknown
			CardExtensions.AddTraits(card, (Trait[])(object)new Trait[1] { (Trait)(int)NeverBoostStats });
			return card;
		}

		public static List<Ability> GetDistinctShownAbilities(CardInfo info, List<CardModificationInfo> mods, List<Ability> hiddenAbilities)
		{
			List<Ability> abilities = info.Abilities;
			abilities.AddRange(AbilitiesUtil.GetAbilitiesFromMods(mods));
			abilities = AbilitiesUtil.RemoveNonDistinctNonStacking(abilities);
			abilities.RemoveAll((Ability x) => mods.Exists((CardModificationInfo m) => m.negateAbilities.Contains(x)));
			if (hiddenAbilities != null)
			{
				abilities.RemoveAll(hiddenAbilities.Contains);
			}
			return abilities;
		}

		public static FullAbility SetCanMerge(this FullAbility info, bool canMerge = true)
		{
			AbilityExtensions.SetExtendedProperty(info, "Spells:CanMerge", (object)canMerge);
			return info;
		}

		public static AbilityInfo SetCanMerge(this AbilityInfo info, bool canMerge = true)
		{
			AbilityExtensions.SetExtendedProperty(info, "Spells:CanMerge", (object)canMerge);
			return info;
		}

		public static CardInfo SetNegativeStats(this CardInfo info, bool negativeStats = true)
		{
			CardExtensions.SetExtendedProperty(info, "Spells:NegativeStats", (object)negativeStats);
			return info;
		}

		public static bool CanMerge(this AbilityInfo info)
		{
			return AbilityExtensions.GetExtendedPropertyAsBool(info, "Spells:CanMerge").GetValueOrDefault(true);
		}

		public static bool CanMerge(this Ability ability)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return AbilityExtensions.GetExtendedPropertyAsBool(ability, "Spells:CanMerge").GetValueOrDefault(true);
		}
	}
	public class DestroyAllCardsOnDeath : AbilityBehaviour
	{
		[CompilerGenerated]
		private sealed class <OnDie>d__7 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public DestroyAllCardsOnDeath <>4__this;

			private List<CardSlot>.Enumerator <>7__wrap1;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				switch (<>1__state)
				{
				case -3:
				case 2:
					try
					{
					}
					finally
					{
						<>m__Finally1();
					}
					break;
				case -4:
				case 3:
					try
					{
					}
					finally
					{
						<>m__Finally2();
					}
					break;
				}
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_015a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0164: Expected O, but got Unknown
				try
				{
					int num = <>1__state;
					DestroyAllCardsOnDeath destroyAllCardsOnDeath = <>4__this;
					switch (num)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<>2__current = ((AbilityBehaviour)destroyAllCardsOnDeath).PreSuccessfulTriggerSequence();
						<>1__state = 1;
						return true;
					case 1:
						<>1__state = -1;
						Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
						<>7__wrap1 = Singleton<BoardManager>.Instance.OpponentSlotsCopy.GetEnumerator();
						<>1__state = -3;
						goto IL_00cb;
					case 2:
						<>1__state = -3;
						goto IL_00cb;
					case 3:
						<>1__state = -4;
						goto IL_0141;
					case 4:
						<>1__state = -1;
						<>2__current = ((AbilityBehaviour)destroyAllCardsOnDeath).LearnAbility(0f);
						<>1__state = 5;
						return true;
					case 5:
						{
							<>1__state = -1;
							Singleton<ViewManager>.Instance.SwitchToView((View)1, false, false);
							return false;
						}
						IL_00cb:
						while (<>7__wrap1.MoveNext())
						{
							CardSlot current = <>7__wrap1.Current;
							if ((Object)(object)current.Card != (Object)null)
							{
								<>2__current = current.Card.Die(true, (PlayableCard)null, true);
								<>1__state = 2;
								return true;
							}
						}
						<>m__Finally1();
						<>7__wrap1 = Singleton<BoardManager>.Instance.PlayerSlotsCopy.GetEnumerator();
						<>1__state = -4;
						goto IL_0141;
						IL_0141:
						while (<>7__wrap1.MoveNext())
						{
							CardSlot current2 = <>7__wrap1.Current;
							if ((Object)(object)current2.Card != (Object)null)
							{
								<>2__current = current2.Card.Die(true, (PlayableCard)null, true);
								<>1__state = 3;
								return true;
							}
						}
						<>m__Finally2();
						<>2__current = (object)new WaitForSeconds(0.5f);
						<>1__state = 4;
						return true;
					}
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

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

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

			private void <>m__Finally2()
			{
				<>1__state = -1;
				((IDisposable)<>7__wrap1).Dispose();
			}

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

		public override Ability Ability => AbilityID;

		public static Ability AbilityID { get; private set; }

		public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer)
		{
			return true;
		}

		[IteratorStateMachine(typeof(<OnDie>d__7))]
		public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OnDie>d__7(0)
			{
				<>4__this = this
			};
		}

		public static void Register()
		{
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>();
			val.rulebookName = "Cataclysm";
			val.rulebookDescription = "When [creature] dies, all other cards on the boards perish as well.";
			val.canStack = false;
			val.powerLevel = 6;
			val.passive = false;
			val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 };
			AbilityExtensions.SetPixelAbilityIcon(val, AssetHelper.LoadTexture("nuke_pixel", (FilterMode)0), (FilterMode?)null);
			AbilityID = AbilityManager.Add("zorro.infiniscryption.sigils", val, typeof(DestroyAllCardsOnDeath), (Texture)(object)AssetHelper.LoadTexture("ability_nuke", (FilterMode)0)).Id;
		}
	}
	public class DirectDamage : AbilityBehaviour
	{
		[CompilerGenerated]
		private sealed class <OnResolveOnBoard>d__8 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public DirectDamage <>4__this;

			private List<CardSlot>.Enumerator <>7__wrap1;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				int num = <>1__state;
				if (num == -3 || num == 2)
				{
					try
					{
					}
					finally
					{
						<>m__Finally1();
					}
				}
				<>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
				try
				{
					int num = <>1__state;
					DirectDamage directDamage = <>4__this;
					switch (num)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
						<>2__current = (object)new WaitForSeconds(0.2f);
						<>1__state = 1;
						return true;
					case 1:
						<>1__state = -1;
						<>7__wrap1 = BoardManagerExtensions.GetSlotsCopy(Singleton<BoardManager>.Instance, !((AbilityBehaviour)directDamage).Card.OpponentCard).GetEnumerator();
						<>1__state = -3;
						goto IL_00d1;
					case 2:
						<>1__state = -3;
						goto IL_00d1;
					case 3:
						{
							<>1__state = -1;
							return false;
						}
						IL_00d1:
						while (<>7__wrap1.MoveNext())
						{
							CardSlot current = <>7__wrap1.Current;
							if ((Object)(object)current.Card != (Object)null)
							{
								<>2__current = current.Card.TakeDamage(1, (PlayableCard)null);
								<>1__state = 2;
								return true;
							}
						}
						<>m__Finally1();
						<>2__current = ((AbilityBehaviour)directDamage).LearnAbility(0.5f);
						<>1__state = 3;
						return true;
					}
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

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

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

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

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

			private object <>2__current;

			public CardSlot slot;

			public PlayableCard attacker;

			public DirectDamage <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				int num = <>1__state;
				DirectDamage directDamage = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = slot.Card.TakeDamage(1, attacker);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>2__current = ((AbilityBehaviour)directDamage).LearnAbility(0.5f);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					return false;
				}
			}

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

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

		public override Ability Ability => AbilityID;

		public static Ability AbilityID { get; private set; }

		public override bool RespondsToResolveOnBoard()
		{
			return ((Card)((AbilityBehaviour)this).Card).Info.IsGlobalSpell();
		}

		public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
		{
			if (((Card)((AbilityBehaviour)this).Card).Info.IsSpell() && (Object)(object)slot.Card != (Object)null)
			{
				return ((AbilityBehaviour)this).Card.OpponentCard != slot.Card.OpponentCard;
			}
			return false;
		}

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

		[IteratorStateMachine(typeof(<OnSlotTargetedForAttack>d__9))]
		public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OnSlotTargetedForAttack>d__9(0)
			{
				<>4__this = this,
				slot = slot,
				attacker = attacker
			};
		}

		public static void Register()
		{
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>();
			val.rulebookName = "Direct Damage";
			val.rulebookDescription = "Deals damage directly to a target.";
			val.canStack = true;
			val.powerLevel = 1;
			val.passive = false;
			val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 };
			AbilityExtensions.SetPixelAbilityIcon(val, AssetHelper.LoadTexture("damage_pixel", (FilterMode)0), (FilterMode?)null);
			AbilityID = AbilityManager.Add("zorro.infiniscryption.sigils", val, typeof(DirectDamage), (Texture)(object)AssetHelper.LoadTexture("ability_damage", (FilterMode)0)).Id;
		}
	}
	public class DirectHeal : AbilityBehaviour
	{
		[CompilerGenerated]
		private sealed class <OnResolveOnBoard>d__10 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public DirectHeal <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_007b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: Expected O, but got Unknown
				int num = <>1__state;
				DirectHeal directHeal = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					foreach (CardSlot slot in Singleton<BoardManager>.Instance.GetSlots(true))
					{
						if ((Object)(object)slot.Card != (Object)null)
						{
							((AbilityBehaviour)directHeal).Card.HealDamage(1);
						}
					}
					<>2__current = (object)new WaitForSeconds(0.45f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>2__current = ((AbilityBehaviour)directHeal).LearnAbility(0f);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					return false;
				}
			}

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

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

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

			private object <>2__current;

			public DirectHeal <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0054: Expected O, but got Unknown
				int num = <>1__state;
				DirectHeal directHeal = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
				{
					<>1__state = -1;
					PlayableCard currentSacrificeDemandingCard = Singleton<BoardManager>.Instance.CurrentSacrificeDemandingCard;
					if ((Object)(object)currentSacrificeDemandingCard != (Object)null)
					{
						currentSacrificeDemandingCard.HealDamage(1);
						<>2__current = (object)new WaitForSeconds(0.45f);
						<>1__state = 1;
						return true;
					}
					break;
				}
				case 1:
					<>1__state = -1;
					<>2__current = ((AbilityBehaviour)directHeal).LearnAbility(0.5f);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					break;
				}
				return false;
			}

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

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

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

			private object <>2__current;

			public CardSlot slot;

			public DirectHeal <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Expected O, but got Unknown
				int num = <>1__state;
				DirectHeal directHeal = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					slot.Card.HealDamage(1);
					<>2__current = (object)new WaitForSeconds(0.45f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>2__current = ((AbilityBehaviour)directHeal).LearnAbility(0f);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					return false;
				}
			}

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

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

		public override Ability Ability => AbilityID;

		public static Ability AbilityID { get; private set; }

		public override bool RespondsToSacrifice()
		{
			return true;
		}

		public override bool RespondsToResolveOnBoard()
		{
			return ((Card)((AbilityBehaviour)this).Card).Info.IsGlobalSpell();
		}

		public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
		{
			if (((Card)((AbilityBehaviour)this).Card).Info.IsSpell() && (Object)(object)slot.Card != (Object)null)
			{
				return ((AbilityBehaviour)this).Card.OpponentCard == slot.Card.OpponentCard;
			}
			return false;
		}

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

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

		[IteratorStateMachine(typeof(<OnSlotTargetedForAttack>d__11))]
		public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OnSlotTargetedForAttack>d__11(0)
			{
				<>4__this = this,
				slot = slot
			};
		}

		public static void Register()
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>();
			val.rulebookName = "Direct Heal";
			val.rulebookDescription = "Heals the target. This can heal the target beyond its original max health.";
			val.canStack = true;
			val.passive = false;
			val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 };
			AbilityExtensions.SetPixelAbilityIcon(val, AssetHelper.LoadTexture("direct_heal_pixel", (FilterMode)0), (FilterMode?)null);
			AbilityID = AbilityManager.Add("zorro.infiniscryption.sigils", val, typeof(DirectHeal), (Texture)(object)AssetHelper.LoadTexture("ability_health_up", (FilterMode)0)).Id;
		}
	}
	public class DrawTwoCards : AbilityBehaviour
	{
		[CompilerGenerated]
		private sealed class <Effect>d__11 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public DrawTwoCards <>4__this;

			private CardDrawPiles3D <cardPiles>5__2;

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

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

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

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

			private bool MoveNext()
			{
				int num = <>1__state;
				DrawTwoCards drawTwoCards = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = ((AbilityBehaviour)drawTwoCards).PreSuccessfulTriggerSequence();
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					Singleton<ViewManager>.Instance.SwitchToView((View)1, false, false);
					if (Singleton<CardDrawPiles>.Instance is CardDrawPiles3D)
					{
						ref CardDrawPiles3D reference = ref <cardPiles>5__2;
						CardDrawPiles instance = Singleton<CardDrawPiles>.Instance;
						reference = (CardDrawPiles3D)(object)((instance is CardDrawPiles3D) ? instance : null);
						<>2__current = ((CardDrawPiles)<cardPiles>5__2).DrawCardFromDeck((CardInfo)null, (Action<PlayableCard>)null);
						<>1__state = 2;
						return true;
					}
					<>2__current = Singleton<CardDrawPiles>.Instance.DrawCardFromDeck((CardInfo)null, (Action<PlayableCard>)null);
					<>1__state = 4;
					return true;
				case 2:
					<>1__state = -1;
					<>2__current = <cardPiles>5__2.DrawFromSidePile();
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -1;
					<cardPiles>5__2 = null;
					goto IL_010f;
				case 4:
					<>1__state = -1;
					<>2__current = Singleton<CardDrawPiles>.Instance.DrawCardFromDeck((CardInfo)null, (Action<PlayableCard>)null);
					<>1__state = 5;
					return true;
				case 5:
					<>1__state = -1;
					goto IL_010f;
				case 6:
					{
						<>1__state = -1;
						return false;
					}
					IL_010f:
					<>2__current = ((AbilityBehaviour)drawTwoCards).LearnAbility(0.5f);
					<>1__state = 6;
					return true;
				}
			}

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

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

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

			private object <>2__current;

			public DrawTwoCards <>4__this;

			private int <randomSeed>5__2;

			private List<CardInfo> <possibleCards>5__3;

			private int <i>5__4;

			private CardInfo <cardToQueue>5__5;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<possibleCards>5__3 = null;
				<cardToQueue>5__5 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ff: Expected O, but got Unknown
				int num = <>1__state;
				DrawTwoCards drawTwoCards = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if (((AbilityBehaviour)drawTwoCards).Card.OpponentCard)
					{
						<randomSeed>5__2 = SaveManager.SaveFile.GetCurrentRandomSeed();
						<possibleCards>5__3 = new List<CardInfo>();
						foreach (List<CardInfo> item in Singleton<TurnManager>.Instance.Opponent.TurnPlan)
						{
							foreach (CardInfo item2 in item)
							{
								if ((Object)(object)((Card)((AbilityBehaviour)drawTwoCards).Card).Info != (Object)(object)item2)
								{
									<possibleCards>5__3.Add(item2);
								}
							}
						}
						<i>5__4 = 0;
						goto IL_01e3;
					}
					<>2__current = drawTwoCards.Effect();
					<>1__state = 3;
					return true;
				case 1:
					<>1__state = -1;
					<possibleCards>5__3.Remove(<cardToQueue>5__5);
					<cardToQueue>5__5 = null;
					goto IL_01d1;
				case 2:
					<>1__state = -1;
					<possibleCards>5__3 = null;
					break;
				case 3:
					{
						<>1__state = -1;
						break;
					}
					IL_01d1:
					<i>5__4++;
					goto IL_01e3;
					IL_01e3:
					if (<i>5__4 < 2)
					{
						List<CardSlot> list = Singleton<BoardManager>.Instance.OpponentSlotsCopy.Where((CardSlot s) => !Singleton<TurnManager>.Instance.Opponent.QueuedSlots.Contains(s)).ToList();
						if (list.Count() > 0)
						{
							CardSlot val = list[SeededRandom.Range(0, list.Count, <randomSeed>5__2++)];
							<cardToQueue>5__5 = <possibleCards>5__3[SeededRandom.Range(0, <possibleCards>5__3.Count, <randomSeed>5__2++)];
							<>2__current = Singleton<TurnManager>.Instance.Opponent.QueueCard(<cardToQueue>5__5, val, true, true, true);
							<>1__state = 1;
							return true;
						}
						goto IL_01d1;
					}
					<>2__current = (object)new WaitForSeconds(0.45f);
					<>1__state = 2;
					return true;
				}
				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 override Ability Ability => AbilityID;

		public static Ability AbilityID { get; private set; }

		public static void Register()
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>();
			val.rulebookName = "Draw Twice";
			val.rulebookDescription = "When [creature] dies, draw two more cards and add them to your deck.";
			val.canStack = true;
			val.passive = false;
			val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 };
			AbilityExtensions.SetPixelAbilityIcon(val, AssetHelper.LoadTexture("drawtwocardsondeath_pixel", (FilterMode)0), (FilterMode?)null);
			AbilityID = AbilityManager.Add("zorro.infiniscryption.sigils", val, typeof(DrawTwoCards), (Texture)(object)AssetHelper.LoadTexture("ability_drawtwocardsondeath", (FilterMode)0)).Id;
		}

		public override bool RespondsToResolveOnBoard()
		{
			return !((Card)((AbilityBehaviour)this).Card).Info.IsSpell();
		}

		public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer)
		{
			return ((Card)((AbilityBehaviour)this).Card).Info.IsSpell();
		}

		public override IEnumerator OnResolveOnBoard()
		{
			return Effect();
		}

		[IteratorStateMachine(typeof(<OnDie>d__10))]
		public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OnDie>d__10(0)
			{
				<>4__this = this
			};
		}

		[IteratorStateMachine(typeof(<Effect>d__11))]
		private IEnumerator Effect()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <Effect>d__11(0)
			{
				<>4__this = this
			};
		}
	}
	public class Fishhook : AbilityBehaviour
	{
		[CompilerGenerated]
		private sealed class <HookEffect>d__10 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public CardSlot slot;

			private PlayableCard <targetCard>5__2;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
				{
					<>1__state = -1;
					<targetCard>5__2 = slot.Card;
					<targetCard>5__2.SetIsOpponentCard(false);
					Transform transform = ((Component)<targetCard>5__2).transform;
					transform.eulerAngles += new Vector3(0f, 0f, -180f);
					<>2__current = Singleton<BoardManager>.Instance.AssignCardToSlot(<targetCard>5__2, slot.opposingSlot, 0.1f, (Action)null, true);
					<>1__state = 1;
					return true;
				}
				case 1:
					<>1__state = -1;
					if (((Card)<targetCard>5__2).FaceDown)
					{
						((Card)<targetCard>5__2).SetFaceDown(false, false);
						<targetCard>5__2.UpdateFaceUpOnBoardEffects();
					}
					return false;
				}
			}

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

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

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

			private object <>2__current;

			public Fishhook <>4__this;

			private List<CardSlot>.Enumerator <>7__wrap1;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				int num = <>1__state;
				if (num == -3 || (uint)(num - 1) <= 1u)
				{
					try
					{
					}
					finally
					{
						<>m__Finally1();
					}
				}
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b9: Expected O, but got Unknown
				try
				{
					int num = <>1__state;
					Fishhook fishhook = <>4__this;
					switch (num)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<>7__wrap1 = Singleton<BoardManager>.Instance.GetSlots(((AbilityBehaviour)fishhook).Card.OpponentCard).GetEnumerator();
						<>1__state = -3;
						goto IL_00cc;
					case 1:
						<>1__state = -3;
						<>2__current = (object)new WaitForSeconds(0.2f);
						<>1__state = 2;
						return true;
					case 2:
						<>1__state = -3;
						goto IL_00cc;
					case 3:
						{
							<>1__state = -1;
							return false;
						}
						IL_00cc:
						while (<>7__wrap1.MoveNext())
						{
							CardSlot current = <>7__wrap1.Current;
							if ((Object)(object)current.Card != (Object)null && (Object)(object)current.opposingSlot.Card == (Object)null)
							{
								<>2__current = fishhook.HookEffect(current);
								<>1__state = 1;
								return true;
							}
						}
						<>m__Finally1();
						<>2__current = ((AbilityBehaviour)fishhook).LearnAbility(0f);
						<>1__state = 3;
						return true;
					}
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

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

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

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

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

			private object <>2__current;

			public Fishhook <>4__this;

			public CardSlot slot;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_005b: Expected O, but got Unknown
				int num = <>1__state;
				Fishhook fishhook = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = fishhook.HookEffect(slot);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.2f);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					return false;
				}
			}

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

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

		public override Ability Ability => AbilityID;

		public static Ability AbilityID { get; private set; }

		public override bool RespondsToResolveOnBoard()
		{
			return ((Card)((AbilityBehaviour)this).Card).Info.IsGlobalSpell();
		}

		public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
		{
			if (((Card)((AbilityBehaviour)this).Card).Info.IsSpell() && (Object)(object)slot.Card != (Object)null && (Object)(object)slot.opposingSlot.Card == (Object)null)
			{
				return ((AbilityBehaviour)this).Card.OpponentCard != slot.Card.OpponentCard;
			}
			return false;
		}

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

		[IteratorStateMachine(typeof(<OnSlotTargetedForAttack>d__9))]
		public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OnSlotTargetedForAttack>d__9(0)
			{
				<>4__this = this,
				slot = slot
			};
		}

		[IteratorStateMachine(typeof(<HookEffect>d__10))]
		private IEnumerator HookEffect(CardSlot slot)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <HookEffect>d__10(0)
			{
				slot = slot
			};
		}

		public static void Register()
		{
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>();
			val.rulebookName = "Gain Control";
			val.rulebookDescription = "Takes control of the targeted creature.";
			val.powerLevel = 8;
			val.canStack = false;
			val.passive = false;
			val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 };
			AbilityExtensions.SetPixelAbilityIcon(val, AssetHelper.LoadTexture("fishhook_pixel", (FilterMode)0), (FilterMode?)null);
			AbilityID = AbilityManager.Add("zorro.infiniscryption.sigils", val, typeof(Fishhook), (Texture)(object)AssetHelper.LoadTexture("ability_fishhook", (FilterMode)0)).Id;
		}
	}
	public abstract class GiveAbility : AbilityBehaviour
	{
		public enum TargetBehaviour
		{
			TargetFriendlies,
			TargetOpponents,
			TargetAny
		}

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

			private object <>2__current;

			public GiveAbility <>4__this;

			private IEnumerator<CardSlot> <>7__wrap1;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				int num = <>1__state;
				if (num == -3 || num == 1)
				{
					try
					{
					}
					finally
					{
						<>m__Finally1();
					}
				}
				<>7__wrap1 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bd: Expected O, but got Unknown
				try
				{
					int num = <>1__state;
					GiveAbility CS$<>8__locals0 = <>4__this;
					switch (num)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<>7__wrap1 = Singleton<BoardManager>.Instance.AllSlotsCopy.Where((CardSlot x) => (Object)(object)x.Card != (Object)null && CS$<>8__locals0.ValidTarget(x.Card)).GetEnumerator();
						<>1__state = -3;
						goto IL_0093;
					case 1:
						<>1__state = -3;
						goto IL_0093;
					case 2:
						<>1__state = -1;
						<>2__current = ((AbilityBehaviour)CS$<>8__locals0).LearnAbility(0f);
						<>1__state = 3;
						return true;
					case 3:
						{
							<>1__state = -1;
							return false;
						}
						IL_0093:
						if (<>7__wrap1.MoveNext())
						{
							CardSlot current = <>7__wrap1.Current;
							<>2__current = CS$<>8__locals0.OnValidTarget(current.Card);
							<>1__state = 1;
							return true;
						}
						<>m__Finally1();
						<>7__wrap1 = null;
						<>2__current = (object)new WaitForSeconds(0.5f);
						<>1__state = 2;
						return true;
					}
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

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

			private void <>m__Finally1()
			{
				<>1__state = -1;
				if (<>7__wrap1 != null)
				{
					<>7__wrap1.Dispose();
				}
			}

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

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

			private object <>2__current;

			public GiveAbility <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006e: Expected O, but got Unknown
				int num = <>1__state;
				GiveAbility giveAbility = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
				{
					<>1__state = -1;
					PlayableCard currentSacrificeDemandingCard = Singleton<BoardManager>.Instance.CurrentSacrificeDemandingCard;
					if ((Object)(object)currentSacrificeDemandingCard != (Object)null)
					{
						<>2__current = giveAbility.OnValidTarget(currentSacrificeDemandingCard);
						<>1__state = 1;
						return true;
					}
					break;
				}
				case 1:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.5f);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					<>2__current = ((AbilityBehaviour)giveAbility).LearnAbility(0f);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -1;
					break;
				}
				return false;
			}

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

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

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

			private object <>2__current;

			public GiveAbility <>4__this;

			public CardSlot slot;

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

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

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

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

			private bool MoveNext()
			{
				//IL_005a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Expected O, but got Unknown
				int num = <>1__state;
				GiveAbility giveAbility = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = giveAbility.OnValidTarget(slot.Card);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.5f);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					<>2__current = ((AbilityBehaviour)giveAbility).LearnAbility(0f);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -1;
					return false;
				}
			}

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

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

		public virtual TargetBehaviour TargetMode { get; set; }

		private bool ValidTarget(PlayableCard card)
		{
			return TargetMode switch
			{
				TargetBehaviour.TargetFriendlies => card.OpponentCard == ((AbilityBehaviour)this).Card.OpponentCard, 
				TargetBehaviour.TargetOpponents => card.OpponentCard != ((AbilityBehaviour)this).Card.OpponentCard, 
				_ => true, 
			};
		}

		public override bool RespondsToSacrifice()
		{
			return true;
		}

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

		public override bool RespondsToResolveOnBoard()
		{
			return ((Card)((AbilityBehaviour)this).Card).Info.IsGlobalSpell();
		}

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

		public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
		{
			if (((Card)((AbilityBehaviour)this).Card).Info.IsSpell() && (Object)(object)slot.Card != (Object)null)
			{
				return ValidTarget(slot.Card);
			}
			return false;
		}

		[IteratorStateMachine(typeof(<OnSlotTargetedForAttack>d__10))]
		public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OnSlotTargetedForAttack>d__10(0)
			{
				<>4__this = this,
				slot = slot
			};
		}

		public abstract IEnumerator OnValidTarget(PlayableCard card);
	}
	public class GiveSigils : GiveAbility
	{
		[CompilerGenerated]
		private sealed class <AddAbilitiesFromHostToTarget>d__7 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public PlayableCard host;

			public PlayableCard target;

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

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

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

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

			private bool MoveNext()
			{
				//IL_001a: 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_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Expected O, but got Unknown
				//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0100: Unknown result type (might be due to invalid IL or missing references)
				//IL_014f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0140: 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_0118: Unknown result type (might be due to invalid IL or missing references)
				//IL_01da: Unknown result type (might be due to invalid IL or missing references)
				//IL_01df: 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_0239: Unknown result type (might be due to invalid IL or missing references)
				//IL_022a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0214: Unknown result type (might be due to invalid IL or missing references)
				//IL_0202: Unknown result type (might be due to invalid IL or missing references)
				//IL_0342: Unknown result type (might be due to invalid IL or missing references)
				//IL_034c: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
				{
					<>1__state = -1;
					CardModificationInfo val = new CardModificationInfo();
					CardModificationInfo val2 = new CardModificationInfo
					{
						fromCardMerge = true
					};
					AbilitiesUtil.GetAbilitiesFromMods((from x in host.TemporaryMods.Concat(((Card)host).Info.Mods)
						where x.fromCardMerge
						select x).ToList());
					val.abilities.AddRange(((Card)host).Info.DefaultAbilities);
					foreach (CardModificationInfo item in ((Card)host).Info.Mods.Where((CardModificationInfo x) => x.abilities.Count > 0))
					{
						foreach (Ability ability in item.abilities)
						{
							bool fromCardMerge = item.fromCardMerge;
							if (AbilitiesUtil.GetInfo(ability).canStack || (fromCardMerge ? (!val2.abilities.Contains(ability)) : (!val.abilities.Contains(ability))))
							{
								if (fromCardMerge)
								{
									val2.abilities.Add(ability);
								}
								else
								{
									val.abilities.Add(ability);
								}
							}
						}
					}
					foreach (CardModificationInfo item2 in host.TemporaryMods.Where((CardModificationInfo x) => x.abilities.Count > 0 && !x.fromTotem && !x.fromLatch && !x.fromOverclock))
					{
						foreach (Ability ability2 in item2.abilities)
						{
							bool fromCardMerge2 = item2.fromCardMerge;
							if (AbilitiesUtil.GetInfo(ability2).canStack || (fromCardMerge2 ? (!val2.abilities.Contains(ability2)) : (!val.abilities.Contains(ability2))))
							{
								if (fromCardMerge2)
								{
									val2.abilities.Add(ability2);
								}
								else
								{
									val.abilities.Add(ability2);
								}
							}
						}
					}
					val.abilities.RemoveAll((Ability x) => AbilityExtensions.GetExtendedPropertyAsBool(x, "Spells:GiveAbility").GetValueOrDefault());
					val2.abilities.RemoveAll((Ability x) => AbilityExtensions.GetExtendedPropertyAsBool(x, "Spells:GiveAbility").GetValueOrDefault());
					if (val.abilities.Count > 4)
					{
						val.abilities.RemoveRange(4, val.abilities.Count - 4);
					}
					if (val2.abilities.Count > 4)
					{
						val2.abilities.RemoveRange(4, val2.abilities.Count - 4);
					}
					((Card)target).Anim.PlayTransformAnimation();
					target.AddTemporaryMod(val);
					target.AddTemporaryMod(val2);
					<>2__current = (object)new WaitForSeconds(0.15f);
					<>1__state = 1;
					return true;
				}
				case 1:
					<>1__state = -1;
					return false;
				}
			}

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

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

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

			private object <>2__current;

			public GiveSigils <>4__this;

			public PlayableCard card;

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

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

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

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

			private bool MoveNext()
			{
				int num = <>1__state;
				GiveSigils giveSigils = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = AddAbilitiesFromHostToTarget(((AbilityBehaviour)giveSigils).Card, card);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					return false;
				}
			}

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

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

		public const int MaxSigilsToGive = 4;

		public override Ability Ability => AbilityID;

		public static Ability AbilityID { get; private set; }

		[IteratorStateMachine(typeof(<AddAbilitiesFromHostToTarget>d__7))]
		public static IEnumerator AddAbilitiesFromHostToTarget(PlayableCard host, PlayableCard target)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <AddAbilitiesFromHostToTarget>d__7(0)
			{
				host = host,
				target = target
			};
		}

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

		public static void Register()
		{
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>();
			val.rulebookName = "Give Sigils";
			val.rulebookDescription = "Gives this card's sigils to the target.";
			val.canStack = true;
			val.powerLevel = 3;
			val.opponentUsable = false;
			val.passive = false;
			val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 };
			AbilityExtensions.SetPixelAbilityIcon(val, AssetHelper.LoadTexture("give_sigils_pixel", (FilterMode)0), (FilterMode?)null);
			AbilityExtensions.SetExtendedProperty(val, "Spells:GiveAbility", (object)true);
			AbilityID = AbilityManager.Add("zorro.infiniscryption.sigils", val, typeof(GiveSigils), (Texture)(object)AssetHelper.LoadTexture("ability_give_sigils", (FilterMode)0)).Id;
		}
	}
	public class GiveStats : GiveAbility
	{
		[CompilerGenerated]
		private sealed class <AddStatsFromHostToTarget>d__6 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public PlayableCard host;

			public PlayableCard target;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0029: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
				{
					<>1__state = -1;
					CardModificationInfo val = new CardModificationInfo(host.Attack, 0);
					if (host.Health < 0)
					{
						target.AddTemporaryMod(val);
						<>2__current = host.TakeDamage(-host.Health, (PlayableCard)null);
						<>1__state = 1;
						return true;
					}
					val.healthAdjustment = host.Health;
					target.AddTemporaryMod(val);
					break;
				}
				case 1:
					<>1__state = -1;
					break;
				}
				return false;
			}

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

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

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

			private object <>2__current;

			public GiveStats <>4__this;

			public PlayableCard card;

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

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

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

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

			private bool MoveNext()
			{
				int num = <>1__state;
				GiveStats giveStats = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = AddStatsFromHostToTarget(((AbilityBehaviour)giveStats).Card, card);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					return false;
				}
			}

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

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

		public override Ability Ability => AbilityID;

		public static Ability AbilityID { get; private set; }

		[IteratorStateMachine(typeof(<AddStatsFromHostToTarget>d__6))]
		public static IEnumerator AddStatsFromHostToTarget(PlayableCard host, PlayableCard target)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <AddStatsFromHostToTarget>d__6(0)
			{
				host = host,
				target = target
			};
		}

		[IteratorStateMachine(typeof(<OnValidTarget>d__7))]
		public override IEnumerator OnValidTarget(PlayableCard card)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OnValidTarget>d__7(0)
			{
				<>4__this = this,
				card = card
			};
		}

		public static void Register()
		{
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>();
			val.rulebookName = "Give Stats";
			val.rulebookDescription = "Gives this card's stats to the target.";
			val.canStack = true;
			val.powerLevel = 2;
			val.opponentUsable = false;
			val.passive = false;
			val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 };
			AbilityExtensions.SetPixelAbilityIcon(val, AssetHelper.LoadTexture("give_stats_pixel", (FilterMode)0), (FilterMode?)null);
			AbilityExtensions.SetExtendedProperty(val, "Spells:GiveAbility", (object)true);
			AbilityID = AbilityManager.Add("zorro.infiniscryption.sigils", val, typeof(GiveStats), (Texture)(object)AssetHelper.LoadTexture("ability_give_stats", (FilterMode)0)).Id;
		}
	}
	public class GiveStatsSigils : GiveAbility
	{
		[CompilerGenerated]
		private sealed class <OnValidTarget>d__6 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public GiveStatsSigils <>4__this;

			public PlayableCard card;

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

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

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

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

			private bool MoveNext()
			{
				//IL_002f: 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)
				int num = <>1__state;
				GiveStatsSigils giveStatsSigils = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if (CardExtensions.LacksAbility(((AbilityBehaviour)giveStatsSigils).Card, GiveStats.AbilityID))
					{
						<>2__current = GiveStats.AddStatsFromHostToTarget(((AbilityBehaviour)giveStatsSigils).Card, card);
						<>1__state = 1;
						return true;
					}
					goto IL_007f;
				case 1:
					<>1__state = -1;
					if ((Object)(object)card == (Object)null || card.Dead)
					{
						return false;
					}
					goto IL_007f;
				case 2:
					{
						<>1__state = -1;
						break;
					}
					IL_007f:
					if (CardExtensions.LacksAbility(((AbilityBehaviour)giveStatsSigils).Card, GiveSigils.AbilityID))
					{
						<>2__current = GiveSigils.AddAbilitiesFromHostToTarget(((AbilityBehaviour)giveStatsSigils).Card, card);
						<>1__state = 2;
						return true;
					}
					break;
				}
				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 override Ability Ability => AbilityID;

		public static Ability AbilityID { get; private set; }

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

		public static void Register()
		{
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>();
			val.rulebookName = "Give Stats and Sigils";
			val.rulebookDescription = "Gives this card's stats and sigils to the target.";
			val.canStack = true;
			val.powerLevel = 5;
			val.opponentUsable = false;
			val.passive = false;
			val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 };
			AbilityExtensions.SetPixelAbilityIcon(val, AssetHelper.LoadTexture("give_stats_sigils_pixel", (FilterMode)0), (FilterMode?)null);
			AbilityExtensions.SetExtendedProperty(val, "Spells:GiveAbility", (object)true);
			AbilityID = AbilityManager.Add("zorro.infiniscryption.sigils", val, typeof(GiveStatsSigils), (Texture)(object)AssetHelper.LoadTexture("ability_give_stats_sigils", (FilterMode)0)).Id;
		}
	}
	public class GlobalSpellAbility : VariableStatBehaviour
	{
		private static SpecialStatIcon _icon;

		private static SpecialTriggeredAbility _id;

		public static SpecialStatIcon Icon => _icon;

		public override SpecialStatIcon IconType => _icon;

		public static SpecialTriggeredAbility ID => _id;

		public static void Register()
		{
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			StatIconInfo val = ScriptableObject.CreateInstance<StatIconInfo>();
			val.appliesToAttack = true;
			val.appliesToHealth = true;
			val.rulebookName = "Spell (Global)";
			val.rulebookDescription = "When this card is played anywhere on the board, it will cause an immediate effect and then disappear.";
			val.gbcDescription = "GLOBAL SPELL.";
			val.iconGraphic = (Texture)(object)AssetHelper.LoadTexture("global_spell_stat_icon", (FilterMode)0);
			AbilityExtensions.SetPixelIcon(val, AssetHelper.LoadTexture("global_spell_icon_pixel", (FilterMode)0), (FilterMode?)null);
			AbilityExtensions.SetDefaultPart1Ability(val);
			FullStatIcon obj = StatIconManager.Add("zorro.infiniscryption.sigils", val, typeof(GlobalSpellAbility));
			_icon = obj.Id;
			_id = obj.AbilityId;
		}

		public override int[] GetStatValues()
		{
			return new int[2];
		}
	}
	public class InstaGlobalSpellAbility : VariableStatBehaviour
	{
		private static SpecialStatIcon _icon;

		private static SpecialTriggeredAbility _id;

		public static SpecialStatIcon Icon => _icon;

		public override SpecialStatIcon IconType => _icon;

		public static SpecialTriggeredAbility ID => _id;

		public static void Register()
		{
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			StatIconInfo val = ScriptableObject.CreateInstance<StatIconInfo>();
			val.appliesToAttack = true;
			val.appliesToHealth = true;
			val.rulebookName = "Spell (Global, Instant)";
			val.rulebookDescription = "When this card is played, it will cause an immediate effect and then disappear.";
			val.gbcDescription = "INSTA-GLOBAL SPELL.";
			val.iconGraphic = (Texture)(object)AssetHelper.LoadTexture("insta_global_spell_stat_icon", (FilterMode)0);
			AbilityExtensions.SetPixelIcon(val, AssetHelper.LoadTexture("insta_global_spell_icon_pixel", (FilterMode)0), (FilterMode?)null);
			AbilityExtensions.SetDefaultPart1Ability(val);
			FullStatIcon obj = StatIconManager.Add("zorro.infiniscryption.sigils", val, typeof(InstaGlobalSpellAbility));
			_icon = obj.Id;
			_id = obj.AbilityId;
		}

		public override int[] GetStatValues()
		{
			return new int[2];
		}
	}
	public class TargetedSpellAbility : VariableStatBehaviour
	{
		private static SpecialStatIcon _icon;

		private static SpecialTriggeredAbility _id;

		public static SpecialStatIcon Icon => _icon;

		public override SpecialStatIcon IconType => _icon;

		public static SpecialTriggeredAbility ID => _id;

		public static void Register()
		{
			//IL_007d: 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_00b0: 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)
			StatIconInfo val = ScriptableObject.CreateInstance<StatIconInfo>();
			val.appliesToAttack = true;
			val.appliesToHealth = true;
			val.rulebookName = "Spell (Targeted)";
			val.rulebookDescription = "When this card is played, it will target and affect a chosen space on the board and then disappear.";
			val.gbcDescription = "TARGETED SPELL.";
			val.iconGraphic = (Texture)(object)AssetHelper.LoadTexture("targeted_spell_stat_icon", (FilterMode)0);
			AbilityExtensions.SetPixelIcon(val, AssetHelper.LoadTexture("targeted_spell_icon_pixel", (FilterMode)0), (FilterMode?)null);
			AbilityExtensions.SetDefaultPart1Ability(val);
			_icon = StatIconManager.Add("zorro.infiniscryption.sigils", val, typeof(TargetedSpellAbility)).Id;
			_id = ((IEnumerable<FullStatIcon>)StatIconManager.AllStatIcons).FirstOrDefault((Func<FullStatIcon, bool>)((FullStatIcon sii) => sii.Id == Icon)).AbilityId;
		}

		public override int[] GetStatValues()
		{
			return new int[2];
		}
	}
}
namespace Infiniscryption.Spells.Patchers
{
	public class Act1QueuedCardInteractable : MainInputInteractable
	{
		public HighlightedInteractable queueSlot;

		public PlayableCard playableCard;

		public void QueueCursorEnter()
		{
			PlayableCard obj = playableCard;
			if ((Object)(object)((obj != null) ? obj.QueuedSlot : null) == (Object)null)
			{
				playableCard = null;
			}
			else
			{
				SpellBehavior.UpdateStatsSpellDisplay((Card)(object)playableCard, showStats: true);
			}
		}

		public void QueueCursorExit()
		{
			PlayableCard obj = playableCard;
			if ((Object)(object)((obj != null) ? obj.QueuedSlot : null) == (Object)null)
			{
				playableCard = null;
			}
			else
			{
				SpellBehavior.UpdateStatsSpellDisplay((Card)(object)playableCard, showStats: false);
			}
		}
	}
	public static class SpellBehavior
	{
		public class SpellBackgroundAppearance : CardAppearanceBehaviour
		{
			public static Appearance ID = CardAppearanceBehaviourManager.Add("zorro.infiniscryption.sigils", "SpellBackground", typeof(SpellBackgroundAppearance)).Id;

			private static readonly Texture _emptySpell = (Texture)(object)AssetHelper.LoadTexture("empty_spell_background", (FilterMode)0);

			public override void ApplyAppearance()
			{
				((CardAppearanceBehaviour)this).Card.RenderInfo.baseTextureOverride = _emptySpell;
			}
		}

		public class RareSpellBackgroundAppearance : CardAppearanceBehaviour
		{
			public static Appearance ID = CardAppearanceBehaviourManager.Add("zorro.infiniscryption.sigils", "RareSpellBackground", typeof(RareSpellBackgroundAppearance)).Id;

			private static readonly Texture _emptySpell = (Texture)(object)AssetHelper.LoadTexture("empty_spell_background_rare", (FilterMode)0);

			public override void ApplyAppearance()
			{
				((CardAppearanceBehaviour)this).Card.RenderInfo.baseTextureOverride = _emptySpell;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass35_0
		{
			public PlayableCard card;

			public CardSlot slot;

			internal bool <OpponentSpellsResolveDifferently>b__0(CardSlot s)
			{
				return s.IsValidTarget(card);
			}

			internal void <OpponentSpellsResolveDifferently>b__2()
			{
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				((Card)card).Anim.PlayRiffleSound();
				Tween.Rotation(((Component)card).transform, ((Component)slot).transform.GetChild(0).rotation, 0.1f, 0f, Tween.EaseOut, (LoopType)0, (Action)null, (Action)null, true);
			}

			internal bool <OpponentSpellsResolveDifferently>b__4(CardSlot s)
			{
				return !card.TriggerHandler.CustomRespondsToTrigger((Trigger)6, s, card);
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass35_1
		{
			public bool targetPlayer;

			public <>c__DisplayClass35_0 CS$<>8__locals1;

			internal void <OpponentSpellsResolveDifferently>b__1()
			{
				if (targetPlayer)
				{
					Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
				}
				if (((Card)CS$<>8__locals1.card).Info.IsSpellShowStats())
				{
					UpdateStatsSpellDisplay((Card)(object)CS$<>8__locals1.card, showStats: true);
				}
			}
		}

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

			private object <>2__current;

			public PlayableCard card;

			public CardSlot slot;

			private <>c__DisplayClass35_1 <>8__1;

			public IEnumerator enumerator;

			private CombatPhaseManager <instance>5__2;

			private SpellSniperVisualiser <visualiser>5__3;

			private CardSlot <targetSlot>5__4;

			private List<CardSlot> <resolveSlots>5__5;

			private List<CardSlot>.Enumerator <>7__wrap5;

			private int <i>5__7;

			private IEnumerator <resolveTrigger>5__8;

			private bool <active>5__9;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				switch (<>1__state)
				{
				case -3:
				case 4:
					try
					{
					}
					finally
					{
						<>m__Finally1();
					}
					break;
				case -4:
				case 8:
					try
					{
					}
					finally
					{
						<>m__Finally2();
					}
					break;
				}
				<>8__1 = null;
				<instance>5__2 = null;
				<visualiser>5__3 = null;
				<targetSlot>5__4 = null;
				<resolveSlots>5__5 = null;
				<resolveTrigger>5__8 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_023d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0286: Unknown result type (might be due to invalid IL or missing references)
				//IL_0290: Expected O, but got Unknown
				//IL_0478: Unknown result type (might be due to invalid IL or missing references)
				//IL_0482: Expected O, but got Unknown
				//IL_07ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_07b8: Expected O, but got Unknown
				//IL_08e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_08ea: Expected O, but got Unknown
				//IL_09d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_09e3: Expected O, but got Unknown
				//IL_0622: Unknown result type (might be due to invalid IL or missing references)
				//IL_062c: Expected O, but got Unknown
				//IL_043c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0446: Expected O, but got Unknown
				//IL_0772: Unknown result type (might be due to invalid IL or missing references)
				//IL_077c: 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
				try
				{
					object[] array;
					SpellSniperVisualiser spellSniperVisualiser2;
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
					{
						<>1__state = -1;
						<>c__DisplayClass35_0 <>c__DisplayClass35_ = new <>c__DisplayClass35_0
						{
							card = card,
							slot = slot
						};
						if ((Object)(object)<>c__DisplayClass35_.card != (Object)null && <>c__DisplayClass35_.card.OpponentCard && ((Card)<>c__DisplayClass35_.card).Info.IsSpell())
						{
							<>8__1 = new <>c__DisplayClass35_1();
							<>8__1.CS$<>8__locals1 = <>c__DisplayClass35_;
							<instance>5__2 = Singleton<CombatPhaseManager>.Instance;
							<visualiser>5__3 = null;
							SaveFile saveFile = SaveManager.SaveFile;
							if (((saveFile != null) ? new bool?(saveFile.IsPart1) : null).GetValueOrDefault())
							{
								<visualiser>5__3 = ((Component)<instance>5__2).GetComponent<SpellSniperVisualiser>() ?? ((Component)<instance>5__2).gameObject.AddComponent<SpellSniperVisualiser>();
							}
							<targetSlot>5__4 = null;
							if (((Card)<>8__1.CS$<>8__locals1.card).Info.IsTargetedSpell())
							{
								<targetSlot>5__4 = OpponentGetTargetSlot(Singleton<BoardManager>.Instance.AllSlotsCopy.FindAll((CardSlot s) => s.IsValidTarget(<>8__1.CS$<>8__locals1.card)));
							}
							<>8__1.targetPlayer = ((Card)<>8__1.CS$<>8__locals1.card).Info.IsGlobalSpell() || ((Object)(object)<targetSlot>5__4 != (Object)null && <>8__1.CS$<>8__locals1.card.OpponentCard == <targetSlot>5__4.IsPlayerSlot);
							Singleton<ViewManager>.Instance.SwitchToView((View)6, false, false);
							<>2__current = (object)new WaitForSeconds(0.3f);
							<>1__state = 1;
							return true;
						}
						<>2__current = enumerator;
						<>1__state = 14;
						return true;
					}
					case 1:
						<>1__state = -1;
						Tween.LocalPosition(((Component)<>8__1.CS$<>8__locals1.card).transform, new Vector3(0.65f, 6.2f, <>8__1.targetPlayer ? 0f : 1f), 0.1f, 0f, Tween.EaseOut, (LoopType)0, (Action)delegate
						{
							if (<>8__1.targetPlayer)
							{
								Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
							}
							if (((Card)<>8__1.CS$<>8__locals1.card).Info.IsSpellShowStats())
							{
								UpdateStatsSpellDisplay((Card)(object)<>8__1.CS$<>8__locals1.card, showStats: true);
							}
						}, (Action)delegate
						{
							//IL_002c: Unknown result type (might be due to invalid IL or missing references)
							((Card)<>8__1.CS$<>8__locals1.card).Anim.PlayRiffleSound();
							Tween.Rotation(((Component)<>8__1.CS$<>8__locals1.card).transform, ((Component)<>8__1.CS$<>8__locals1.slot).transform.GetChild(0).rotation, 0.1f, 0f, Tween.EaseOut, (LoopType)0, (Action)null, (Action)null, true);
						}, true);
						<>2__current = (object)new WaitForSeconds(0.4f);
						<>1__state = 2;
						return true;
					case 2:
						<>1__state = -1;
						if (<>8__1.CS$<>8__locals1.card.TriggerHandler.RespondsToTrigger((Trigger)2, Array.Empty<object>()))
						{
							<>2__current = <>8__1.CS$<>8__locals1.card.TriggerHandler.OnTrigger((Trigger)2, Array.Empty<object>());
							<>1__state = 3;
							return true;
						}
						goto IL_0302;
					case 3:
						<>1__state = -1;
						goto IL_0302;
					case 4:
						<>1__state = -3;
						goto IL_045c;
					case 5:
						<>1__state = -1;
						goto IL_0497;
					case 6:
						<>1__state = -1;
						goto IL_055b;
					case 7:
						<>1__state = -1;
						<instance>5__2.VisualizeClearSniperAbility();
						<visualiser>5__3?.VisualizeClearSniperAbility();
						<resolveSlots>5__5 = null;
						goto IL_0664;
					case 8:
						<>1__state = -4;
						goto IL_0792;
					case 9:
						<>1__state = -1;
						<i>5__7 = 0;
						goto IL_08c4;
					case 10:
						<>1__state = -1;
						<i>5__7++;
						goto IL_08c4;
					case 11:
						<>1__state = -1;
						<instance>5__2.VisualizeClearSniperAbility();
						<visualiser>5__3?.VisualizeClearSniperAbility();
						<resolveSlots>5__5 = null;
						goto IL_0923;
					case 12:
						<>1__state = -1;
						goto IL_09b9;
					case 13:
						<>1__state = -1;
						return false;
					case 14:
						{
							<>1__state = -1;
							return false;
						}
						IL_08c4:
						if (<i>5__7 < <resolveSlots>5__5.Count)
						{
							SpellSniperVisualiser spellSniperVisualiser = <visualiser>5__3;
							if (spellSniperVisualiser != null && spellSniperVisualiser.sniperIcons.Count > <i>5__7 && (Object)(object)<visualiser>5__3?.sniperIcons[<i>5__7] != (Object)null)
							{
								<visualiser>5__3?.CleanUpTargetIcon(<visualiser>5__3?.sniperIcons[<i>5__7]);
							}
							<>2__current = <>8__1.CS$<>8__locals1.card.TriggerHandler.OnTrigge