示例#1
0
		protected override ChoiceResult Decide_CardGain(Choice choice, CardGainEventArgs cgea, IEnumerable<Type> cardTriggerTypes)
		{
			// Always reveal & trash this if we don't have 2 or more in hand
			if (choice.PlayerSource != this && cardTriggerTypes.Contains(Cards.Hinterlands.TypeClass.FoolsGold))
			{
				if (this.RealThis.Hand[Cards.Hinterlands.TypeClass.FoolsGold].Count < 2)
					return new ChoiceResult(new List<String>() { cgea.Actions[Cards.Hinterlands.TypeClass.FoolsGold].Text });
			}

			// Always reveal Trader when Gaining a Curse or Copper -- Silver (or even nothing) is better anyway
			// This should happen before Watchtower -- we'll assume that gaining a Silver is better
			// than trashing the Curse or Copper
			if (cardTriggerTypes.Contains(Cards.Hinterlands.TypeClass.Trader))
			{
				if (choice.CardTriggers[0].Category == Category.Curse || choice.CardTriggers[0].CardType == Cards.Universal.TypeClass.Copper)
					return new ChoiceResult(new List<String>() { cgea.Actions[Cards.Hinterlands.TypeClass.Trader].Text });
			}

			// Always put card on top of your deck
			if (cardTriggerTypes.Contains(Cards.Prosperity.TypeClass.RoyalSeal))
			{
				// Only put non-Curse & non-Victory-only cards on top of your deck
				if (choice.CardTriggers[0].Category != Category.Curse && 
					choice.CardTriggers[0].Category != Category.Victory && 
					choice.CardTriggers[0].CardType != Cards.Universal.TypeClass.Copper)
					return new ChoiceResult(new List<String>() { cgea.Actions[Cards.Prosperity.TypeClass.RoyalSeal].Text });
			}

			// Always reveal for Curse & Copper cards from a Watchtower (to trash)
			if (cardTriggerTypes.Contains(Cards.Prosperity.TypeClass.Watchtower))
			{
				if (choice.CardTriggers[0].Category != Category.Curse &&
					choice.CardTriggers[0].Category != Category.Victory &&
					choice.CardTriggers[0].CardType != Cards.Universal.TypeClass.Copper)
					return new ChoiceResult(new List<String>() { cgea.Actions[Cards.Prosperity.TypeClass.Watchtower].Text });
			}

			// Eh... it's an OK card, I guess... don't really want too many of them
			// Especially if we have lots of Action cards and very few +2 or more Action cards
			if (cardTriggerTypes.Contains(Cards.Hinterlands.TypeClass.Duchess))
			{
				double duchessMultipleActionCards = this.RealThis.CountAll(this.RealThis, c => (c.GroupMembership & Group.PlusMultipleActions) == Group.PlusMultipleActions, true, false);
				double duchessTotalActionCards = this.RealThis.CountAll(this.RealThis, c => (c.Category & Category.Action) == Category.Action, true, false);
				double duchessDuchesses = this.RealThis.CountAll(this.RealThis, c => c.CardType == Cards.Hinterlands.TypeClass.Duchess, true, false);
				double duchessTotalCards = this.RealThis.CountAll();

				if ((duchessTotalActionCards / duchessTotalCards) < 0.075 ||
					(duchessDuchesses / duchessTotalActionCards) < 0.20 ||
					(duchessMultipleActionCards / duchessTotalActionCards) > 0.33)
					return new ChoiceResult(new List<String>() { cgea.Actions[Cards.Hinterlands.TypeClass.Duchess].Text });
			}

			// Dunno what to do -- choose a random IsRequired one or nothing if there are none
			IEnumerable<CardGainAction> requiredActions = cgea.Actions.Select(kvp => kvp.Value).Where(a => a.IsRequired);
			if (requiredActions.Count() > 0)
			{
				int index = this._Game.RNG.Next(requiredActions.Count());
				return new ChoiceResult(new List<String>() { cgea.Actions[requiredActions.ElementAt(index).Card.CardType].Text });
			}

			return new ChoiceResult(new List<String>());
		}
示例#2
0
		protected override ChoiceResult Decide_CardGain(Choice choice, CardGainEventArgs cgea, IEnumerable<Type> cardTriggerTypes)
		{
			// Always put card on top of your deck
			if (cardTriggerTypes.Contains(Cards.Prosperity.TypeClass.RoyalSeal))
				return new ChoiceResult(new List<String>() { cgea.Actions[Cards.Prosperity.TypeClass.RoyalSeal].Text });

			// Always reveal for Curse & Copper cards from a Watchtower (to trash)
			if (cardTriggerTypes.Contains(Cards.Prosperity.TypeClass.Watchtower))
			{
				if (choice.CardTriggers[0].Category == Category.Curse || choice.CardTriggers[0].CardType == Cards.Universal.TypeClass.Copper)
					return new ChoiceResult(new List<String>() { cgea.Actions[Cards.Prosperity.TypeClass.Watchtower].Text });
			}

			return new ChoiceResult(new List<String>());
		}