Decompiled source of Plants vs Zombies v0.6.2

ZephtPvZ.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
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.Logging;
using DiskCardGame;
using HarmonyLib;
using Infiniscryption.PackManagement;
using InscryptionAPI.Ascension;
using InscryptionAPI.Card;
using InscryptionAPI.Guid;
using InscryptionAPI.Helpers;
using InscryptionCommunityPatch.Card;
using Microsoft.CodeAnalysis;
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("ZephtPvZ")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ZephtPvZ")]
[assembly: AssemblyTitle("ZephtPvZ")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ZephtPvZ
{
	public class EvolveSprout : SpecialCardBehaviour
	{
		public static SpecialTriggeredAbility SpecialTriggeredAbility;

		private void Start()
		{
		}

		public override bool RespondsToUpkeep(bool playerUpkeep)
		{
			return true;
		}

		public override IEnumerator OnUpkeep(bool playerUpkeep)
		{
			Plugin.Log.LogInfo((object)"evocheck 1");
			EvolveParams evoParams = new EvolveParams();
			evoParams.turnsToEvolve = 1;
			int randomSeed = ((TriggerReceiver)this).GetRandomSeed();
			CardInfo randomChoosableCard = GetRandomSproutEvo(randomSeed);
			evoParams.evolution = randomChoosableCard;
			((SpecialCardBehaviour)this).Card.Info.evolveParams = evoParams;
			yield break;
		}

		public static CardInfo GetRandomSproutEvo(int randomSeed)
		{
			List<CardInfo> plantCards = GetPlantCards();
			return CardLoader.Clone(plantCards[SeededRandom.Range(0, plantCards.Count, randomSeed)]);
		}

		public static List<CardInfo> GetPlantCards()
		{
			return CardLoader.RemoveDeckSingletonsIfInDeck(ScriptableObjectLoader<CardInfo>.AllData.FindAll((CardInfo x) => (x.metaCategories.Contains((CardMetaCategory)0) || x.metaCategories.Contains((CardMetaCategory)3)) && (x.IsOfTribe(Plugin.PlantFlower) || x.IsOfTribe(Plugin.PlantFruit) || x.IsOfTribe(Plugin.PlantShroom) || x.IsOfTribe(Plugin.PlantVeg) || x.IsOfTribe(Plugin.PlantSpiky)) && !(((Object)x).name == "zep_pvz_sprout") && !x.specialAbilities.Contains(SpecialTriggeredAbility) && !x.HasAbility(Plugin.AddStats.ability)));
		}
	}
	public class InfoStoreIce : SpecialCardBehaviour
	{
		public static SpecialTriggeredAbility SpecialTriggeredAbility;

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

		public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer)
		{
			Plugin.Log.LogInfo((object)"icecheck 2");
			CardModificationInfo copymod = new CardModificationInfo(0, 0);
			copymod.abilities.AddRange(((SpecialCardBehaviour)this).Card.Info.ModAbilities);
			if (((SpecialCardBehaviour)this).Card.Info.ModAbilities.Count > 0)
			{
				copymod.fromDuplicateMerge = true;
			}
			CardExtensions.SetIceCube(((SpecialCardBehaviour)this).Card.Info, "zep_pvz_infininutbase", (IEnumerable<CardModificationInfo>)null);
			((SpecialCardBehaviour)this).Card.Info.iceCubeParams.creatureWithin.Mods.Add(copymod);
			Plugin.Log.LogInfo((object)"icecheck 2");
			yield break;
		}
	}
	public static class ext
	{
		public static int GetSunCost(this CardInfo info)
		{
			int? extendedPropertyAsInt = CardExtensions.GetExtendedPropertyAsInt(info, "SunCost");
			return extendedPropertyAsInt.HasValue ? extendedPropertyAsInt.Value : 0;
		}
	}
	[BepInPlugin("zepht.inscryption.ZephtPvZ", "PvZbyZepht", "0.6.2")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public class Sunmaker1 : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

			public override bool RespondsToTurnEnd(bool playerTurnEnd)
			{
				return ((AbilityBehaviour)this).Card.OpponentCard != playerTurnEnd && !((AbilityBehaviour)this).Card.Dead;
			}

			public override IEnumerator OnTurnEnd(bool playerTurnEnd)
			{
				if (!((AbilityBehaviour)this).Card.OpponentCard)
				{
					Singleton<ViewManager>.Instance.SwitchToView((View)4, false, true);
					yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
					yield return gainSunFromCard(1, ((AbilityBehaviour)this).Card);
					yield return ((AbilityBehaviour)this).LearnAbility(0.1f);
					Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0;
				}
			}
		}

		public class Sunmaker2 : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

			public override bool RespondsToTurnEnd(bool playerTurnEnd)
			{
				return ((AbilityBehaviour)this).Card.OpponentCard != playerTurnEnd && !((AbilityBehaviour)this).Card.Dead;
			}

			public override IEnumerator OnTurnEnd(bool playerTurnEnd)
			{
				if (!((AbilityBehaviour)this).Card.OpponentCard)
				{
					Singleton<ViewManager>.Instance.SwitchToView((View)4, false, true);
					yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
					yield return gainSunFromCard(2, ((AbilityBehaviour)this).Card);
					yield return ((AbilityBehaviour)this).LearnAbility(0.1f);
					Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0;
				}
			}
		}

		public class Sunmaker3 : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

			public override bool RespondsToTurnEnd(bool playerTurnEnd)
			{
				return ((AbilityBehaviour)this).Card.OpponentCard != playerTurnEnd && !((AbilityBehaviour)this).Card.Dead;
			}

			public override IEnumerator OnTurnEnd(bool playerTurnEnd)
			{
				if (!((AbilityBehaviour)this).Card.OpponentCard)
				{
					Singleton<ViewManager>.Instance.SwitchToView((View)4, false, true);
					yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
					yield return gainSunFromCard(3, ((AbilityBehaviour)this).Card);
					yield return ((AbilityBehaviour)this).LearnAbility(0.1f);
					Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0;
				}
			}
		}

		public class SunKill : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

			public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer)
			{
				return (Object)(object)killer != (Object)null && (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card;
			}

			public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer)
			{
				Singleton<ViewManager>.Instance.SwitchToView((View)4, false, true);
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				yield return gainSunFromCard(3, ((AbilityBehaviour)this).Card);
				yield return ((AbilityBehaviour)this).LearnAbility(0.1f);
				Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0;
			}
		}

		public class Spudow : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

			public override bool RespondsToPreDeathAnimation(bool wasSacrifice)
			{
				return ((AbilityBehaviour)this).Card.OnBoard;
			}

			public override IEnumerator OnPreDeathAnimation(bool wasSacrifice)
			{
				((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				if (!wasSacrifice)
				{
					yield return ExplodeFromSlot(((AbilityBehaviour)this).Card.Slot);
				}
			}

			protected IEnumerator ExplodeFromSlot(CardSlot Slot)
			{
				if ((Object)(object)Slot.opposingSlot.Card != (Object)null && !Slot.opposingSlot.Card.Dead)
				{
					yield return BombCard(Slot.opposingSlot.Card, Slot.Card);
				}
			}

			private IEnumerator BombCard(PlayableCard target, PlayableCard attacker)
			{
				yield return (object)new WaitForSeconds(0.1f);
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				yield return (object)new WaitForSeconds(0.1f);
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				yield return (object)new WaitForSeconds(0.1f);
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				yield return target.TakeDamage(4, attacker);
			}

			public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer)
			{
				return !wasSacrifice && ((AbilityBehaviour)this).Card.OnBoard;
			}

			public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer)
			{
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				yield return ((AbilityBehaviour)this).LearnAbility(0.5f);
			}
		}

		public class Sweet : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

			public override bool RespondsToPreDeathAnimation(bool wasSacrifice)
			{
				return ((AbilityBehaviour)this).Card.OnBoard;
			}

			public override IEnumerator OnPreDeathAnimation(bool wasSacrifice)
			{
				((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				if (!wasSacrifice)
				{
					yield return ExplodeFromSlot(((AbilityBehaviour)this).Card.Slot);
				}
			}

			protected IEnumerator ExplodeFromSlot(CardSlot Slot)
			{
				List<CardSlot> adjacentSlots = Singleton<BoardManager>.Instance.GetAdjacentSlots(Slot);
				if (adjacentSlots.Count > 0 && adjacentSlots[0].Index < Slot.Index)
				{
					if ((Object)(object)adjacentSlots[0].Card != (Object)null && !adjacentSlots[0].Card.Dead)
					{
						yield return BombCard(adjacentSlots[0].Card, Slot.Card, 1);
					}
					if ((Object)(object)adjacentSlots[0].opposingSlot.Card != (Object)null && !adjacentSlots[0].opposingSlot.Card.Dead)
					{
						yield return BombCard(adjacentSlots[0].opposingSlot.Card, Slot.Card, 3);
					}
					adjacentSlots.RemoveAt(0);
				}
				if ((Object)(object)Slot.opposingSlot.Card != (Object)null && !Slot.opposingSlot.Card.Dead)
				{
					yield return BombCard(Slot.opposingSlot.Card, Slot.Card, 3);
				}
				if (adjacentSlots.Count > 0 && (Object)(object)adjacentSlots[0].opposingSlot.Card != (Object)null && !adjacentSlots[0].opposingSlot.Card.Dead)
				{
					yield return BombCard(adjacentSlots[0].opposingSlot.Card, Slot.Card, 3);
				}
				if (adjacentSlots.Count > 0 && (Object)(object)adjacentSlots[0].Card != (Object)null && !adjacentSlots[0].Card.Dead)
				{
					yield return BombCard(adjacentSlots[0].Card, Slot.Card, 1);
				}
			}

			private IEnumerator BombCard(PlayableCard target, PlayableCard attacker, int damage)
			{
				yield return (object)new WaitForSeconds(0.1f);
				((Card)target).Anim.PlayHitAnimation();
				yield return target.TakeDamage(damage, attacker);
			}

			public override bool RespondsToTurnEnd(bool playerTurnEnd)
			{
				return ((AbilityBehaviour)this).Card.OpponentCard != playerTurnEnd;
			}

			public override IEnumerator OnTurnEnd(bool playerTurnEnd)
			{
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				yield return (object)new WaitForSeconds(0.1f);
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				yield return (object)new WaitForSeconds(0.1f);
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				yield return (object)new WaitForSeconds(0.1f);
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				if ((Object)(object)((AbilityBehaviour)this).Card != (Object)null && !((AbilityBehaviour)this).Card.Dead)
				{
					if (!SaveManager.SaveFile.IsPart2)
					{
						Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
						yield return (object)new WaitForSeconds(0.1f);
					}
					yield return ((AbilityBehaviour)this).Card.Die(false, (PlayableCard)null, true);
					if (!SaveManager.SaveFile.IsPart2)
					{
						yield return (object)new WaitForSeconds(0.1f);
					}
				}
			}

			public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer)
			{
				return !wasSacrifice && ((AbilityBehaviour)this).Card.OnBoard;
			}

			public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer)
			{
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				yield return ((AbilityBehaviour)this).LearnAbility(0.5f);
			}
		}

		public class Spicy : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

			public override bool RespondsToPreDeathAnimation(bool wasSacrifice)
			{
				return ((AbilityBehaviour)this).Card.OnBoard;
			}

			public override IEnumerator OnPreDeathAnimation(bool wasSacrifice)
			{
				((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				if (!wasSacrifice)
				{
					yield return ExplodeFromSlot(((AbilityBehaviour)this).Card.Slot);
				}
			}

			protected IEnumerator ExplodeFromSlot(CardSlot Slot)
			{
				if ((Object)(object)Slot.opposingSlot.Card != (Object)null && !Slot.opposingSlot.Card.Dead)
				{
					yield return BombCard(Slot.opposingSlot.Card, Slot.Card);
				}
				if ((Object)(object)Singleton<BoardManager>.Instance.GetCardQueuedForSlot(Slot.opposingSlot) != (Object)null)
				{
					yield return BombCard(Singleton<BoardManager>.Instance.GetCardQueuedForSlot(Slot.opposingSlot), Slot.Card);
				}
			}

			private IEnumerator BombCard(PlayableCard target, PlayableCard attacker)
			{
				yield return (object)new WaitForSeconds(0.1f);
				((Card)target).Anim.PlayHitAnimation();
				yield return target.TakeDamage(4, attacker);
			}

			public override bool RespondsToTurnEnd(bool playerTurnEnd)
			{
				return ((AbilityBehaviour)this).Card.OpponentCard != playerTurnEnd;
			}

			public override IEnumerator OnTurnEnd(bool playerTurnEnd)
			{
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				yield return (object)new WaitForSeconds(0.1f);
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				yield return (object)new WaitForSeconds(0.1f);
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				yield return (object)new WaitForSeconds(0.1f);
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				if ((Object)(object)((AbilityBehaviour)this).Card != (Object)null && !((AbilityBehaviour)this).Card.Dead)
				{
					if (!SaveManager.SaveFile.IsPart2)
					{
						Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
						yield return (object)new WaitForSeconds(0.1f);
					}
					yield return ((AbilityBehaviour)this).Card.Die(false, (PlayableCard)null, true);
					if (!SaveManager.SaveFile.IsPart2)
					{
						yield return (object)new WaitForSeconds(0.1f);
					}
				}
			}

			public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer)
			{
				return !wasSacrifice && ((AbilityBehaviour)this).Card.OnBoard;
			}

			public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer)
			{
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				yield return ((AbilityBehaviour)this).LearnAbility(0.5f);
			}
		}

		public class DoomBringer : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

			public override bool RespondsToPreDeathAnimation(bool wasSacrifice)
			{
				return ((AbilityBehaviour)this).Card.OnBoard;
			}

			public override IEnumerator OnPreDeathAnimation(bool wasSacrifice)
			{
				((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				if (!wasSacrifice)
				{
					yield return ExplodeFromSlot(((AbilityBehaviour)this).Card.Slot);
				}
			}

			protected IEnumerator ExplodeFromSlot(CardSlot Slot)
			{
				foreach (CardSlot cardSlot in Singleton<BoardManager>.Instance.OpponentSlotsCopy)
				{
					if ((Object)(object)cardSlot.Card != (Object)null && !cardSlot.Card.Dead)
					{
						yield return BombCard(cardSlot.Card, Slot.Card, 7);
					}
					if ((Object)(object)cardSlot.opposingSlot.Card != (Object)null && !cardSlot.opposingSlot.Card.Dead)
					{
						yield return BombCard(cardSlot.opposingSlot.Card, Slot.Card, 1);
					}
				}
			}

			private IEnumerator BombCard(PlayableCard target, PlayableCard attacker, int damage)
			{
				yield return (object)new WaitForSeconds(0.003f);
				((Card)target).Anim.PlayHitAnimation();
				yield return target.TakeDamage(damage, attacker);
			}

			public override bool RespondsToTurnEnd(bool playerTurnEnd)
			{
				return ((AbilityBehaviour)this).Card.OpponentCard != playerTurnEnd;
			}

			public override IEnumerator OnTurnEnd(bool playerTurnEnd)
			{
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
				yield return (object)new WaitForSeconds(0.3f);
				((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
				yield return (object)new WaitForSeconds(0.2f);
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				yield return (object)new WaitForSeconds(0.1f);
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				yield return (object)new WaitForSeconds(0.1f);
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				yield return (object)new WaitForSeconds(0.05f);
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				yield return (object)new WaitForSeconds(0.02f);
				((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
				if ((Object)(object)((AbilityBehaviour)this).Card != (Object)null && !((AbilityBehaviour)this).Card.Dead)
				{
					if (!SaveManager.SaveFile.IsPart2)
					{
						Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
						yield return (object)new WaitForSeconds(0.1f);
					}
					yield return ((AbilityBehaviour)this).Card.Die(false, (PlayableCard)null, true);
					if (!SaveManager.SaveFile.IsPart2)
					{
						yield return (object)new WaitForSeconds(0.1f);
					}
				}
			}
		}

		public class Hypnotist : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

			public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer)
			{
				return !wasSacrifice && ((AbilityBehaviour)this).Card.OnBoard;
			}

			public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer)
			{
				if (!wasSacrifice && (Object)(object)killer != (Object)null && CardExtensions.HasAnyOfTraits(killer, (Trait[])(object)new Trait[2]
				{
					(Trait)16,
					(Trait)14
				}))
				{
					yield return Singleton<BoardManager>.Instance.AssignCardToSlot(killer, ((AbilityBehaviour)this).Card.Slot, 0.1f, (Action)null, true);
					killer.SetIsOpponentCard(!killer.Slot.IsPlayerSlot);
					((Card)killer).Anim.LightNegationEffect();
					yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
					yield return ((AbilityBehaviour)this).LearnAbility(0.5f);
				}
			}
		}

		public class TacticalRetreat : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;
		}

		[HarmonyPatch(typeof(PlayableCard), "GetPassiveAttackBuffs")]
		public class ScaredyAttack_patch
		{
			[HarmonyPostfix]
			public static void Postfix(ref int __result, ref PlayableCard __instance)
			{
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				if (__instance.OnBoard && (Object)(object)__instance.Slot.Card != (Object)null && __instance.Slot.Card.HasAbility(TacticalRetreat.ability) && (Object)(object)__instance.Slot.opposingSlot.Card != (Object)null && !__instance.Slot.opposingSlot.Card.HasAbility(TacticalRetreat.ability) && __instance.Slot.opposingSlot.Card.Attack >= 1)
				{
					__result--;
				}
			}
		}

		[HarmonyPatch(typeof(PlayableCard), "GetPassiveHealthBuffs")]
		public class ScaredHealth_patch
		{
			[HarmonyPostfix]
			public static void Postfix(ref int __result, ref PlayableCard __instance)
			{
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_0088: Unknown result type (might be due to invalid IL or missing references)
				if (__instance.OnBoard && (Object)(object)__instance.Slot.Card != (Object)null && __instance.Slot.Card.HasAbility(TacticalRetreat.ability) && (Object)(object)__instance.Slot.opposingSlot.Card != (Object)null && __instance.Slot.opposingSlot.Card.Attack >= 1 && !__instance.Slot.opposingSlot.Card.HasAbility(TacticalRetreat.ability))
				{
					__result++;
				}
			}
		}

		public class Pierce : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

			public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
			{
				return !slot.IsPlayerSlot && (Object)(object)((AbilityBehaviour)this).Card == (Object)(object)attacker;
			}

			public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
			{
				if (!slot.IsPlayerSlot)
				{
					PlayableCard queued = Singleton<BoardManager>.Instance.GetCardQueuedForSlot(slot);
					if ((Object)(object)queued != (Object)null && (Object)(object)attacker != (Object)null && CardExtensions.NotDead(attacker))
					{
						Singleton<ViewManager>.Instance.SwitchToView((View)6, false, true);
						yield return (object)new WaitForSeconds(0.3f);
						((Card)queued).Anim.LightNegationEffect();
						((Card)attacker).Anim.PlayAttackAnimation(false, queued.Slot);
						yield return queued.TakeDamage(((AbilityBehaviour)this).Card.Attack, ((AbilityBehaviour)this).Card);
						yield return (object)new WaitForSeconds(0.3f);
						((Card)queued).Anim.PlayHitAnimation();
						yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
						yield return ((AbilityBehaviour)this).LearnAbility(0.5f);
						Singleton<ViewManager>.Instance.SwitchToView((View)4, false, true);
						Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0;
					}
				}
			}
		}

		[HarmonyPatch(typeof(CombatPhaseManager), "DealOverkillDamage")]
		public class PierceOverkill_patch
		{
			[HarmonyPrefix]
			public static void CheckforPierce(ref int damage, CardSlot attackingSlot, CardSlot opposingSlot)
			{
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)attackingSlot.Card != (Object)null && attackingSlot.IsPlayerSlot && ((Card)attackingSlot.Card).Info.HasAbility(Pierce.ability))
				{
					damage = 0;
				}
			}
		}

		[HarmonyPatch(typeof(CombatPhaseManager), "SlotAttackSlot")]
		public class PierceArmor_patch
		{
			[HarmonyPrefix]
			public static void CheckforPierceArmor(ref CardSlot opposingSlot, CardSlot attackingSlot)
			{
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00db: Expected O, but got Unknown
				if (!((Object)(object)attackingSlot.Card != (Object)null) || !((Card)attackingSlot.Card).Info.HasAbility(Pierce.ability) || attackingSlot.Card.Dead || !((Object)(object)opposingSlot.Card != (Object)null) || !((Card)opposingSlot.Card).Info.HasAbility((Ability)54) || opposingSlot.Card.Dead)
				{
					return;
				}
				object obj = ((Card)opposingSlot.Card).Info.Clone();
				CardInfo val = (CardInfo)((obj is CardInfo) ? obj : null);
				foreach (CardModificationInfo mod in ((Card)opposingSlot.Card).Info.Mods)
				{
					val.Mods.Add(mod);
				}
				CardModificationInfo val2 = new CardModificationInfo();
				val2.negateAbilities = new List<Ability>
				{
					(Ability)54,
					(Ability)54,
					(Ability)54
				};
				val.Mods.Add(val2);
				((Card)opposingSlot.Card).SetInfo(val);
			}
		}

		public class SporeSpread : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

			public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer)
			{
				Log.LogInfo((object)("playable card is " + (object)card));
				Log.LogInfo((object)("this card is " + (object)((AbilityBehaviour)this).Card));
				Log.LogInfo((object)("killer is " + (object)killer));
				return (Object)(object)((AbilityBehaviour)this).Card == (Object)(object)killer;
			}

			public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer)
			{
				CardInfo CardToDraw = ((Card)((AbilityBehaviour)this).Card).Info;
				if ((int)Singleton<ViewManager>.Instance.CurrentView != 1)
				{
					yield return (object)new WaitForSeconds(0.2f);
					Singleton<ViewManager>.Instance.SwitchToView((View)1, false, false);
					yield return (object)new WaitForSeconds(0.2f);
				}
				yield return Singleton<CardSpawner>.Instance.SpawnCardToHand(CardToDraw, (List<CardModificationInfo>)null, 0.25f, (Action<PlayableCard>)null);
				yield return (object)new WaitForSeconds(0.45f);
				yield return ((AbilityBehaviour)this).LearnAbility(0.1f);
			}
		}

		public class AddStats : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

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

			public override IEnumerator OnResolveOnBoard()
			{
				((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				foreach (CardSlot cardSlot in Singleton<BoardManager>.Instance.PlayerSlotsCopy)
				{
					if (!((Object)(object)cardSlot.Card != (Object)null) || cardSlot.Card.Dead || !Object.op_Implicit((Object)(object)((AbilityBehaviour)this).Card) || !((Object)(object)cardSlot.Card != (Object)(object)((AbilityBehaviour)this).Card) || ((Card)cardSlot.Card).Info.traits.Contains((Trait)12) || ((Card)cardSlot.Card).Info.traits.Contains(NoSacs))
					{
						continue;
					}
					((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
					yield return (object)new WaitForSeconds(0.2f);
					((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
					yield return (object)new WaitForSeconds(0.2f);
					((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
					yield return (object)new WaitForSeconds(0.3f);
					((Card)cardSlot.Card).Anim.PlayTransformAnimation();
					object obj = ((Card)cardSlot.Card).Info.Clone();
					CardInfo targetCardInfo = (CardInfo)((obj is CardInfo) ? obj : null);
					foreach (CardModificationInfo cardmod in ((Card)cardSlot.Card).Info.Mods)
					{
						targetCardInfo.Mods.Add(cardmod);
					}
					foreach (Ability ability in ((Card)((AbilityBehaviour)this).Card).Info.Abilities)
					{
						if (ability != AddStats.ability)
						{
							CardModificationInfo cardModificationInfoPvZ = new CardModificationInfo(ability);
							targetCardInfo.Mods.Add(cardModificationInfoPvZ);
						}
					}
					CardModificationInfo cardModificationInfoPvZ2 = new CardModificationInfo();
					cardModificationInfoPvZ2.attackAdjustment = ((Card)((AbilityBehaviour)this).Card).Info.Attack;
					cardModificationInfoPvZ2.healthAdjustment = ((Card)((AbilityBehaviour)this).Card).Info.Health;
					targetCardInfo.Mods.Add(cardModificationInfoPvZ2);
					((Card)cardSlot.Card).SetInfo(targetCardInfo);
					((Card)cardSlot.Card).RenderCard();
					yield return (object)new WaitForSeconds(0.3f);
				}
				yield return (object)new WaitForSeconds(0.2f);
				yield return ((AbilityBehaviour)this).Card.Die(false, (PlayableCard)null, true);
				yield return (object)new WaitForSeconds(0.2f);
				yield return ((AbilityBehaviour)this).LearnAbility(0.5f);
				Singleton<ViewManager>.Instance.SwitchToView(Singleton<BoardManager>.Instance.DefaultView, false, false);
			}
		}

		public class AddStatsOpponent : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

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

			public override IEnumerator OnResolveOnBoard()
			{
				((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				foreach (CardSlot cardSlot in Singleton<BoardManager>.Instance.OpponentSlotsCopy)
				{
					if (!((Object)(object)cardSlot.Card != (Object)null) || cardSlot.Card.Dead || !Object.op_Implicit((Object)(object)((AbilityBehaviour)this).Card) || ((Card)cardSlot.Card).Info.traits.Contains(NoSacs))
					{
						continue;
					}
					((Card)cardSlot.Card).Anim.LightNegationEffect();
					yield return (object)new WaitForSeconds(0.2f);
					((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
					yield return (object)new WaitForSeconds(0.2f);
					((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
					yield return (object)new WaitForSeconds(0.3f);
					((Card)cardSlot.Card).Anim.PlayTransformAnimation();
					object obj = ((Card)cardSlot.Card).Info.Clone();
					CardInfo targetCardInfo = (CardInfo)((obj is CardInfo) ? obj : null);
					foreach (CardModificationInfo cardmod in ((Card)cardSlot.Card).Info.Mods)
					{
						targetCardInfo.Mods.Add(cardmod);
					}
					foreach (Ability ability in ((Card)((AbilityBehaviour)this).Card).Info.Abilities)
					{
						if (ability != AddStatsOpponent.ability)
						{
							CardModificationInfo cardModificationInfoPvZ = new CardModificationInfo(ability);
							targetCardInfo.Mods.Add(cardModificationInfoPvZ);
						}
					}
					CardModificationInfo cardModificationInfoPvZ2 = new CardModificationInfo();
					cardModificationInfoPvZ2.attackAdjustment = ((Card)((AbilityBehaviour)this).Card).Info.Attack;
					cardModificationInfoPvZ2.healthAdjustment = ((Card)((AbilityBehaviour)this).Card).Info.Health;
					targetCardInfo.Mods.Add(cardModificationInfoPvZ2);
					((Card)cardSlot.Card).SetInfo(targetCardInfo);
					((Card)cardSlot.Card).RenderCard();
					yield return (object)new WaitForSeconds(0.3f);
				}
				yield return (object)new WaitForSeconds(0.2f);
				yield return ((AbilityBehaviour)this).Card.Die(false, (PlayableCard)null, true);
				yield return (object)new WaitForSeconds(0.2f);
				yield return ((AbilityBehaviour)this).LearnAbility(0.5f);
				Singleton<ViewManager>.Instance.SwitchToView(Singleton<BoardManager>.Instance.DefaultView, false, false);
			}
		}

		public class ArmorBreak : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

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

			public override IEnumerator OnResolveOnBoard()
			{
				((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				Ability[] array = new Ability[6];
				RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
				array[0] = (Ability)(int)HardHeaded.ability;
				Ability[] armorAbilities = (Ability[])(object)array;
				foreach (CardSlot cardSlot in Singleton<BoardManager>.Instance.OpponentSlotsCopy)
				{
					if (!((Object)(object)cardSlot.Card != (Object)null) || cardSlot.Card.Dead)
					{
						continue;
					}
					Ability[] array2 = armorAbilities;
					foreach (Ability ability1 in array2)
					{
						if (!((Card)cardSlot.Card).Info.HasAbility(ability1))
						{
							continue;
						}
						((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
						yield return (object)new WaitForSeconds(0.1f);
						((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
						yield return (object)new WaitForSeconds(0.1f);
						((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect();
						yield return (object)new WaitForSeconds(0.2f);
						((Card)cardSlot.Card).Anim.PlayTransformAnimation();
						object obj = ((Card)cardSlot.Card).Info.Clone();
						CardInfo targetCardInfo = (CardInfo)((obj is CardInfo) ? obj : null);
						foreach (CardModificationInfo cardmod in ((Card)cardSlot.Card).Info.Mods)
						{
							targetCardInfo.Mods.Add(cardmod);
						}
						CardModificationInfo cardModificationInfo = new CardModificationInfo();
						cardModificationInfo.negateAbilities = new List<Ability> { ability1 };
						targetCardInfo.Mods.Add(cardModificationInfo);
						((Card)cardSlot.Card).SetInfo(targetCardInfo);
						((Card)cardSlot.Card).RenderCard();
						yield return (object)new WaitForSeconds(0.1f);
						yield return ((AbilityBehaviour)this).LearnAbility(0.5f);
					}
				}
			}
		}

		public class ZombieWave : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

			public override bool RespondsToResolveOnBoard()
			{
				return true;
			}

			public override IEnumerator OnResolveOnBoard()
			{
				Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
				CardSlot toLeft = Singleton<BoardManager>.Instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, true);
				CardSlot toRight = Singleton<BoardManager>.Instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, false);
				bool toLeftValid = (Object)(object)toLeft != (Object)null && (Object)(object)toLeft.Card == (Object)null;
				bool toRightValid = (Object)(object)toRight != (Object)null && (Object)(object)toRight.Card == (Object)null;
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				if (toLeftValid)
				{
					yield return (object)new WaitForSeconds(0.1f);
					yield return SpawnCardOnSlot(toLeft);
				}
				if (toRightValid)
				{
					yield return (object)new WaitForSeconds(0.1f);
					yield return SpawnCardOnSlot(toRight);
				}
				if (toLeftValid || toRightValid)
				{
					Say("A huge wave of zombies is approaching");
				}
			}

			private IEnumerator SpawnCardOnSlot(CardSlot Slot)
			{
				int rand = SeededRandom.Range(0, 10, ((TriggerReceiver)this).GetRandomSeed());
				if (rand <= 6)
				{
					yield return Singleton<BoardManager>.Instance.CreateCardInSlot(CardLoader.GetCardByName("zep_pvz_zombie"), Slot, 0.15f, true);
				}
				else if (rand <= 9)
				{
					yield return Singleton<BoardManager>.Instance.CreateCardInSlot(CardLoader.GetCardByName("zep_pvz_zombiecone"), Slot, 0.15f, true);
				}
				else
				{
					yield return Singleton<BoardManager>.Instance.CreateCardInSlot(CardLoader.GetCardByName("zep_pvz_zombiebucket"), Slot, 0.15f, true);
				}
			}
		}

		public class HardHeaded : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

			public override bool RespondsToResolveOnBoard()
			{
				return true;
			}

			public override bool RespondsToTakeDamage(PlayableCard source)
			{
				return true;
			}

			public override IEnumerator OnTakeDamage(PlayableCard source)
			{
				if ((Object)(object)((AbilityBehaviour)this).Card != (Object)null && ((Card)((AbilityBehaviour)this).Card).Info.HasAbility(ability) && !((AbilityBehaviour)this).Card.Dead && hardheadHealth > 0)
				{
					if (hardheadHealth - ((AbilityBehaviour)this).Card.Health == 0)
					{
						((AbilityBehaviour)this).Card.HealDamage(-2);
					}
					else if (hardheadHealth - ((AbilityBehaviour)this).Card.Health >= 1)
					{
						object obj = ((Card)((AbilityBehaviour)this).Card).Info.Clone();
						CardInfo targetCardInfo = (CardInfo)((obj is CardInfo) ? obj : null);
						foreach (CardModificationInfo cardmod in ((Card)((AbilityBehaviour)this).Card).Info.Mods)
						{
							targetCardInfo.Mods.Add(cardmod);
						}
						CardModificationInfo cardModificationInfo = new CardModificationInfo();
						cardModificationInfo.negateAbilities = new List<Ability> { ability };
						targetCardInfo.Mods.Add(cardModificationInfo);
						((Card)((AbilityBehaviour)this).Card).SetInfo(targetCardInfo);
						if (((Object)targetCardInfo).name == "zep_pvz_zombiebucket" && !((AbilityBehaviour)this).Card.HasAbility(ability))
						{
							((AbilityBehaviour)this).Card.SwitchToAlternatePortrait();
						}
						if (hardheadHealth - ((AbilityBehaviour)this).Card.Health == 1)
						{
							((AbilityBehaviour)this).Card.HealDamage(-1);
						}
					}
					if (((AbilityBehaviour)this).Card.Health <= 0)
					{
						((AbilityBehaviour)this).Card.Die(false, (PlayableCard)null, true);
					}
				}
				hardheadHealth = 0;
				yield break;
			}
		}

		[HarmonyPatch(typeof(CombatPhaseManager), "SlotAttackSlot")]
		public class HardHeaded_patch
		{
			[HarmonyPrefix]
			public static void CheckforHardHeaded(ref CardSlot opposingSlot, CardSlot attackingSlot)
			{
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)opposingSlot.Card != (Object)null && ((Card)opposingSlot.Card).Info.HasAbility(HardHeaded.ability))
				{
					opposingSlot.Card.HealDamage(2);
					hardheadHealth = opposingSlot.Card.Health;
				}
			}
		}

		public class FadeAway : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;

			public override bool RespondsToTurnEnd(bool playerTurnEnd)
			{
				return ((AbilityBehaviour)this).Card.OpponentCard != playerTurnEnd && !((AbilityBehaviour)this).Card.Dead;
			}

			public override IEnumerator OnTurnEnd(bool playerTurnEnd)
			{
				Singleton<ViewManager>.Instance.SwitchToView((View)4, false, true);
				yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence();
				yield return (object)new WaitForSeconds(0.3f);
				((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect();
				yield return (object)new WaitForSeconds(0.3f);
				((Card)((AbilityBehaviour)this).Card).Anim.PlayHitAnimation();
				yield return ((AbilityBehaviour)this).Card.TakeDamage(1, (PlayableCard)null);
				yield return (object)new WaitForSeconds(0.3f);
				yield return ((AbilityBehaviour)this).LearnAbility(0.1f);
				Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0;
			}
		}

		public class FloorPoolInfo : AbilityBehaviour
		{
			public static Ability ability;

			public override Ability Ability => ability;
		}

		[HarmonyPatch(typeof(PlayableCard), "CanPlay")]
		public class CanPlay_patch
		{
			[HarmonyPostfix]
			public static void Postfix(ref bool __result, ref PlayableCard __instance)
			{
				if (((Card)__instance).Info.GetSunCost() > 0)
				{
					int sunCost = ((Card)__instance).Info.GetSunCost();
					if (sunCost > Sun)
					{
						__result = false;
					}
				}
			}
		}

		[HarmonyPatch(typeof(HintsHandler), "OnNonplayableCardClicked")]
		public class CanPlayHint_patch
		{
			[HarmonyPrefix]
			public static bool Prefix(PlayableCard card, List<PlayableCard> cardsInHand)
			{
				if (SaveManager.SaveFile.IsPart2)
				{
					HintsHandler.OnGBCNonPlayableCardPressed(card);
					return false;
				}
				if (((Card)card).Info.GetSunCost() > Sun)
				{
					SayQuick("You dont have enough sun for that one");
					return false;
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(PlayerHand))]
		public class paySun_patch
		{
			[HarmonyPostfix]
			[HarmonyPatch("SelectSlotForCard")]
			public static IEnumerator Postfix(IEnumerator enumerator, PlayerHand __instance, PlayableCard card)
			{
				if (((Card)card).Info.GetSunCost() > 0)
				{
					__instance.CardsInHand.ForEach(delegate(PlayableCard x)
					{
						((InteractableBase)x).SetEnabled(false);
					});
					yield return (object)new WaitWhile((Func<bool>)(() => __instance.ChoosingSlot));
					__instance.OnSelectSlotStartedForCard(card);
					if ((Object)(object)Singleton<RuleBookController>.Instance != (Object)null)
					{
						Singleton<RuleBookController>.Instance.SetShown(false, true);
					}
					Singleton<BoardManager>.Instance.CancelledSacrifice = false;
					__instance.choosingSlotCard = card;
					if ((Object)(object)card != (Object)null && (Object)(object)((Card)card).Anim != (Object)null)
					{
						((Card)card).Anim.SetSelectedToPlay(true);
					}
					Singleton<BoardManager>.Instance.ShowCardNearBoard(card, true);
					if ((Object)(object)Singleton<TurnManager>.Instance.SpecialSequencer != (Object)null)
					{
						yield return Singleton<TurnManager>.Instance.SpecialSequencer.CardSelectedFromHand(card);
					}
					bool cardWasPlayed = false;
					bool requiresSacrifices = ((Card)card).Info.BloodCost > 0;
					if (requiresSacrifices)
					{
						List<CardSlot> validSlots = Singleton<BoardManager>.Instance.PlayerSlotsCopy.FindAll((CardSlot x) => (Object)(object)x.Card != (Object)null);
						yield return Singleton<BoardManager>.Instance.ChooseSacrificesForCard(validSlots, card);
					}
					if (!Singleton<BoardManager>.Instance.CancelledSacrifice)
					{
						List<CardSlot> validSlots2 = Singleton<BoardManager>.Instance.PlayerSlotsCopy.FindAll((CardSlot x) => (Object)(object)x.Card == (Object)null);
						yield return Singleton<BoardManager>.Instance.ChooseSlot(validSlots2, !requiresSacrifices);
						CardSlot lastSelectedSlot = Singleton<BoardManager>.Instance.LastSelectedSlot;
						if ((Object)(object)lastSelectedSlot != (Object)null)
						{
							cardWasPlayed = true;
							((Card)card).Anim.SetSelectedToPlay(false);
							yield return __instance.PlayCardOnSlot(card, lastSelectedSlot);
							if (((Card)card).Info.BonesCost > 0)
							{
								yield return Singleton<ResourcesManager>.Instance.SpendBones(((Card)card).Info.BonesCost);
							}
							if (card.EnergyCost > 0)
							{
								yield return Singleton<ResourcesManager>.Instance.SpendEnergy(card.EnergyCost);
							}
							if (((Card)card).Info.GetSunCost() > 0 && !SaveManager.SaveFile.IsPart2)
							{
								int costToPay = ((Card)card).Info.GetSunCost();
								yield return extractSun(costToPay);
							}
						}
					}
					if (!cardWasPlayed)
					{
						Singleton<BoardManager>.Instance.ShowCardNearBoard(card, false);
					}
					__instance.choosingSlotCard = null;
					if ((Object)(object)card != (Object)null && (Object)(object)((Card)card).Anim != (Object)null)
					{
						((Card)card).Anim.SetSelectedToPlay(false);
					}
					__instance.CardsInHand.ForEach(delegate(PlayableCard x)
					{
						((InteractableBase)x).SetEnabled(true);
					});
				}
				else
				{
					yield return enumerator;
				}
			}
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		public class CardInfo_CostTier_Patch
		{
			[HarmonyPostfix]
			public static void Postfix(ref int __result, ref CardInfo __instance)
			{
				__result += Mathf.CeilToInt((float)__instance.GetSunCost() / 3f);
			}
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		public class Deck_CardCanBePlayedByTurn2WithHand
		{
			[HarmonyPostfix]
			public static void Postfix(ref CardInfo card, List<CardInfo> hand, ref bool __result, ref Deck __instance)
			{
				__result = __result && card.GetSunCost() <= 2;
			}
		}

		[HarmonyPatch(typeof(TurnManager), "DoUpkeepPhase")]
		public class TurnStart_patch
		{
			[HarmonyPostfix]
			public static void Postfix(ref bool playerUpkeep)
			{
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				if (playerUpkeep && !AscensionSaveData.Data.ChallengeIsActive(noSunChallenge.challengeType))
				{
					Log.LogInfo((object)"Sun upkeep patch initialised");
					SunCounterCard.Anim.LightNegationEffect();
					Sun++;
					UpdateSunCounter();
				}
			}
		}

		[HarmonyPatch(typeof(GameFlowManager), "TransitionTo")]
		public class Transition_To_patch
		{
			[HarmonyPrefix]
			public static void Prefix()
			{
				Sun = 2;
			}
		}

		[HarmonyPatch(typeof(CardDrawPiles), "Initialize")]
		public class Initialise_patch
		{
			[HarmonyPostfix]
			public static void Postfix()
			{
				//IL_005b: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
				Log.LogInfo((object)"Sun counter patch initialised");
				SunCounterObject = Object.Instantiate<GameObject>(Singleton<CardSpawner>.Instance.playableCardPrefab);
				UpdateSunCounter();
				SunCounterCard.Anim.StrongNegationEffect();
				Vector3 val = default(Vector3);
				((Vector3)(ref val))..ctor(1.24f, 1.05f, 5.014f);
				SunCounterObject.transform.Translate(val);
				((Vector3)(ref val))..ctor(-2.82f, -0.6f, -5.63f);
				SunCounterObject.transform.Translate(val);
				Vector3 val2 = default(Vector3);
				((Vector3)(ref val2))..ctor(-90f, 0f, 0f);
				SunCounterObject.transform.Rotate(val2);
				Vector3 val3 = default(Vector3);
				((Vector3)(ref val3))..ctor(15f, -35f, 0f);
				SunCounterObject.transform.Rotate(val3);
				SunCounterObject.transform.localScale = new Vector3(1.3f, 1.3f, 1.3f);
			}
		}

		[HarmonyPatch(typeof(CardDrawPiles), "CleanUp")]
		public class Cleanup_patch
		{
			[HarmonyPostfix]
			public static void Postfix()
			{
				Log.LogInfo((object)"Sun counter patch clean up");
				if ((Object)(object)SunCounterObject != (Object)null)
				{
					SunCounterCard.Anim.StrongNegationEffect();
					Object.Destroy((Object)(object)SunCounterObject.gameObject);
				}
				ClearFloor();
			}
		}

		public class SunCounterBackground : CardAppearanceBehaviour
		{
			public static Appearance CustomAppearance;

			public override void ApplyAppearance()
			{
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Unknown result type (might be due to invalid IL or missing references)
				((CardAppearanceBehaviour)this).Card.RenderInfo.baseTextureOverride = (Texture)(object)findTexture("SunCounter");
				Color nameTextColor = default(Color);
				nameTextColor.a = 1f;
				nameTextColor.r = 1f;
				nameTextColor.g = 0.5f;
				nameTextColor.b = 0f;
				((CardAppearanceBehaviour)this).Card.RenderInfo.nameTextColor = nameTextColor;
				SunCounterCard = ((CardAppearanceBehaviour)this).Card;
			}
		}

		public class InstantCardBackground : CardAppearanceBehaviour
		{
			public static Appearance CustomAppearance;

			public override void ApplyAppearance()
			{
				((CardAppearanceBehaviour)this).Card.RenderInfo.baseTextureOverride = (Texture)(object)findTexture("InstantBack");
				if (((CardAppearanceBehaviour)this).Card.Info.baseAttack == 0)
				{
					((CardAppearanceBehaviour)this).Card.RenderInfo.hiddenAttack = true;
				}
				if (((CardAppearanceBehaviour)this).Card.Info.baseHealth == 0)
				{
					((CardAppearanceBehaviour)this).Card.RenderInfo.hiddenHealth = true;
				}
			}
		}

		public class FloorPoolBackground : CardAppearanceBehaviour
		{
			public static Appearance CustomAppearance;

			public override void ApplyAppearance()
			{
				((CardAppearanceBehaviour)this).Card.RenderInfo.baseTextureOverride = (Texture)(object)findTexture("FloorPool");
			}
		}

		[HarmonyPatch(typeof(CardSingleChoicesSequencer), "GetCardbackTexture")]
		public class SunCostBack_patch
		{
			[HarmonyPostfix]
			public static void Postfix(ref Texture __result, CardChoice choice)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				if (choice.resourceType == SunResource)
				{
					__result = (Texture)(object)findTexture("SunCostTrial");
				}
			}
		}

		[HarmonyPatch(typeof(Part1CardChoiceGenerator), "GenerateCostChoices")]
		public class CostChoice_patch
		{
			[HarmonyPostfix]
			public static void Postfix(ref List<CardChoice> __result, int randomSeed)
			{
				//IL_0004: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Expected O, but got Unknown
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				List<CardChoice> list = __result;
				CardChoice val = new CardChoice();
				val.resourceType = SunResource;
				val.resourceAmount = 1;
				list.Add(val);
				ShuffleChoice(list);
				while (list.Count > 3)
				{
					list.RemoveAt(SeededRandom.Range(0, list.Count, randomSeed++));
				}
				if (list[0] != val && list[1] != val && list[2] != val)
				{
					list[0] = val;
					ShuffleChoice(list);
				}
				__result = list;
			}
		}

		[HarmonyPatch(typeof(CardSingleChoicesSequencer))]
		public class SunCostCreateCard_patch
		{
			[HarmonyPostfix]
			[HarmonyPatch("CostChoiceChosen")]
			public static IEnumerator Postfix(IEnumerator enumerator, CardSingleChoicesSequencer __instance, SelectableCard card)
			{
				if (card.ChoiceInfo.resourceType == SunResource)
				{
					CardInfo cardInfo = GetRandomChoosablePlantCard(SaveManager.SaveFile.GetCurrentRandomSeed());
					((Card)card).SetInfo(cardInfo);
					((Card)card).SetFaceDown(false, false);
					((Card)card).SetInteractionEnabled(false);
					yield return __instance.TutorialTextSequence(card);
					((Card)card).SetCardbackToDefault();
					yield return __instance.WaitForCardToBeTaken(card);
				}
				else
				{
					yield return enumerator;
				}
			}
		}

		[HarmonyPatch(typeof(DeckTrialSequencer), "GenerateRewardChoices")]
		public class TrialChoice_patch
		{
			[HarmonyPostfix]
			public static void Postfix(ref List<CardInfo> __result, int randomSeed)
			{
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0129: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
				List<CardInfo> list = __result;
				for (int i = 0; i < list.Count; i++)
				{
					if (!list[i].HasTrait(NoSacs))
					{
						continue;
					}
					List<CardInfo> list2 = CardLoader.RemoveDeckSingletonsIfInDeck(ScriptableObjectLoader<CardInfo>.AllData.FindAll((CardInfo x) => x.metaCategories.Contains((CardMetaCategory)0) && !x.HasTrait(NoSacs) && ((Object)x).name != ((Object)list[0]).name && ((Object)x).name != ((Object)list[1]).name && ((Object)x).name != ((Object)list[2]).name));
					list[i] = CardLoader.Clone(list2[SeededRandom.Range(0, list2.Count, randomSeed)]);
					CardModificationInfo randomAbilityModForCard = CardLoader.GetRandomAbilityModForCard(randomSeed++, list[i], false);
					if (ProgressionData.NumLearnedAbilities < 3)
					{
						if (list[i].HasAbility((Ability)19))
						{
							randomAbilityModForCard.abilities[0] = (Ability)15;
						}
						else
						{
							randomAbilityModForCard.abilities[0] = (Ability)19;
						}
					}
					else
					{
						while (list[i].HasAbility(randomAbilityModForCard.abilities[0]))
						{
							randomAbilityModForCard = CardLoader.GetRandomAbilityModForCard(randomSeed++, list[i], false);
						}
					}
					list[i].Mods.Add(randomAbilityModForCard);
					CardModificationInfo randomAbilityModForCard2 = CardLoader.GetRandomAbilityModForCard(randomSeed++, list[i], false);
					if (ProgressionData.NumLearnedAbilities < 3)
					{
						if (list[i].HasAbility((Ability)19))
						{
							randomAbilityModForCard2.abilities[0] = (Ability)15;
						}
						else
						{
							randomAbilityModForCard2.abilities[0] = (Ability)19;
						}
					}
					else
					{
						while (list[i].HasAbility(randomAbilityModForCard2.abilities[0]))
						{
							randomAbilityModForCard2 = CardLoader.GetRandomAbilityModForCard(randomSeed++, list[i], false);
						}
					}
					list[i].Mods.Add(randomAbilityModForCard2);
				}
				__result = list;
			}
		}

		[HarmonyPatch(typeof(GainConsumablesSequencer), "FullConsumablesSequence")]
		public class Rat_patch
		{
			[HarmonyPrefix]
			public static void Prefix(ref GainConsumablesSequencer __instance)
			{
				CardInfo cardByName = CardLoader.GetCardByName("zep_pvz_magnetshroom");
				__instance.fullConsumablesReward = cardByName;
			}
		}

		[HarmonyPatch(typeof(PackMule), "GenerateCardPack")]
		public class Mule_patch
		{
			[HarmonyPostfix]
			public static void Postfix(ref List<CardInfo> __result)
			{
				List<CardInfo> list = __result;
				int currentRandomSeed = SaveManager.SaveFile.GetCurrentRandomSeed();
				while (list.Count <= 5)
				{
					list.Add(GetRandomChoosableCardWithSunCost(currentRandomSeed++));
				}
				__result = list;
			}
		}

		[HarmonyPatch(typeof(CardMergeSequencer), "GetValidCardsForHost")]
		public class SacStoneHost_patch
		{
			[HarmonyPostfix]
			public static void Postfix(ref List<CardInfo> __result)
			{
				List<CardInfo> list = __result;
				list.RemoveAll((CardInfo x) => x.traits.Contains(NoSacs) || x.Abilities.Contains(AddStats.ability) || x.Abilities.Contains(Spicy.ability) || x.Abilities.Contains(Sweet.ability));
				__result = list;
			}
		}

		[HarmonyPatch(typeof(CardMergeSequencer), "GetValidCardsForSacrifice")]
		public class SacStoneSacrifice_patch
		{
			[HarmonyPostfix]
			public static void Postfix(ref List<CardInfo> __result)
			{
				List<CardInfo> list = __result;
				list.RemoveAll((CardInfo x) => x.traits.Contains(NoSacs) || x.Abilities.Contains(AddStats.ability) || x.Abilities.Contains(Spicy.ability) || x.Abilities.Contains(Sweet.ability));
				__result = list;
			}
		}

		[HarmonyPatch(typeof(CardStatBoostSequencer), "GetValidCards")]
		public class CampfireBoost_patch
		{
			[HarmonyPostfix]
			public static void Postfix(ref List<CardInfo> __result)
			{
				List<CardInfo> list = __result;
				list.RemoveAll((CardInfo x) => x.traits.Contains(NoSacs) || x.Abilities.Contains(AddStats.ability) || x.Abilities.Contains(Spicy.ability) || x.Abilities.Contains(Sweet.ability));
				__result = list;
			}
		}

		public const string PluginGuid = "zepht.inscryption.ZephtPvZ";

		private const string PluginName = "PvZbyZepht";

		private const string PluginVersion = "0.6.2";

		public static int Sun;

		public static Texture[] costDecals;

		public static Tribe PlantShroom;

		public static Tribe PlantFruit;

		public static Tribe PlantVeg;

		public static Tribe PlantFlower;

		public static Tribe PlantSpiky;

		public static readonly SpecialTriggeredAbility EvolveSprout = SpecialTriggeredAbilityManager.Add("zepht.inscryption.ZephtPvZ", "Sprout Evolve", typeof(EvolveSprout)).Id;

		public static readonly SpecialTriggeredAbility InheritIce = SpecialTriggeredAbilityManager.Add("zepht.inscryption.ZephtPvZ", "Inherit Ice", typeof(InfoStoreIce)).Id;

		public static readonly Appearance SunCounterApp = CardAppearanceBehaviourManager.Add("zepht.inscryption.ZephtPvZ", "SunCounterApp", typeof(SunCounterBackground)).Id;

		public static readonly Appearance InstantCardApp = CardAppearanceBehaviourManager.Add("zepht.inscryption.ZephtPvZ", "InstantCardApp", typeof(InstantCardBackground)).Id;

		public static readonly Appearance FloorPoolApp = CardAppearanceBehaviourManager.Add("zepht.inscryption.ZephtPvZ", "FloorPoolApp", typeof(FloorPoolBackground)).Id;

		public static readonly CardMetaCategory SIDE_DECK_CATEGORY = GuidManager.GetEnumValue<CardMetaCategory>("zorro.inscryption.infiniscryption.sidedecks", "SideDeck");

		public static Trait NoSacs = (Trait)7802;

		public static ResourceType SunResource = (ResourceType)78;

		public static Card SunCounterCard;

		public static CardInfo SunCounterCardInfo = ScriptableObject.CreateInstance<CardInfo>();

		public static GameObject SunCounterObject;

		public static string[] FloorCurrent = new string[4];

		public static string[] FloorExpected = new string[4];

		public static GameObject[] FloorCards = (GameObject[])(object)new GameObject[4];

		public static CardInfo FloorCardInfo = ScriptableObject.CreateInstance<CardInfo>();

		internal static ManualLogSource Log;

		public static Random rng = new Random();

		public static int hardheadHealth = 0;

		public static AscensionChallengeInfo noSunChallenge;

		public static Assembly _assembly;

		public static GameObject Particle;

		public static Assembly CurrentAssembly => _assembly ?? (_assembly = Assembly.GetExecutingAssembly());

		private void Awake()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			Log.LogInfo((object)"Loaded PvZbyZepht!");
			Log.LogInfo((object)"Inside Awake");
			Harmony val = new Harmony("zepht.inscryption.ZephtPvZ");
			val.PatchAll();
			Log.LogInfo((object)"DonePatch");
			AddTribes();
			Log.LogInfo((object)"DoneTribes");
			AddSigils();
			Log.LogInfo((object)"DoneSigils");
			AddCards();
			Log.LogInfo((object)"DoneCards");
			AddStarters();
			Log.LogInfo((object)"DoneStarters");
			AddChallenges();
			Log.LogInfo((object)"DoneChallenges");
			PatchAquaSquirrel();
		}

		private void PatchAquaSquirrel()
		{
			CardInfo val = CardExtensions.CardByName((IEnumerable<CardInfo>)CardManager.BaseGameCards, "AquaSquirrel");
			CardExtensions.SetPixelPortrait(val, findTexture("AquaSquirrel-p"), (FilterMode?)null);
		}

		private void AddChallenges()
		{
			AddNoSunChallenge();
		}

		private void AddNoSunChallenge()
		{
			noSunChallenge = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("zepht.inscryption.ZephtPvZ", "Night time", "You will no longer get passive sun falling from the sky.", 10, findTexture("ChallengeNight"), findTexture("ChallengeNightActive"), 2, 1));
		}

		private void AddTribes()
		{
			//IL_0024: 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_0051: 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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			string text = "PlantFruit";
			PlantFruit = TribeManager.Add("zepht.inscryption.ZephtPvZ", text, findTexture(text), true, findTexture(text + "Pick"));
			text = "PlantVeg";
			PlantVeg = TribeManager.Add("zepht.inscryption.ZephtPvZ", text, findTexture(text), true, findTexture(text + "Pick"));
			text = "PlantFlower";
			PlantFlower = TribeManager.Add("zepht.inscryption.ZephtPvZ", text, findTexture(text), true, findTexture(text + "Pick"));
			text = "PlantShroom";
			PlantShroom = TribeManager.Add("zepht.inscryption.ZephtPvZ", text, findTexture(text), true, findTexture(text + "Pick"));
			text = "PlantSpiky";
			PlantSpiky = TribeManager.Add("zepht.inscryption.ZephtPvZ", text, findTexture(text), true, findTexture(text + "Pick"));
		}

		private void AddCards()
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Expected I4, but got Unknown
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Expected I4, but got Unknown
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Expected I4, but got Unknown
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Expected I4, but got Unknown
			//IL_0374: Unknown result type (might be due to invalid IL or missing references)
			//IL_037a: Expected I4, but got Unknown
			//IL_04b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bb: Expected I4, but got Unknown
			//IL_05f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fa: Expected I4, but got Unknown
			//IL_0738: Unknown result type (might be due to invalid IL or missing references)
			//IL_073e: Expected I4, but got Unknown
			//IL_0876: Unknown result type (might be due to invalid IL or missing references)
			//IL_087c: Expected I4, but got Unknown
			//IL_09b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_09bb: Expected I4, but got Unknown
			//IL_0ae1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae7: Expected I4, but got Unknown
			//IL_0af9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aff: Expected I4, but got Unknown
			//IL_0c33: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c39: Expected I4, but got Unknown
			//IL_0d6d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d73: Expected I4, but got Unknown
			//IL_0ea7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ead: Expected I4, but got Unknown
			//IL_1002: Unknown result type (might be due to invalid IL or missing references)
			//IL_1008: Expected I4, but got Unknown
			//IL_114a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1150: Expected I4, but got Unknown
			//IL_1286: Unknown result type (might be due to invalid IL or missing references)
			//IL_128c: Expected I4, but got Unknown
			//IL_13c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_13ce: Expected I4, but got Unknown
			//IL_1500: Unknown result type (might be due to invalid IL or missing references)
			//IL_1506: Expected I4, but got Unknown
			//IL_1518: Unknown result type (might be due to invalid IL or missing references)
			//IL_151e: Expected I4, but got Unknown
			//IL_1570: Unknown result type (might be due to invalid IL or missing references)
			//IL_1576: Expected I4, but got Unknown
			//IL_1583: Unknown result type (might be due to invalid IL or missing references)
			//IL_1588: Unknown result type (might be due to invalid IL or missing references)
			//IL_16aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_16b0: Expected I4, but got Unknown
			//IL_16fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_1701: Expected I4, but got Unknown
			//IL_170e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1713: Unknown result type (might be due to invalid IL or missing references)
			//IL_17fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_1803: Expected I4, but got Unknown
			//IL_1815: Unknown result type (might be due to invalid IL or missing references)
			//IL_181b: Expected I4, but got Unknown
			//IL_1869: Unknown result type (might be due to invalid IL or missing references)
			//IL_186f: Expected I4, but got Unknown
			//IL_187c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1881: Unknown result type (might be due to invalid IL or missing references)
			//IL_198e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1994: Expected I4, but got Unknown
			//IL_19a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_19ac: Expected I4, but got Unknown
			//IL_19fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a00: Expected I4, but got Unknown
			//IL_1a0d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a12: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b1f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b25: Expected I4, but got Unknown
			//IL_1b37: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b3d: Expected I4, but got Unknown
			//IL_1b8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b91: Expected I4, but got Unknown
			//IL_1b9e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ba3: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c8d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c93: Expected I4, but got Unknown
			//IL_1caa: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cb0: Expected I4, but got Unknown
			//IL_1e20: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e26: Expected I4, but got Unknown
			//IL_1e38: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e3e: Expected I4, but got Unknown
			//IL_1fa9: Unknown result type (might be due to invalid IL or missing references)
			//IL_1faf: Expected I4, but got Unknown
			//IL_1fc5: Unknown result type (might be due to invalid IL or missing references)
			//IL_1fcb: Expected I4, but got Unknown
			//IL_213a: Unknown result type (might be due to invalid IL or missing references)
			//IL_2140: Expected I4, but got Unknown
			//IL_2156: Unknown result type (might be due to invalid IL or missing references)
			//IL_215c: Expected I4, but got Unknown
			//IL_2288: Unknown result type (might be due to invalid IL or missing references)
			//IL_228e: Expected I4, but got Unknown
			//IL_22a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_22a6: Expected I4, but got Unknown
			//IL_23d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_23d8: Expected I4, but got Unknown
			//IL_23ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_23f0: Expected I4, but got Unknown
			//IL_2515: Unknown result type (might be due to invalid IL or missing references)
			//IL_251b: Expected I4, but got Unknown
			//IL_251d: Unknown result type (might be due to invalid IL or missing references)
			//IL_2523: Expected I4, but got Unknown
			//IL_253d: Unknown result type (might be due to invalid IL or missing references)
			//IL_2543: Expected I4, but got Unknown
			//IL_2752: Unknown result type (might be due to invalid IL or missing references)
			//IL_2758: Expected I4, but got Unknown
			//IL_2944: Unknown result type (might be due to invalid IL or missing references)
			//IL_294a: Expected I4, but got Unknown
			//IL_2b07: Unknown result type (might be due to invalid IL or missing references)
			//IL_2b0d: Expected I4, but got Unknown
			//IL_2cc6: Unknown result type (might be due to invalid IL or missing references)
			//IL_2ccc: Expected I4, but got Unknown
			//IL_2e85: Unknown result type (might be due to invalid IL or missing references)
			//IL_2e8b: Expected I4, but got Unknown
			//IL_2ef1: Unknown result type (might be due to invalid IL or missing references)
			//IL_2ef7: Expected I4, but got Unknown
			//IL_3054: Unknown result type (might be due to invalid IL or missing references)
			//IL_305a: Expected I4, but got Unknown
			//IL_31f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_31fb: Expected I4, but got Unknown
			//IL_3215: Unknown result type (might be due to invalid IL or missing references)
			//IL_321b: Expected I4, but got Unknown
			//IL_33e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_33e8: Expected I4, but got Unknown
			//IL_33f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_33fc: Expected I4, but got Unknown
			//IL_340a: Unknown result type (might be due to invalid IL or missing references)
			//IL_3410: Expected I4, but got Unknown
			//IL_35a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_35af: Expected I4, but got Unknown
			//IL_35bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_35c3: Expected I4, but got Unknown
			//IL_35d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_35d7: Expected I4, but got Unknown
			//IL_3770: Unknown result type (might be due to invalid IL or missing references)
			//IL_3776: Expected I4, but got Unknown
			//IL_3789: Unknown result type (might be due to invalid IL or missing references)
			//IL_378f: Expected I4, but got Unknown
			//IL_379d: Unknown result type (might be due to invalid IL or missing references)
			//IL_37a3: Expected I4, but got Unknown
			//IL_3958: Unknown result type (might be due to invalid IL or missing references)
			//IL_395e: Expected I4, but got Unknown
			//IL_3aff: Unknown result type (might be due to invalid IL or missing references)
			//IL_3b05: Expected I4, but got Unknown
			//IL_3b1f: Unknown result type (might be due to invalid IL or missing references)
			//IL_3b25: Expected I4, but got Unknown
			//IL_3cbe: Unknown result type (might be due to invalid IL or missing references)
			//IL_3cc4: Expected I4, but got Unknown
			//IL_3ce3: Unknown result type (might be due to invalid IL or missing references)
			//IL_3ce9: Expected I4, but got Unknown
			//IL_3e85: Unknown result type (might be due to invalid IL or missing references)
			//IL_3e8b: Expected I4, but got Unknown
			//IL_3e8d: Unknown result type (might be due to invalid IL or missing references)
			//IL_3e93: Expected I4, but got Unknown
			//IL_3ea1: Unknown result type (might be due to invalid IL or missing references)
			//IL_3ea7: Expected I4, but got Unknown
			//IL_3eb5: Unknown result type (might be due to invalid IL or missing references)
			//IL_3ebb: Expected I4, but got Unknown
			//IL_4054: Unknown result type (might be due to invalid IL or missing references)
			//IL_405a: Expected I4, but got Unknown
			//IL_406d: Unknown result type (might be due to invalid IL or missing references)
			//IL_4073: Expected I4, but got Unknown
			//IL_4081: Unknown result type (might be due to invalid IL or missing references)
			//IL_4087: Expected I4, but got Unknown
			//IL_4220: Unknown result type (might be due to invalid IL or missing references)
			//IL_4226: Expected I4, but got Unknown
			//IL_4239: Unknown result type (might be due to invalid IL or missing references)
			//IL_423f: Expected I4, but got Unknown
			//IL_424d: Unknown result type (might be due to invalid IL or missing references)
			//IL_4253: Expected I4, but got Unknown
			//IL_43ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_43f2: Expected I4, but got Unknown
			//IL_4404: Unknown result type (might be due to invalid IL or missing references)
			//IL_440a: Expected I4, but got Unknown
			//IL_4418: Unknown result type (might be due to invalid IL or missing references)
			//IL_441e: Expected I4, but got Unknown
			//IL_45d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_45d9: Expected I4, but got Unknown
			//IL_45db: Unknown result type (might be due to invalid IL or missing references)
			//IL_45e1: Expected I4, but got Unknown
			//IL_45e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_45e9: Expected I4, but got Unknown
			//IL_45eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_45f1: Expected I4, but got Unknown
			//IL_45f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_45f9: Expected I4, but got Unknown
			//IL_4662: Unknown result type (might be due to invalid IL or missing references)
			//IL_4668: Expected I4, but got Unknown
			//IL_49a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_49aa: Expected I4, but got Unknown
			//IL_4b7d: Unknown result type (might be due to invalid IL or missing references)
			//IL_4b83: Expected I4, but got Unknown
			//IL_4b85: Unknown result type (might be due to invalid IL or missing references)
			//IL_4b8b: Expected I4, but got Unknown
			//IL_4d9e: Unknown result type (might be due to invalid IL or missing references)
			//IL_4da4: Expected I4, but got Unknown
			//IL_54cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_54d5: Expected I4, but got Unknown
			//IL_5785: Unknown result type (might be due to invalid IL or missing references)
			//IL_578b: Expected I4, but got Unknown
			//IL_58dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_58e2: Expected I4, but got Unknown
			//IL_5b6f: Unknown result type (might be due to invalid IL or missing references)
			//IL_5b75: Expected I4, but got Unknown
			//IL_5bb2: Unknown result type (might be due to invalid IL or missing references)
			//IL_5bb8: Expected I4, but got Unknown
			//IL_5bcb: Unknown result type (might be due to invalid IL or missing references)
			//IL_5bd1: Expected I4, but got Unknown
			//IL_5c19: Unknown result type (might be due to invalid IL or missing references)
			//IL_5c1f: Expected I4, but got Unknown
			//IL_5dcb: Unknown result type (might be due to invalid IL or missing references)
			//IL_5dd1: Expected I4, but got Unknown
			CardMetaCategory[] array = (CardMetaCategory[])(object)new CardMetaCategory[2]
			{
				default(CardMetaCategory),
				(CardMetaCategory)1
			};
			CardMetaCategory[] array2 = (CardMetaCategory[])(object)new CardMetaCategory[1];
			CardMetaCategory[] array3 = (CardMetaCategory[])(object)new CardMetaCategory[1] { (CardMetaCategory)3 };
			CardMetaCategory[] array4 = (CardMetaCategory[])(object)new CardMetaCategory[0];
			Appearance[] array5 = (Appearance[])(object)new Appearance[2]
			{
				(Appearance)2,
				(Appearance)9
			};
			Appearance[] array6 = (Appearance[])(object)new Appearance[1] { (Appearance)13 };
			Appearance[] array7 = (Appearance[])(object)new Appearance[1] { (Appearance)7 };
			Appearance[] array8 = (Appearance[])(object)new Appearance[2]
			{
				(Appearance)6,
				(Appearance)(int)InstantCardApp
			};
			Appearance[] array9 = (Appearance[])(object)new Appearance[1] { (Appearance)(int)InstantCardApp };
			Part1CardCostRender.UpdateCardCost += delegate(CardInfo card, List<Texture2D> costs)
			{
				int sunCost = card.GetSunCost();
				if (sunCost > 0)
				{
					costs.Add(findTexture("SunCost" + sunCost));
				}
			};
			Texture2D val = findTexture("ZA");
			string text = "zep_pvz";
			string text2 = "Peashooter";
			Ability[] array10 = (Ability[])(object)new Ability[0];
			Trait[] array11 = (Trait[])(object)new Trait[0];
			Tribe[] array12 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantFruit };
			string text3 = "repeater";
			string text4 = "leaflitter";
			int num = 2;
			CardInfo val2 = CardManager.New(text, "peashooter", "Peashooter", 1, 2, "A plant commonly used to fend off the undead");
			CardExtensions.AddAppearances(val2, Array.Empty<Appearance>());
			CardExtensions.AddMetaCategories(val2, array);
			CardExtensions.SetExtendedProperty(val2, "SunCost", (object)num);
			CardExtensions.SetPortrait(val2, findTexture(text2), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val2, findTexture(text2 + "2"), (FilterMode?)null);
			CardExtensions.SetPixelPortrait(val2, findTexture(text2 + "3"), (FilterMode?)null);
			CardExtensions.AddDecal(val2, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val2, array10);
			CardExtensions.AddTraits(val2, array11);
			if (text3 != null)
			{
				CardExtensions.SetEvolve(val2, text + "_" + text3, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val2, text + "_" + text4, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val2, text + "_" + text4, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val2, array12);
			string text5 = "Repeater";
			Ability[] array13 = (Ability[])(object)new Ability[1] { (Ability)100 };
			Trait[] array14 = (Trait[])(object)new Trait[0];
			Tribe[] array15 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantFruit };
			string text6 = "threepeater";
			string text7 = "leaflitter";
			int num2 = 4;
			CardInfo val3 = CardManager.New(text, "repeater", "Repeater", 1, 2, "A more powerful version of the iconic peashooter");
			CardExtensions.AddAppearances(val3, Array.Empty<Appearance>());
			CardExtensions.AddMetaCategories(val3, array);
			CardExtensions.SetExtendedProperty(val3, "SunCost", (object)num2);
			CardExtensions.SetPortrait(val3, findTexture(text5), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val3, findTexture(text5 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val3, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val3, array13);
			CardExtensions.AddTraits(val3, array14);
			if (text6 != null)
			{
				CardExtensions.SetEvolve(val3, text + "_" + text6, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val3, text + "_" + text7, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val3, text + "_" + text7, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val3, array15);
			string text8 = "Threepeater";
			Ability[] array16 = (Ability[])(object)new Ability[1] { (Ability)25 };
			Trait[] array17 = (Trait[])(object)new Trait[0];
			Tribe[] array18 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantFruit };
			string text9 = null;
			string text10 = "leaflitter";
			int num3 = 5;
			CardInfo val4 = CardManager.New(text, "threepeater", "Threepeater", 1, 3, "they say 3 heads are better than one");
			CardExtensions.AddAppearances(val4, array7);
			CardExtensions.AddMetaCategories(val4, array3);
			CardExtensions.SetExtendedProperty(val4, "SunCost", (object)num3);
			CardExtensions.SetPortrait(val4, findTexture(text8), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val4, findTexture(text8 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val4, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val4, array16);
			CardExtensions.AddTraits(val4, array17);
			if (text9 != null)
			{
				CardExtensions.SetEvolve(val4, text + "_" + text9, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val4, text + "_" + text10, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val4, text + "_" + text10, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val4, array18);
			string text11 = "Cactus";
			Ability[] array19 = (Ability[])(object)new Ability[2]
			{
				(Ability)15,
				(Ability)23
			};
			Trait[] array20 = (Trait[])(object)new Trait[0];
			Tribe[] array21 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantSpiky };
			string text12 = null;
			string text13 = "splinters";
			int num4 = 5;
			CardInfo val5 = CardManager.New(text, "cactus", "Cactus", 2, 2, "Try not to prick yourself on it");
			CardExtensions.AddAppearances(val5, Array.Empty<Appearance>());
			CardExtensions.AddMetaCategories(val5, array);
			CardExtensions.SetExtendedProperty(val5, "SunCost", (object)num4);
			CardExtensions.SetPortrait(val5, findTexture(text11), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val5, findTexture(text11 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val5, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val5, array19);
			CardExtensions.AddTraits(val5, array20);
			if (text12 != null)
			{
				CardExtensions.SetEvolve(val5, text + "_" + text12, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val5, text + "_" + text13, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val5, text + "_" + text13, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val5, array21);
			string text14 = "Thistle";
			Ability[] array22 = (Ability[])(object)new Ability[1] { (Ability)53 };
			Trait[] array23 = (Trait[])(object)new Trait[0];
			Tribe[] array24 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantSpiky };
			string text15 = null;
			string text16 = "splinters";
			int num5 = 6;
			CardInfo val6 = CardManager.New(text, "thistle", "Homing Thistle", 3, 2, "This one tracks down its target with ease");
			CardExtensions.AddAppearances(val6, Array.Empty<Appearance>());
			CardExtensions.AddMetaCategories(val6, array);
			CardExtensions.SetExtendedProperty(val6, "SunCost", (object)num5);
			CardExtensions.SetPortrait(val6, findTexture(text14), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val6, findTexture(text14 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val6, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val6, array22);
			CardExtensions.AddTraits(val6, array23);
			if (text15 != null)
			{
				CardExtensions.SetEvolve(val6, text + "_" + text15, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val6, text + "_" + text16, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val6, text + "_" + text16, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val6, array24);
			string text17 = "Cattail";
			Ability[] array25 = (Ability[])(object)new Ability[2]
			{
				(Ability)53,
				(Ability)13
			};
			Trait[] array26 = (Trait[])(object)new Trait[0];
			Tribe[] array27 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantSpiky };
			string text18 = null;
			string text19 = "leaflitter";
			int num6 = 3;
			CardInfo val7 = CardManager.New(text, "cattail", "Cattail", 1, 1, "Nyah~");
			CardExtensions.AddAppearances(val7, Array.Empty<Appearance>());
			CardExtensions.AddMetaCategories(val7, array);
			CardExtensions.SetExtendedProperty(val7, "SunCost", (object)num6);
			CardExtensions.SetPortrait(val7, findTexture(text17), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val7, findTexture(text17 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val7, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val7, array25);
			CardExtensions.AddTraits(val7, array26);
			if (text18 != null)
			{
				CardExtensions.SetEvolve(val7, text + "_" + text18, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val7, text + "_" + text19, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val7, text + "_" + text19, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val7, array27);
			string text20 = "Chomper";
			Ability[] array28 = (Ability[])(object)new Ability[1] { (Ability)4 };
			Trait[] array29 = (Trait[])(object)new Trait[0];
			Tribe[] array30 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantSpiky };
			string text21 = null;
			string text22 = "leaflitter";
			int num7 = 4;
			CardInfo val8 = CardManager.New(text, "chomper", "Chomper", 2, 1, "No bark and all bite");
			CardExtensions.AddAppearances(val8, Array.Empty<Appearance>());
			CardExtensions.AddMetaCategories(val8, array);
			CardExtensions.SetExtendedProperty(val8, "SunCost", (object)num7);
			CardExtensions.SetPortrait(val8, findTexture(text20), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val8, findTexture(text20 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val8, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val8, array28);
			CardExtensions.AddTraits(val8, array29);
			if (text21 != null)
			{
				CardExtensions.SetEvolve(val8, text + "_" + text21, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val8, text + "_" + text22, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val8, text + "_" + text22, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val8, array30);
			string text23 = "Starfruit";
			Ability[] array31 = (Ability[])(object)new Ability[1] { (Ability)33 };
			Trait[] array32 = (Trait[])(object)new Trait[0];
			Tribe[] array33 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantFruit };
			string text24 = null;
			string text25 = "leaflitter";
			int num8 = 3;
			CardInfo val9 = CardManager.New(text, "starfruit", "Starfruit", 1, 1, "Surprisingly not a ball of fire");
			CardExtensions.AddAppearances(val9, array7);
			CardExtensions.AddMetaCategories(val9, array3);
			CardExtensions.SetExtendedProperty(val9, "SunCost", (object)num8);
			CardExtensions.SetPortrait(val9, findTexture(text23), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val9, findTexture(text23 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val9, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val9, array31);
			CardExtensions.AddTraits(val9, array32);
			if (text24 != null)
			{
				CardExtensions.SetEvolve(val9, text + "_" + text24, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val9, text + "_" + text25, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val9, text + "_" + text25, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val9, array33);
			string text26 = "Bloomerang";
			Ability[] array34 = (Ability[])(object)new Ability[2]
			{
				(Ability)100,
				(Ability)(int)Pierce.ability
			};
			Trait[] array35 = (Trait[])(object)new Trait[0];
			Tribe[] array36 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantFlower };
			string text27 = null;
			string text28 = "splinters";
			int num9 = 5;
			CardInfo val10 = CardManager.New(text, "bloomerang", "Bloomerang", 2, 2, "Don't be deceived, it won't just return if you throw it away");
			CardExtensions.AddAppearances(val10, Array.Empty<Appearance>());
			CardExtensions.AddMetaCategories(val10, array);
			CardExtensions.SetExtendedProperty(val10, "SunCost", (object)num9);
			CardExtensions.SetPortrait(val10, findTexture(text26), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val10, findTexture(text26 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val10, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val10, array34);
			CardExtensions.AddTraits(val10, array35);
			if (text27 != null)
			{
				CardExtensions.SetEvolve(val10, text + "_" + text27, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val10, text + "_" + text28, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val10, text + "_" + text28, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val10, array36);
			string text29 = "BonkChoy";
			Ability[] array37 = (Ability[])(object)new Ability[0];
			Trait[] array38 = (Trait[])(object)new Trait[0];
			Tribe[] array39 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantVeg };
			string text30 = null;
			string text31 = "leaflitter";
			int num10 = 4;
			CardInfo val11 = CardManager.New(text, "bonkchoy", "bonk choy", 2, 2, "A feisty one for sure");
			CardExtensions.AddAppearances(val11, Array.Empty<Appearance>());
			CardExtensions.AddMetaCategories(val11, array);
			CardExtensions.SetExtendedProperty(val11, "SunCost", (object)num10);
			CardExtensions.SetPortrait(val11, findTexture(text29), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val11, findTexture(text29 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val11, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val11, array37);
			CardExtensions.AddTraits(val11, array38);
			if (text30 != null)
			{
				CardExtensions.SetEvolve(val11, text + "_" + text30, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val11, text + "_" + text31, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val11, text + "_" + text31, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val11, array39);
			string text32 = "Citron";
			Ability[] array40 = (Ability[])(object)new Ability[0];
			Trait[] array41 = (Trait[])(object)new Trait[0];
			Tribe[] array42 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantFruit };
			string text33 = null;
			string text34 = "leaflitter";
			int num11 = 5;
			CardInfo val12 = CardManager.New(text, "citron", "Citron", 3, 2, "If you can afford to play it, it's zest is bound to aid you");
			CardExtensions.AddAppearances(val12, Array.Empty<Appearance>());
			CardExtensions.AddMetaCategories(val12, array);
			CardExtensions.SetExtendedProperty(val12, "SunCost", (object)num11);
			CardExtensions.SetPortrait(val12, findTexture(text32), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val12, findTexture(text32 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val12, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val12, array40);
			CardExtensions.AddTraits(val12, array41);
			if (text33 != null)
			{
				CardExtensions.SetEvolve(val12, text + "_" + text33, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val12, text + "_" + text34, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val12, text + "_" + text34, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val12, array42);
			string text35 = "RedStinger";
			Ability[] array43 = (Ability[])(object)new Ability[0];
			Trait[] array44 = (Trait[])(object)new Trait[0];
			Tribe[] array45 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantFlower };
			string text36 = null;
			string text37 = "leaflitter";
			int num12 = 5;
			CardInfo val13 = CardManager.New(text, "redstinger", "Red Stinger", 0, 1, "Position it strategically if you want to use its full potential");
			CardExtensions.AddAppearances(val13, Array.Empty<Appearance>());
			CardExtensions.AddMetaCategories(val13, array);
			CardExtensions.SetStatIcon(val13, (SpecialStatIcon)4);
			CardExtensions.AddSpecialAbilities(val13, (SpecialTriggeredAbility[])(object)new SpecialTriggeredAbility[1] { (SpecialTriggeredAbility)12 });
			CardExtensions.SetExtendedProperty(val13, "SunCost", (object)num12);
			CardExtensions.SetPortrait(val13, findTexture(text35), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val13, findTexture(text35 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val13, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val13, array43);
			CardExtensions.AddTraits(val13, array44);
			if (text36 != null)
			{
				CardExtensions.SetEvolve(val13, text + "_" + text36, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val13, text + "_" + text37, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val13, text + "_" + text37, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val13, array45);
			string text38 = "Spikeweed";
			Ability[] array46 = (Ability[])(object)new Ability[1] { (Ability)62 };
			Trait[] array47 = (Trait[])(object)new Trait[0];
			Tribe[] array48 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantSpiky };
			string text39 = "spikerock";
			string text40 = "splinters";
			int num13 = 4;
			CardInfo val14 = CardManager.New(text, "spikeweed", "Spikeweed", 1, 1, "Will you lay the spikeweed as a trap for those who dare approach it?");
			CardExtensions.AddAppearances(val14, Array.Empty<Appearance>());
			CardExtensions.AddMetaCategories(val14, array);
			CardExtensions.SetExtendedProperty(val14, "SunCost", (object)num13);
			CardExtensions.SetPortrait(val14, findTexture(text38), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val14, findTexture(text38 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val14, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val14, array46);
			CardExtensions.AddTraits(val14, array47);
			if (text39 != null)
			{
				CardExtensions.SetEvolve(val14, text + "_" + text39, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val14, text + "_" + text40, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val14, text + "_" + text40, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val14, array48);
			string text41 = "Spikerock";
			Ability[] array49 = (Ability[])(object)new Ability[2]
			{
				(Ability)62,
				(Ability)62
			};
			Trait[] array50 = (Trait[])(object)new Trait[0];
			Tribe[] array51 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantSpiky };
			string text42 = null;
			string text43 = "splinters";
			int num14 = 5;
			CardInfo val15 = CardManager.New(text, "spikerock", "Spikerock", 2, 3, "Anybody who attempts to trample it will meet a sharp fate.");
			CardExtensions.AddAppearances(val15, array7);
			CardExtensions.AddMetaCategories(val15, array3);
			CardExtensions.SetExtendedProperty(val15, "SunCost", (object)num14);
			CardExtensions.SetPortrait(val15, findTexture(text41), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val15, findTexture(text41 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val15, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val15, array49);
			CardExtensions.AddTraits(val15, array50);
			if (text42 != null)
			{
				CardExtensions.SetEvolve(val15, text + "_" + text42, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val15, text + "_" + text43, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val15, text + "_" + text43, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val15, array51);
			string text44 = "Artichoke";
			Ability[] array52 = (Ability[])(object)new Ability[1] { (Ability)19 };
			Trait[] array53 = (Trait[])(object)new Trait[0];
			Tribe[] array54 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantVeg };
			string text45 = null;
			string text46 = "leaflitter";
			int num15 = 2;
			CardInfo val16 = CardManager.New(text, "artichoke", "Artichoke", 1, 1, "This drone has seen some warfare");
			CardExtensions.AddAppearances(val16, Array.Empty<Appearance>());
			CardExtensions.AddMetaCategories(val16, array);
			CardExtensions.SetExtendedProperty(val16, "SunCost", (object)num15);
			CardExtensions.SetPortrait(val16, findTexture(text44), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val16, findTexture(text44 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val16, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val16, array52);
			CardExtensions.AddTraits(val16, array53);
			if (text45 != null)
			{
				CardExtensions.SetEvolve(val16, text + "_" + text45, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val16, text + "_" + text46, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val16, text + "_" + text46, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val16, array54);
			string text47 = "Beeshooter";
			Ability[] array55 = (Ability[])(object)new Ability[1] { (Ability)2 };
			Trait[] array56 = (Trait[])(object)new Trait[0];
			Tribe[] array57 = (Tribe[])(object)new Tribe[2]
			{
				(Tribe)6,
				(Tribe)(int)PlantFruit
			};
			string text48 = null;
			string text49 = "leaflitter";
			int num16 = 2;
			CardInfo val17 = CardManager.New(text, "beeshooter", "Beeshooter", 2, 2, "According to all known laws of aviation, there is no way a bee should be able to fly");
			CardExtensions.AddAppearances(val17, Array.Empty<Appearance>());
			CardExtensions.AddMetaCategories(val17, array);
			CardExtensions.SetBloodCost(val17, (int?)1);
			CardExtensions.SetExtendedProperty(val17, "SunCost", (object)num16);
			CardExtensions.SetPortrait(val17, findTexture(text47), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val17, findTexture(text47 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val17, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val17, array55);
			CardExtensions.AddTraits(val17, array56);
			if (text48 != null)
			{
				CardExtensions.SetEvolve(val17, text + "_" + text48, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val17, text + "_" + text49, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val17, text + "_" + text49, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val17, array57);
			string text50 = "Puff";
			Ability[] array58 = (Ability[])(object)new Ability[1] { (Ability)(int)FadeAway.ability };
			Trait[] array59 = (Trait[])(object)new Trait[0];
			Tribe[] array60 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantShroom };
			string text51 = "fumeshroom";
			string text52 = "shroomchunks";
			int num17 = 0;
			CardInfo val18 = CardManager.New(text, "puffshroom", "Puffshroom", 0, 1, "It might not be very powerful, but it can get you out of a pinch");
			CardExtensions.AddAppearances(val18, Array.Empty<Appearance>());
			CardExtensions.AddMetaCategories(val18, array);
			CardExtensions.AddSpecialAbilities(val18, (SpecialTriggeredAbility[])(object)new SpecialTriggeredAbility[1] { (SpecialTriggeredAbility)(int)AttackForShroom.FullSpecial.Id });
			val18.specialStatIcon = AttackForShroom.FullStatIcon.Id;
			CardExtensions.SetExtendedProperty(val18, "SunCost", (object)num17);
			CardExtensions.SetPortrait(val18, findTexture(text50), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val18, findTexture(text50 + "2"), (FilterMode?)null);
			CardExtensions.SetPixelPortrait(val18, findTexture(text50 + "3"), (FilterMode?)null);
			CardExtensions.AddDecal(val18, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val18, array58);
			CardExtensions.AddTraits(val18, array59);
			if (text51 != null)
			{
				CardExtensions.SetEvolve(val18, text + "_" + text51, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val18, text + "_" + text52, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val18, text + "_" + text52, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val18, array60);
			string text53 = "SeaShroom";
			Ability[] array61 = (Ability[])(object)new Ability[1] { (Ability)13 };
			Trait[] array62 = (Trait[])(object)new Trait[0];
			Tribe[] array63 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantShroom };
			string text54 = null;
			string text55 = "shroomchunks";
			int num18 = 0;
			CardInfo val19 = CardManager.New(text, "seashroom", "Seashroom", 0, 1, "Just a little mushroom, sitting on the water");
			CardExtensions.AddAppearances(val19, array7);
			CardExtensions.AddMetaCategories(val19, array3);
			CardExtensions.AddSpecialAbilities(val19, (SpecialTriggeredAbility[])(object)new SpecialTriggeredAbility[1] { (SpecialTriggeredAbility)(int)AttackForShroom.FullSpecial.Id });
			val19.specialStatIcon = AttackForShroom.FullStatIcon.Id;
			CardExtensions.SetExtendedProperty(val19, "SunCost", (object)num18);
			CardExtensions.SetPortrait(val19, findTexture(text53), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val19, findTexture(text53 + "2"), (FilterMode?)null);
			CardExtensions.AddDecal(val19, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val19, array61);
			CardExtensions.AddTraits(val19, array62);
			if (text54 != null)
			{
				CardExtensions.SetEvolve(val19, text + "_" + text54, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardExtensions.SetTail(val19, text + "_" + text55, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.SetIceCube(val19, text + "_" + text55, (IEnumerable<CardModificationInfo>)null);
			CardExtensions.AddTribes(val19, array63);
			string text56 = "Scaredy";
			Ability[] array64 = (Ability[])(object)new Ability[1] { (Ability)(int)TacticalRetreat.ability };
			Trait[] array65 = (Trait[])(object)new Trait[0];
			Tribe[] array66 = (Tribe[])(object)new Tribe[1] { (Tribe)(int)PlantShroom };
			string text57 = null;
			string text58 = "shroomchunks";
			int num19 = 1;
			CardInfo val20 = CardManager.New(text, "scaredyshroom", "Scaredyshroom", 0, 1, "Some may consider this one a coward for its tactics");
			CardExtensions.AddAppearances(val20, Array.Empty<Appearance>());
			CardExtensions.AddMetaCategories(val20, array);
			CardExtensions.AddSpecialAbilities(val20, (SpecialTriggeredAbility[])(object)new SpecialTriggeredAbility[1] { (SpecialTriggeredAbility)(int)AttackForShroom.FullSpecial.Id });
			val20.specialStatIcon = AttackForShroom.FullStatIcon.Id;
			CardExtensions.SetExtendedProperty(val20, "SunCost", (object)num19);
			CardExtensions.SetPortrait(val20, findTexture(text56), (FilterMode?)null);
			CardExtensions.SetEmissivePortrait(val20, findTexture(text56 + "2"), (FilterMode?)null);
			CardExtensions.SetPixelPortrait(val20, findTexture(text56 + "3"), (FilterMode?)null);
			CardExtensions.AddDecal(val20, (Texture[])(object)new Texture[1] { (Texture)val });
			CardExtensions.AddAbilities(val20, array64);
			CardExtensions.AddTraits(val20, array65);
			if (text57 != null)
			{
				CardExtensions.SetEvolve(val20, text + "_" + text57, 1, (IEnumerable<CardModificationInfo>)null);
			}
			CardE