Decompiled source of SauriaSigils v1.0.1

SauriaSigils.dll

Decompiled 4 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using DiskCardGame;
using HarmonyLib;
using Infiniscryption.Achievements;
using InscryptionAPI.Ascension;
using InscryptionAPI.Card;
using InscryptionAPI.Dialogue;
using InscryptionAPI.Guid;
using InscryptionAPI.Saves;
using InscryptionAPI.Sound;
using InscryptionAPI.TalkingCards.Create;
using InscryptionAPI.Triggers;
using OpponentBones;
using Pixelplacement;
using SauriaSigils;
using SauriaSigilsAch;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("SauriaSigils")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+f2af05a85e299483d73eedc2d47b866444d0e7b5")]
[assembly: AssemblyProduct("SauriaSigils")]
[assembly: AssemblyTitle("SauriaSigils")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace SauriaSigils
{
	[BepInPlugin("SauriaSigils", "SauriaSigils", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "SauriaSigils";

		private const string PluginName = "SauriaSigils";

		private const string PluginVersion = "1.0.0";

		public static AssetBundle bundle;

		public static bool NevernamedFound;

		public static bool ATSFound;

		public static bool CardsFound;

		public static bool AchFound;

		public static Harmony Harmony;

		public static ManualLogSource Log;

		public static string ATS;

		public static List<string> JPList;

		private void Awake()
		{
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			Log.LogInfo((object)"Loaded Sauria Sigils!");
			DialogueEventGenerator.GenerateDialogueEvents();
			NevernamedFound = false;
			ATSFound = false;
			CardsFound = false;
			AchFound = false;
			if (Chainloader.PluginInfos.ContainsKey("nevernamed.inscryption.sigils"))
			{
				Log.LogInfo((object)"Sauria Sigils found Nevernamed sigils!");
				NevernamedFound = true;
			}
			ATS = "ATS";
			if (Chainloader.PluginInfos.ContainsKey("ATS"))
			{
				Log.LogInfo((object)"Sauria Sigils found ATS sigils!");
				ATSFound = true;
			}
			else if (Chainloader.PluginInfos.ContainsKey("AllTheSigils"))
			{
				ATS = "AllTheSigils";
				Log.LogInfo((object)"Sauria Sigils found ATS sigils!");
				ATSFound = true;
			}
			else if (Chainloader.PluginInfos.ContainsKey("extraVoid.inscryption.voidSigils"))
			{
				ATS = "extraVoid.inscryption.voidSigils";
				Log.LogInfo((object)"Sauria Sigils found ATS sigils!");
				ATSFound = true;
			}
			if (Chainloader.PluginInfos.ContainsKey("SauriaCards"))
			{
				Log.LogInfo((object)"Sauria Sigils found cards!");
				CardsFound = true;
				if (Chainloader.PluginInfos.ContainsKey("zorro.inscryption.infiniscryption.achievements"))
				{
					Log.LogInfo((object)"Sauria Sigils found achievements too!");
					AchFound = true;
				}
			}
			bundle = LoadBundle("SauriaSigils/Resources/sigilassetbundle");
			Harmony = new Harmony("SauriaSigils.harmonypatcher");
			Harmony.PatchAll();
			Avenging.Init();
			AvengingStrike.Init();
			Bleeding.Init();
			BleedingA.Init();
			Blessing.Init();
			Blizzard.Init();
			BoneBlast.Init();
			BoneGift.Init();
			BoneOffering.Init();
			Cannibalistic.Init();
			Caretaker.Init();
			Catapult.Init();
			ChangeForm.Init();
			ChangeFormB.Init();
			Concerned.Init();
			Cruelty.Init();
			DeepFreeze.Init();
			Dismember.Init();
			Embolden.Init();
			Enduring.Init();
			Fervor.Init();
			ErraticMarch.Init();
			GroundPound.Init();
			GroundSmash.Init();
			GeneticFlaw.Init();
			GeneticPerfection.Init();
			GreaterCatapult.Init();
			GreaterGrudgeBearer.Init();
			GreaterEmbolden.Init();
			GreaterNurture.Init();
			GrievousDisplay.Init();
			GrudgeBearer.Init();
			GrudgePowered.Init();
			GrudgeTarget.Init();
			HastyEscape.Init();
			Indominus.Init();
			KnockBack.Init();
			Memento.Init();
			Micro.Init();
			MovementCommand.Init();
			Nurture.Init();
			Outburst.Init();
			ParasitoidPropagation.Init();
			ParentalCare.Init();
			PartingBone.Init();
			Persistent.Init();
			ProtectiveParent.Init();
			PurpleEm2App.Init();
			PurpleEmApp.Init();
			Pursuer.Init();
			Quake.Init();
			Raptor.Init();
			RedEmApp.Init();
			ServedDinner.Init();
			ShoalStrike.Init();
			Skittish.Init();
			SprinterStrike.Init();
			StickyTongue.Init();
			TacticalRetreat.Init();
			TearThrough.Init();
			Territorial.Init();
			Tyranny.Init();
			ViciousGrowth.Init();
			Wounding.Init();
			Bone.Init();
			Ice.Init();
			Meat.Init();
			AbilityManager.ModifyAbilityList += (List<FullAbility> abilities) => abilities;
			CreateJPList();
		}

		public static AssetBundle LoadBundle(string path)
		{
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(path.Replace("\\", ".").Replace("/", "."));
			return AssetBundle.LoadFromStream(stream);
		}

		static Plugin()
		{
		}

		public static void LogError(string error)
		{
			Log.LogError((object)error);
		}

		public static void CreateJPList()
		{
			if (JPList == null)
			{
				JPList = new List<string>();
				JPList.Add("Sauria_Trex");
				JPList.Add("Sauria_TrexB");
				JPList.Add("Sauria_Tricera");
				JPList.Add("Sauria_TriceraB");
				JPList.Add("Sauria_Velo");
				JPList.Add("Sauria_Deinon");
				JPList.Add("Sauria_Dilo");
				JPList.Add("Sauria_DiloA");
				JPList.Add("Sauria_Brachio");
				JPList.Add("Sauria_BrachioB");
				JPList.Add("Sauria_Comp");
				JPList.Add("Sauria_Proc");
				JPList.Add("Sauria_Gal");
				JPList.Add("Sauria_Para");
				JPList.Add("Sauria_ParaB");
				JPList.Add("Sauria_Maiasaura");
				JPList.Add("Sauria_Othni");
				JPList.Add("Sauria_Apa");
				JPList.Add("Sauria_Cama");
				JPList.Add("Sauria_Ceara");
				JPList.Add("Sauria_Hadro");
				JPList.Add("Sauria_Hypsilo");
				JPList.Add("Sauria_Euoplo");
				JPList.Add("Sauria_Microcera");
				JPList.Add("Sauria_Herrera");
				JPList.Add("Sauria_Bary");
				JPList.Add("Sauria_Procera");
				JPList.Add("Sauria_Pterano");
				JPList.Add("Sauria_Metria");
				JPList.Add("Sauria_Segi");
			}
		}
	}
	public class SigilSetupUtility
	{
		public static Dictionary<Tribe, string> TribalTailDefault;

		public static AbilityInfo MakeNewSigil(string name, string description, Type behaviour, List<AbilityMetaCategory> categories = null, int powerLevel = 0, bool stackable = false, bool opponentUsable = false, Texture tex = null, Texture2D pixelTex = null, bool isConduit = false, bool isActivated = false, string triggerText = null, bool isConduitCell = false)
		{
			AbilityInfo val = AbilityManager.New("Sauria", name, description, behaviour, (Texture)(((Object)(object)tex != (Object)null) ? ((object)tex) : ((object)Util.LoadTex("NevernamedsSigils/Resources/Sigils/placeholdersigil.png"))));
			val.powerLevel = powerLevel;
			val.canStack = stackable;
			val.opponentUsable = opponentUsable;
			if ((Object)(object)pixelTex != (Object)null)
			{
				val.pixelIcon = Util.ConvertTexToSprite(pixelTex);
			}
			val.metaCategories = ((categories != null) ? categories : new List<AbilityMetaCategory>());
			val.conduit = isConduit;
			val.activated = isActivated;
			val.triggerText = triggerText;
			val.conduitCell = isConduitCell;
			return val;
		}

		public static StatIconInfo MakeNewStatIcon(string name, string description, Type behaviour, Texture2D tex = null, Texture2D pixelTex = null, bool isForHealth = false, List<AbilityMetaCategory> categories = null, string gbcDescription = null)
		{
			StatIconInfo val = StatIconManager.New("nevernamed.inscryption.sigils", name, description, behaviour);
			val.iconGraphic = (Texture)(object)(((Object)(object)tex != (Object)null) ? tex : Util.LoadTex("NevernamedsSigils/Resources/Sigils/placeholdersigil.png"));
			val.pixelIconGraphic = (((Object)(object)pixelTex != (Object)null) ? Util.GenerateAct2Portrait(pixelTex) : null);
			val.gbcDescription = gbcDescription;
			val.appliesToAttack = !isForHealth;
			val.appliesToHealth = isForHealth;
			if (categories != null)
			{
				val.metaCategories.AddRange(categories);
			}
			return val;
		}

		public static CardInfo NewCard(string internalName, string displayname, int power, int health, List<CardMetaCategory> categories, CardTemple temple, string description, int bloodCost = 0, int bonesCost = 0, int energyCost = 0, List<GemType> gemsCost = null, List<Ability> abilities = null, Texture2D defaultTex = null, Texture2D emissionTex = null, Texture2D pixelTex = null, Texture2D altTexture = null, Texture2D altTextureEmission = null, Texture2D titleGraphic = null, List<Texture> decals = null, List<Appearance> appearanceBehaviour = null, List<Tribe> tribes = null, bool preventSignature = false, List<Trait> traits = null, string defaultTailCard = null, string defaultEvolutionCard = null, string defaultEvolutionName = null, int defaultEvolutionTurns = 1, string defaultFrozenCard = null, Texture2D tailLostTexture = null, List<SpecialTriggeredAbility> specialAbilities = null, SpecialStatIcon variableStat = (SpecialStatIcon)0, bool hideStats = false, bool onePerDeck = false, GameObject animatedPortrait = null, bool flipPortraitWhenStrafing = false, string overrideDamID = null, string overrideDamBlockedDialogue = null, string overrideFactoryConduitSpawn = null, string overrideRabbitHoleSpawn = null, string overrideAntSpawnerSpawn = null, string overrideBellistID = null, string overrideBellistBlockedDialogue = null, string overrideSquirrelShedderId = null, string overrideSkeletonCrewID = null, string overrideBeesWithinID = null, string twisterForm = null, string transformerForm = null, string overrideLeftClaw = null, string overrideRightClaw = null, string customDoomedLifespan = null, string customGutSpewerGuts = null, string customExplodingCorpseGuts = null, string customOrganThiefGuts = null, string harbingerLeaveBehind = null, string tramplerLeaveBehind = null, string flightyLeaveBehind = null, string parthenogenesisOverride = null, string sigilShedderDef = null, bool preventBones = false, bool preventCampfire = false, bool preventSigilVictim = false, bool preventSigilHost = false, bool customGiftBearerSpawnsRares = false, string erraticLeaveBehind = null, bool preventPlay = false, string fatalFlankDef = null, bool allStrikesDoubled = false, string phantasmicLeaveBehind = null, bool preventCampfireHealth = false, bool preventCampfireDamage = false)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Expected O, but got Unknown
			CardInfo val = CardManager.New("Sauria", internalName, displayname, power, health, description);
			val.metaCategories = categories;
			val.temple = temple;
			val.cost = bloodCost;
			val.cardComplexity = (CardComplexity)1;
			val.bonesCost = bonesCost;
			val.gemsCost = ((gemsCost != null) ? gemsCost : new List<GemType>());
			val.energyCost = energyCost;
			val.abilities = ((abilities != null) ? abilities : new List<Ability>());
			val.tribes = ((tribes != null) ? tribes : new List<Tribe>());
			val.traits = ((traits != null) ? traits : new List<Trait>());
			if (specialAbilities != null && specialAbilities.Count > 0)
			{
				CardExtensions.AddSpecialAbilities(val, specialAbilities.ToArray());
			}
			if ((int)variableStat != 0)
			{
				val.specialStatIcon = variableStat;
			}
			if (!string.IsNullOrEmpty(defaultEvolutionName))
			{
				val.defaultEvolutionName = defaultEvolutionName;
			}
			if (!string.IsNullOrEmpty(defaultEvolutionCard))
			{
				CardExtensions.SetEvolve(val, defaultEvolutionCard, defaultEvolutionTurns, (IEnumerable<CardModificationInfo>)null);
			}
			if (!string.IsNullOrEmpty(defaultFrozenCard))
			{
				CardExtensions.SetIceCube(val, defaultFrozenCard, (IEnumerable<CardModificationInfo>)null);
			}
			if (!string.IsNullOrEmpty(defaultTailCard))
			{
				val.tailParams = new TailParams
				{
					tail = CardLoader.GetCardByName(defaultTailCard)
				};
			}
			else if (val.tribes.Count > 0 && TribalTailDefault.ContainsKey(val.tribes[0]))
			{
				val.tailParams = new TailParams
				{
					tail = CardLoader.GetCardByName(TribalTailDefault[val.tribes[0]])
				};
			}
			if (!string.IsNullOrEmpty(overrideDamID))
			{
				CardExtensions.SetExtendedProperty(val, "CustomDamDefinition", (object)overrideDamID);
			}
			if (!string.IsNullOrEmpty(overrideDamBlockedDialogue))
			{
				CardExtensions.SetExtendedProperty(val, "CustomDamDefinitionDialogue", (object)overrideDamID);
			}
			if (!string.IsNullOrEmpty(overrideRabbitHoleSpawn))
			{
				CardExtensions.SetExtendedProperty(val, "CustomRabbitHoleDefinition", (object)overrideRabbitHoleSpawn);
			}
			if (!string.IsNullOrEmpty(overrideAntSpawnerSpawn))
			{
				CardExtensions.SetExtendedProperty(val, "CustomAntSpawnerDefinition", (object)overrideAntSpawnerSpawn);
			}
			if (!string.IsNullOrEmpty(overrideFactoryConduitSpawn))
			{
				CardExtensions.SetExtendedProperty(val, "CustomFactoryConduitDefinition", (object)overrideFactoryConduitSpawn);
			}
			if (!string.IsNullOrEmpty(overrideBellistID))
			{
				CardExtensions.SetExtendedProperty(val, "CustomBellDefinition", (object)overrideBellistID);
			}
			if (!string.IsNullOrEmpty(overrideBellistBlockedDialogue))
			{
				CardExtensions.SetExtendedProperty(val, "CustomBellDefinitionDialogue", (object)overrideBellistBlockedDialogue);
			}
			if (!string.IsNullOrEmpty(overrideSquirrelShedderId))
			{
				CardExtensions.SetExtendedProperty(val, "CustomSquirrelShedderDefinition", (object)overrideSquirrelShedderId);
			}
			if (!string.IsNullOrEmpty(overrideSkeletonCrewID))
			{
				CardExtensions.SetExtendedProperty(val, "CustomSkeletonCrewDefinition", (object)overrideSkeletonCrewID);
			}
			if (!string.IsNullOrEmpty(overrideBeesWithinID))
			{
				CardExtensions.SetExtendedProperty(val, "CustomBeesWithinDefinition", (object)overrideBeesWithinID);
			}
			if (!string.IsNullOrEmpty(twisterForm))
			{
				CardExtensions.SetExtendedProperty(val, "TwisterTransformation", (object)twisterForm);
			}
			if (!string.IsNullOrEmpty(transformerForm))
			{
				CardExtensions.SetExtendedProperty(val, "CustomTransformerTransformation", (object)transformerForm);
			}
			if (!string.IsNullOrEmpty(overrideLeftClaw))
			{
				CardExtensions.SetExtendedProperty(val, "ClawedLeftClawOverride", (object)overrideLeftClaw);
			}
			if (!string.IsNullOrEmpty(overrideRightClaw))
			{
				CardExtensions.SetExtendedProperty(val, "ClawedRightClawOverride", (object)overrideRightClaw);
			}
			if (!string.IsNullOrEmpty(customGutSpewerGuts))
			{
				CardExtensions.SetExtendedProperty(val, "GutSpewerGutOverride", (object)customGutSpewerGuts);
			}
			if (!string.IsNullOrEmpty(customExplodingCorpseGuts))
			{
				CardExtensions.SetExtendedProperty(val, "ExplodingCorpseGutOverride", (object)customExplodingCorpseGuts);
			}
			if (!string.IsNullOrEmpty(customOrganThiefGuts))
			{
				CardExtensions.SetExtendedProperty(val, "OrganThiefGutOverride", (object)customOrganThiefGuts);
			}
			if (!string.IsNullOrEmpty(parthenogenesisOverride))
			{
				CardExtensions.SetExtendedProperty(val, "ParthenogenesisOverride", (object)parthenogenesisOverride);
			}
			if (!string.IsNullOrEmpty(sigilShedderDef))
			{
				CardExtensions.SetExtendedProperty(val, "OverrideSigilShedderDefinition", (object)sigilShedderDef);
			}
			if (!string.IsNullOrEmpty(fatalFlankDef))
			{
				CardExtensions.SetExtendedProperty(val, "FatalFlankOverride", (object)fatalFlankDef);
			}
			if (!string.IsNullOrEmpty(harbingerLeaveBehind))
			{
				CardExtensions.SetExtendedProperty(val, "HarbingerLeaveBehind", (object)harbingerLeaveBehind);
			}
			if (!string.IsNullOrEmpty(tramplerLeaveBehind))
			{
				CardExtensions.SetExtendedProperty(val, "TramplerLeaveBehind", (object)tramplerLeaveBehind);
			}
			if (!string.IsNullOrEmpty(flightyLeaveBehind))
			{
				CardExtensions.SetExtendedProperty(val, "FlightyLeaveBehind", (object)flightyLeaveBehind);
			}
			if (!string.IsNullOrEmpty(erraticLeaveBehind))
			{
				CardExtensions.SetExtendedProperty(val, "ErraticLeaveBehind", (object)erraticLeaveBehind);
			}
			if (!string.IsNullOrEmpty(phantasmicLeaveBehind))
			{
				CardExtensions.SetExtendedProperty(val, "PhantasmicLeaveBehind", (object)phantasmicLeaveBehind);
			}
			if (!string.IsNullOrEmpty(customDoomedLifespan))
			{
				CardExtensions.SetExtendedProperty(val, "CustomDoomedDuration", (object)customDoomedLifespan);
			}
			if (preventBones)
			{
				CardExtensions.SetExtendedProperty(val, "PreventBones", (object)"Yes");
			}
			if (preventCampfire)
			{
				CardExtensions.SetExtendedProperty(val, "BannedFromCampfire", (object)"Yes");
			}
			if (preventCampfireDamage)
			{
				CardExtensions.SetExtendedProperty(val, "BannedFromCampfireDamage", (object)"Yes");
			}
			if (preventCampfireHealth)
			{
				CardExtensions.SetExtendedProperty(val, "BannedFromCampfireHealth", (object)"Yes");
			}
			if (preventSigilVictim)
			{
				CardExtensions.SetExtendedProperty(val, "BannedSigilTransferVictim", (object)"Yes");
			}
			if (preventSigilHost)
			{
				CardExtensions.SetExtendedProperty(val, "BannedSigilTransferTarget", (object)"Yes");
			}
			if (customGiftBearerSpawnsRares)
			{
				CardExtensions.SetExtendedProperty(val, "CustomGiftBearerSpawnsRare", (object)"Yes");
			}
			if (preventPlay)
			{
				CardExtensions.SetExtendedProperty(val, "PreventPlay", (object)"Yes");
			}
			if (allStrikesDoubled)
			{
				CardExtensions.SetExtendedProperty(val, "AllStrikesDoubled", (object)"Yes");
			}
			if ((Object)(object)defaultTex != (Object)null)
			{
				CardExtensions.SetPortrait(val, defaultTex, (FilterMode?)null);
			}
			if ((Object)(object)emissionTex != (Object)null)
			{
				CardExtensions.SetEmissivePortrait(val, emissionTex, (FilterMode?)null);
			}
			if ((Object)(object)pixelTex != (Object)null)
			{
				CardExtensions.SetPixelPortrait(val, pixelTex, (FilterMode?)null);
			}
			if ((Object)(object)altTexture != (Object)null)
			{
				CardExtensions.SetAltPortrait(val, altTexture, (FilterMode?)null);
			}
			if ((Object)(object)altTextureEmission != (Object)null)
			{
				CardExtensions.SetEmissiveAltPortrait(val, altTextureEmission, (FilterMode?)null);
			}
			if ((Object)(object)titleGraphic != (Object)null)
			{
				val.titleGraphic = (Texture)(object)titleGraphic;
			}
			if ((Object)(object)tailLostTexture != (Object)null)
			{
				CardExtensions.SetLostTailPortrait(val, tailLostTexture, (FilterMode?)(FilterMode)0);
			}
			val.hideAttackAndHealth = hideStats;
			val.onePerDeck = onePerDeck;
			val.animatedPortrait = animatedPortrait;
			val.flipPortraitForStrafe = flipPortraitWhenStrafing;
			val.decals = ((decals != null) ? decals : new List<Texture>());
			if (appearanceBehaviour != null)
			{
				CardExtensions.AddAppearances(val, appearanceBehaviour.ToArray());
			}
			CardManager.Add("Sauria", val);
			return val;
		}

		static SigilSetupUtility()
		{
			TribalTailDefault = new Dictionary<Tribe, string>
			{
				{
					(Tribe)3,
					"Tail_Furry"
				},
				{
					(Tribe)2,
					"Tail_Bird"
				},
				{
					(Tribe)6,
					"Tail_Insect"
				},
				{
					(Tribe)4,
					"Tail_Furry"
				},
				{
					(Tribe)1,
					"Tail_Furry"
				}
			};
		}

		public static AbilityInfo MakeNewSigil(string name, string description, string learnedDialogue, Type behaviour, List<AbilityMetaCategory> categories = null, int powerLevel = 0, bool stackable = false, bool opponentUsable = false, string tex = null, bool isActivated = false)
		{
			AbilityInfo val = AbilityManager.New("Sauria", name, description, behaviour, (Texture)(object)((!string.IsNullOrEmpty(tex)) ? Util.LoadTex(tex + "_sig.png") : Util.LoadTex("saurianope_sig.png")));
			val.powerLevel = powerLevel;
			if (!string.IsNullOrEmpty(learnedDialogue))
			{
				val.abilityLearnedDialogue = SetAbilityInfoDialogue(learnedDialogue);
			}
			val.canStack = stackable;
			val.opponentUsable = opponentUsable;
			if (!string.IsNullOrEmpty(tex))
			{
				val.pixelIcon = Util.ConvertTexToSprite(Util.LoadTex(tex + "_sigp.png"));
			}
			else
			{
				val.pixelIcon = Util.ConvertTexToSprite(Util.LoadTex("saurianope_sigp.png"));
			}
			val.metaCategories = ((categories != null) ? categories : new List<AbilityMetaCategory>());
			val.activated = isActivated;
			return val;
		}

		public static LineSet SetAbilityInfoDialogue(string dialogue)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			return new LineSet(new List<Line>
			{
				new Line
				{
					text = dialogue
				}
			});
		}

		public static CardInfo SimpleCard(string internalName, string displayname, int power, int health, List<CardMetaCategory> categories, string description, int bloodCost = 0, int bonesCost = 0, int energyCost = 0, List<Ability> abilities = null, Texture2D defaultTex = null, Texture2D emissionTex = null, Texture2D pixelTex = null, List<Appearance> appearanceBehaviour = null, List<Tribe> tribes = null, List<Trait> traits = null, string defaultTailCard = null, string defaultEvolutionCard = null, string defaultEvolutionName = null, int defaultEvolutionTurns = 1, string defaultFrozenCard = null, List<SpecialTriggeredAbility> specialAbilities = null, SpecialStatIcon variableStat = (SpecialStatIcon)0)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Expected O, but got Unknown
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: 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_0159: Expected O, but got Unknown
			CardInfo val = CardManager.New("Sauria", internalName, displayname, power, health, description);
			val.metaCategories = ((categories != null) ? categories : new List<CardMetaCategory>());
			val.temple = (CardTemple)0;
			val.cost = bloodCost;
			val.cardComplexity = (CardComplexity)1;
			val.bonesCost = bonesCost;
			val.energyCost = energyCost;
			val.abilities = ((abilities != null) ? abilities : new List<Ability>());
			val.tribes = ((tribes != null) ? tribes : new List<Tribe>());
			val.traits = ((traits != null) ? traits : new List<Trait>());
			if (specialAbilities != null && specialAbilities.Count > 0)
			{
				CardExtensions.AddSpecialAbilities(val, specialAbilities.ToArray());
			}
			if ((int)variableStat != 0)
			{
				val.specialStatIcon = variableStat;
			}
			if (!string.IsNullOrEmpty(defaultEvolutionName))
			{
				val.defaultEvolutionName = defaultEvolutionName;
			}
			if (!string.IsNullOrEmpty(defaultEvolutionCard))
			{
				CardExtensions.SetEvolve(val, defaultEvolutionCard, defaultEvolutionTurns, (IEnumerable<CardModificationInfo>)null);
			}
			if (!string.IsNullOrEmpty(defaultFrozenCard))
			{
				CardExtensions.SetIceCube(val, defaultFrozenCard, (IEnumerable<CardModificationInfo>)null);
			}
			if (!string.IsNullOrEmpty(defaultTailCard))
			{
				val.tailParams = new TailParams
				{
					tail = CardLoader.GetCardByName(defaultTailCard)
				};
			}
			else if (val.tribes.Count > 0 && TribalTailDefault.ContainsKey(val.tribes[0]))
			{
				val.tailParams = new TailParams
				{
					tail = CardLoader.GetCardByName(TribalTailDefault[val.tribes[0]])
				};
			}
			if ((Object)(object)defaultTex != (Object)null)
			{
				CardExtensions.SetPortrait(val, defaultTex, (FilterMode?)null);
			}
			if ((Object)(object)emissionTex != (Object)null)
			{
				CardExtensions.SetEmissivePortrait(val, emissionTex, (FilterMode?)null);
			}
			if ((Object)(object)pixelTex != (Object)null)
			{
				CardExtensions.SetPixelPortrait(val, pixelTex, (FilterMode?)null);
			}
			if (appearanceBehaviour != null)
			{
				CardExtensions.AddAppearances(val, appearanceBehaviour.ToArray());
			}
			CardManager.Add("Sauria", val);
			return val;
		}

		public static CardInfo SimpleCardPrep(string internalName, string displayname, int power, int health, List<CardMetaCategory> categories, string description, int bloodCost = 0, int bonesCost = 0, int energyCost = 0, List<Ability> abilities = null, Texture2D defaultTex = null, Texture2D emissionTex = null, Texture2D pixelTex = null, List<Appearance> appearanceBehaviour = null, List<Tribe> tribes = null, List<Trait> traits = null, string defaultTailCard = null, string defaultEvolutionCard = null, string defaultEvolutionName = null, int defaultEvolutionTurns = 1, string defaultFrozenCard = null, List<SpecialTriggeredAbility> specialAbilities = null, SpecialStatIcon variableStat = (SpecialStatIcon)0)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Expected O, but got Unknown
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: 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_0159: Expected O, but got Unknown
			CardInfo val = CardManager.New("Sauria", internalName, displayname, power, health, description);
			val.metaCategories = ((categories != null) ? categories : new List<CardMetaCategory>());
			val.temple = (CardTemple)0;
			val.cost = bloodCost;
			val.cardComplexity = (CardComplexity)1;
			val.bonesCost = bonesCost;
			val.energyCost = energyCost;
			val.abilities = ((abilities != null) ? abilities : new List<Ability>());
			val.tribes = ((tribes != null) ? tribes : new List<Tribe>());
			val.traits = ((traits != null) ? traits : new List<Trait>());
			if (specialAbilities != null && specialAbilities.Count > 0)
			{
				CardExtensions.AddSpecialAbilities(val, specialAbilities.ToArray());
			}
			if ((int)variableStat != 0)
			{
				val.specialStatIcon = variableStat;
			}
			if (!string.IsNullOrEmpty(defaultEvolutionName))
			{
				val.defaultEvolutionName = defaultEvolutionName;
			}
			if (!string.IsNullOrEmpty(defaultEvolutionCard))
			{
				CardExtensions.SetEvolve(val, defaultEvolutionCard, defaultEvolutionTurns, (IEnumerable<CardModificationInfo>)null);
			}
			if (!string.IsNullOrEmpty(defaultFrozenCard))
			{
				CardExtensions.SetIceCube(val, defaultFrozenCard, (IEnumerable<CardModificationInfo>)null);
			}
			if (!string.IsNullOrEmpty(defaultTailCard))
			{
				val.tailParams = new TailParams
				{
					tail = CardLoader.GetCardByName(defaultTailCard)
				};
			}
			else if (val.tribes.Count > 0 && TribalTailDefault.ContainsKey(val.tribes[0]))
			{
				val.tailParams = new TailParams
				{
					tail = CardLoader.GetCardByName(TribalTailDefault[val.tribes[0]])
				};
			}
			if ((Object)(object)defaultTex != (Object)null)
			{
				CardExtensions.SetPortrait(val, defaultTex, (FilterMode?)null);
			}
			if ((Object)(object)emissionTex != (Object)null)
			{
				CardExtensions.SetEmissivePortrait(val, emissionTex, (FilterMode?)null);
			}
			if ((Object)(object)pixelTex != (Object)null)
			{
				CardExtensions.SetPixelPortrait(val, pixelTex, (FilterMode?)null);
			}
			if (appearanceBehaviour != null)
			{
				CardExtensions.AddAppearances(val, appearanceBehaviour.ToArray());
			}
			return val;
		}
	}
	public class Bleeding : AbilityBehaviour
	{
		public static Ability ability;

		public override Ability Ability => ability;

		public static void Init()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Bleeding", "A card bearing this sigil loses 1 Health at the end of their owner's turn.", "How much longer can it endure?", typeof(Bleeding), new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }, -2, stackable: false, opponentUsable: false, "sauriableed").ability;
		}

		public override bool RespondsToTurnEnd(bool playerTurnEnd)
		{
			if (((AbilityBehaviour)this).Card.OpponentCard != playerTurnEnd && ((AbilityBehaviour)this).Card.OnBoard)
			{
				return !((AbilityBehaviour)this).Card.HasAbility((Ability)105);
			}
			return false;
		}

		public override IEnumerator OnTurnEnd(bool playerTurnEnd)
		{
			Singleton<ViewManager>.Instance.SwitchToView((View)4, false, true);
			yield return (object)new WaitForSeconds(0.1f);
			UtilFunky.CreateBlood(((Component)((AbilityBehaviour)this).Card).transform);
			((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
			yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
			CardModificationInfo val = ((AbilityBehaviour)this).Card.TemporaryMods.Find((CardModificationInfo x) => x.singletonId == "Sauria_Bleeding");
			if (val == null)
			{
				val = new CardModificationInfo();
				((AbilityBehaviour)this).Card.AddTemporaryMod(val);
				val.singletonId = "Sauria_Bleeding";
			}
			if (val != null)
			{
				CardModificationInfo obj = val;
				obj.healthAdjustment--;
			}
			if (((Card)((AbilityBehaviour)this).Card).Info.TempDecals.Count < 4)
			{
				((Card)((AbilityBehaviour)this).Card).Info.TempDecals.Add(ResourceBank.Get<Texture>("Art/Cards/Decals/" + AlternatingBloodDecal.GetBloodDecalId()));
			}
			((AbilityBehaviour)this).Card.OnStatsChanged();
			if (((AbilityBehaviour)this).Card.Health <= 0)
			{
				yield return ((AbilityBehaviour)this).Card.Die(false, (PlayableCard)null, true);
			}
			yield return (object)new WaitForSeconds(0.1f);
			yield return ((AbilityBehaviour)this).LearnAbility(0.1f);
			BleedingA.CheckBleedingA(((AbilityBehaviour)this).Card);
			Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0;
		}
	}
	public static class Util
	{
		public static GameObject Particle;

		public static Texture2D LoadTex(string path)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			//IL_0033: Expected O, but got Unknown
			byte[] array = ExtractEmbeddedResource(path);
			if (array == null)
			{
				Plugin.LogError("Could not load texture: " + path);
			}
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false)
			{
				filterMode = (FilterMode)0
			};
			ImageConversion.LoadImage(val, array);
			return val;
		}

		public static byte[] ExtractEmbeddedResource(string filePath)
		{
			filePath = filePath.Replace("/", ".");
			filePath = filePath.Replace("\\", ".");
			using Stream stream = Assembly.GetCallingAssembly().GetManifestResourceStream(filePath);
			if (stream == null)
			{
				return null;
			}
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			return array;
		}

		public static Sprite ConvertTexToSprite(Texture2D tex, Vector2? pivot = null)
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = default(Vector2);
			((Vector2)(ref val))..ctor(0.5f, 0.5f);
			if (pivot.HasValue)
			{
				((Vector2)(ref val))..ctor(pivot.Value.x, pivot.Value.y);
			}
			return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), val, 100f);
		}

		public static Sprite GenerateAct2Portrait(Texture2D tex)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f), 100f);
		}

		public static Sprite LoadSpriteFromFile(string fileName, Vector2? vector = null)
		{
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = LoadTex(fileName);
			if ((Object)(object)val == (Object)null)
			{
				return null;
			}
			Rect val2 = default(Rect);
			((Rect)(ref val2))..ctor(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height);
			Vector2 val3 = (Vector2)(((??)vector) ?? new Vector2(0.5f, 0.5f));
			return Sprite.Create(val, val2, val3, 100f);
		}

		public static FaceAnim MakeFaceAnim(string openName, string closedName = null)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Expected O, but got Unknown
			Texture2D val = LoadTex(openName);
			Rect val2 = default(Rect);
			((Rect)(ref val2))..ctor(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height);
			Sprite val3 = Sprite.Create(val, val2, new Vector2(0.5f, 0f), 100f);
			if (closedName != null)
			{
				Sprite val4 = Sprite.Create(LoadTex(closedName), val2, new Vector2(0.5f, 0f), 100f);
				return new FaceAnim(val3, val4);
			}
			return new FaceAnim(val3, (Sprite)null);
		}

		public static void TemporarilyRemoveAbilityFromCard(this PlayableCard card, Ability toRemove)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			card.AddTemporaryMod(new CardModificationInfo
			{
				negateAbilities = { toRemove }
			});
			card.Status.hiddenAbilities.Add(toRemove);
			((Card)card).RenderCard();
		}

		public static IEnumerator FakeDeath(PlayableCard card, bool wasSacrifice, PlayableCard killer)
		{
			((Card)card).Anim.PlayHitAnimation();
			((Card)card).Anim.SetShielded(false);
			yield return ((Card)card).Anim.ClearLatchAbility();
			if (card.TriggerHandler.RespondsToTrigger((Trigger)12, new object[2] { wasSacrifice, killer }))
			{
				yield return card.TriggerHandler.OnTrigger((Trigger)12, new object[2] { wasSacrifice, killer });
			}
		}

		public static T RandomElement<T>(List<T> list)
		{
			return list[Random.Range(0, list.Count)];
		}

		public static T SeededRandomElement<T>(List<T> list, int seed = -1)
		{
			return list[SeededRandom.Range(0, list.Count, (seed == -1) ? GetRandomSeed() : seed)];
		}

		public static int GetRandomSeed(int manualIncrement = 0)
		{
			return SaveManager.SaveFile.GetCurrentRandomSeed() + Singleton<GlobalTriggerHandler>.Instance.NumTriggersThisBattle + manualIncrement;
		}

		public static CardModificationInfo CondenseMods(this PlayableCard card, List<Ability> excludedabilities = null, bool sigilsOnly = false)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Expected O, but got Unknown
			CardModificationInfo val = new CardModificationInfo();
			foreach (CardModificationInfo temporaryMod in card.temporaryMods)
			{
				if (!temporaryMod.nonCopyable)
				{
					val.abilities.AddRange(temporaryMod.abilities);
					if (!sigilsOnly)
					{
						val.attackAdjustment += temporaryMod.attackAdjustment;
						val.healthAdjustment += temporaryMod.healthAdjustment;
					}
					if (temporaryMod.gemify)
					{
						val.gemify = true;
					}
				}
			}
			foreach (CardModificationInfo mod in ((Card)card).Info.mods)
			{
				if (!mod.nonCopyable)
				{
					val.abilities.AddRange(mod.abilities);
					if (!sigilsOnly)
					{
						val.attackAdjustment += mod.attackAdjustment;
						val.healthAdjustment += mod.healthAdjustment;
					}
					if (mod.gemify)
					{
						val.gemify = true;
					}
				}
			}
			if (excludedabilities != null)
			{
				val.abilities.RemoveAll((Ability x) => excludedabilities.Contains(x));
			}
			if (val.abilities.Count > 0)
			{
				val.fromCardMerge = true;
			}
			return val;
		}

		public static IEnumerator MoveCard(PlayableCard card, CardSlot newSlot)
		{
			if ((Object)(object)card != (Object)null && (Object)(object)newSlot.Card == (Object)null)
			{
				card.SetIsOpponentCard(!newSlot.IsPlayerSlot);
				Vector3 val = (((Component)card.Slot).transform.position + ((Component)newSlot).transform.position) / 2f;
				Tween.Position(((Component)card).transform, val + Vector3.up * 0.35f, 0.1f, 0f, Tween.EaseIn, (LoopType)0, (Action)null, (Action)null, true);
				yield return Singleton<BoardManager>.Instance.AssignCardToSlot(card, newSlot, 0.1f, (Action)null, true);
			}
		}

		public static void AddAbilityToList(List<Ability> list, string GUID, string name)
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			if ((GUID != "nevernamed.inscryption.sigils" && Plugin.ATSFound) || Plugin.NevernamedFound)
			{
				if (GUID != "nevernamed.inscryption.sigils" && GUID != Plugin.ATS)
				{
					GUID = Plugin.ATS;
				}
				list.Add(GuidManager.GetEnumValue<Ability>(GUID, name));
			}
		}

		public static IEnumerator AttackCard(CardSlot attacker, CardSlot victim, bool checkTargetDeath)
		{
			bool flag = true;
			if (checkTargetDeath && ((Object)(object)victim.Card == (Object)null || ((Object)(object)victim.Card != (Object)null && victim.Card.Dead)))
			{
				flag = false;
			}
			if ((Object)(object)attacker.Card != (Object)null && !attacker.Card.Dead && flag)
			{
				yield return Singleton<TurnManager>.Instance.CombatPhaseManager.SlotAttackSlot(attacker, victim, 0f);
			}
		}

		public static void UnlockAchievement(bool flag, Achievement ach)
		{
		}

		public static void SpawnParticlesOnCard(this PlayableCard target, Texture2D tex, float yOffset = 0f)
		{
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Expected O, but got Unknown
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: 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)
			if (Object.op_Implicit((Object)(object)((Card)target).Anim) && ((Card)target).Anim is PaperCardAnimationController)
			{
				CardAnimationController anim = ((Card)target).Anim;
				PaperCardAnimationController val = (PaperCardAnimationController)(object)((anim is PaperCardAnimationController) ? anim : null);
				if (Object.op_Implicit((Object)(object)val.deathParticles))
				{
					GameObject val2 = Object.Instantiate<GameObject>(val.deathParticles);
					ParticleSystem component = val2.GetComponent<ParticleSystem>();
					if (Object.op_Implicit((Object)(object)component))
					{
						MainModule main = component.main;
						component.startColor = Color.white;
						((Renderer)((Component)component).GetComponent<ParticleSystemRenderer>()).material = new Material(((Renderer)((Component)component).GetComponent<ParticleSystemRenderer>()).material)
						{
							mainTexture = (Texture)(object)tex
						};
						((MainModule)(ref main)).startColor = new MinMaxGradient(Color.white);
						val2.SetActive(true);
						val2.transform.SetParent(((Component)val).transform);
						val2.transform.position = val.deathParticles.transform.position;
						val2.transform.localScale = val.deathParticles.transform.localScale;
						val2.transform.rotation = val.deathParticles.transform.rotation;
						((Component)component).transform.position = new Vector3(((Component)component).transform.position.x, ((Component)component).transform.position.y + yOffset, ((Component)component).transform.position.z);
						Object.Destroy((Object)(object)val2, 6f);
					}
				}
			}
			else
			{
				if ((Object)(object)Particle == (Object)null)
				{
					Particle = Plugin.bundle.LoadAsset<GameObject>("MiscBurningParticles");
				}
				GameObject val3 = Object.Instantiate<GameObject>(Particle);
				ParticleSystem component2 = val3.GetComponent<ParticleSystem>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					MainModule main2 = component2.main;
					component2.startColor = Color.white;
					((Renderer)((Component)component2).GetComponent<ParticleSystemRenderer>()).material = new Material(((Renderer)((Component)component2).GetComponent<ParticleSystemRenderer>()).material)
					{
						mainTexture = (Texture)(object)tex
					};
					((MainModule)(ref main2)).startColor = new MinMaxGradient(Color.white);
					val3.SetActive(true);
					val3.transform.position = ((Component)target).transform.position;
					val3.transform.SetParent(((Component)target).transform);
					val3.transform.localScale = new Vector3(0.165f, 0.165f, 0.165f);
					val3.transform.rotation = ((Component)target).transform.rotation;
					((Component)component2).transform.position = new Vector3(((Component)component2).transform.position.x, ((Component)component2).transform.position.y + yOffset, ((Component)component2).transform.position.z);
					Object.Destroy((Object)(object)val3, 6f);
				}
			}
		}

		public static IEnumerator MoveCardFast(PlayableCard card, CardSlot newSlot)
		{
			if ((Object)(object)card != (Object)null && (Object)(object)newSlot.Card == (Object)null)
			{
				Vector3 val = (((Component)card.Slot).transform.position + ((Component)newSlot).transform.position) / 2f;
				Tween.Position(((Component)card).transform, val + Vector3.up * 0.35f, 0.025f, 0f, Tween.EaseIn, (LoopType)0, (Action)null, (Action)null, true);
				yield return Singleton<BoardManager>.Instance.AssignCardToSlot(card, newSlot, 0.025f, (Action)null, true);
			}
		}
	}
	public class Wounding : AbilityBehaviour
	{
		public static Ability ability;

		public override Ability Ability => ability;

		public static void Init()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Wounding", "When a card bearing this sigil deals damage to another card without Made of Stone, its target gains Bleeding effect. Bleeding cards lose 1 Health at the end of their owner's turn.", "This must sting.", typeof(Wounding), new List<AbilityMetaCategory>
			{
				(AbilityMetaCategory)0,
				(AbilityMetaCategory)1
			}, 2, stackable: false, opponentUsable: true, "sauriawound").ability;
		}

		public override bool RespondsToDealDamage(int amount, PlayableCard target)
		{
			return true;
		}

		public Ability toAdd()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return Bleeding.ability;
		}

		public override IEnumerator OnDealDamage(int amount, PlayableCard target)
		{
			if (!target.HasAbility((Ability)105) && !target.HasAbility(toAdd()))
			{
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				target.AddTemporaryMod(new CardModificationInfo
				{
					abilities = { toAdd() }
				});
				((Card)target).Anim.PlayTransformAnimation();
				((Card)target).Anim.PlaySacrificeParticles();
				((Card)target).RenderCard();
				yield return ((AbilityBehaviour)this).LearnAbility(0.1f);
			}
		}
	}
	public class Persistent : AbilityBehaviour
	{
		public static Ability ability;

		private CardModificationInfo mod;

		public bool active;

		public override Ability Ability => ability;

		private static void RemoveAbility(PlayableCard card, Ability ability)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			if (((Object)AbilitiesUtil.GetInfo(ability)).name == "Sauria_Persistent")
			{
				card.TemporarilyRemoveAbilityFromCard(ability);
			}
		}

		public static void Init()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Persistent", "When a card bearing this sigil would die during combat for the first time, it revives and gains 2 Power.", "That creature will not give up so easily.", typeof(Persistent), new List<AbilityMetaCategory>
			{
				(AbilityMetaCategory)0,
				(AbilityMetaCategory)1
			}, 2, stackable: false, opponentUsable: false, "sauriapersist").ability;
		}

		public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer)
		{
			yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
			yield return (object)new WaitForSeconds(0.25f);
			((Card)((AbilityBehaviour)this).Card).Anim.PlayTransformAnimation();
			((Card)((AbilityBehaviour)this).Card).Anim.PlaySacrificeParticles();
			CardModificationInfo val = new CardModificationInfo();
			val.attackAdjustment = 2;
			val.negateAbilities.Add(ability);
			if (((AbilityBehaviour)this).Card.Health <= 0)
			{
				((AbilityBehaviour)this).Card.Status.damageTaken = ((AbilityBehaviour)this).Card.MaxHealth - 1;
			}
			if (((AbilityBehaviour)this).Card.Health <= 0)
			{
				val.healthAdjustment += 1 + ((AbilityBehaviour)this).Card.Health * -1;
			}
			((AbilityBehaviour)this).Card.temporaryMods.Add(val);
			((AbilityBehaviour)this).Card.Status.hiddenAbilities.Add(ability);
			active = true;
			((AbilityBehaviour)this).Card.OnStatsChanged();
			yield return (object)new WaitForSeconds(0.25f);
			yield return ((AbilityBehaviour)this).LearnAbility(0.4f);
		}

		public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer)
		{
			if (((AbilityBehaviour)this).Card.OnBoard && !wasSacrifice)
			{
				return !active;
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(PlayableCard), "Die")]
	public class DeathPatch
	{
		[HarmonyPrefix]
		public static bool DiePrefix(ref IEnumerator __result, PlayableCard __instance, bool wasSacrifice)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			bool result = true;
			if (!wasSacrifice && Object.op_Implicit((Object)(object)__instance) && __instance.HasAbility(Persistent.ability))
			{
				__result = Util.FakeDeath(__instance, wasSacrifice, null);
				result = false;
			}
			return result;
		}
	}
	public class Skittish : AbilityBehaviour
	{
		public static Ability ability;

		private int lastShotTurn = -1;

		public override Ability Ability => ability;

		public override int Priority => -1;

		public static void Init()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Skittish", "When a card moves into space opposing the one bearing this sigil, deal 1 damage to it, then move to a random unoccupied space on the owner's side of board if possible.", "This creature appears to be rather skittish.", typeof(Skittish), new List<AbilityMetaCategory>
			{
				(AbilityMetaCategory)0,
				(AbilityMetaCategory)1
			}, 1, stackable: false, opponentUsable: true, "sauriaattackretreat").ability;
		}

		private bool RespondsToTrigger(PlayableCard otherCard)
		{
			if (((AbilityBehaviour)this).Card.OnBoard && !((AbilityBehaviour)this).Card.Dead && !otherCard.Dead)
			{
				return (Object)(object)otherCard.Slot == (Object)(object)((AbilityBehaviour)this).Card.Slot.opposingSlot;
			}
			return false;
		}

		public override bool RespondsToOtherCardResolve(PlayableCard otherCard)
		{
			return RespondsToTrigger(otherCard);
		}

		public override bool RespondsToOtherCardAssignedToSlot(PlayableCard otherCard)
		{
			return RespondsToTrigger(otherCard);
		}

		public override IEnumerator OnOtherCardResolve(PlayableCard otherCard)
		{
			yield return FireAtOpposingSlot(otherCard);
		}

		public override IEnumerator OnOtherCardAssignedToSlot(PlayableCard otherCard)
		{
			yield return FireAtOpposingSlot(otherCard);
		}

		private IEnumerator FireAtOpposingSlot(PlayableCard otherCard)
		{
			if ((Object)(object)((AbilityBehaviour)this).Card != (Object)null && !((AbilityBehaviour)this).Card.Dead)
			{
				((Card)((AbilityBehaviour)this).Card).Anim.SetShaking(true);
				Singleton<ViewManager>.Instance.SwitchToView((View)4, false, true);
				yield return (object)new WaitForSeconds(0.25f);
				if ((Object)(object)otherCard != (Object)null && !otherCard.Dead)
				{
					yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
					((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
					((Card)((AbilityBehaviour)this).Card).Anim.PlayAttackAnimation(false, otherCard.Slot);
					yield return otherCard.TakeDamage(1, ((AbilityBehaviour)this).Card);
					yield return (object)new WaitForSeconds(0.3f);
				}
				yield return ((AbilityBehaviour)this).LearnAbility(0.5f);
				Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0;
				yield return Move();
				((Card)((AbilityBehaviour)this).Card).Anim.SetShaking(false);
			}
		}

		public IEnumerator Move()
		{
			if ((Object)(object)((AbilityBehaviour)this).Card != (Object)null && !((AbilityBehaviour)this).Card.Dead)
			{
				List<CardSlot> openSlots = Singleton<BoardManager>.Instance.AllSlots.FindAll((CardSlot x) => x.IsPlayerSlot != ((AbilityBehaviour)this).Card.OpponentCard && (Object)(object)x.Card == (Object)null);
				if (openSlots.Count > 0)
				{
					yield return (object)new WaitForSeconds(0.55f);
					_ = ((AbilityBehaviour)this).Card.slot;
					CardSlot target = Util.SeededRandomElement(openSlots, Util.GetRandomSeed());
					yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
					yield return Util.MoveCard(((AbilityBehaviour)this).Card, target);
				}
				else
				{
					((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				}
			}
		}
	}
	public class Blizzard : AbilityBehaviour
	{
		public static Ability ability;

		public override Ability Ability => ability;

		public CardInfo GetIce
		{
			get
			{
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				CardInfo val = ((CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)this).Card).Info, "SauriaBlizzardOverride") == null) ? CardLoader.GetCardByName("Sauria_Ice") : CardLoader.GetCardByName(CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)this).Card).Info, "SauriaBlizzardOverride")));
				if ((Object)(object)((AbilityBehaviour)this).Card != (Object)null)
				{
					CardModificationInfo item = ((AbilityBehaviour)this).Card.CondenseMods(new List<Ability> { ability });
					val.Mods.Add(item);
				}
				return val;
			}
		}

		public static void Init()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Blizzard", "When a card bearing this sigil is placed, unoccupied spaces on its owner's side are filled with blocks of ice.", "Winter is coming.", typeof(Blizzard), new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }, 2, stackable: false, opponentUsable: false, "sauriawinter").ability;
		}

		private IEnumerator SpawnCardOnSlot(CardSlot slot)
		{
			CardInfo getIce = GetIce;
			yield return Singleton<BoardManager>.Instance.CreateCardInSlot(getIce, slot, 0.15f, true);
		}

		public override bool RespondsToResolveOnBoard()
		{
			return true;
		}

		public override IEnumerator OnResolveOnBoard()
		{
			Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
			yield return (object)new WaitForSeconds(0.15f);
			List<CardSlot> availableSlots = new List<CardSlot>(Singleton<BoardManager>.Instance.GetSlots(!((AbilityBehaviour)this).Card.OpponentCard));
			for (int num = availableSlots.Count - 1; num >= 0; num--)
			{
				if ((Object)(object)availableSlots[num].Card != (Object)null)
				{
					availableSlots.RemoveAt(num);
				}
			}
			if (availableSlots.Count <= 0)
			{
				yield break;
			}
			yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
			AudioController.Instance.PlaySound3D("sauria_blizzard", (MixerGroup)5, ((Component)((AbilityBehaviour)this).Card).transform.position, 1f, 0f, (Pitch)null, (Repetition)null, new Randomization(true), (Distortion)null, false);
			UtilFunky.FlashMagic(((Component)((AbilityBehaviour)this).Card).transform.position, ((Component)((AbilityBehaviour)this).Card).transform);
			foreach (CardSlot targetSlot in availableSlots)
			{
				yield return (object)new WaitForSeconds(0.1f);
				yield return SpawnCardOnSlot(targetSlot);
			}
			yield return (object)new WaitForSeconds(0.3f);
			yield return ((AbilityBehaviour)this).LearnAbility(0.1f);
		}
	}
	public static class UtilFunky
	{
		public static IEnumerator FlashAndBlur(int blurAmount, Color color, float intensity)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			Singleton<UIManager>.Instance.Effects.GetEffect<ScreenColorEffect>().SetColor(color);
			((ScreenEffect)Singleton<UIManager>.Instance.Effects.GetEffect<ScreenColorEffect>()).SetIntensity(intensity, 50f);
			yield return (object)new WaitForSeconds(0.1f);
			Singleton<CameraEffects>.Instance.TweenBlur((float)blurAmount * 2f, 3f);
			((ScreenEffect)Singleton<UIManager>.Instance.Effects.GetEffect<ScreenColorEffect>()).SetIntensity(0f, 10f);
		}

		public static void CreateBlue(Transform transform)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			GameObject obj = Object.Instantiate<GameObject>(((Component)Singleton<SpecialNodeHandler>.Instance.cardMerger.transformParticles).gameObject, transform.position, Quaternion.Euler(-90f, 0f, 0f));
			_ = obj.GetComponent<ParticleSystem>().shape;
			VelocityOverLifetimeModule velocityOverLifetime = obj.GetComponent<ParticleSystem>().velocityOverLifetime;
			((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = false;
			obj.SetActive(false);
			obj.SetActive(true);
		}

		public static void CreateBlood(Transform transform)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(((Component)Singleton<SpecialNodeHandler>.Instance.duplicateMerger.bloodParticles1).gameObject, transform);
			GameObject val2 = Object.Instantiate<GameObject>(((Component)Singleton<SpecialNodeHandler>.Instance.duplicateMerger.bloodParticles2).gameObject, transform);
			_ = val.GetComponent<ParticleSystem>().shape;
			VelocityOverLifetimeModule velocityOverLifetime = val.GetComponent<ParticleSystem>().velocityOverLifetime;
			((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = false;
			_ = val2.GetComponent<ParticleSystem>().shape;
			VelocityOverLifetimeModule velocityOverLifetime2 = val2.GetComponent<ParticleSystem>().velocityOverLifetime;
			((VelocityOverLifetimeModule)(ref velocityOverLifetime2)).enabled = false;
			val.SetActive(true);
			val2.SetActive(true);
		}

		public static void FlashMagic(Vector3 position, Transform transform)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			GameObject obj = Object.Instantiate<GameObject>(ResourceBank.Get<GameObject>("prefabs/finalemagnificus/WizardProjectileImpactEffects"), transform);
			obj.transform.position = position;
			obj.transform.localScale = new Vector3(1f, 1f, 1f);
			obj.SetActive(true);
			Object.Destroy((Object)(object)obj, 10f);
			Singleton<CameraEffects>.Instance.Shake(0.08f, 0.25f);
		}
	}
	internal static class Ice
	{
		public static void Init()
		{
			string displayname = "Block of Ice";
			string defaultEvolutionName = "Bigger Block of Ice";
			int power = 0;
			int health = 2;
			string description = "A block of ice, nothing to see";
			int bloodCost = 0;
			int bonesCost = 0;
			int energyCost = 0;
			int defaultEvolutionTurns = 1;
			Texture2D defaultTex = Util.LoadTex("Sauria_Ice.png");
			Texture2D emissionTex = null;
			Texture2D pixelTex = null;
			List<CardMetaCategory> categories = null;
			List<Ability> abilities = null;
			List<SpecialTriggeredAbility> specialAbilities = null;
			List<Tribe> tribes = null;
			List<Trait> traits = null;
			string defaultTailCard = null;
			string defaultEvolutionCard = null;
			string defaultFrozenCard = null;
			List<Appearance> appearanceBehaviour = new List<Appearance>
			{
				(Appearance)2,
				(Appearance)9
			};
			SigilSetupUtility.SimpleCard("Ice", displayname, power, health, categories, description, bloodCost, bonesCost, energyCost, abilities, defaultTex, emissionTex, pixelTex, appearanceBehaviour, tribes, traits, defaultTailCard, defaultEvolutionCard, defaultEvolutionName, defaultEvolutionTurns, defaultFrozenCard, specialAbilities, (SpecialStatIcon)0);
		}
	}
	[HarmonyPatch]
	internal static class AudioPatch
	{
		[HarmonyPatch(typeof(AudioController), "Awake")]
		[HarmonyPostfix]
		internal static void LoadMyCustomAudio(ref AudioController __instance)
		{
			string[] array = new string[3] { "sauria_blizzard", "sauria_quake", "sauria_middle_loop" };
			foreach (string clipName in array)
			{
				if (!__instance.SFX.Any((AudioClip ac) => ((Object)ac).name.Equals(clipName, StringComparison.InvariantCultureIgnoreCase)))
				{
					AudioClip val = SoundManager.LoadAudioClip("Sauria", clipName + ".ogg");
					((Object)val).name = clipName;
					__instance.SFX.Add(val);
				}
			}
		}
	}
	public class BoneBlast : AbilityBehaviour, IOnBellRung
	{
		public static Ability ability;

		public GameObject bombPrefab;

		public static bool BlowingUp;

		public int killcount;

		public override Ability Ability => ability;

		public float bones
		{
			get
			{
				if (((AbilityBehaviour)this).Card.OpponentCard && (Object)(object)OpponentResourceManager.instance != (Object)null)
				{
					return OpponentResourceManager.instance.OpponentBones;
				}
				return Singleton<ResourcesManager>.Instance.PlayerBones;
			}
		}

		public static void Init()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Bone Blast", "When initiating combat, a card bearing this sigil dies. Upon death, all other cards take damage equal to the amount of owner's bones.", "Not a pretty sight", typeof(BoneBlast), new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }, 0, stackable: false, opponentUsable: false, "sauriabomb").ability;
		}

		public override bool RespondsToPreDeathAnimation(bool wasSacrifice)
		{
			return true;
		}

		public override IEnumerator OnPreDeathAnimation(bool wasSacrifice)
		{
			List<PlayableCard> cards = new List<PlayableCard>();
			cards.AddRange(Singleton<BoardManager>.Instance.CardsOnBoard.FindAll((PlayableCard x) => (Object)(object)x != (Object)(object)((AbilityBehaviour)this).Card && !x.Dead));
			BlowingUp = true;
			if (cards.Count > 0)
			{
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				for (int num = 0; num < cards.Count; num++)
				{
					if (!Object.op_Implicit((Object)(object)((AbilityBehaviour)this).Card))
					{
						break;
					}
					yield return BombCard(cards[num], ((AbilityBehaviour)this).Card);
				}
				yield return ((AbilityBehaviour)this).LearnAbility(0.5f);
			}
			BlowingUp = false;
		}

		public IEnumerator BombCard(PlayableCard target, PlayableCard attacker)
		{
			GameObject bomb = Object.Instantiate<GameObject>(ResourceBank.Get<GameObject>("Prefabs/CardBattle/CardBattle").GetComponentInChildren<Part1ResourcesManager>().boneTokenPrefab);
			if ((Object)(object)bomb != (Object)null && (Object)(object)attacker != (Object)null)
			{
				((Card)attacker).Anim.StrongNegationEffect();
				bomb.transform.position = ((Component)attacker).transform.position + Vector3.up * 0.1f;
				Tween.Position(bomb.transform, ((Component)target).transform.position + Vector3.up * 0.1f, 0.1f, 0f, Tween.EaseLinear, (LoopType)0, (Action)null, (Action)null, true);
				yield return (object)new WaitForSeconds(0.1f);
			}
			((Card)target).Anim.PlayHitAnimation();
			Object.Destroy((Object)(object)bomb);
			yield return target.TakeDamage((int)bones, attacker);
		}

		public bool RespondsToBellRung(bool playerCombatPhase)
		{
			return ((AbilityBehaviour)this).Card.OnBoard && playerCombatPhase;
		}

		public IEnumerator OnBellRung(bool playerCombatPhase)
		{
			yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
			((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
			yield return ((AbilityBehaviour)this).Card.Die(false, (PlayableCard)null, true);
		}

		public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer)
		{
			if (BlowingUp)
			{
				killcount++;
			}
			if (killcount >= 7)
			{
				AchievementsMain.Unlocked(AchievementsSaveMain.Bone, AchievementsMain.Bone);
			}
			yield break;
		}

		public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer)
		{
			if ((Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card)
			{
				return BlowingUp;
			}
			return false;
		}
	}
	public class Dismember : AbilityBehaviour
	{
		public static Ability ability;

		public override Ability Ability => ability;

		public static void Init()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Dismember", "When a card bearing this sigil deals damage to another card, gain bones equal to the damage dealt, up to 5 bones at once.", "How gruesome.", typeof(Dismember), new List<AbilityMetaCategory>
			{
				(AbilityMetaCategory)0,
				(AbilityMetaCategory)1
			}, 1, stackable: false, opponentUsable: false, "sauriabone").ability;
		}

		public override bool RespondsToDealDamage(int amount, PlayableCard target)
		{
			if (!((AbilityBehaviour)this).Card.Dead)
			{
				return amount > 0;
			}
			return false;
		}

		public override IEnumerator OnDealDamage(int amount, PlayableCard target)
		{
			yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
			((Card)target).Anim.PlaySacrificeParticles();
			if (((AbilityBehaviour)this).Card.OpponentCard)
			{
				yield return OpponentResourceManager.instance.AddOpponentBones(target.Slot, Mathf.Clamp(amount, 0, 5));
			}
			else
			{
				yield return Singleton<ResourcesManager>.Instance.AddBones(Mathf.Clamp(amount, 0, 5), target.Slot);
			}
			yield return (object)new WaitForSeconds(0.1f);
			yield return ((AbilityBehaviour)this).LearnAbility(0.25f);
		}
	}
	public class Cannibalistic : AbilityBehaviour
	{
		public static Ability ability;

		public int killcount;

		public bool active;

		public override Ability Ability => ability;

		public override bool RespondsToOtherCardDealtDamage(PlayableCard attacker, int amount, PlayableCard target)
		{
			if (((AbilityBehaviour)this).Card.OnBoard && !attacker.Dead && !target.Dead && (Object)(object)target != (Object)(object)((AbilityBehaviour)this).Card && target.OpponentCard == ((AbilityBehaviour)this).Card.OpponentCard)
			{
				return target.Health <= ((AbilityBehaviour)this).Card.Attack;
			}
			return false;
		}

		public override IEnumerator OnOtherCardDealtDamage(PlayableCard attacker, int amount, PlayableCard target)
		{
			((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
			CardModificationInfo removeFlyingMod = null;
			active = true;
			if (((AbilityBehaviour)this).Card.HasAbility((Ability)19))
			{
				removeFlyingMod = new CardModificationInfo();
				removeFlyingMod.negateAbilities.Add((Ability)19);
				((AbilityBehaviour)this).Card.AddTemporaryMod(removeFlyingMod);
			}
			yield return Util.AttackCard(((AbilityBehaviour)this).Card.Slot, target.Slot, checkTargetDeath: true);
			if (removeFlyingMod != null)
			{
				((AbilityBehaviour)this).Card.RemoveTemporaryMod(removeFlyingMod, true);
			}
			active = false;
			yield return (object)new WaitForSeconds(0.25f);
			yield return ((AbilityBehaviour)this).LearnAbility(0.3f);
		}

		public static void Init()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Cannibalistic", "When another card on the owner's side of board takes damage and its Health no longer exceeds Power of the bearer of this sigil, this card attacks it.", "A grim opportunity to feast.", typeof(Cannibalistic), new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }, -2, stackable: false, opponentUsable: false, "sauriacan").ability;
		}

		public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer)
		{
			if (active && card.OpponentCard == killer.OpponentCard)
			{
				killcount++;
			}
			if (killcount >= 10)
			{
				AchievementsMain.Unlocked(AchievementsSaveMain.Can, AchievementsMain.Can);
			}
			yield break;
		}

		public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer)
		{
			if ((Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card && active)
			{
				return card.OpponentCard == killer.OpponentCard;
			}
			return false;
		}
	}
	public class PartingBone : DrawCreatedCard
	{
		public static Ability ability;

		public override Ability Ability => ability;

		public override CardInfo CardToDraw
		{
			get
			{
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				CardInfo val = ((CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)this).Card).Info, "SauriaBoneOverride") == null) ? CardLoader.GetCardByName("Sauria_Bone") : CardLoader.GetCardByName(CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)this).Card).Info, "SauriaBoneOverride")));
				val.mods.Add(((AbilityBehaviour)this).Card.CondenseMods(new List<Ability> { ability }, sigilsOnly: true));
				return val;
			}
		}

		public static void Init()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Parting Bone", "When a card bearing this sigil dies or is sacrificed, a Bone is created in your hand. [define:Sauria_Bone]", "A parting gift for its master.", typeof(PartingBone), new List<AbilityMetaCategory>
			{
				(AbilityMetaCategory)0,
				(AbilityMetaCategory)1
			}, 1, stackable: true, opponentUsable: false, "sauriadiebone").ability;
		}

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

		public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer)
		{
			yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
			yield return ((DrawCreatedCard)this).CreateDrawnCard();
			yield return ((AbilityBehaviour)this).LearnAbility(0f);
		}
	}
	internal static class Bone
	{
		public static void Init()
		{
			string displayname = "Bone";
			string defaultEvolutionName = null;
			int power = 0;
			int health = 1;
			string description = "A bone to gnaw on.";
			int bloodCost = 0;
			int bonesCost = 0;
			int energyCost = 0;
			int defaultEvolutionTurns = 1;
			Texture2D defaultTex = Util.LoadTex("Sauria_Bon.png");
			Texture2D emissionTex = Util.LoadTex("Sauria_Bon_emission.png");
			Texture2D pixelTex = Util.LoadTex("Sauria_BonP.png");
			List<CardMetaCategory> categories = null;
			List<Ability> list = new List<Ability>();
			Util.AddAbilityToList(list, "nevernamed.inscryption.sigils", "Bone Spurs");
			List<SpecialTriggeredAbility> specialAbilities = null;
			List<Tribe> tribes = null;
			List<Trait> traits = null;
			string defaultTailCard = null;
			string defaultEvolutionCard = "Skeleton";
			string defaultFrozenCard = null;
			List<Appearance> appearanceBehaviour = null;
			SigilSetupUtility.SimpleCard("Bone", displayname, power, health, categories, description, bloodCost, bonesCost, energyCost, list, defaultTex, emissionTex, pixelTex, appearanceBehaviour, tribes, traits, defaultTailCard, defaultEvolutionCard, defaultEvolutionName, defaultEvolutionTurns, defaultFrozenCard, specialAbilities, (SpecialStatIcon)0);
		}
	}
	public class ServedDinner : ActivatedAbilityBehaviour
	{
		public static Ability ability;

		public static GameObject target;

		private CardSlot recentlySelected;

		private GameObject instanceTarget;

		public override Ability Ability => ability;

		public static void Init()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Served Dinner", "Select a card on the owner's side of board. Add stats of the card bearing this sigil to the selected card. This card dies afterwards. This effect can also be activated by sacrificing or killing this page directly.", "Dinner is served.", typeof(ServedDinner), new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }, 0, stackable: false, opponentUsable: false, "sauriafeed", isActivated: true).ability;
		}

		public override bool CanActivate()
		{
			List<CardSlot> list = Singleton<BoardManager>.Instance.AllSlotsCopy.FindAll((CardSlot x) => (Object)(object)x.Card != (Object)null && (Object)(object)x.Card != (Object)(object)((AbilityBehaviour)this).Card);
			if (((Card)((AbilityBehaviour)this).Card).Info.HasTrait((Trait)19) || ((AbilityBehaviour)this).Card.HasAbility((Ability)4))
			{
				List<CardSlot> collection = Singleton<BoardManager>.Instance.OpponentSlotsCopy.FindAll((CardSlot x) => (Object)(object)x.Card != (Object)null && (Object)(object)x.Card != (Object)(object)((AbilityBehaviour)this).Card && !x.Card.HasAbility((Ability)105));
				list.AddRange(collection);
			}
			return list.Count > 0;
		}

		public override IEnumerator Activate()
		{
			Vector3 location = ((Component)((AbilityBehaviour)this).Card).transform.position;
			Singleton<ViewManager>.Instance.SwitchToView((View)4, false, true);
			yield return (object)new WaitForSeconds(0.25f);
			Vector3 val = (((AbilityBehaviour)this).Card.Slot.IsPlayerSlot ? Vector3.forward : Vector3.back);
			val *= 0.5f;
			Tween.Position(((Component)((AbilityBehaviour)this).Card).transform, ((Component)((AbilityBehaviour)this).Card).transform.position + val * 2f + Vector3.up * 0.25f, 0.15f, 0f, Tween.EaseOut, (LoopType)0, (Action)null, (Action)null, true);
			if ((Object)(object)target == (Object)null)
			{
				target = ResourceBank.Get<GameObject>("Prefabs/Cards/SpecificCardModels/CannonTargetIcon");
			}
			Singleton<ViewManager>.Instance.Controller.SwitchToControlMode(Singleton<BoardManager>.Instance.ChoosingSlotViewMode, false);
			Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)1;
			BoardManager instance = Singleton<BoardManager>.Instance;
			List<CardSlot> allSlotsCopy = Singleton<BoardManager>.Instance.AllSlotsCopy;
			List<CardSlot> list = Singleton<BoardManager>.Instance.AllSlotsCopy.FindAll((CardSlot x) => (Object)(object)x.Card != (Object)null && (Object)(object)x.Card != (Object)(object)((AbilityBehaviour)this).Card);
			if (((Card)((AbilityBehaviour)this).Card).Info.HasTrait((Trait)19) || ((AbilityBehaviour)this).Card.HasAbility((Ability)4))
			{
				List<CardSlot> collection = Singleton<BoardManager>.Instance.OpponentSlotsCopy.FindAll((CardSlot x) => (Object)(object)x.Card != (Object)null && (Object)(object)x.Card != (Object)(object)((AbilityBehaviour)this).Card && !x.Card.HasAbility((Ability)105));
				list.AddRange(collection);
			}
			yield return instance.ChooseTarget(allSlotsCopy, list, (Action<CardSlot>)CardSelected, (Action<CardSlot>)InvalidTargetSelected, (Action<CardSlot>)CursotEnteredSlot, (Func<bool>)(() => false), (CursorType)16);
			if ((Object)(object)instanceTarget != (Object)null)
			{
				Tween.LocalScale(instanceTarget.transform, Vector3.zero, 0.1f, 0f, Tween.EaseIn, (LoopType)0, (Action)null, (Action)delegate
				{
					Object.Destroy((Object)(object)instanceTarget);
				}, true);
			}
			if ((Object)(object)recentlySelected != (Object)null)
			{
				if ((Object)(object)recentlySelected.Card != (Object)null)
				{
					Tween.Position(((Component)((AbilityBehaviour)this).Card).transform, ((Component)recentlySelected.Card).transform.position + Vector3.up * 0.1f, 0.25f, 0f, Tween.EaseLinear, (LoopType)0, (Action)null, (Action)null, true);
					yield return (object)new WaitForSeconds(0.1f);
					UtilFunky.CreateBlood(((Component)((AbilityBehaviour)this).Card).transform);
					yield return ((AbilityBehaviour)this).Card.Die(true, recentlySelected.Card, true);
				}
			}
			else
			{
				Tween.Position(((Component)((AbilityBehaviour)this).Card).transform, location, 0.25f, 0f, Tween.EaseLinear, (LoopType)0, (Action)null, (Action)null, true);
			}
			Singleton<InteractionCursor>.Instance.ClearForcedCursorType();
			Singleton<ViewManager>.Instance.Controller.SwitchToControlMode(Singleton<BoardManager>.Instance.DefaultViewMode, false);
			Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0;
		}

		private void CardSelected(CardSlot slot)
		{
			recentlySelected = slot;
		}

		private void InvalidTargetSelected(CardSlot slot)
		{
			AudioController.Instance.PlaySound2D("toneless_negate", (MixerGroup)10, 0.2f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false);
		}

		private void CursotEnteredSlot(CardSlot slot)
		{
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)instanceTarget != (Object)null)
			{
				GameObject inst = instanceTarget;
				Tween.LocalScale(inst.transform, Vector3.zero, 0.1f, 0f, Tween.EaseIn, (LoopType)0, (Action)null, (Action)delegate
				{
					Object.Destroy((Object)(object)inst);
				}, true);
			}
			GameObject val = Object.Instantiate<GameObject>(target, ((Component)slot).transform);
			val.transform.localPosition = new Vector3(0f, 0.25f, 0f);
			val.transform.localRotation = Quaternion.identity;
			instanceTarget = val;
		}

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

		public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer)
		{
			if ((Object)(object)killer != (Object)null || (Object)(object)Singleton<BoardManager>.Instance.currentSacrificeDemandingCard != (Object)null)
			{
				if ((Object)(object)killer == (Object)null && (Object)(object)Singleton<BoardManager>.Instance.currentSacrificeDemandingCard != (Object)null)
				{
					killer = Singleton<BoardManager>.Instance.currentSacrificeDemandingCard;
				}
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				CardModificationInfo val = new CardModificationInfo(((AbilityBehaviour)this).Card.Attack, ((AbilityBehaviour)this).Card.Health);
				if (((AbilityBehaviour)this).Card.Health <= 0)
				{
					val.healthAdjustment = ((Card)((AbilityBehaviour)this).Card).Info.Health;
				}
				killer.AddTemporaryMod(val);
				if (killer.OpponentCard != ((AbilityBehaviour)this).Card.OpponentCard && (((Card)((AbilityBehaviour)this).Card).Info.HasTrait((Trait)19) || ((AbilityBehaviour)this).Card.HasAbility((Ability)4)) && !killer.HasAbility((Ability)105))
				{
					yield return killer.Die(false, (PlayableCard)null, true);
				}
				yield return ((AbilityBehaviour)this).LearnAbility(0f);
			}
		}
	}
	public class ErraticMarch : AbilityBehaviour
	{
		public static Ability ability;

		protected bool movingLeft;

		public override Ability Ability => ability;

		public static void Init()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Erratic March", "A card bearing this sigil will move in the direction inscribed on the sigil at the end of its owner's turn. If there are cards in its way or this card is at edge of the board, it will try to move to the opponent's side of board first.", "Its movements are unpredictable.", typeof(ErraticMarch), new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }, -2, stackable: false, opponentUsable: false, "sauriaerratic").ability;
		}

		public override bool RespondsToTurnEnd(bool playerTurnEnd)
		{
			if (((AbilityBehaviour)this).Card.OnBoard && (Object)(object)((AbilityBehaviour)this).Card != (Object)null)
			{
				return ((AbilityBehaviour)this).Card.OpponentCard != playerTurnEnd;
			}
			return false;
		}

		public override IEnumerator OnTurnEnd(bool playerTurnEnd)
		{
			CardSlot toLeft = Singleton<BoardManager>.Instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, true);
			CardSlot toRight = Singleton<BoardManager>.Instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, false);
			Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
			yield return (object)new WaitForSeconds(0.25f);
			if ((movingLeft && ((Object)(object)toLeft == (Object)null || (Object)(object)toLeft.Card != (Object)null)) || (!movingLeft && ((Object)(object)toRight == (Object)null || (Object)(object)toRight.Card != (Object)null)))
			{
				yield return Check(toLeft, toRight);
			}
			toLeft = Singleton<BoardManager>.Instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, true);
			toRight = Singleton<BoardManager>.Instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, false);
			yield return DoStrafe(toLeft, toRight);
		}

		public virtual IEnumerator DoStrafe(CardSlot toLeft, CardSlot toRight)
		{
			bool flag = (Object)(object)toLeft != (Object)null && (Object)(object)toLeft.Card == (Object)null;
			bool flag2 = (Object)(object)toRight != (Object)null && (Object)(object)toRight.Card == (Object)null;
			if (movingLeft && !flag)
			{
				movingLeft = false;
			}
			if (!movingLeft && !flag2)
			{
				movingLeft = true;
			}
			CardSlot destination = (movingLeft ? toLeft : toRight);
			bool destinationValid = (movingLeft ? flag : flag2);
			yield return MoveToSlot(destination, destinationValid);
			if ((Object)(object)destination != (Object)null && destinationValid)
			{
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				yield return ((AbilityBehaviour)this).LearnAbility(0f);
			}
		}

		public IEnumerator MoveToSlot(CardSlot destination, bool destinationValid)
		{
			((Card)((AbilityBehaviour)this).Card).RenderInfo.SetAbilityFlipped(((AbilityBehaviour)this).Ability, movingLeft);
			((Card)((AbilityBehaviour)this).Card).RenderCard();
			if ((Object)(object)destination != (Object)null && destinationValid)
			{
				yield return Util.MoveCard(((AbilityBehaviour)this).Card, destination);
				yield return (object)new WaitForSeconds(0.25f);
			}
			else
			{
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				yield return (object)new WaitForSeconds(0.15f);
			}
		}

		public IEnumerator Check(CardSlot toLeft, CardSlot toRight)
		{
			CardSlot opposingSlot = ((AbilityBehaviour)this).Card.Slot.opposingSlot;
			bool destinationValid = (Object)(object)opposingSlot.Card == (Object)null;
			yield return MoveToSlot(opposingSlot, destinationValid);
		}
	}
	public class ShoalStrike : AbilityBehaviour
	{
		public static Ability ability;

		public override Ability Ability => ability;

		public static void Init()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Shoal Strike", "When a card bearing this sigil is placed, it deals 1 damage to all of opponent's submerged cards and forces them to surface.", "The hunt begins...", typeof(ShoalStrike), new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }, 1, stackable: false, opponentUsable: false, "sauriafishing").ability;
		}

		public override bool RespondsToResolveOnBoard()
		{
			return Singleton<BoardManager>.Instance.GetSlots(((AbilityBehaviour)this).Card.OpponentCard).Exists((CardSlot x) => (Object)(object)x.Card != (Object)null && ((Card)x.Card).FaceDown);
		}

		public override IEnumerator OnResolveOnBoard()
		{
			List<CardSlot> list = Singleton<BoardManager>.Instance.GetSlots(((AbilityBehaviour)this).Card.OpponentCard).FindAll((CardSlot x) => (Object)(object)x.Card != (Object)null && ((Card)x.Card).FaceDown);
			List<PlayableCard> targets = new List<PlayableCard>();
			foreach (CardSlot item in list)
			{
				targets.Add(item.Card);
			}
			Singleton<ViewManager>.Instance.SwitchToView((View)4, false, true);
			yield return ((AbilityBehaviour)this).LearnAbility(0.5f);
			for (int num = 0; num < targets.Count; num++)
			{
				if (!((Object)(object)((AbilityBehaviour)this).Card != (Object)null))
				{
					break;
				}
				if (((AbilityBehaviour)this).Card.Dead)
				{
					break;
				}
				if ((Object)(object)targets[num] != (Object)null && !targets[num].Dead)
				{
					PlayableCard indivTarget = targets[num];
					yield return (object)new WaitForSeconds(0.25f);
					if ((Object)(object)indivTarget != (Object)null && !indivTarget.Dead)
					{
						yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
						((Card)indivTarget).SetFaceDown(false, false);
						indivTarget.UpdateFaceUpOnBoardEffects();
						((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
						((Card)((AbilityBehaviour)this).Card).Anim.PlayAttackAnimation(false, targets[num].Slot);
						yield return (object)new WaitForSeconds(0.2f);
						yield return indivTarget.TakeDamage(1, ((AbilityBehaviour)this).Card);
					}
				}
			}
			Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0;
		}
	}
	public class GeneticPerfection : AbilityBehaviour
	{
		public static Ability ability;

		public override Ability Ability => ability;

		public static void Init()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Genetic Perfection", "If card bearing this sigil has its stats reduced below their normal values, it gains 1 Power and/or Health at the end of its owner's turn. If this card has Genetic Flaw sigil, remove it.", "It is perfection incarnate.", typeof(GeneticPerfection), new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }, 2, stackable: false, opponentUsable: true, "sauriagene").ability;
		}

		public override bool RespondsToTurnEnd(bool playerTurnEnd)
		{
			if (playerTurnEnd != ((AbilityBehaviour)this).Card.OpponentCard && ((AbilityBehaviour)this).Card.OnBoard)
			{
				if (((AbilityBehaviour)this).Card.Attack >= ((Card)((AbilityBehaviour)this).Card).Info.Attack)
				{
					return ((AbilityBehaviour)this).Card.Health < ((Card)((AbilityBehaviour)this).Card).Info.Health;
				}
				return true;
			}
			return false;
		}

		public override IEnumerator OnTurnEnd(bool playerTurnEnd)
		{
			yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
			yield return (object)new WaitForSeconds(0.1f);
			CardModificationInfo val = new CardModificationInfo();
			if (((AbilityBehaviour)this).Card.Attack < ((Card)((AbilityBehaviour)this).Card).Info.Attack)
			{
				val.attackAdjustment = 1;
			}
			if (((AbilityBehaviour)this).Card.Health < ((Card)((AbilityBehaviour)this).Card).Info.Health)
			{
				val.healthAdjustment = 1;
			}
			((AbilityBehaviour)this).Card.temporaryMods.Add(val);
			((AbilityBehaviour)this).Card.OnStatsChanged();
			((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
			UtilFunky.CreateBlue(((Component)((AbilityBehaviour)this).Card).transform);
			yield return (object)new WaitForSeconds(0.25f);
			yield return ((AbilityBehaviour)this).LearnAbility(0.4f);
			yield return (object)new WaitForSeconds(0.1f);
		}
	}
	public class GeneticFlaw : AbilityBehaviour
	{
		public static Ability ability;

		public override Ability Ability => ability;

		public static void Init()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Genetic Flaw", "A card bearing this sigil loses 1 Health at the end of their owner's turn.", "Perhaps it's not meant to live.", typeof(GeneticFlaw), new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }, -2, stackable: true, opponentUsable: false, "sauriagenebad").ability;
		}

		public override bool RespondsToTurnEnd(bool playerTurnEnd)
		{
			if (((AbilityBehaviour)this).Card.OpponentCard != playerTurnEnd && ((AbilityBehaviour)this).Card.OnBoard)
			{
				return !((AbilityBehaviour)this).Card.HasAbility((Ability)105);
			}
			return false;
		}

		public override IEnumerator OnTurnEnd(bool playerTurnEnd)
		{
			Singleton<ViewManager>.Instance.SwitchToView((View)4, false, true);
			yield return (object)new WaitForSeconds(0.1f);
			((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
			yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
			CardModificationInfo val = ((AbilityBehaviour)this).Card.TemporaryMods.Find((CardModificationInfo x) => x.singletonId == "Sauria_Genetic Flaw");
			if (val == null)
			{
				val = new CardModificationInfo();
				((AbilityBehaviour)this).Card.AddTemporaryMod(val);
				val.singletonId = "Sauria_Genetic Flaw";
			}
			if (val != null)
			{
				CardModificationInfo obj = val;
				obj.healthAdjustment--;
			}
			((AbilityBehaviour)this).Card.OnStatsChanged();
			if (((AbilityBehaviour)this).Card.Health <= 0)
			{
				yield return ((AbilityBehaviour)this).Card.Die(false, (PlayableCard)null, true);
			}
			yield return (object)new WaitForSeconds(0.1f);
			yield return ((AbilityBehaviour)this).LearnAbility(0.1f);
			Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0;
		}
	}
	public class Embolden : AbilityBehaviour
	{
		public static Ability ability;

		public int num;

		public override Ability Ability => ability;

		public static void Init()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Embolden", "At the end of the owner's turn, if there are adjacent cards with less Power than the bearer of this sigil, lose 1 Power and give 1 Power to them.", "It shares its strength with its allies.", typeof(Embolden), new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }, 1, stackable: false, opponentUsable: false, "sauriagiveattack").ability;
		}

		public override bool RespondsToTurnEnd(bool playerTurnEnd)
		{
			if (((AbilityBehaviour)this).Card.OnBoard && ((AbilityBehaviour)this).Card.slot.IsPlayerSlot == playerTurnEnd)
			{
				return Singleton<BoardManager>.Instance.GetAdjacentSlots(((AbilityBehaviour)this).Card.Slot).FindAll((CardSlot x) => (Object)(object)x.Card != (Object)null && !x.Card.Dead && x.Card.Attack < ((AbilityBehaviour)this).Card.Attack).Count > 0;
			}
			return false;
		}

		public override IEnumerator OnTurnEnd(bool playerTurnEnd)
		{
			Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
			yield return (object)new WaitForSeconds(0.15f);
			List<CardSlot> adjacentSlots = Singleton<BoardManager>.Instance.GetAdjacentSlots(((AbilityBehaviour)this).Card.Slot);
			foreach (CardSlot item in adjacentSlots)
			{
				if (Object.op_Implicit((Object)(object)item) && Object.op_Implicit((Object)(object)item.Card) && !item.Card.Dead && item.Card.Attack < ((AbilityBehaviour)this).Card.Attack)
				{
					((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
					((Card)item.Card).Anim.LightNegationEffect();
					item.Card.temporaryMods.Add(new CardModificationInfo(1, 0));
					item.Card.OnStatsChanged();
					yield return (object)new WaitForSeconds(0.3f);
				}
			}
			((AbilityBehaviour)this).Card.temporaryMods.Add(new CardModificationInfo(-1, 0));
			((AbilityBehaviour)this).Card.OnStatsChanged();
			((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
			((Card)((AbilityBehaviour)this).Card).Anim.PlaySacrificeParticles();
			num++;
			if (num >= 10)
			{
				AchievementsMain.Unlocked(AchievementsSaveMain.Attack, AchievementsMain.Attack);
			}
			yield return ((AbilityBehaviour)this).LearnAbility(0f);
		}
	}
	public class GreaterEmbolden : AbilityBehaviour
	{
		public static Ability ability;

		public int num;

		public override Ability Ability => ability;

		public static void Init()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Greater Embolden", "At the end of the owner's turn, if there are any cards on owner's side of the board with less Power than the bearer of this sigil, lose 1 Power and give 1 Power to them.", "It shares its strength with all of its allies.", typeof(GreaterEmbolden), new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }, 2, stackable: false, opponentUsable: false, "sauriagiveattackall").ability;
		}

		public override bool RespondsToTurnEnd(bool playerTurnEnd)
		{
			if (((AbilityBehaviour)this).Card.OnBoard && ((AbilityBehaviour)this).Card.slot.IsPlayerSlot == playerTurnEnd)
			{
				return Singleton<BoardManager>.Instance.GetSlots(!((AbilityBehaviour)this).Card.OpponentCard).FindAll((CardSlot x) => (Object)(object)x.Card != (Object)null && (Object)(object)x.Card != (Object)(object)((AbilityBehaviour)this).Card && !x.Card.Dead && x.Card.Attack < ((AbilityBehaviour)this).Card.Attack).Count > 0;
			}
			return false;
		}

		public override IEnumerator OnTurnEnd(bool playerTurnEnd)
		{
			Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
			yield return (object)new WaitForSeconds(0.15f);
			List<CardSlot> slots = Singleton<BoardManager>.Instance.GetSlots(!((AbilityBehaviour)this).Card.OpponentCard);
			foreach (CardSlot item in slots)
			{
				if (Object.op_Implicit((Object)(object)item) && Object.op_Implicit((Object)(object)item.Card) && (Object)(object)item.Card != (Object)(object)((AbilityBehaviour)this).Card && !item.Card.Dead && item.Card.Attack < ((AbilityBehaviour)this).Card.Attack)
				{
					((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
					((Card)item.Card).Anim.LightNegationEffect();
					item.Card.temporaryMods.Add(new CardModificationInfo(1, 0));
					item.Card.OnStatsChanged();
					yield return (object)new WaitForSeconds(0.3f);
				}
			}
			((AbilityBehaviour)this).Card.temporaryMods.Add(new CardModificationInfo(-1, 0));
			((AbilityBehaviour)this).Card.OnStatsChanged();
			((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
			((Card)((AbilityBehaviour)this).Card).Anim.PlaySacrificeParticles();
			num++;
			if (num >= 10)
			{
				AchievementsMain.Unlocked(AchievementsSaveMain.Attack, AchievementsMain.Attack);
			}
			yield return ((AbilityBehaviour)this).LearnAbility(0f);
		}
	}
	public class Nurture : AbilityBehaviour
	{
		public static Ability ability;

		public int num;

		public override Ability Ability => ability;

		public static void Init()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Nurture", "At the end of the owner's turn, if there are adjacent cards with less Health than the bearer of this sigil, lose 1 Health and give 1 Health to them.", "It shares its essence with its allies.", typeof(Nurture), new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }, 1, stackable: false, opponentUsable: false, "sauriagivehealth").ability;
		}

		public override bool RespondsToTurnEnd(bool playerTurnEnd)
		{
			if (((AbilityBehaviour)this).Card.OnBoard && ((AbilityBehaviour)this).Card.slot.IsPlayerSlot == playerTurnEnd && ((AbilityBehaviour)this).Card.Health > 1)
			{
				return Singleton<BoardManager>.Instance.GetAdjacentSlots(((AbilityBehaviour)this).Card.Slot).FindAll((CardSlot x) => (Object)(object)x.Card != (Object)null && !x.Card.Dead && x.Card.Health < ((AbilityBehaviour)this).Card.Health).Count > 0;
			}
			return false;
		}

		public override IEnumerator OnTurnEnd(bool playerTurnEnd)
		{
			Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
			yield return (object)new WaitForSeconds(0.15f);
			List<CardSlot> adjacentSlots = Singleton<BoardManager>.Instance.GetAdjacentSlots(((AbilityBehaviour)this).Card.Slot);
			foreach (CardSlot item in adjacentSlots)
			{
				if (Object.op_Implicit((Object)(object)item) && Object.op_Implicit((Object)(object)item.Card) && !item.Card.Dead && item.Card.Health < ((AbilityBehaviour)this).Card.Health)
				{
					((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
					((Card)item.Card).Anim.LightNegationEffect();
					item.Card.temporaryMods.Add(new CardModificationInfo(0, 1));
					item.Card.OnStatsChanged();
					yield return (object)new WaitForSeconds(0.3f);
				}
			}
			((AbilityBehaviour)this).Card.temporaryMods.Add(new CardModificationInfo(0, -1));
			((AbilityBehaviour)this).Card.OnStatsChanged();
			((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
			((Card)((AbilityBehaviour)this).Card).Anim.PlaySacrificeParticles();
			num++;
			if (num >= 10)
			{
				AchievementsMain.Unlocked(AchievementsSaveMain.Health, AchievementsMain.Health);
			}
			yield return ((AbilityBehaviour)this).LearnAbility(0f);
		}
	}
	public class GreaterNurture : AbilityBehaviour
	{
		public static Ability ability;

		public int num;

		public override Ability Ability => ability;

		public static void Init()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			ability = SigilSetupUtility.MakeNewSigil("Greater Nurture", "At the end of the owner's turn, if there are any cards on owner's side of the board with less Health than the bearer of this sigil, lose 1 Health and give 1 Health to them.", "It shares its essence with all of its allies.", typeof(GreaterNurture), new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }, 2, stackable: false, opponentUsable: false, "sauriagivehealthall").ability;
		}

		public override bool RespondsToTurnEnd(bool playerTurnEnd)
		{
			if (((AbilityBehaviour)this).Card.OnBoard && ((AbilityBehaviour)this).Card.slot.IsPlayerSlot == playerTurnEnd && ((AbilityBehaviour)this).Card.Health > 1)
			{
				return Singleton<BoardManager>.Instance.GetSlots(!((AbilityBehaviour)this).Card.OpponentCard).FindAll((CardSlot x) => (Object)(object)x.Card != (Object)null && (Object)(object)x.Card != (Object)(object)((AbilityBehaviour)this).Card && !x.Card.Dead && x.Card.Health < ((AbilityBehaviour)this)