Decompiled source of Lagartos Challenges v1.0.0

plugins/LagartosChallenges.dll

Decompiled 2 days 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.Text;
using BepInEx;
using BepInEx.Logging;
using DiskCardGame;
using HarmonyLib;
using InscryptionAPI.Ascension;
using InscryptionAPI.Card;
using InscryptionAPI.Helpers;
using InscryptionAPI.Localizing;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("LagartosChallenges")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+a28ca8a60f639d4166d176858a68cc9e12c40315")]
[assembly: AssemblyProduct("LagartosChallenges")]
[assembly: AssemblyTitle("LagartosChallenges")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[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 LagartosChallenges
{
	public static class AnnoyingRules
	{
		public static bool StarterPeltsBecomeAnnoying(bool annoyingStartersActive, bool annoyingTradesActive)
		{
			return annoyingStartersActive && annoyingTradesActive;
		}

		public static bool TradeOffersBecomeAnnoying(bool annoyingTradesActive, IEnumerable<bool> peltsAnnoying)
		{
			if (annoyingTradesActive)
			{
				return peltsAnnoying.Any((bool annoying) => annoying);
			}
			return false;
		}

		public static bool NeedsAnnoying(bool alreadyAnnoying)
		{
			return !alreadyAnnoying;
		}
	}
	internal static class AnnoyingCards
	{
		internal static bool IsPelt(CardInfo card)
		{
			if (!card.HasTrait((Trait)13))
			{
				return CardLoader.PeltNames.Contains(((Object)card).name);
			}
			return true;
		}

		internal static bool IsAnnoying(CardInfo card)
		{
			return card.HasAbility((Ability)76);
		}

		internal static CardModificationInfo NewMod()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			return new CardModificationInfo((Ability)76);
		}
	}
	[HarmonyPatch(typeof(RunIntroSequencer), "TryModifyStarterCards")]
	internal static class StarterPeltsPatch
	{
		[HarmonyPostfix]
		private static void Postfix()
		{
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			if (!AnnoyingRules.StarterPeltsBecomeAnnoying(Plugin.AnnoyingStartersActive, Plugin.AnnoyingTradesActive))
			{
				return;
			}
			DeckInfo playerDeck = RunState.Run.playerDeck;
			List<CardInfo> list = ((CardCollectionInfo)playerDeck).Cards.Where((CardInfo c) => AnnoyingCards.IsPelt(c) && AnnoyingRules.NeedsAnnoying(AnnoyingCards.IsAnnoying(c))).ToList();
			foreach (CardInfo item in list)
			{
				playerDeck.ModifyCard(item, AnnoyingCards.NewMod());
			}
			Plugin.Log.LogInfo((object)$"Annoying Starters + Annoying Trades: gave Annoying to {list.Count} starter pelts.");
			if (list.Count > 0)
			{
				ChallengeActivationUI.TryShowActivation(Plugin.AnnoyingTradesChallenge);
			}
		}
	}
	[HarmonyPatch]
	internal static class TradeOffersPatch
	{
		private static bool offersAnnoying;

		[HarmonyPrefix]
		[HarmonyPatch(typeof(TradePeltsSequencer), "GetTradingTiers")]
		private static void DecideAtTradeStart()
		{
			List<CardInfo> list = RunState.DeckList.Where(AnnoyingCards.IsPelt).ToList();
			offersAnnoying = AnnoyingRules.TradeOffersBecomeAnnoying(Plugin.AnnoyingTradesActive, list.Select(AnnoyingCards.IsAnnoying));
			Plugin.Log.LogInfo((object)($"Pelt trade: {list.Count(AnnoyingCards.IsAnnoying)}/{list.Count} pelts Annoying, " + string.Format("challenge {0} -> offers Annoying: {1}.", Plugin.AnnoyingTradesActive ? "on" : "off", offersAnnoying)));
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(TradePeltsSequencer), "GetTradeCardInfos")]
		private static void MakeOffersAnnoying(List<CardInfo> __result)
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			if (!offersAnnoying || __result == null)
			{
				return;
			}
			foreach (CardInfo item in __result.Where((CardInfo c) => AnnoyingRules.NeedsAnnoying(AnnoyingCards.IsAnnoying(c))))
			{
				item.Mods.Add(AnnoyingCards.NewMod());
			}
			ChallengeActivationUI.TryShowActivation(Plugin.AnnoyingTradesChallenge);
		}
	}
	public enum FilterTribe
	{
		Canine,
		Bird,
		Insect,
		Reptile,
		Hooved
	}
	public readonly struct CardTraits
	{
		public IReadOnlyCollection<FilterTribe> Tribes { get; }

		public bool HasOtherTribe { get; }

		public int Blood { get; }

		public int Bones { get; }

		public int Energy { get; }

		public int Gems { get; }

		public bool Tribeless
		{
			get
			{
				if (Tribes.Count == 0)
				{
					return !HasOtherTribe;
				}
				return false;
			}
		}

		public bool Free
		{
			get
			{
				if (Blood == 0 && Bones == 0 && Energy == 0)
				{
					return Gems == 0;
				}
				return false;
			}
		}

		public CardTraits(IReadOnlyCollection<FilterTribe> tribes, bool hasOtherTribe, int blood, int bones, int energy, int gems)
		{
			Tribes = tribes;
			HasOtherTribe = hasOtherTribe;
			Blood = blood;
			Bones = bones;
			Energy = energy;
			Gems = gems;
		}
	}
	public sealed class CardFilter
	{
		private static readonly Dictionary<ChallengeKey, FilterTribe> TribeKeys = new Dictionary<ChallengeKey, FilterTribe>
		{
			[ChallengeKey.CanineOnly] = FilterTribe.Canine,
			[ChallengeKey.AvianOnly] = FilterTribe.Bird,
			[ChallengeKey.InsectOnly] = FilterTribe.Insect,
			[ChallengeKey.ReptileOnly] = FilterTribe.Reptile,
			[ChallengeKey.HoovedOnly] = FilterTribe.Hooved
		};

		private static readonly Dictionary<ChallengeKey, int> BloodKeys = new Dictionary<ChallengeKey, int>
		{
			[ChallengeKey.Blood1Only] = 1,
			[ChallengeKey.Blood2Only] = 2,
			[ChallengeKey.Blood3Only] = 3,
			[ChallengeKey.Blood4Only] = 4
		};

		public static readonly IReadOnlyList<ChallengeKey> FilterKeys = TribeKeys.Keys.Concat(new ChallengeKey[1] { ChallengeKey.NoTribeOnly }).Concat(BloodKeys.Keys).Concat(new ChallengeKey[2]
		{
			ChallengeKey.BonesOnly,
			ChallengeKey.FreeOnly
		})
			.ToList();

		private readonly HashSet<FilterTribe> tribes;

		private readonly bool noTribe;

		private readonly HashSet<int> bloods;

		private readonly bool bones;

		private readonly bool free;

		public bool TribeGroupActive
		{
			get
			{
				if (tribes.Count <= 0)
				{
					return noTribe;
				}
				return true;
			}
		}

		public bool CostGroupActive
		{
			get
			{
				if (bloods.Count <= 0 && !bones)
				{
					return free;
				}
				return true;
			}
		}

		public bool IsActive
		{
			get
			{
				if (!TribeGroupActive)
				{
					return CostGroupActive;
				}
				return true;
			}
		}

		public IReadOnlyList<FilterTribe> AllowedTribeChoices => tribes.ToList();

		public CardFilter(IEnumerable<ChallengeKey> active)
		{
			HashSet<ChallengeKey> set = new HashSet<ChallengeKey>(active);
			tribes = new HashSet<FilterTribe>(from k in TribeKeys
				where set.Contains(k.Key)
				select k.Value);
			noTribe = set.Contains(ChallengeKey.NoTribeOnly);
			bloods = new HashSet<int>(from k in BloodKeys
				where set.Contains(k.Key)
				select k.Value);
			bones = set.Contains(ChallengeKey.BonesOnly);
			free = set.Contains(ChallengeKey.FreeOnly);
		}

		public bool Passes(CardTraits card)
		{
			if (PassesTribe(card))
			{
				return PassesCost(card);
			}
			return false;
		}

		public bool AllowsCostChoice(int? blood)
		{
			if (CostGroupActive)
			{
				if (!blood.HasValue)
				{
					return bones;
				}
				return bloods.Contains(blood.Value);
			}
			return true;
		}

		private bool PassesTribe(CardTraits card)
		{
			if (TribeGroupActive && !card.Tribes.Any(tribes.Contains))
			{
				if (noTribe)
				{
					return card.Tribeless;
				}
				return false;
			}
			return true;
		}

		private bool PassesCost(CardTraits card)
		{
			if (CostGroupActive && !bloods.Contains(card.Blood) && (!bones || card.Bones <= 0))
			{
				if (free)
				{
					return card.Free;
				}
				return false;
			}
			return true;
		}
	}
	public enum ChallengeKey
	{
		NoFirstTurnKill,
		NoPhaseTurnKill,
		CanineOnly,
		AvianOnly,
		InsectOnly,
		ReptileOnly,
		HoovedOnly,
		NoTribeOnly,
		Blood1Only,
		Blood2Only,
		Blood3Only,
		Blood4Only,
		BonesOnly,
		FreeOnly,
		OneSquirrel,
		TwoSquirrels,
		NoBoneAltar,
		NoMysteriousStones,
		NoMycologists,
		NoDeckTrial,
		NoConsumables,
		NoCampfire,
		NoBuyPelts,
		NoTradePelts,
		TotemKinship,
		UnfairHand,
		WorthySquirrel,
		AnnoyingTrades
	}
	public sealed class ChallengeDef
	{
		public ChallengeKey Key { get; }

		public string Title { get; }

		public string Description { get; }

		public int Points { get; }

		public string IconFile { get; }

		public string ActiveIconFile { get; }

		public ChallengeDef(ChallengeKey key, string title, string description, int points)
		{
			Key = key;
			Title = title;
			Description = description;
			Points = points;
			IconFile = SnakeCase(key.ToString()) + "_icon.png";
			ActiveIconFile = SnakeCase(key.ToString()) + "_icon_activated.png";
		}

		private static string SnakeCase(string name)
		{
			StringBuilder stringBuilder = new StringBuilder();
			for (int i = 0; i < name.Length; i++)
			{
				if (char.IsUpper(name[i]) && i > 0)
				{
					stringBuilder.Append('_');
				}
				stringBuilder.Append(char.ToLowerInvariant(name[i]));
			}
			return stringBuilder.ToString();
		}
	}
	public static class ChallengeCatalog
	{
		public static readonly IReadOnlyList<ChallengeDef> All = new List<ChallengeDef>
		{
			new ChallengeDef(ChallengeKey.NoFirstTurnKill, "No First Turn Kill", "Nobody can win or lose a battle on their first turn: that damage stops one short.", 5),
			new ChallengeDef(ChallengeKey.NoPhaseTurnKill, "No Phase Turn Kill", "Nobody can win or lose a boss phase on their first turn after the scales reset.", 5),
			new ChallengeDef(ChallengeKey.CanineOnly, "Canine Only", "Only Canine cards are offered to you.", 10),
			new ChallengeDef(ChallengeKey.AvianOnly, "Avian Only", "Only Avian cards are offered to you.", 10),
			new ChallengeDef(ChallengeKey.InsectOnly, "Insect Only", "Only Insect cards are offered to you.", 10),
			new ChallengeDef(ChallengeKey.ReptileOnly, "Reptile Only", "Only Reptile cards are offered to you.", 15),
			new ChallengeDef(ChallengeKey.HoovedOnly, "Hooved Only", "Only Hooved cards are offered to you.", 15),
			new ChallengeDef(ChallengeKey.NoTribeOnly, "No Tribe Only", "Only cards without a tribe are offered to you.", 10),
			new ChallengeDef(ChallengeKey.Blood1Only, "1 Blood Only", "Only cards costing 1 Blood are offered to you.", 10),
			new ChallengeDef(ChallengeKey.Blood2Only, "2 Blood Only", "Only cards costing 2 Blood are offered to you.", 10),
			new ChallengeDef(ChallengeKey.Blood3Only, "3 Blood Only", "Only cards costing 3 Blood are offered to you.", 15),
			new ChallengeDef(ChallengeKey.Blood4Only, "4 Blood Only", "Only cards costing 4 Blood are offered to you.", 20),
			new ChallengeDef(ChallengeKey.BonesOnly, "Bones Only", "Only cards costing Bones are offered to you.", 10),
			new ChallengeDef(ChallengeKey.FreeOnly, "Free Only", "Only free cards are offered to you.", 15),
			new ChallengeDef(ChallengeKey.OneSquirrel, "One Squirrel", "After your opening hand, only one Squirrel is left to draw.", 15),
			new ChallengeDef(ChallengeKey.TwoSquirrels, "Two Squirrels", "Your opening hand has a second Squirrel.", -5),
			new ChallengeDef(ChallengeKey.NoBoneAltar, "No Bone Altar", "The bone altar does nothing.", 5),
			new ChallengeDef(ChallengeKey.NoMysteriousStones, "No Mysterious Stones", "The mysterious stones do nothing.", 5),
			new ChallengeDef(ChallengeKey.NoMycologists, "No Mycologists", "The Mycologists do nothing.", 5),
			new ChallengeDef(ChallengeKey.NoDeckTrial, "No Deck Trial", "Deck trials do nothing.", 5),
			new ChallengeDef(ChallengeKey.NoConsumables, "No Consumables", "Item packs give you nothing.", 5),
			new ChallengeDef(ChallengeKey.NoCampfire, "No Campfire", "Campfires do nothing.", 5),
			new ChallengeDef(ChallengeKey.NoBuyPelts, "No Buy Pelts", "The Trapper does nothing.", 5),
			new ChallengeDef(ChallengeKey.NoTradePelts, "No Trade Pelts", "The Trader does nothing.", 10),
			new ChallengeDef(ChallengeKey.TotemKinship, "Totem Kinship", "The last totem head offered is a tribe from your deck.", -5),
			new ChallengeDef(ChallengeKey.UnfairHand, "Unfair Hand", "Your opening hand is no longer guaranteed to be playable.", 5),
			new ChallengeDef(ChallengeKey.WorthySquirrel, "Worthy Squirrel", "Your opening squirrel has the Double Blood sigil.", -5),
			new ChallengeDef(ChallengeKey.AnnoyingTrades, "Annoying Trades", "Annoying Starters also affects pelts. At every trade, if any of your pelts is Annoying, all offered cards are too.", 5)
		};

		public static ChallengeDef Get(ChallengeKey key)
		{
			return All.First((ChallengeDef c) => c.Key == key);
		}
	}
	internal static class Challenges
	{
		private static readonly Dictionary<ChallengeKey, AscensionChallenge> ids = new Dictionary<ChallengeKey, AscensionChallenge>();

		internal static void RegisterAll(string pluginGuid)
		{
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			foreach (ChallengeDef item in ChallengeCatalog.All)
			{
				ids[item.Key] = ChallengeManager.Add(pluginGuid, item.Title, item.Description, item.Points, TextureHelper.GetImageAsTexture(item.IconFile, typeof(Plugin).Assembly, (FilterMode)0), TextureHelper.GetImageAsTexture(item.ActiveIconFile, typeof(Plugin).Assembly, (FilterMode)0), 0, false).Challenge.challengeType;
			}
		}

		internal static AscensionChallenge Id(ChallengeKey key)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return ids[key];
		}

		internal static bool IsActive(ChallengeKey key)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			if (ids.ContainsKey(key))
			{
				return Plugin.ChallengeActive(ids[key]);
			}
			return false;
		}

		internal static void ShowActivation(ChallengeKey key)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			if (ids.ContainsKey(key))
			{
				ChallengeActivationUI.TryShowActivation(ids[key]);
			}
		}
	}
	public class DoubleBlood : AbilityBehaviour
	{
		public static Ability ability;

		public override Ability Ability => ability;
	}
	public class DoubleBloodGrant
	{
		private bool armed;

		public void Arm()
		{
			armed = true;
		}

		public void Disarm()
		{
			armed = false;
		}

		public bool TryConsume()
		{
			bool result = armed;
			armed = false;
			return result;
		}
	}
	[HarmonyPatch(typeof(SpecialNodeHandler), "StartSpecialNodeSequence")]
	internal static class EventSkipPatch
	{
		private static readonly Dictionary<Type, MapEvent> Events = new Dictionary<Type, MapEvent>
		{
			[typeof(CardRemoveNodeData)] = MapEvent.BoneAltar,
			[typeof(CardMergeNodeData)] = MapEvent.MysteriousStones,
			[typeof(DuplicateMergeNodeData)] = MapEvent.Mycologists,
			[typeof(DeckTrialNodeData)] = MapEvent.DeckTrial,
			[typeof(GainConsumablesNodeData)] = MapEvent.Consumables,
			[typeof(CardStatBoostNodeData)] = MapEvent.Campfire,
			[typeof(BuyPeltsNodeData)] = MapEvent.BuyPelts,
			[typeof(TradePeltsNodeData)] = MapEvent.TradePelts
		};

		[HarmonyPrefix]
		private static bool Prefix(SpecialNodeHandler __instance, SpecialNodeData nodeData)
		{
			if (nodeData == null || !Events.TryGetValue(((object)nodeData).GetType(), out var value))
			{
				return true;
			}
			ChallengeKey challengeKey = EventRules.SkipChallengeFor(value);
			if (!Challenges.IsActive(challengeKey))
			{
				return true;
			}
			Plugin.Log.LogInfo((object)$"{challengeKey}: skipped {value}.");
			((MonoBehaviour)__instance).StartCoroutine(Skip(challengeKey));
			return false;
		}

		private static IEnumerator Skip(ChallengeKey key)
		{
			yield return (object)new WaitForSeconds(0.25f);
			Challenges.ShowActivation(key);
			yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("...", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true);
			Singleton<GameFlowManager>.Instance.TransitionToGameState((GameState)1, (NodeData)null);
		}
	}
	[HarmonyPatch(typeof(BuildTotemSequencer), "GenerateTotemChoices")]
	internal static class TotemKinshipPatch
	{
		private static readonly Tribe[] VanillaHeads;

		[HarmonyPostfix]
		private static void Postfix(int randomSeed, List<ItemData> __result)
		{
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			if (__result == null || !Challenges.IsActive(ChallengeKey.TotemKinship))
			{
				return;
			}
			List<TotemTopData> list = __result.OfType<TotemTopData>().ToList();
			if (list.Count != 0)
			{
				TotemTopData last = list[list.Count - 1];
				List<Tribe> list2 = VanillaHeads.ToList();
				if (StoryEventsData.EventCompleted((StoryEvent)14))
				{
					list2.Add((Tribe)1);
				}
				IEnumerable<Tribe> shownHeads = from h in list
					where (Object)(object)h != (Object)(object)last
					select h.prerequisites.tribe;
				if (TotemRules.TryPickKinshipTribe(RunState.DeckList.SelectMany((CardInfo c) => c.tribes), list2, RunState.Run.totemTops, shownHeads, randomSeed, out var tribe))
				{
					Plugin.Log.LogInfo((object)$"Totem Kinship: last head {last.prerequisites.tribe} -> {tribe}.");
					last.prerequisites.tribe = tribe;
					Challenges.ShowActivation(ChallengeKey.TotemKinship);
				}
			}
		}

		static TotemKinshipPatch()
		{
			Tribe[] array = new Tribe[5];
			RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			VanillaHeads = (Tribe[])(object)array;
		}
	}
	public enum MapEvent
	{
		BoneAltar,
		MysteriousStones,
		Mycologists,
		DeckTrial,
		Consumables,
		Campfire,
		BuyPelts,
		TradePelts
	}
	public static class EventRules
	{
		private static readonly Dictionary<MapEvent, ChallengeKey> Skips = new Dictionary<MapEvent, ChallengeKey>
		{
			[MapEvent.BoneAltar] = ChallengeKey.NoBoneAltar,
			[MapEvent.MysteriousStones] = ChallengeKey.NoMysteriousStones,
			[MapEvent.Mycologists] = ChallengeKey.NoMycologists,
			[MapEvent.DeckTrial] = ChallengeKey.NoDeckTrial,
			[MapEvent.Consumables] = ChallengeKey.NoConsumables,
			[MapEvent.Campfire] = ChallengeKey.NoCampfire,
			[MapEvent.BuyPelts] = ChallengeKey.NoBuyPelts,
			[MapEvent.TradePelts] = ChallengeKey.NoTradePelts
		};

		public static ChallengeKey SkipChallengeFor(MapEvent mapEvent)
		{
			return Skips[mapEvent];
		}
	}
	internal static class GameCards
	{
		internal const string FillerCardName = "PeltHare";

		private static readonly Dictionary<Tribe, FilterTribe> TribeMap = new Dictionary<Tribe, FilterTribe>
		{
			[(Tribe)3] = FilterTribe.Canine,
			[(Tribe)2] = FilterTribe.Bird,
			[(Tribe)6] = FilterTribe.Insect,
			[(Tribe)5] = FilterTribe.Reptile,
			[(Tribe)4] = FilterTribe.Hooved
		};

		internal static Tribe ToGame(FilterTribe tribe)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			return TribeMap.First((KeyValuePair<Tribe, FilterTribe> t) => t.Value == tribe).Key;
		}

		internal static CardTraits Traits(CardInfo card)
		{
			List<FilterTribe> tribes = (from t in card.tribes.Where(TribeMap.ContainsKey)
				select TribeMap[t]).Distinct().ToList();
			bool hasOtherTribe = card.tribes.Any((Tribe t) => (int)t != 0 && !TribeMap.ContainsKey(t));
			return new CardTraits(tribes, hasOtherTribe, card.BloodCost, card.BonesCost, card.EnergyCost, card.GemsCost?.Count ?? 0);
		}

		internal static CardFilter CurrentFilter()
		{
			return new CardFilter(CardFilter.FilterKeys.Where(Challenges.IsActive));
		}

		internal static bool Matches(CardInfo card, CardFilter filter)
		{
			if ((Object)(object)card != (Object)null && !IsFiller(card))
			{
				return filter.Passes(Traits(card));
			}
			return false;
		}

		internal static bool IsFiller(CardInfo card)
		{
			if ((Object)(object)card != (Object)null && ((Object)card).name == "PeltHare")
			{
				return card.HasAbility((Ability)76);
			}
			return false;
		}

		internal static CardInfo MakeFiller()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			CardInfo obj = Clone(ScriptableObjectLoader<CardInfo>.AllData.Find((CardInfo c) => ((Object)c).name == "PeltHare"));
			obj.Mods.Add(new CardModificationInfo((Ability)76));
			return obj;
		}

		internal static CardInfo Clone(CardInfo card)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return (CardInfo)card.Clone();
		}

		internal static void ShowFilterActivation()
		{
			foreach (ChallengeKey item in CardFilter.FilterKeys.Where(Challenges.IsActive))
			{
				Challenges.ShowActivation(item);
			}
		}
	}
	public static class HandRules
	{
		public const int SquirrelCount = 1;

		public const int DeckCardCount = 3;

		public static int OpeningSquirrels(bool twoSquirrels)
		{
			if (!twoSquirrels)
			{
				return 1;
			}
			return 2;
		}

		public static int RandomDrawsNeeded(int fixedCardsDrawn, int cardsLeftInDeck)
		{
			int num = 3 - fixedCardsDrawn;
			if (num < 0)
			{
				num = 0;
			}
			if (num >= cardsLeftInDeck)
			{
				return cardsLeftInDeck;
			}
			return num;
		}

		public static int SacrificeValue(bool hasTripleBlood, bool hasDoubleBlood)
		{
			if (hasTripleBlood)
			{
				return 3;
			}
			if (!hasDoubleBlood)
			{
				return 1;
			}
			return 2;
		}
	}
	[HarmonyPatch]
	internal static class KillCapPatches
	{
		internal static readonly PhaseTracker Tracker = new PhaseTracker();

		[HarmonyPrefix]
		[HarmonyPatch(typeof(LifeManager), "ShowDamageSequence")]
		private static void CapDamage(LifeManager __instance, ref int damage, ref int numWeights, bool toPlayer)
		{
			if (!InCapRound(out var turns))
			{
				return;
			}
			int num = KillCapRules.CapDamage(__instance.Balance, damage, toPlayer);
			if (num != damage)
			{
				Plugin.Log.LogInfo((object)($"Kill cap: round {turns.TurnNumber}, balance {__instance.Balance}, " + string.Format("{0} would take {1}, capped to {2}.", toPlayer ? "player" : "opponent", damage, num)));
				damage = num;
				if (numWeights > num)
				{
					numWeights = num;
				}
				ShowCapActivation();
			}
		}

		internal static bool InCapRound(out TurnManager turns)
		{
			turns = Singleton<TurnManager>.Instance;
			bool flag = Challenges.IsActive(ChallengeKey.NoFirstTurnKill);
			bool flag2 = Challenges.IsActive(ChallengeKey.NoPhaseTurnKill);
			if ((flag || flag2) && (Object)(object)turns != (Object)null)
			{
				return Tracker.IsCapRound(turns.TurnNumber, flag, flag2);
			}
			return false;
		}

		internal static void ShowCapActivation()
		{
			Challenges.ShowActivation(Tracker.InPhaseRound ? ChallengeKey.NoPhaseTurnKill : ChallengeKey.NoFirstTurnKill);
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(LifeManager), "Initialize")]
		private static void BattleStarted()
		{
			Tracker.BattleStarted();
		}
	}
	[HarmonyPatch]
	internal static class CombatDamageCapPatch
	{
		private static IEnumerable<MethodBase> TargetMethods()
		{
			return from m in PatchTargets.Declarations(AccessTools.GetTypesFromAssembly(typeof(CombatPhaseManager).Assembly), typeof(CombatPhaseManager), "VisualizeDamageMovingToScales").Select((Func<MethodInfo, MethodBase>)((MethodInfo m) => AccessTools.EnumeratorMoveNext((MethodBase)m)))
				where m != null
				select m;
		}

		private static void Prefix()
		{
			if (!KillCapPatches.InCapRound(out var turns))
			{
				return;
			}
			CombatPhaseManager combatPhaseManager = turns.CombatPhaseManager;
			LifeManager instance = Singleton<LifeManager>.Instance;
			if (!((Object)(object)combatPhaseManager == (Object)null) && !((Object)(object)instance == (Object)null))
			{
				int damageDealtThisPhase = combatPhaseManager.DamageDealtThisPhase;
				int num = KillCapRules.CombatDamage(instance.Balance, damageDealtThisPhase, turns.IsPlayerTurn);
				if (num != damageDealtThisPhase)
				{
					Plugin.Log.LogInfo((object)$"Kill cap: combat damage {damageDealtThisPhase} capped to {num} (no overkill teeth).");
					Traverse.Create((object)combatPhaseManager).Property("DamageDealtThisPhase", (object[])null).SetValue((object)num);
					KillCapPatches.ShowCapActivation();
				}
			}
		}
	}
	[HarmonyPatch]
	internal static class PhaseStartPatch
	{
		private static IEnumerable<MethodBase> TargetMethods()
		{
			return PatchTargets.Declarations(AccessTools.GetTypesFromAssembly(typeof(Opponent).Assembly), typeof(Opponent), "PostResetScalesSequence").Cast<MethodBase>();
		}

		private static void Prefix()
		{
			TurnManager instance = Singleton<TurnManager>.Instance;
			if ((Object)(object)instance != (Object)null)
			{
				KillCapPatches.Tracker.PhaseStarted(instance.TurnNumber);
			}
		}
	}
	public static class KillCapRules
	{
		public const int Goal = 5;

		public static int CapDamage(int balance, int damage, bool toPlayer)
		{
			int val = (toPlayer ? (balance + 4) : (4 - balance));
			return Math.Min(damage, Math.Max(0, val));
		}

		public static int CombatDamage(int balance, int dealt, bool playerIsAttacker)
		{
			return CapDamage(balance, dealt, !playerIsAttacker);
		}
	}
	public sealed class PhaseTracker
	{
		private int phaseStartRound;

		public bool InPhaseRound => phaseStartRound > 0;

		public void BattleStarted()
		{
			phaseStartRound = 0;
		}

		public void PhaseStarted(int currentRound)
		{
			phaseStartRound = currentRound + 1;
		}

		public bool IsCapRound(int round, bool firstTurnKillOn, bool phaseTurnKillOn)
		{
			if (!firstTurnKillOn || round != 1 || phaseStartRound != 0)
			{
				if (phaseTurnKillOn && phaseStartRound > 0)
				{
					return round == phaseStartRound;
				}
				return false;
			}
			return true;
		}
	}
	internal static class OfferScope
	{
		private static int depth;

		internal static bool Active => depth > 0;

		internal static void Enter()
		{
			depth++;
		}

		internal static void Exit()
		{
			depth = Math.Max(0, depth - 1);
		}
	}
	[HarmonyPatch]
	internal static class OfferPatches
	{
		private static List<CardInfo> Pool(CardMetaCategory category)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return CardLoader.GetUnlockedCards(category, (CardTemple)0).Select(GameCards.Clone).ToList();
		}

		private static List<CardChoice> FillCardChoices(List<CardChoice> choices, List<CardInfo> pool, CardFilter filter, int seed)
		{
			List<CardChoice> pool2 = ((IEnumerable<CardInfo>)pool).Select((Func<CardInfo, CardChoice>)((CardInfo c) => new CardChoice
			{
				CardInfo = c
			})).ToList();
			List<CardChoice> list = OfferRules.Fill<CardChoice>(choices, pool2, (CardChoice c) => GameCards.Matches(c.CardInfo, filter), delegate(CardChoice c)
			{
				CardInfo cardInfo = c.CardInfo;
				return ((cardInfo != null) ? ((Object)cardInfo).name : null) ?? "";
			}, () => new CardChoice
			{
				CardInfo = GameCards.MakeFiller()
			}, seed);
			int num = list.Count((CardChoice c) => !choices.Contains(c));
			if (num > 0)
			{
				Plugin.Log.LogInfo((object)($"Card filter: replaced {num}/{choices.Count} offered cards " + $"({list.Count((CardChoice c) => GameCards.IsFiller(c.CardInfo))} filler)."));
			}
			GameCards.ShowFilterActivation();
			return list;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Part1CardChoiceGenerator), "GenerateChoices", new Type[]
		{
			typeof(CardChoicesNodeData),
			typeof(int)
		})]
		private static void FilterCardChoices(CardChoicesNodeData data, int randomSeed, ref List<CardChoice> __result)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected I4, but got Unknown
			CardFilter cardFilter = GameCards.CurrentFilter();
			if (!cardFilter.IsActive || __result == null)
			{
				return;
			}
			switch (data?.choicesType)
			{
			case (CardChoicesType)0L:
				__result = FilterCostChoices(__result, cardFilter);
				GameCards.ShowFilterActivation();
				break;
			case (CardChoicesType)1L:
				if (cardFilter.TribeGroupActive)
				{
					__result = FilterTribeChoices(__result, cardFilter);
				}
				GameCards.ShowFilterActivation();
				break;
			case (CardChoicesType)2L:
				__result = FillCardChoices(__result, new List<CardInfo>(), cardFilter, randomSeed);
				break;
			default:
				__result = FillCardChoices(__result, Pool((CardMetaCategory)0), cardFilter, randomSeed);
				break;
			}
		}

		private static List<CardChoice> FilterCostChoices(List<CardChoice> choices, CardFilter filter)
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Expected O, but got Unknown
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Expected O, but got Unknown
			List<CardChoice> list = choices.Where(Allowed).ToList();
			foreach (CardChoice option in ((IEnumerable<int>)new int[3] { 1, 2, 3 }).Select((Func<int, CardChoice>)((int n) => new CardChoice
			{
				resourceType = (ResourceType)1,
				resourceAmount = n
			})).Concat((IEnumerable<CardChoice>)(object)new CardChoice[1]
			{
				new CardChoice
				{
					resourceType = (ResourceType)2
				}
			}).Where(Allowed))
			{
				if (list.Count >= 3)
				{
					break;
				}
				if (!list.Any((CardChoice r) => Same(r, option)))
				{
					list.Add(option);
				}
			}
			while (list.Count < 3)
			{
				list.Add(new CardChoice
				{
					CardInfo = GameCards.MakeFiller()
				});
			}
			return list;
			bool Allowed(CardChoice c)
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Invalid comparison between Unknown and I4
				if ((Object)(object)c.CardInfo == (Object)null)
				{
					return filter.AllowsCostChoice(((int)c.resourceType == 1) ? new int?(c.resourceAmount) : ((int?)null));
				}
				return false;
			}
			static bool Same(CardChoice a, CardChoice b)
			{
				//IL_0001: 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 (a.resourceType == b.resourceType)
				{
					return a.resourceAmount == b.resourceAmount;
				}
				return false;
			}
		}

		private static List<CardChoice> FilterTribeChoices(List<CardChoice> choices, CardFilter filter)
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Expected O, but got Unknown
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Expected O, but got Unknown
			List<Tribe> allowed = filter.AllowedTribeChoices.Select(GameCards.ToGame).ToList();
			List<CardChoice> list = choices.Where((CardChoice c) => (Object)(object)c.CardInfo == (Object)null && allowed.Contains(c.tribe)).ToList();
			foreach (Tribe tribe in allowed)
			{
				if (list.Count >= 3)
				{
					break;
				}
				if (!list.Any((CardChoice r) => r.tribe == tribe))
				{
					list.Add(new CardChoice
					{
						tribe = tribe
					});
				}
			}
			while (list.Count < 3)
			{
				list.Add(new CardChoice
				{
					CardInfo = GameCards.MakeFiller()
				});
			}
			return list;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Part1RareChoiceGenerator), "GenerateChoices", new Type[]
		{
			typeof(CardChoicesNodeData),
			typeof(int)
		})]
		private static void FilterRareChoices(int randomSeed, ref List<CardChoice> __result)
		{
			CardFilter cardFilter = GameCards.CurrentFilter();
			if (cardFilter.IsActive && __result != null)
			{
				__result = FillCardChoices(__result, Pool((CardMetaCategory)3), cardFilter, randomSeed);
			}
		}

		private static void PickMatching(ref CardInfo result, Predicate<CardInfo> criteria, int seed)
		{
			CardFilter filter = GameCards.CurrentFilter();
			if (filter.IsActive && !GameCards.Matches(result, filter))
			{
				CardInfo val = OfferRules.PickOrFiller(CardLoader.GetUnlockedCards((CardMetaCategory)0, (CardTemple)0).FindAll(criteria), (CardInfo c) => GameCards.Matches(c, filter), () => (CardInfo)null, seed);
				result = (((Object)(object)val == (Object)null) ? GameCards.MakeFiller() : GameCards.Clone(val));
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(CardLoader), "GetRandomChoosableCardWithCost")]
		private static void FilterCardWithCost(int randomSeed, int bloodCost, ref CardInfo __result)
		{
			PickMatching(ref __result, (CardInfo c) => c.BloodCost == bloodCost, randomSeed);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(CardLoader), "GetRandomChoosableCardOfTribe")]
		private static void FilterCardOfTribe(int randomSeed, Tribe tribe, ref CardInfo __result)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			PickMatching(ref __result, (CardInfo c) => c.IsOfTribe(tribe), randomSeed);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(CardLoader), "GetRandomChoosableBonesCard")]
		private static void FilterBonesCard(int randomSeed, ref CardInfo __result)
		{
			PickMatching(ref __result, (CardInfo c) => c.BonesCost > 0, randomSeed);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Part1CardChoiceGenerator), "RollRandomDeathCardOfCost")]
		private static void FilterDeathCardOfCost(ref CardInfo __result)
		{
			CardFilter cardFilter = GameCards.CurrentFilter();
			if (cardFilter.IsActive && (Object)(object)__result != (Object)null && !GameCards.Matches(__result, cardFilter))
			{
				__result = null;
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(DeckTrialSequencer), "GenerateRewardChoices")]
		private static void DeckTrialEnter()
		{
			OfferScope.Enter();
		}

		[HarmonyFinalizer]
		[HarmonyPatch(typeof(DeckTrialSequencer), "GenerateRewardChoices")]
		private static void DeckTrialExit()
		{
			OfferScope.Exit();
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(TradePeltsSequencer), "GetTradeCardInfos")]
		private static void TraderEnter()
		{
			OfferScope.Enter();
		}

		[HarmonyFinalizer]
		[HarmonyPatch(typeof(TradePeltsSequencer), "GetTradeCardInfos")]
		private static void TraderExit()
		{
			OfferScope.Exit();
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(CardLoader), "GetDistinctCardsFromPool")]
		private static void FilterPool(ref List<CardInfo> cardPool)
		{
			if (!OfferScope.Active || cardPool == null)
			{
				return;
			}
			CardFilter filter = GameCards.CurrentFilter();
			if (filter.IsActive)
			{
				cardPool = cardPool.FindAll((CardInfo c) => GameCards.Matches(c, filter));
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(CardLoader), "GetDistinctCardsFromPool")]
		private static void PadPool(int numCards, List<CardInfo> __result)
		{
			if (OfferScope.Active && __result != null && GameCards.CurrentFilter().IsActive)
			{
				int num = numCards - __result.Count;
				for (int i = 0; i < num; i++)
				{
					__result.Add(GameCards.MakeFiller());
				}
				if (num > 0)
				{
					Plugin.Log.LogInfo((object)$"Card filter: offer padded with {num} filler.");
				}
				GameCards.ShowFilterActivation();
			}
		}
	}
	[HarmonyPatch]
	internal static class BoulderOfferScopePatch
	{
		private static MethodBase TargetMethod()
		{
			return AccessTools.EnumeratorMoveNext((MethodBase)AccessTools.Method(typeof(BoulderChoiceSequencer), "RewardSequence", (Type[])null, (Type[])null));
		}

		private static void Prefix()
		{
			OfferScope.Enter();
		}

		private static void Finalizer()
		{
			OfferScope.Exit();
		}
	}
	public static class OfferRules
	{
		public static List<T> Fill<T>(IReadOnlyList<T> offer, IReadOnlyList<T> pool, Func<T, bool> passes, Func<T, string> nameOf, Func<T> makeFiller, int seed)
		{
			Random random = new Random(seed);
			HashSet<string> used = new HashSet<string>(offer.Where(passes).Select(nameOf));
			List<T> list = (from c in pool.Where(passes)
				where !used.Contains(nameOf(c))
				select c).ToList();
			List<T> list2 = new List<T>(offer.Count);
			foreach (T item in offer)
			{
				if (passes(item))
				{
					list2.Add(item);
					continue;
				}
				list.RemoveAll((T c) => used.Contains(nameOf(c)));
				if (list.Count == 0)
				{
					list2.Add(makeFiller());
					continue;
				}
				T val = list[random.Next(list.Count)];
				used.Add(nameOf(val));
				list2.Add(val);
			}
			return list2;
		}

		public static T PickOrFiller<T>(IReadOnlyList<T> pool, Func<T, bool> passes, Func<T> makeFiller, int seed)
		{
			List<T> list = pool.Where(passes).ToList();
			if (list.Count != 0)
			{
				return list[new Random(seed).Next(list.Count)];
			}
			return makeFiller();
		}
	}
	[HarmonyPatch(typeof(CardDrawPiles3D), "DrawOpeningHand")]
	internal static class OpeningHandPatch
	{
		internal static readonly DoubleBloodGrant SquirrelGrant = new DoubleBloodGrant();

		[HarmonyPostfix]
		private static void Postfix(CardDrawPiles3D __instance, List<CardInfo> fixedHand, ref IEnumerator __result)
		{
			if (__instance is Part1CardDrawPiles)
			{
				if (Plugin.UnfairHandActive)
				{
					__result = DrawUnfairOpeningHand(__instance, fixedHand);
				}
				if (Challenges.IsActive(ChallengeKey.TwoSquirrels))
				{
					__result = WithExtraSquirrels(__instance, __result);
				}
				if (Plugin.WorthySquirrelActive)
				{
					__result = WithDoubleBloodSquirrel(__result);
				}
			}
		}

		private static IEnumerator WithExtraSquirrels(CardDrawPiles3D piles, IEnumerator openingHand)
		{
			while (openingHand.MoveNext())
			{
				yield return openingHand.Current;
			}
			Challenges.ShowActivation(ChallengeKey.TwoSquirrels);
			for (int i = 1; i < HandRules.OpeningSquirrels(twoSquirrels: true); i++)
			{
				if (piles.SideDeck.CardsInDeck <= 0)
				{
					break;
				}
				Plugin.Log.LogInfo((object)"Two Squirrels: extra opening squirrel.");
				piles.SidePile.Draw();
				yield return piles.DrawFromSidePile();
			}
		}

		private static IEnumerator WithDoubleBloodSquirrel(IEnumerator openingHand)
		{
			SquirrelGrant.Arm();
			try
			{
				while (openingHand.MoveNext())
				{
					yield return openingHand.Current;
				}
			}
			finally
			{
				SquirrelGrant.Disarm();
			}
		}

		private static IEnumerator DrawUnfairOpeningHand(CardDrawPiles3D piles, List<CardInfo> fixedHand)
		{
			ChallengeActivationUI.TryShowActivation((AscensionChallenge)12);
			ChallengeActivationUI.TryShowActivation(Plugin.UnfairHandChallenge);
			for (int i = 0; i < 1; i++)
			{
				if (piles.SideDeck.CardsInDeck <= 0)
				{
					break;
				}
				piles.SidePile.Draw();
				yield return piles.DrawFromSidePile();
			}
			int fixedCardsDrawn = 0;
			if (fixedHand != null)
			{
				foreach (CardInfo item in fixedHand)
				{
					if ((Object)(object)item != (Object)null && ((CardDrawPiles)piles).Deck.HasCard(item))
					{
						piles.Pile.Draw();
						yield return ((CardDrawPiles)piles).DrawCardFromDeck(item, (Action<PlayableCard>)null);
						fixedCardsDrawn++;
					}
				}
			}
			int randomDraws = HandRules.RandomDrawsNeeded(fixedCardsDrawn, ((CardDrawPiles)piles).Deck.CardsInDeck);
			for (int i = 0; i < randomDraws; i++)
			{
				piles.Pile.Draw();
				yield return ((CardDrawPiles)piles).DrawCardFromDeck((CardInfo)null, (Action<PlayableCard>)null);
			}
		}
	}
	[HarmonyPatch(typeof(CardDrawPiles3D), "DrawFromSidePile")]
	internal static class SideDrawPatch
	{
		[HarmonyPostfix]
		private static void Postfix(CardDrawPiles3D __instance, ref IEnumerator __result)
		{
			if (OpeningHandPatch.SquirrelGrant.TryConsume())
			{
				__result = DrawDoubleBloodSquirrel(__instance);
			}
		}

		private static IEnumerator DrawDoubleBloodSquirrel(CardDrawPiles3D piles)
		{
			ChallengeActivationUI.TryShowActivation(Plugin.WorthySquirrelChallenge);
			CardInfo val = piles.SideDeck.Draw();
			Vector2 value = Traverse.Create((object)piles).Field("drawFromPilesSpawnOffset").GetValue<Vector2>();
			List<CardModificationInfo> list = new List<CardModificationInfo>
			{
				new CardModificationInfo(DoubleBlood.ability)
			};
			yield return Singleton<CardSpawner>.Instance.SpawnCardToHand(val, list, Vector2.op_Implicit(value), 0.15f, (Action<PlayableCard>)null);
		}
	}
	public static class PatchTargets
	{
		public static IEnumerable<MethodInfo> Declarations(IEnumerable<Type> types, Type baseType, string methodName)
		{
			return from m in types.Where((Type t) => t != null && baseType.IsAssignableFrom(t)).SelectMany((Type t) => t.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic))
				where m.Name == methodName && !m.IsAbstract
				select m;
		}
	}
	public sealed class PeltDeck
	{
		public string Title { get; }

		public string IconFile { get; }

		public IReadOnlyList<string> CardNames { get; }

		public PeltDeck(string title, string iconFile, params string[] cardNames)
		{
			Title = title;
			IconFile = iconFile;
			CardNames = cardNames;
		}
	}
	public static class PeltDecks
	{
		public const string RabbitPelt = "PeltHare";

		public const string WolfPelt = "PeltWolf";

		public const string GoldenPelt = "PeltGolden";

		public static readonly IReadOnlyList<PeltDeck> All = new PeltDeck[8]
		{
			new PeltDeck("Rabbit Pelts", "deck_rabbit.png", "PeltHare", "PeltHare", "PeltHare"),
			new PeltDeck("Rabbit and Wolf Pelts", "deck_rabbit_wolf.png", "PeltHare", "PeltHare", "PeltWolf"),
			new PeltDeck("Rabbit and Golden Pelts", "deck_rabbit_golden.png", "PeltHare", "PeltHare", "PeltGolden"),
			new PeltDeck("Wolf and Rabbit Pelts", "deck_wolf_rabbit.png", "PeltHare", "PeltWolf", "PeltWolf"),
			new PeltDeck("Pelt Assortment", "deck_assortment.png", "PeltHare", "PeltWolf", "PeltGolden"),
			new PeltDeck("Wolf and Golden Pelts", "deck_wolf_golden.png", "PeltWolf", "PeltWolf", "PeltGolden"),
			new PeltDeck("Golden and Wolf Pelts", "deck_golden_wolf.png", "PeltWolf", "PeltGolden", "PeltGolden"),
			new PeltDeck("Golden Pelts", "deck_golden.png", "PeltGolden", "PeltGolden", "PeltGolden")
		};

		public static readonly IReadOnlyDictionary<string, string> PixelPortraits = new Dictionary<string, string>
		{
			["PeltHare"] = "pixel_rabbit.png",
			["PeltWolf"] = "pixel_wolf.png",
			["PeltGolden"] = "pixel_golden.png"
		};
	}
	internal static class PeltPixelPortraits
	{
		private static readonly Dictionary<string, Sprite> Sprites = new Dictionary<string, Sprite>();

		internal static void Register()
		{
			foreach (KeyValuePair<string, string> pixelPortrait in PeltDecks.PixelPortraits)
			{
				Texture2D imageAsTexture = TextureHelper.GetImageAsTexture(pixelPortrait.Value, typeof(Plugin).Assembly, (FilterMode)0);
				Sprites[pixelPortrait.Key] = TextureHelper.ConvertTexture(imageAsTexture, (SpriteType)1, (FilterMode)0);
			}
			CardManager.ModifyCardList += delegate(List<CardInfo> cards)
			{
				Apply(cards);
				return cards;
			};
			StarterDeckManager.ModifyDeckList += delegate(List<FullStarterDeck> decks)
			{
				foreach (FullStarterDeck deck in decks)
				{
					if (deck.Info.cards != null)
					{
						Apply(deck.Info.cards);
					}
				}
				return decks;
			};
		}

		private static void Apply(IEnumerable<CardInfo> cards)
		{
			foreach (CardInfo card in cards)
			{
				if ((Object)(object)card != (Object)null && (Object)(object)card.pixelPortrait == (Object)null && Sprites.TryGetValue(((Object)card).name, out var value))
				{
					card.pixelPortrait = value;
				}
			}
		}
	}
	[BepInPlugin("lucas.inscryption.lagartoschallenges", "Lagarto's Challenges", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInIncompatibility("lucas.inscryption.unfairhand")]
	[BepInIncompatibility("lucas.inscryption.peltstarterhands")]
	public class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "lucas.inscryption.lagartoschallenges";

		public const string PluginName = "Lagarto's Challenges";

		public const string PluginVersion = "1.0.0";

		internal static ManualLogSource Log;

		internal static AscensionChallenge UnfairHandChallenge => Challenges.Id(ChallengeKey.UnfairHand);

		internal static AscensionChallenge WorthySquirrelChallenge => Challenges.Id(ChallengeKey.WorthySquirrel);

		internal static AscensionChallenge AnnoyingTradesChallenge => Challenges.Id(ChallengeKey.AnnoyingTrades);

		internal static bool UnfairHandActive => Challenges.IsActive(ChallengeKey.UnfairHand);

		internal static bool WorthySquirrelActive => Challenges.IsActive(ChallengeKey.WorthySquirrel);

		internal static bool AnnoyingTradesActive => Challenges.IsActive(ChallengeKey.AnnoyingTrades);

		internal static bool AnnoyingStartersActive => ChallengeActive((AscensionChallenge)9);

		private void Awake()
		{
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			Log = ((BaseUnityPlugin)this).Logger;
			RegisterTranslations();
			PeltPixelPortraits.Register();
			foreach (PeltDeck item in PeltDecks.All)
			{
				StarterDeckManager.New("lucas.inscryption.lagartoschallenges", item.Title, TextureHelper.GetImageAsTexture(item.IconFile, typeof(Plugin).Assembly, (FilterMode)0), item.CardNames.ToArray(), 0);
			}
			Challenges.RegisterAll("lucas.inscryption.lagartoschallenges");
			DoubleBlood.ability = AbilityExtensions.AddMetaCategories(AbilityManager.New("lucas.inscryption.lagartoschallenges", "Double Blood", "[creature] is counted as 2 Blood rather than 1 Blood when sacrificed.", typeof(DoubleBlood), (Texture)(object)TextureHelper.GetImageAsTexture("ability_doubleblood.png", typeof(Plugin).Assembly, (FilterMode)0)), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]).ability;
			new Harmony("lucas.inscryption.lagartoschallenges").PatchAll(typeof(Plugin).Assembly);
			Log.LogInfo((object)"Lagarto's Challenges loaded.");
		}

		private static void RegisterTranslations()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			foreach (KeyValuePair<string, IReadOnlyDictionary<string, string>> item in Translations.All)
			{
				foreach (KeyValuePair<string, string> item2 in item.Value)
				{
					LocalizationManager.Translate("lucas.inscryption.lagartoschallenges", "lucas.inscryption.lagartoschallenges." + item.Key, item.Key, item2.Value, LocalizationManager.CodeToLanguage(item2.Key));
				}
			}
		}

		internal static bool ChallengeActive(AscensionChallenge challenge)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			if (SaveFile.IsAscension && AscensionSaveData.Data != null)
			{
				return AscensionSaveData.Data.ChallengeIsActive(challenge);
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(BoardManager), "GetValueOfSacrifices")]
	internal static class SacrificeValuePatch
	{
		[HarmonyPostfix]
		private static void Postfix(List<CardSlot> sacrifices, ref int __result)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			if (sacrifices == null)
			{
				return;
			}
			foreach (CardSlot sacrifice in sacrifices)
			{
				if (!((Object)(object)sacrifice == (Object)null) && !((Object)(object)sacrifice.Card == (Object)null) && sacrifice.Card.HasAbility(DoubleBlood.ability))
				{
					bool hasTripleBlood = sacrifice.Card.HasAbility((Ability)22);
					__result += HandRules.SacrificeValue(hasTripleBlood, hasDoubleBlood: true) - HandRules.SacrificeValue(hasTripleBlood, hasDoubleBlood: false);
				}
			}
		}
	}
	public static class TotemRules
	{
		public static bool TryPickKinshipTribe<T>(IEnumerable<T> deckTribes, IEnumerable<T> eligibleHeads, IEnumerable<T> ownedHeads, IEnumerable<T> shownHeads, int seed, out T tribe)
		{
			HashSet<T> excluded = new HashSet<T>(ownedHeads.Concat(shownHeads));
			HashSet<T> eligible = new HashSet<T>(eligibleHeads);
			List<T> list = (from t in deckTribes.Distinct()
				where eligible.Contains(t) && !excluded.Contains(t)
				select t).ToList();
			if (list.Count == 0)
			{
				tribe = default(T);
				return false;
			}
			tribe = list[new Random(seed).Next(list.Count)];
			return true;
		}
	}
	public static class Translations
	{
		public const string UnfairHandTitle = "Unfair Hand";

		public const string UnfairHandDescription = "Your opening hand is no longer guaranteed to be playable.";

		public const string WorthySquirrelTitle = "Worthy Squirrel";

		public const string WorthySquirrelDescription = "Your opening squirrel has the Double Blood sigil.";

		public const string DoubleBloodName = "Double Blood";

		public const string DoubleBloodDescription = "[creature] is counted as 2 Blood rather than 1 Blood when sacrificed.";

		public const string AnnoyingTradesTitle = "Annoying Trades";

		public const string AnnoyingTradesDescription = "Annoying Starters also affects pelts. At every trade, if any of your pelts is Annoying, all offered cards are too.";

		public const string NoFirstTurnKillTitle = "No First Turn Kill";

		public const string NoFirstTurnKillDescription = "Nobody can win or lose a battle on their first turn: that damage stops one short.";

		public const string NoPhaseTurnKillTitle = "No Phase Turn Kill";

		public const string NoPhaseTurnKillDescription = "Nobody can win or lose a boss phase on their first turn after the scales reset.";

		public const string CanineOnlyTitle = "Canine Only";

		public const string CanineOnlyDescription = "Only Canine cards are offered to you.";

		public const string AvianOnlyTitle = "Avian Only";

		public const string AvianOnlyDescription = "Only Avian cards are offered to you.";

		public const string InsectOnlyTitle = "Insect Only";

		public const string InsectOnlyDescription = "Only Insect cards are offered to you.";

		public const string ReptileOnlyTitle = "Reptile Only";

		public const string ReptileOnlyDescription = "Only Reptile cards are offered to you.";

		public const string HoovedOnlyTitle = "Hooved Only";

		public const string HoovedOnlyDescription = "Only Hooved cards are offered to you.";

		public const string NoTribeOnlyTitle = "No Tribe Only";

		public const string NoTribeOnlyDescription = "Only cards without a tribe are offered to you.";

		public const string Blood1OnlyTitle = "1 Blood Only";

		public const string Blood1OnlyDescription = "Only cards costing 1 Blood are offered to you.";

		public const string Blood2OnlyTitle = "2 Blood Only";

		public const string Blood2OnlyDescription = "Only cards costing 2 Blood are offered to you.";

		public const string Blood3OnlyTitle = "3 Blood Only";

		public const string Blood3OnlyDescription = "Only cards costing 3 Blood are offered to you.";

		public const string Blood4OnlyTitle = "4 Blood Only";

		public const string Blood4OnlyDescription = "Only cards costing 4 Blood are offered to you.";

		public const string BonesOnlyTitle = "Bones Only";

		public const string BonesOnlyDescription = "Only cards costing Bones are offered to you.";

		public const string FreeOnlyTitle = "Free Only";

		public const string FreeOnlyDescription = "Only free cards are offered to you.";

		public const string OneSquirrelTitle = "One Squirrel";

		public const string OneSquirrelDescription = "After your opening hand, only one Squirrel is left to draw.";

		public const string TwoSquirrelsTitle = "Two Squirrels";

		public const string TwoSquirrelsDescription = "Your opening hand has a second Squirrel.";

		public const string NoBoneAltarTitle = "No Bone Altar";

		public const string NoBoneAltarDescription = "The bone altar does nothing.";

		public const string NoMysteriousStonesTitle = "No Mysterious Stones";

		public const string NoMysteriousStonesDescription = "The mysterious stones do nothing.";

		public const string NoMycologistsTitle = "No Mycologists";

		public const string NoMycologistsDescription = "The Mycologists do nothing.";

		public const string NoDeckTrialTitle = "No Deck Trial";

		public const string NoDeckTrialDescription = "Deck trials do nothing.";

		public const string NoConsumablesTitle = "No Consumables";

		public const string NoConsumablesDescription = "Item packs give you nothing.";

		public const string NoCampfireTitle = "No Campfire";

		public const string NoCampfireDescription = "Campfires do nothing.";

		public const string NoBuyPeltsTitle = "No Buy Pelts";

		public const string NoBuyPeltsDescription = "The Trapper does nothing.";

		public const string NoTradePeltsTitle = "No Trade Pelts";

		public const string NoTradePeltsDescription = "The Trader does nothing.";

		public const string TotemKinshipTitle = "Totem Kinship";

		public const string TotemKinshipDescription = "The last totem head offered is a tribe from your deck.";

		public static readonly IReadOnlyDictionary<string, IReadOnlyDictionary<string, string>> All = new Dictionary<string, IReadOnlyDictionary<string, string>>
		{
			["Unfair Hand"] = new Dictionary<string, string>
			{
				["fr"] = "Main injuste",
				["it"] = "Mano ingiusta",
				["de"] = "Unfaire Hand",
				["es"] = "Mano injusta",
				["pt"] = "Mão Injusta",
				["tr"] = "Adaletsiz El",
				["ru"] = "Нечестная рука",
				["ja"] = "不公平な手札",
				["ko"] = "불공평한 패",
				["zhcn"] = "不公平手牌",
				["zhtw"] = "不公平手牌"
			},
			["Your opening hand is no longer guaranteed to be playable."] = new Dictionary<string, string>
			{
				["fr"] = "Votre main de départ n'est plus forcément jouable.",
				["it"] = "Non è più garantito che la tua mano iniziale sia giocabile.",
				["de"] = "Deine Starthand ist nicht mehr garantiert spielbar.",
				["es"] = "Ya no se garantiza que tu mano inicial sea jugable.",
				["pt"] = "Sua mão inicial não tem mais garantia de ser jogável.",
				["tr"] = "Başlangıç elinin oynanabilir olması artık garanti değil.",
				["ru"] = "Ваша стартовая рука больше не обязательно будет играбельной.",
				["ja"] = "最初の手札が使えるものになる保証はもうない。",
				["ko"] = "시작 패를 낼 수 있다는 보장이 더 이상 없다.",
				["zhcn"] = "起始手牌不再保证可以打出。",
				["zhtw"] = "起始手牌不再保證可以打出。"
			},
			["Worthy Squirrel"] = new Dictionary<string, string>
			{
				["fr"] = "Écureuil digne",
				["it"] = "Degno scoiattolo",
				["de"] = "Würdiges Eichhörnchen",
				["es"] = "Ardilla digna",
				["pt"] = "Esquilo Digno",
				["tr"] = "Kutsal Sincap",
				["ru"] = "Достойная белка",
				["ja"] = "価値あるリス",
				["ko"] = "값진 다람쥐",
				["zhcn"] = "优质松鼠",
				["zhtw"] = "夠格松鼠"
			},
			["Your opening squirrel has the Double Blood sigil."] = new Dictionary<string, string>
			{
				["fr"] = "Votre écureuil de départ a l'emblème Double sang.",
				["it"] = "Il tuo scoiattolo iniziale ha il sigillo Doppio sangue.",
				["de"] = "Dein Start-Eichhörnchen hat das Siegel „Doppelblut“.",
				["es"] = "Tu Ardilla inicial tiene el sello Sangre doble.",
				["pt"] = "Seu Esquilo inicial recebe o selo Sangue Duplo.",
				["tr"] = "Başlangıç sincabın Çift Kan mührüne sahip olur.",
				["ru"] = "Ваша стартовая белка получит символ «Двойная кровь».",
				["ja"] = "最初のリスに「二倍の血」の印がつく。",
				["ko"] = "시작 다람쥐에게 두 배의 피 도장이 주어진다.",
				["zhcn"] = "你的起始松鼠带有双倍血量印记。",
				["zhtw"] = "你的起始松鼠會有雙倍鮮血印記。"
			},
			["Double Blood"] = new Dictionary<string, string>
			{
				["fr"] = "Double sang",
				["it"] = "Doppio sangue",
				["de"] = "Doppelblut",
				["es"] = "Sangre doble",
				["pt"] = "Sangue Duplo",
				["tr"] = "Çift Kan",
				["ru"] = "Двойная кровь",
				["ja"] = "二倍の血",
				["ko"] = "두 배의 피",
				["zhcn"] = "双倍血量",
				["zhtw"] = "雙倍鮮血"
			},
			["[creature] is counted as 2 Blood rather than 1 Blood when sacrificed."] = new Dictionary<string, string>
			{
				["fr"] = "Sacrifier [creature] accorde 2 gouttes de sang au lieu de 1.",
				["it"] = "Quando viene sacrificata, [creature] vale 2 di sangue invece di 1.",
				["de"] = "[creature] bringt beim Opfern 2 statt 1 Blut ein.",
				["es"] = "Cuando se sacrifica, [creature] se cuenta como 2 de sangre en lugar de 1 de sangre.",
				["pt"] = "[creature] concede 2 de sangue (ao invés de 1) ao ser sacrificada.",
				["tr"] = "[creature], kurban edildiğinde 1 yerine 2 Kan verir.",
				["ru"] = "Когда [creature] приносится в жертву, вы получаете 2 капли крови вместо одной.",
				["ja"] = "[creature]を捧げると、血が1個ではなく2個手に入る。",
				["ko"] = "[creature]은(는) 희생될 시 1이 아닌 2의 피를 제공한다.",
				["zhcn"] = "[creature]在献祭时可算作2点血量,而非1点。",
				["zhtw"] = "[creature] 被犧牲時視為 2 點鮮血,而非 1 點。"
			},
			["Annoying Trades"] = new Dictionary<string, string>
			{
				["fr"] = "Échanges Fureur",
				["it"] = "Scambi irritanti",
				["de"] = "Nervige Tauschgeschäfte",
				["es"] = "Trueques molestos",
				["pt"] = "Trocas Irritantes",
				["tr"] = "Sinir Bozucu Takaslar",
				["ru"] = "Надоедливый обмен",
				["ja"] = "「嫌がらせ」の取引",
				["ko"] = "구타유발자 거래",
				["zhcn"] = "惹人生厌的交易",
				["zhtw"] = "煩躁交易"
			},
			["Annoying Starters also affects pelts. At every trade, if any of your pelts is Annoying, all offered cards are too."] = new Dictionary<string, string>
			{
				["fr"] = "« Fureur du défi » touche aussi les fourrures. À chaque échange, si une de vos fourrures a Fureur, toutes les cartes proposées l'ont aussi.",
				["it"] = "«Carte iniziali irritanti» vale anche per le pelli. A ogni scambio, se una tua pelle è Irritante, lo sono anche tutte le carte offerte.",
				["de"] = "„Nervige Startkarten“ gilt auch für Felle. Bei jedem Tausch: Ist eines deiner Felle nervig, sind es alle angebotenen Karten auch.",
				["es"] = "«Molestias iniciales» también afecta a las pieles. En cada trueque, si alguna de tus pieles es Molesta, todas las cartas ofrecidas también.",
				["pt"] = "\"Irritação inicial\" também afeta as peles. Em toda troca, se alguma das suas peles for Irritante, todas as cartas oferecidas também serão.",
				["tr"] = "\"Sinir Bozucu Başlangıç Destesi\" postları da etkiler. Her takasta postlarından biri Sinir Bozucu ise sunulan tüm kartlar da öyle olur.",
				["ru"] = "«Надоеды в начале» действует и на шкуры. При каждом обмене, если хоть одна шкура с символом Надоеды, все предложенные карты получат его.",
				["ja"] = "「嫌がらせ」スターターが皮にも適用される。取引のたびに、「嫌がらせ」の皮が1枚でもあれば、提示されるカードすべてが「嫌がらせ」になる。",
				["ko"] = "구타유발자 시작이 가죽에도 적용된다. 거래할 때마다 구타유발자 가죽이 하나라도 있으면 제시되는 모든 카드가 구타유발자가 된다.",
				["zhcn"] = "惹人生厌的开局也作用于皮草。每次交易时,只要有一张皮草带有惹人生厌印记,提供的所有卡牌也都会带有该印记。",
				["zhtw"] = "煩躁起手也會影響皮草。每次交易時,只要有一張皮草帶有煩躁印記,提供的所有卡牌也都會有煩躁印記。"
			},
			["No First Turn Kill"] = new Dictionary<string, string>
			{
				["fr"] = "Pas de victoire au premier tour",
				["it"] = "Niente vittoria al primo turno",
				["de"] = "Kein Sieg im ersten Zug",
				["es"] = "Sin victoria en el primer turno",
				["pt"] = "Sem vitória no primeiro turno",
				["tr"] = "İlk Turda Zafer Yok",
				["ru"] = "Без победы в первый ход",
				["ja"] = "初手決着禁止",
				["ko"] = "첫 턴 결판 금지",
				["zhcn"] = "禁止首回合决胜",
				["zhtw"] = "禁止首回合決勝"
			},
			["Nobody can win or lose a battle on their first turn: that damage stops one short."] = new Dictionary<string, string>
			{
				["fr"] = "Personne ne peut gagner ou perdre un combat à son premier tour : ces dégâts s'arrêtent à un point.",
				["it"] = "Nessuno può vincere o perdere una battaglia al primo turno: quel danno si ferma a un punto.",
				["de"] = "Niemand kann einen Kampf in seinem ersten Zug gewinnen oder verlieren: Der Schaden stoppt einen Punkt davor.",
				["es"] = "Nadie puede ganar ni perder un combate en su primer turno: ese daño se queda a uno.",
				["pt"] = "Ninguém pode vencer ou perder uma batalha no primeiro turno: esse dano para a um ponto.",
				["tr"] = "Kimse ilk turunda bir savaşı kazanamaz ya da kaybedemez: o hasar bir eksikte durur.",
				["ru"] = "Никто не может выиграть или проиграть бой в свой первый ход: урон останавливается за одно очко.",
				["ja"] = "最初のターンでは誰もバトルに勝つことも負けることもできない。そのダメージはあと1つで止まる。",
				["ko"] = "누구도 첫 턴에 전투를 이기거나 질 수 없다. 그 피해는 1 모자라게 멈춘다.",
				["zhcn"] = "任何一方都无法在自己的第一回合赢下或输掉战斗:伤害会停在差一点的位置。",
				["zhtw"] = "任何一方都無法在自己的第一回合贏下或輸掉戰鬥:傷害會停在差一點的位置。"
			},
			["No Phase Turn Kill"] = new Dictionary<string, string>
			{
				["fr"] = "Pas de victoire au premier tour de phase",
				["it"] = "Niente vittoria al primo turno di fase",
				["de"] = "Kein Sieg im ersten Phasenzug",
				["es"] = "Sin victoria en el primer turno de fase",
				["pt"] = "Sem vitória no primeiro turno da fase",
				["tr"] = "Aşamanın İlk Turunda Zafer Yok",
				["ru"] = "Без победы в первый ход фазы",
				["ja"] = "フェーズ初手決着禁止",
				["ko"] = "페이즈 첫 턴 결판 금지",
				["zhcn"] = "禁止阶段首回合决胜",
				["zhtw"] = "禁止階段首回合決勝"
			},
			["Nobody can win or lose a boss phase on their first turn after the scales reset."] = new Dictionary<string, string>
			{
				["fr"] = "Personne ne peut gagner ou perdre une phase de boss à son premier tour après la remise à zéro de la balance.",
				["it"] = "Nessuno può vincere o perdere una fase del boss al primo turno dopo l'azzeramento della bilancia.",
				["de"] = "Niemand kann eine Bossphase im ersten Zug nach dem Zurücksetzen der Waage gewinnen oder verlieren.",
				["es"] = "Nadie puede ganar ni perder una fase de jefe en su primer turno tras reiniciarse la balanza.",
				["pt"] = "Ninguém pode vencer ou perder uma fase de chefe no primeiro turno depois que a balança zera.",
				["tr"] = "Kimse terazi sıfırlandıktan sonraki ilk turunda bir patron aşamasını kazanamaz ya da kaybedemez.",
				["ru"] = "Никто не может выиграть или проиграть фазу босса в свой первый ход после сброса весов.",
				["ja"] = "天秤がリセットされた後の最初のターンでは、誰もボスのフェーズに勝つことも負けることもできない。",
				["ko"] = "저울이 초기화된 뒤 첫 턴에는 누구도 보스 페이즈를 이기거나 질 수 없다.",
				["zhcn"] = "天平重置后的第一回合,任何一方都无法赢下或输掉首领阶段。",
				["zhtw"] = "天平重置後的第一回合,任何一方都無法贏下或輸掉首領階段。"
			},
			["Canine Only"] = new Dictionary<string, string>
			{
				["fr"] = "Canidés uniquement",
				["it"] = "Solo canidi",
				["de"] = "Nur Hunde",
				["es"] = "Solo caninos",
				["pt"] = "Só Caninos",
				["tr"] = "Yalnızca Köpekgiller",
				["ru"] = "Только псовые",
				["ja"] = "イヌ科のみ",
				["ko"] = "갯과만",
				["zhcn"] = "仅限犬科",
				["zhtw"] = "僅限犬科"
			},
			["Only Canine cards are offered to you."] = new Dictionary<string, string>
			{
				["fr"] = "On ne vous propose que des cartes Canidé.",
				["it"] = "Ti vengono offerte solo carte Canide.",
				["de"] = "Dir werden nur Hunde-Karten angeboten.",
				["es"] = "Solo se te ofrecen cartas Canino.",
				["pt"] = "Só lhe oferecem cartas Canino.",
				["tr"] = "Sana yalnızca Köpekgil kartları sunulur.",
				["ru"] = "Вам предлагают только карты псовых.",
				["ja"] = "提示されるのはイヌ科のカードだけ。",
				["ko"] = "갯과 카드만 제시된다.",
				["zhcn"] = "只会向你提供犬科卡牌。",
				["zhtw"] = "只會向你提供犬科卡牌。"
			},
			["Avian Only"] = new Dictionary<string, string>
			{
				["fr"] = "Oiseaux uniquement",
				["it"] = "Solo uccelli",
				["de"] = "Nur Vögel",
				["es"] = "Solo aves",
				["pt"] = "Só Aves",
				["tr"] = "Yalnızca Kuşlar",
				["ru"] = "Только птицы",
				["ja"] = "鳥類のみ",
				["ko"] = "조류만",
				["zhcn"] = "仅限鸟类",
				["zhtw"] = "僅限鳥類"
			},
			["Only Avian cards are offered to you."] = new Dictionary<string, string>
			{
				["fr"] = "On ne vous propose que des cartes Oiseau.",
				["it"] = "Ti vengono offerte solo carte Uccello.",
				["de"] = "Dir werden nur Vogel-Karten angeboten.",
				["es"] = "Solo se te ofrecen cartas Ave.",
				["pt"] = "Só lhe oferecem cartas Ave.",
				["tr"] = "Sana yalnızca Kuş kartları sunulur.",
				["ru"] = "Вам предлагают только карты птиц.",
				["ja"] = "提示されるのは鳥類のカードだけ。",
				["ko"] = "조류 카드만 제시된다.",
				["zhcn"] = "只会向你提供鸟类卡牌。",
				["zhtw"] = "只會向你提供鳥類卡牌。"
			},
			["Insect Only"] = new Dictionary<string, string>
			{
				["fr"] = "Insectes uniquement",
				["it"] = "Solo insetti",
				["de"] = "Nur Insekten",
				["es"] = "Solo insectos",
				["pt"] = "Só Insetos",
				["tr"] = "Yalnızca Böcekler",
				["ru"] = "Только насекомые",
				["ja"] = "昆虫のみ",
				["ko"] = "곤충만",
				["zhcn"] = "仅限昆虫",
				["zhtw"] = "僅限昆蟲"
			},
			["Only Insect cards are offered to you."] = new Dictionary<string, string>
			{
				["fr"] = "On ne vous propose que des cartes Insecte.",
				["it"] = "Ti vengono offerte solo carte Insetto.",
				["de"] = "Dir werden nur Insekten-Karten angeboten.",
				["es"] = "Solo se te ofrecen cartas Insecto.",
				["pt"] = "Só lhe oferecem cartas Inseto.",
				["tr"] = "Sana yalnızca Böcek kartları sunulur.",
				["ru"] = "Вам предлагают только карты насекомых.",
				["ja"] = "提示されるのは昆虫のカードだけ。",
				["ko"] = "곤충 카드만 제시된다.",
				["zhcn"] = "只会向你提供昆虫卡牌。",
				["zhtw"] = "只會向你提供昆蟲卡牌。"
			},
			["Reptile Only"] = new Dictionary<string, string>
			{
				["fr"] = "Reptiles uniquement",
				["it"] = "Solo rettili",
				["de"] = "Nur Reptilien",
				["es"] = "Solo reptiles",
				["pt"] = "Só Répteis",
				["tr"] = "Yalnızca Sürüngenler",
				["ru"] = "Только рептилии",
				["ja"] = "爬虫類のみ",
				["ko"] = "파충류만",
				["zhcn"] = "仅限爬行类",
				["zhtw"] = "僅限爬行類"
			},
			["Only Reptile cards are offered to you."] = new Dictionary<string, string>
			{
				["fr"] = "On ne vous propose que des cartes Reptile.",
				["it"] = "Ti vengono offerte solo carte Rettile.",
				["de"] = "Dir werden nur Reptilien-Karten angeboten.",
				["es"] = "Solo se te ofrecen cartas Reptil.",
				["pt"] = "Só lhe oferecem cartas Réptil.",
				["tr"] = "Sana yalnızca Sürüngen kartları sunulur.",
				["ru"] = "Вам предлагают только карты рептилий.",
				["ja"] = "提示されるのは爬虫類のカードだけ。",
				["ko"] = "파충류 카드만 제시된다.",
				["zhcn"] = "只会向你提供爬行类卡牌。",
				["zhtw"] = "只會向你提供爬行類卡牌。"
			},
			["Hooved Only"] = new Dictionary<string, string>
			{
				["fr"] = "Ongulés uniquement",
				["it"] = "Solo ungulati",
				["de"] = "Nur Huftiere",
				["es"] = "Solo ungulados",
				["pt"] = "Só Cascos",
				["tr"] = "Yalnızca Toynaklılar",
				["ru"] = "Только копытные",
				["ja"] = "有蹄類のみ",
				["ko"] = "발굽 동물만",
				["zhcn"] = "仅限有蹄类",
				["zhtw"] = "僅限有蹄類"
			},
			["Only Hooved cards are offered to you."] = new Dictionary<string, string>
			{
				["fr"] = "On ne vous propose que des cartes Ongulé.",
				["it"] = "Ti vengono offerte solo carte Ungulato.",
				["de"] = "Dir werden nur Huftier-Karten angeboten.",
				["es"] = "Solo se te ofrecen cartas Ungulado.",
				["pt"] = "Só lhe oferecem cartas com Cascos.",
				["tr"] = "Sana yalnızca Toynaklı kartları sunulur.",
				["ru"] = "Вам предлагают только карты копытных.",
				["ja"] = "提示されるのは有蹄類のカードだけ。",
				["ko"] = "발굽 동물 카드만 제시된다.",
				["zhcn"] = "只会向你提供有蹄类卡牌。",
				["zhtw"] = "只會向你提供有蹄類卡牌。"
			},
			["No Tribe Only"] = new Dictionary<string, string>
			{
				["fr"] = "Sans tribu uniquement",
				["it"] = "Solo senza tribù",
				["de"] = "Nur ohne Stamm",
				["es"] = "Solo sin tribu",
				["pt"] = "Só Sem Tribo",
				["tr"] = "Yalnızca Kabilesizler",
				["ru"] = "Только без племени",
				["ja"] = "種族なしのみ",
				["ko"] = "부족 없음만",
				["zhcn"] = "仅限无族群",
				["zhtw"] = "僅限無族群"
			},
			["Only cards without a tribe are offered to you."] = new Dictionary<string, string>
			{
				["fr"] = "On ne vous propose que des cartes sans tribu.",
				["it"] = "Ti vengono offerte solo carte senza tribù.",
				["de"] = "Dir werden nur Karten ohne Stamm angeboten.",
				["es"] = "Solo se te ofrecen cartas sin tribu.",
				["pt"] = "Só lhe oferecem cartas sem tribo.",
				["tr"] = "Sana yalnızca kabilesi olmayan kartlar sunulur.",
				["ru"] = "Вам предлагают только карты без племени.",
				["ja"] = "提示されるのは種族のないカードだけ。",
				["ko"] = "부족이 없는 카드만 제시된다.",
				["zhcn"] = "只会向你提供没有族群的卡牌。",
				["zhtw"] = "只會向你提供沒有族群的卡牌。"
			},
			["1 Blood Only"] = new Dictionary<string, string>
			{
				["fr"] = "1 sang uniquement",
				["it"] = "Solo 1 sangue",
				["de"] = "Nur 1 Blut",
				["es"] = "Solo 1 de sangre",
				["pt"] = "Só 1 de Sangue",
				["tr"] = "Yalnızca 1 Kan",
				["ru"] = "Только 1 крови",
				["ja"] = "血1のみ",
				["ko"] = "피 1만",
				["zhcn"] = "仅限1血",
				["zhtw"] = "僅限1血"
			},
			["Only cards costing 1 Blood are offered to you."] = new Dictionary<string, string>
			{
				["fr"] = "On ne vous propose que des cartes coûtant 1 sang.",
				["it"] = "Ti vengono offerte solo carte che costano 1 sangue.",
				["de"] = "Dir werden nur Karten angeboten, die 1 Blut kosten.",
				["es"] = "Solo se te ofrecen cartas que cuestan 1 de sangre.",
				["pt"] = "Só lhe oferecem cartas que custam 1 de sangue.",
				["tr"] = "Sana yalnızca 1 Kan değerindeki kartlar sunulur.",
				["ru"] = "Вам предлагают только карты стоимостью 1 крови.",
				["ja"] = "提示されるのはコストが血1のカードだけ。",
				["ko"] = "피 1 비용의 카드만 제시된다.",
				["zhcn"] = "只会向你提供消耗1点鲜血的卡牌。",
				["zhtw"] = "只會向你提供消耗1點鮮血的卡牌。"
			},
			["2 Blood Only"] = new Dictionary<string, string>
			{
				["fr"] = "2 sang uniquement",
				["it"] = "Solo 2 sangue",
				["de"] = "Nur 2 Blut",
				["es"] = "Solo 2 de sangre",
				["pt"] = "Só 2 de Sangue",
				["tr"] = "Yalnızca 2 Kan",
				["ru"] = "Только 2 крови",
				["ja"] = "血2のみ",
				["ko"] = "피 2만",
				["zhcn"] = "仅限2血",
				["zhtw"] = "僅限2血"
			},
			["Only cards costing 2 Blood are offered to you."] = new Dictionary<string, string>
			{
				["fr"] = "On ne vous propose que des cartes coûtant 2 sang.",
				["it"] = "Ti vengono offerte solo carte che costano 2 sangue.",
				["de"] = "Dir werden nur Karten angeboten, die 2 Blut kosten.",
				["es"] = "Solo se te ofrecen cartas que cuestan 2 de sangre.",
				["pt"] = "Só lhe oferecem cartas que custam 2 de sangue.",
				["tr"] = "Sana yalnızca 2 Kan değerindeki kartlar sunulur.",
				["ru"] = "Вам предлагают только карты стоимостью 2 крови.",
				["ja"] = "提示されるのはコストが血2のカードだけ。",
				["ko"] = "피 2 비용의 카드만 제시된다.",
				["zhcn"] = "只会向你提供消耗2点鲜血的卡牌。",
				["zhtw"] = "只會向你提供消耗2點鮮血的卡牌。"
			},
			["3 Blood Only"] = new Dictionary<string, string>
			{
				["fr"] = "3 sang uniquement",
				["it"] = "Solo 3 sangue",
				["de"] = "Nur 3 Blut",
				["es"] = "Solo 3 de sangre",
				["pt"] = "Só 3 de Sangue",
				["tr"] = "Yalnızca 3 Kan",
				["ru"] = "Только 3 крови",
				["ja"] = "血3のみ",
				["ko"] = "피 3만",
				["zhcn"] = "仅限3血",
				["zhtw"] = "僅限3血"
			},
			["Only cards costing 3 Blood are offered to you."] = new Dictionary<string, string>
			{
				["fr"] = "On ne vous propose que des cartes coûtant 3 sang.",
				["it"] = "Ti vengono offerte solo carte che costano 3 sangue.",
				["de"] = "Dir werden nur Karten angeboten, die 3 Blut kosten.",
				["es"] = "Solo se te ofrecen cartas que cuestan 3 de sangre.",
				["pt"] = "Só lhe oferecem cartas que custam 3 de sangue.",
				["tr"] = "Sana yalnızca 3 Kan değerindeki kartlar sunulur.",
				["ru"] = "Вам предлагают только карты стоимостью 3 крови.",
				["ja"] = "提示されるのはコストが血3のカードだけ。",
				["ko"] = "피 3 비용의 카드만 제시된다.",
				["zhcn"] = "只会向你提供消耗3点鲜血的卡牌。",
				["zhtw"] = "只會向你提供消耗3點鮮血的卡牌。"
			},
			["4 Blood Only"] = new Dictionary<string, string>
			{
				["fr"] = "4 sang uniquement",
				["it"] = "Solo 4 sangue",
				["de"] = "Nur 4 Blut",
				["es"] = "Solo 4 de sangre",
				["pt"] = "Só 4 de Sangue",
				["tr"] = "Yalnızca 4 Kan",
				["ru"] = "Только 4 крови",
				["ja"] = "血4のみ",
				["ko"] = "피 4만",
				["zhcn"] = "仅限4血",
				["zhtw"] = "僅限4血"
			},
			["Only cards costing 4 Blood are offered to you."] = new Dictionary<string, string>
			{
				["fr"] = "On ne vous propose que des cartes coûtant 4 sang.",
				["it"] = "Ti vengono offerte solo carte che costano 4 sangue.",
				["de"] = "Dir werden nur Karten angeboten, die 4 Blut kosten.",
				["es"] = "Solo se te ofrecen cartas que cuestan 4 de sangre.",
				["pt"] = "Só lhe oferecem cartas que custam 4 de sangue.",
				["tr"] = "Sana yalnızca 4 Kan değerindeki kartlar sunulur.",
				["ru"] = "Вам предлагают только карты стоимостью 4 крови.",
				["ja"] = "提示されるのはコストが血4のカードだけ。",
				["ko"] = "피 4 비용의 카드만 제시된다.",
				["zhcn"] = "只会向你提供消耗4点鲜血的卡牌。",
				["zhtw"] = "只會向你提供消耗4點鮮血的卡牌。"
			},
			["Bones Only"] = new Dictionary<string, string>
			{
				["fr"] = "Os uniquement",
				["it"] = "Solo ossa",
				["de"] = "Nur Knochen",
				["es"] = "Solo huesos",
				["pt"] = "Só Ossos",
				["tr"] = "Yalnızca Kemik",
				["ru"] = "Только кости",
				["ja"] = "骨のみ",
				["ko"] = "뼈만",
				["zhcn"] = "仅限骨头",
				["zhtw"] = "僅限骨頭"
			},
			["Only cards costing Bones are offered to you."] = new Dictionary<string, string>
			{
				["fr"] = "On ne vous propose que des cartes coûtant des os.",
				["it"] = "Ti vengono offerte solo carte che costano ossa.",
				["de"] = "Dir werden nur Karten angeboten, die Knochen kosten.",
				["es"] = "Solo se te ofrecen cartas que cuestan huesos.",
				["pt"] = "Só lhe oferecem cartas que custam ossos.",
				["tr"] = "Sana yalnızca Kemik değerindeki kartlar sunulur.",
				["ru"] = "Вам предлагают только карты, стоящие костей.",
				["ja"] = "提示されるのはコストが骨のカードだけ。",
				["ko"] = "뼈 비용의 카드만 제시된다.",
				["zhcn"] = "只会向你提供消耗骨头的卡牌。",
				["zhtw"] = "只會向你提供消耗骨頭的卡牌。"
			},
			["Free Only"] = new Dictionary<string, string>
			{
				["fr"] = "Gratuites uniquement",
				["it"] = "Solo gratuite",
				["de"] = "Nur kostenlos",
				["es"] = "Solo gratis",
				["pt"] = "Só Grátis",
				["tr"] = "Yalnızca Bedava",
				["ru"] = "Только бесплатные",
				["ja"] = "コストなしのみ",
				["ko"] = "무료만",
				["zhcn"] = "仅限免费",
				["zhtw"] = "僅限免費"
			},
			["Only free cards are offered to you."] = new Dictionary<string, string>
			{
				["fr"] = "On ne vous propose que des cartes gratuites.",
				["it"] = "Ti vengono offerte solo carte gratuite.",
				["de"] = "Dir werden nur kostenlose Karten angeboten.",
				["es"] = "Solo se te ofrecen cartas gratuitas.",
				["pt"] = "Só lhe oferecem cartas gratuitas.",
				["tr"] = "Sana yalnızca bedava kartlar sunulur.",
				["ru"] = "Вам предлагают только бесплатные карты.",
				["ja"] = "提示されるのはコストのないカードだけ。",
				["ko"] = "비용이 없는 카드만 제시된다.",
				["zhcn"] = "只会向你提供无消耗的卡牌。",
				["zhtw"] = "只會向你提供無消耗的卡牌。"
			},
			["One Squirrel"] = new Dictionary<string, string>
			{
				["fr"] = "Un seul écureuil",
				["it"] = "Un solo scoiattolo",
				["de"] = "Ein Eichhörnchen",
				["es"] = "Una ardilla",
				["pt"] = "Um Esquilo",
				["tr"] = "Tek Sincap",
				["ru"] = "Одна белка",
				["ja"] = "リス1匹",
				["ko"] = "다람쥐 한 마리",
				["zhcn"] = "一只松鼠",
				["zhtw"] = "一隻松鼠"
			},
			["After your opening hand, only one Squirrel is left to draw."] = new Dictionary<string, string>
			{
				["fr"] = "Après votre main de départ, il ne reste qu'un écureuil à piocher.",
				["it"] = "Dopo la mano iniziale resta un solo scoiattolo da pescare.",
				["de"] = "Nach deiner Starthand bleibt nur ein Eichhörnchen zum Ziehen übrig.",
				["es"] = "Tras tu mano inicial, solo queda una ardilla por robar.",
				["pt"] = "Depois da mão inicial, só resta um esquilo para comprar.",
				["tr"] = "Başlangıç elinden sonra çekilecek tek bir sincap kalır.",
				["ru"] = "После стартовой руки в колоде остаётся только одна белка.",
				["ja"] = "最初の手札の後、引けるリスは1匹しか残らない。",
				["ko"] = "시작 패 이후 뽑을 다람쥐가 한 마리만 남는다.",
				["zhcn"] = "起手之后,只剩一只松鼠可以抽。",
				["zhtw"] = "起手之後,只剩一隻松鼠可以抽。"
			},
			["Two Squirrels"] = new Dictionary<string, string>
			{
				["fr"] = "Deux écureuils",
				["it"] = "Due scoiattoli",
				["de"] = "Zwei Eichhörnchen",
				["es"] = "Dos ardillas",
				["pt"] = "Dois Esquilos",
				["tr"] = "İki Sincap",
				["ru"] = "Две белки",
				["ja"] = "リス2匹",
				["ko"] = "다람쥐 두 마리",
				["zhcn"] = "两只松鼠",
				["zhtw"] = "兩隻松鼠"
			},
			["Your opening hand has a second Squirrel."] = new Dictionary<string, string>
			{
				["fr"] = "Votre main de départ contient un deuxième écureuil.",
				["it"] = "La tua mano iniziale ha un secondo scoiattolo.",
				["de"] = "Deine Starthand enthält ein zweites Eichhörnchen.",
				["es"] = "Tu mano inicial tiene una segunda ardilla.",
				["pt"] = "Sua mão inicial tem um segundo esquilo.",
				["tr"] = "Başlangıç elinde ikinci bir sincap olur.",
				["ru"] = "В стартовой руке есть вторая белка.",
				["ja"] = "最初の手札にリスがもう1匹加わる。",
				["ko"] = "시작 패에 다람쥐가 한 마리 더 있다.",
				["zhcn"] = "起手多一只松鼠。",
				["zhtw"] = "起手多一隻松鼠。"
			},
			["No Bone Altar"] = new Dictionary<string, string>
			{
				["fr"] = "Pas d'autel d'os",
				["it"] = "Niente altare d'ossa",
				["de"] = "Kein Knochenaltar",
				["es"] = "Sin altar de huesos",
				["pt"] = "Sem Altar de Ossos",
				["tr"] = "Kemik Sunağı Yok",
				["ru"] = "Без костяного алтаря",
				["ja"] = "骨の祭壇なし",
				["ko"] = "뼈 제단 없음",
				["zhcn"] = "没有骨祭坛",
				["zhtw"] = "沒有骨祭壇"
			},
			["The bone altar does nothing."] = new Dictionary<string, string>
			{
				["fr"] = "L'autel d'os ne fait rien.",
				["it"] = "L'altare d'ossa non fa nulla.",
				["de"] = "Der Knochenaltar bewirkt nichts.",
				["es"] = "El altar de huesos no hace nada.",
				["pt"] = "O altar de ossos não faz nada.",
				["tr"] = "Kemik sunağı hiçbir şey yapmaz.",
				["ru"] = "Костяной алтарь ничего не делает.",
				["ja"] = "骨の祭壇は何もしない。",
				["ko"] = "뼈 제단은 아무것도 하지 않는다.",
				["zhcn"] = "骨祭坛毫无作用。",
				["zhtw"] = "骨祭壇毫無作用。"
			},
			["No Mysterious Stones"] = new Dictionary<string, string>
			{
				["fr"] = "Pas de pierres mystérieuses",
				["it"] = "Niente pietre misteriose",
				["de"] = "Keine mysteriösen Steine",
				["es"] = "Sin piedras misteriosas",
				["pt"] = "Sem Pedras Misteriosas",
				["tr"] = "Gizemli Taşlar Yok",
				["ru"] = "Без таинственных камней",
				["ja"] = "謎の石なし",
				["ko"] = "신비한 돌 없음",
				["zhcn"] = "没有神秘石头",
				["zhtw"] = "沒有神秘石頭"
			},
			["The mysterious stones do nothing."] = new Dictionary<string, string>
			{
				["fr"] = "Les pierres mystérieuses ne font rien.",
				["it"] = "Le pietre misteriose non fanno nulla.",
				["de"] = "Die mysteriösen Steine bewirken nichts.",
				["es"] = "Las piedras misteriosas no hacen nada.",
				["pt"] = "As pedras misteriosas não fazem nada.",
				["tr"] = "Gizemli taşlar hiçbir şey yapmaz.",
				["ru"] = "Таинственные камни ничего не делают.",
				["ja"] = "謎の石は何もしない。",
				["ko"] = "신비한 돌은 아무것도 하지 않는다.",
				["zhcn"] = "神秘石头毫无作用。",
				["zhtw"] = "神秘石頭毫無作用。"
			},
			["No Mycologists"] = new Dictionary<string, string>
			{
				["fr"] = "Pas de mycologues",
				["it"] = "Niente micologi",
				["de"] = "Keine Mykologen",
				["es"] = "Sin micólogos",
				["pt"] = "Sem Micologistas",
				["tr"] = "Mantarbilimciler Yok",
				["ru"] = "Без микологов",
				["ja"] = "菌類学者なし",
				["ko"] = "균류학자 없음",
				["zhcn"] = "没有真菌学家",
				["zhtw"] = "沒有真菌學家"
			},
			["The Mycologists do nothing."] = new Dictionary<string, string>
			{
				["fr"] = "Les mycologues ne font rien.",
				["it"] = "I micologi non fanno nulla.",
				["de"] = "Die Mykologen bewirken nichts.",
				["es"] = "Los micólogos no hacen nada.",
				["pt"] = "Os micologistas não fazem nada.",
				["tr"] = "Mantarbilimciler hiçbir şey yapmaz.",
				["ru"] = "Микологи ничего не делают.",
				["ja"] = "菌類学者は何もしない。",
				["ko"] = "균류학자는 아무것도 하지 않는다.",
				["zhcn"] = "真菌学家毫无作用。",
				["zhtw"] = "真菌學家毫無作用。"
			},
			["No Deck Trial"] = new Dictionary<string, string>
			{
				["fr"] = "Pas d'épreuve de deck",
				["it"] = "Niente prove del mazzo",
				["de"] = "Keine Deckprüfung",
				["es"] = "Sin pruebas de mazo",
				["pt"] = "Sem Prova do Baralho",
				["tr"] = "Deste Sınavı Yok",
				["ru"] = "Без испытаний колоды",
				["ja"] = "デッキの試練なし",
				["ko"] = "덱 시험 없음",
				["zhcn"] = "没有牌组试炼",
				["zhtw"] = "沒有牌組試煉"
			},
			["Deck trials do nothing."] = new Dictionary<string, string>
			{
				["fr"] = "Les épreuves de deck ne font rien.",
				["it"] = "Le prove del mazzo non fanno nulla.",
				["de"] = "Deckprüfungen bewirken nichts.",
				["es"] = "Las pruebas de mazo no hacen nada.",
				["pt"] = "As provas do baralho não fazem nada.",
				["tr"] = "Deste sınavları hiçbir şey yapmaz.",
				["ru"] = "Испытания колоды ничего не делают.",
				["ja"] = "デッキの試練は何もしない。",
				["ko"] = "덱 시험은 아무것도 하지 않는다.",
				["zhcn"] = "牌组试炼毫无作用。",
				["zhtw"] = "牌組試煉毫無作用。"
			},
			["No Consumables"] = new Dictionary<string, string>
			{
				["fr"] = "Pas de consommables",
				["it"] = "Niente consumabili",
				["de"] = "Keine Verbrauchsgüter",
				["es"] = "Sin consumibles",
				["pt"] = "Sem Consumíveis",
				["tr"] = "Sarf Malzemesi Yok",
				["ru"] = "Без расходников",
				["ja"] = "消耗品なし",
				["ko"] = "소모품 없음",
				["zhcn"] = "没有消耗品",
				["zhtw"] = "沒有消耗品"
			},
			["Item packs give you nothing."] = new Dictionary<string, string>
			{
				["fr"] = "Les sacs d'objets ne vous donnent rien.",
				["it"] = "Gli zaini di oggetti non ti danno nulla.",
				["de"] = "Gegenstandsbeutel geben dir nichts.",
				["es"] = "Las mochilas de objetos no te dan nada.",
				["pt"] = "As mochilas de itens não lhe dão nada.",
				["tr"] = "Eşya çantaları sana hiçbir şey vermez.",
				["ru"] = "Сумки с предметами ничего не дают.",
				["ja"] = "アイテムの袋からは何も得られない。",
				["ko"] = "아이템 꾸러미는 아무것도 주지 않는다.",
				["zhcn"] = "物品背包什么也不给你。",
				["zhtw"] = "物品背包什麼也不給你。"
			},
			["No Campfire"] = new Dictionary<string, string>
			{
				["fr"] = "Pas de feu de camp",
				["it"] = "Niente falò",
				["de"] = "Kein Lagerfeuer",
				["es"] = "Sin hogueras",
				["pt"] = "Sem Fogueira",
				["tr"] = "Kamp Ateşi Yok",
				["ru"] = "Без костра",
				["ja"] = "焚き火なし",
				["ko"] = "모닥불 없음",
				["zhcn"] = "没有篝火",
				["zhtw"] = "沒有篝火"
			},
			["Campfires do nothing."] = new Dictionary<string, string>
			{
				["fr"] = "Les feux de camp ne font rien.",
				["it"] = "I falò non fanno nulla.",
				["de"] = "Lagerfeuer bewirken nichts.",
				["es"] = "Las hogueras no hacen nada.",
				["pt"] = "As fogueiras não fazem nada.",
				["tr"] = "Kamp ateşleri hiçbir şey yapmaz.",
				["ru"] = "Костры ничего не делают.",
				["ja"] = "焚き火は何もしない。",
				["ko"] = "모닥불은 아무것도 하지 않는다.",
				["zhcn"] = "篝火毫无作用。",
				["zhtw"] = "篝火毫無作用。"
			},
			["No Buy Pelts"] = new Dictionary<string, string>
			{
				["fr"] = "Pas d'achat de fourrures",
				["it"] = "Niente acquisto di pelli",
				["de"] = "Kein Fellkauf",
				["es"] = "Sin comprar pieles",
				["pt"] = "Sem Comprar Peles",
				["tr"] = "Post Satın Alma Yok",
				["ru"] = "Без покупки шкур",
				["ja"] = "皮の購入なし",
				["ko"] = "가죽 구매 없음",
				["zhcn"] = "没有购买皮草",
				["zhtw"] = "沒有購買皮草"
			},
			["The Trapper does nothing."] = new Dictionary<string, string>
			{
				["fr"] = "Le Trappeur ne fait rien.",
				["it"] = "Il Cacciatore non fa nulla.",
				["de"] = "Der Fallensteller bewirkt nichts.",
				["es"] = "El Trampero no hace nada.",
				["pt"] = "O Caçador não faz nada.",
				["tr"] = "Tuzakçı hiçbir şey yapmaz.",
				["ru"] = "Охотник ничего не делает.",
				["ja"] = "罠師は何もしない。",
				["ko"] = "덫사냥꾼은 아무것도 하지 않는다.",
				["zhcn"] = "猎人毫无作用。",
				["zhtw"] = "獵人毫無作用。"
			},
			["No Trade Pelts"] = new Dictionary<string, string>
			{
				["fr"] = "Pas d'échange de fourrures",
				["it"] = "Niente scambio di pelli",
				["de"] = "Kein Felltausch",
				["es"] = "Sin trueque de pieles",
				["pt"] = "Sem Trocar Peles",
				["tr"] = "Post Takası Yok",
				["ru"] = "Без обмена шкур",
				["ja"] = "皮の取引なし",
				["ko"] = "가죽 거래 없음",
				["zhcn"] = "没有交易皮草",
				["zhtw"] = "沒有交易皮草"
			},
			["The Trader does nothing."] = new Dictionary<string, string>
			{
				["fr"] = "Le Marchand ne fait rien.",
				["it"] = "Il Mercante non fa nulla.",
				["de"] = "Der Händler bewirkt nichts.",
				["es"] = "El Comerciante no hace nada.",
				["pt"] = "O Comerciante não faz nada.",
				["tr"] = "Tüccar hiçbir şey yapmaz.",
				["ru"] = "Торговец ничего не делает.",
				["ja"] = "商人は何もしない。",
				["ko"] = "상인은 아무것도 하지 않는다.",
				["zhcn"] = "商人毫无作用。",
				["zhtw"] = "商人毫無作用。"
			},
			["Totem Kinship"] = new Dictionary<string, string>
			{
				["fr"] = "Totem de parenté",
				["it"] = "Totem affine",
				["de"] = "Totem-Verwandtschaft",
				["es"] = "Tótem afín",
				["pt"] = "Totem Afim",
				["tr"] = "Totem Akrabalığı",
				["ru"] = "Родство тотема",
				["ja"] = "トーテムの絆",
				["ko"] = "토템 친족",
				["zhcn"] = "图腾亲缘",
				["zhtw"] = "圖騰親緣"
			},
			["The last totem head offered is a tribe from your deck."] = new Dictionary<string, string>
			{
				["fr"] = "La dernière tête de totem proposée est une tribu de votre deck.",
				["it"] = "L'ultima testa di totem offerta è una tribù del tuo mazzo.",
				["de"] = "Der letzte angebotene Totemkopf ist ein Stamm aus deinem Deck.",
				["es"] = "La última cabeza de tótem ofrecida es una tribu de tu mazo.",
				["pt"] = "A última cabeça de totem oferecida é uma tribo do seu baralho.",
				["tr"] = "Sunulan son totem başı destendeki bir kabiledir.",
				["ru"] = "Последняя предложенная голова тотема — племя из вашей колоды.",
				["ja"] = "最後に提示されるトーテムの頭は、デッキにある種族になる。",
				["ko"] = "마지막으로 제시되는 토템 머리는 덱에 있는 부족이다.",
				["zhcn"] = "最后提供的图腾头会是你牌组中的族群。",
				["zhtw"] = "最後提供的圖騰頭會是你牌組中的族群。"
			}
		};
	}
	[HarmonyPatch(typeof(BuyPeltsSequencer))]
	internal static class TrapperPatches
	{
		private static bool PeltsRejected()
		{
			CardFilter cardFilter = GameCards.CurrentFilter();
			if (!cardFilter.IsActive)
			{
				return false;
			}
			CardInfo val = ScriptableObjectLoader<CardInfo>.AllData.Find((CardInfo c) => ((Object)c).name == "PeltHare");
			if ((Object)(object)val != (Object)null)
			{
				return !cardFilter.Passes(GameCards.Traits(val));
			}
			return false;
		}

		[HarmonyPostfix]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		private static void FilterPrices(ref int[] __result)
		{
			if (__result != null && PeltsRejected())
			{
				__result = TrapperRules.Prices(__result, peltsPass: false);
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("CreatePelt")]
		private static void SellFiller(BuyPeltsSequencer __instance, int index)
		{
			if (PeltsRejected())
			{
				List<SelectableCard> value = Traverse.Create((object)__instance).Field("peltsForSale").GetValue<List<SelectableCard>>();
				if (value != null && index >= 0 && index < value.Count && !((Object)(object)value[index] == (Object)null))
				{
					((Card)value[index]).SetInfo(GameCards.MakeFiller());
					GameCards.ShowFilterActivation();
				}
			}
		}
	}
	[HarmonyPatch]
	internal static class OneSquirrelPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		private static void CutSideDeck(ref List<CardInfo> __result)
		{
			if (__result != null && Challenges.IsActive(ChallengeKey.OneSquirrel))
			{
				__result = TrapperRules.CutSideDeck(__result, HandRules.OpeningSquirrels(Challenges.IsActive(ChallengeKey.TwoSquirrels)));
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(CardDrawPiles3D), "DrawOpeningHand")]
		private static void ShowIcon(CardDrawPiles3D __instance)
		{
			if (__instance is Part1CardDrawPiles)
			{
				Challenges.ShowActivation(ChallengeKey.OneSquirrel);
			}
		}
	}
	public static class TrapperRules
	{
		public static int[] Prices(int[] vanillaPrices, bool peltsPass)
		{
			if (!peltsPass)
			{
				return vanillaPrices.Select((int _) => vanillaPrices[0]).ToArray();
			}
			return vanillaPrices.ToArray();
		}

		public static List<T> CutSideDeck<T>(List<T> deck, int openingSquirrels)
		{
			return deck.Take(openingSquirrels + 1).ToList();
		}
	}
}