Example #1
0
		public override void Play(Player player)
		{
			base.Play(player);
			player.BeginDrawing();
			while (player.Revealed[Category.Treasure].Count < 2 && player.CanDraw)
				player.Draw(DeckLocation.Revealed);

			player.EndDrawing();

			player.AddCardsToHand(player.RetrieveCardsFrom(DeckLocation.Revealed, c => (c.Category & Category.Treasure) == Category.Treasure));

			player.DiscardRevealed();
		}
Example #2
0
		public override void Play(Player player)
		{
			base.Play(player);

			Choice choiceCard = new Choice("Reveal a card from your hand to return up to 2 to the Supply.", this, player.Hand, player);
			ChoiceResult resultCard = player.MakeChoice(choiceCard);

			if (resultCard.Cards.Count > 0)
			{
				Card revealedCard = resultCard.Cards[0];
				player.AddCardInto(DeckLocation.Revealed, player.RetrieveCardFrom(DeckLocation.Hand, revealedCard));
				player.AddCardInto(DeckLocation.Hand, player.RetrieveCardFrom(DeckLocation.Revealed, revealedCard));

				Supply supply = player._Game.Table.FindSupplyPileByCard(revealedCard);
				if (supply != null)
				{
					List<String> options = new List<string>() { "0", "1" };
					if (player.Hand[revealedCard.CardType].Count > 1)
						options.Add("2");
					Choice choice = new Choice("How many would you like to return to the Supply?", this, new CardCollection() { revealedCard }, options, player);
					ChoiceResult result = player.MakeChoice(choice);

					int numberToReturn = int.Parse(result.Options[0]);
					if (numberToReturn > 0)
					{
						CardCollection cardsToReturn = player.RetrieveCardsFrom(DeckLocation.Hand, revealedCard.CardType, numberToReturn);
						player.Lose(cardsToReturn);
						supply.AddTo(cardsToReturn);
					}

					player._Game.SendMessage(player, this, supply, numberToReturn);
				}

				IEnumerator<Player> enumerator = player._Game.GetPlayersStartingWithEnumerator(player);
				enumerator.MoveNext();
				while (enumerator.MoveNext())
				{
					Player attackee = enumerator.Current;
					// Skip if the attack is blocked (Moat, Lighthouse, etc.)
					if (this.IsAttackBlocked[attackee])
						continue;

					if (supply != null && supply.CanGain() && supply.TopCard.Name == revealedCard.Name)
						attackee.Gain(supply);
				}
			}
		}
Example #3
0
		public override void Play(Player player)
		{
			base.Play(player);

			CardCollection newCards = player.Draw(1, DeckLocation.Revealed);

			player.AddCardsToHand(player.RetrieveCardsFrom(DeckLocation.Revealed, 
				c => (c.Category & Cards.Category.Curse) == Cards.Category.Curse ||
					(c.Category & Cards.Category.Ruins) == Cards.Category.Ruins ||
					(c.Category & Cards.Category.Shelter) == Cards.Category.Shelter ||
					(c.Category & Cards.Category.Victory) == Cards.Category.Victory
				));

			player.AddCardsToDeck(player.RetrieveCardsFrom(DeckLocation.Revealed), DeckPosition.Top);
		}
		public override void Play(Player player)
		{
			base.Play(player);

			Choice choiceTrash = new Choice("Choose a card to trash", this, player.Hand, player);
			ChoiceResult resultTrash = player.MakeChoice(choiceTrash);
			player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards));

			if (resultTrash.Cards.Count > 0)
			{
				player.Gain(player._Game.Table.Silver, player._Game.ComputeCost(resultTrash.Cards[0]).Coin.Value);
			}
		}
Example #5
0
		public override void Play(Player player)
		{
			base.Play(player);

			CardCollection newCards = player.Draw(2, DeckLocation.Private);

			if (newCards.Count > 0)
			{
				Choice choice = new Choice(
					String.Format("Do you want to discard {0} or put {1} back on top?", String.Join(" and ", newCards.Select(c => c.Name)), newCards.Count == 1 ? "it" : "them"),
					this,
					newCards,
					new List<string>() { "Discard", String.Format("Put {0} back", newCards.Count == 1 ? "it" : "them") },
					player);
				ChoiceResult result = player.MakeChoice(choice);
				if (result.Options[0] == "Discard")
					player.Discard(DeckLocation.Private);
				else
				{
					Choice replaceChoice = new Choice("Choose order of cards to put back on your deck", this, player.Private, player, true, 2, 2);
					ChoiceResult replaceResult = player.MakeChoice(replaceChoice);
					player.RetrieveCardsFrom(DeckLocation.Private);
					player.AddCardsToDeck(replaceResult.Cards, DeckPosition.Top);
				}
			}
		}
Example #6
0
		public override void Play(Player player)
		{
			base.Play(player);

			Choice choiceTrash = new Choice("Choose up to 4 cards to trash", this, player.Hand, player, false, 0, 4);
			ChoiceResult resultTrash = player.MakeChoice(choiceTrash);
			player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards));
		}
Example #7
0
		public override void Play(Player player)
		{
			base.Play(player);

			Choice choiceTrash = new Choice("Choose a card to trash", this, player.Hand, player);
			ChoiceResult resultTrash = player.MakeChoice(choiceTrash);
			player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards));

			if (resultTrash.Cards.Count > 0)
			{
				Cost trashedCardCost = player._Game.ComputeCost(resultTrash.Cards[0]);
				SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost <= (trashedCardCost + new Coin(2)));
				Choice choice = new Choice("Gain a card", this, gainableSupplies, player, false);
				ChoiceResult result = player.MakeChoice(choice);
				if (result.Supply != null)
					player.Gain(result.Supply);
			}
		}
Example #8
0
		public override void Play(Player player)
		{
			base.Play(player);

			Choice choiceTrash = new Choice("You may trash an Action card", this, player.Hand[Cards.Category.Action], player, false, 0, 1);
			ChoiceResult resultTrash = player.MakeChoice(choiceTrash);
			if (resultTrash.Cards.Count > 0)
			{
				player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards));
			}
			else if (player.InPlay.Contains(this.PhysicalCard))
			{
				player.Trash(player.RetrieveCardFrom(DeckLocation.InPlay, this.PhysicalCard));
			}
		}
Example #9
0
		public override void Play(Player player)
		{
			base.Play(player);

			Choice choiceTrash = new Choice("Choose a card to trash", this, player.Hand, player);
			ChoiceResult resultTrash = player.MakeChoice(choiceTrash);
			player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards));

			player.ReceiveBenefit(this, new CardBenefit()
			{
				Currency = new Currency(player._Game.Table.Trash.Where(card => 
					(card.Category & Cards.Category.Treasure) == Cards.Category.Treasure
					).GroupBy(card => card.Name).Count())
			});
		}
		internal void player_GainMandarin(Player player, ref Players.CardGainEventArgs e)
		{
			CardCollection cardsInPlay = new CardCollection(player.InPlay[Cards.Category.Treasure]);
			cardsInPlay.AddRange(player.SetAside[Cards.Category.Treasure]);
			Choice replaceChoice = new Choice("Choose order of Treasure cards to put back on your deck", this, cardsInPlay, player, true, cardsInPlay.Count, cardsInPlay.Count);
			ChoiceResult replaceResult = player.MakeChoice(replaceChoice);

			player.RetrieveCardsFrom(DeckLocation.InPlay, c => replaceResult.Cards.Contains(c));
			player.RetrieveCardsFrom(DeckLocation.SetAside, c => replaceResult.Cards.Contains(c));

			player.AddCardsToDeck(replaceResult.Cards, DeckPosition.Top);

			e.HandledBy.Add(TypeClass.Mandarin);

			// Clear out the Event Triggers -- this only happens when its Gained, so we don't care any more
			foreach (Player playerLoop in _CardGainedHandlers.Keys)
				playerLoop.CardGained -= _CardGainedHandlers[playerLoop];
			_CardGainedHandlers.Clear();
		}
Example #11
0
		public override void Play(Player player)
		{
			base.Play(player);

			Choice choice = new Choice("Choose one:", this, new CardCollection() { this }, new List<string>() { "Gain a card from the trash", "Trash an Action card from your hand" }, player);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Options.Contains("Gain a card from the trash"))
			{
				List<Cost> availableCosts = new List<Cost>() { new Cost(3), new Cost(4), new Cost(5), new Cost(6) };
				IEnumerable<Card> availableTrashCards = player._Game.Table.Trash.Where(c => availableCosts.Any(cost => player._Game.ComputeCost(c) == cost));

				Choice choiceFromTrash = new Choice("Choose a card to gain from the trash", this, availableTrashCards, player);
				ChoiceResult resultFromTrash = player.MakeChoice(choiceFromTrash);
				if (resultFromTrash.Cards.Count > 0)
				{
					player.Gain(player._Game.Table.Trash, resultFromTrash.Cards[0], DeckLocation.Deck, DeckPosition.Top);
				}
			}
			else
			{
				Choice choiceTrash = new Choice("Choose an Action card to trash", this, player.Hand[Cards.Category.Action], player);
				ChoiceResult resultTrash = player.MakeChoice(choiceTrash);
				player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards));

				if (resultTrash.Cards.Count > 0)
				{
					Cost trashedCardCost = player._Game.ComputeCost(resultTrash.Cards[0]);
					SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost <= (trashedCardCost + new Coin(3)));
					Choice choiceGain = new Choice("Gain a card", this, gainableSupplies, player, false);
					ChoiceResult resultGain = player.MakeChoice(choiceGain);
					if (resultGain.Supply != null)
						player.Gain(resultGain.Supply);
				}

			}
		}
		public override void Play(Player player)
		{
			base.Play(player);

			// Step 1
			player.Gain(player._Game.Table.Silver);

			// Step 2
			if (player.CanDraw)
			{
				Card card = player.Draw(DeckLocation.Private);
				Choice choice = new Choice(String.Format("Do you want to discard {0} or put it back on top?", card.Name), this, new CardCollection() { card }, new List<string>() { "Discard", "Put it back" }, player);
				ChoiceResult result = player.MakeChoice(choice);
				if (result.Options[0] == "Discard")
					player.Discard(DeckLocation.Private);
				else
					player.AddCardsToDeck(player.RetrieveCardsFrom(DeckLocation.Private), DeckPosition.Top);
			}

			// Step 3
			player.Draw(5 - player.Hand.Count, DeckLocation.Hand);

			// Step 4
			Choice choiceTrash = new Choice("You may trash a card", this, player.Hand[c => (c.Category & Category.Treasure) != Category.Treasure], player, false, 0, 1);
			ChoiceResult resultTrash = player.MakeChoice(choiceTrash);
			player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards));

		}
		public override void Play(Player player)
		{
			base.Play(player);

			Choice replaceChoice = new Choice("Choose a card to put back on your deck", this, player.Hand, player, false, 1, 1);
			ChoiceResult replaceResult = player.MakeChoice(replaceChoice);
			player.RetrieveCardsFrom(DeckLocation.Hand, replaceResult.Cards);
			player.AddCardsToDeck(replaceResult.Cards, DeckPosition.Top);
		}
		internal void player_BuyFarmland(Player player, ref Players.CardBuyEventArgs e)
		{
			Choice choiceTrash = new Choice("Choose a card to trash", this, player.Hand, player);
			ChoiceResult resultTrash = player.MakeChoice(choiceTrash);
			player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards));

			if (resultTrash.Cards.Count > 0)
			{
				Cost trashedCardCost = player._Game.ComputeCost(resultTrash.Cards[0]);
				SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost == (trashedCardCost + new Coin(2)));
				Choice choice = new Choice("Gain a card", this, gainableSupplies, player, false);
				ChoiceResult result = player.MakeChoice(choice);
				if (result.Supply != null)
					player.Gain(result.Supply);
			}

			e.HandledBy.Add(TypeClass.Farmland);

			// Clear out the Event Triggers -- this only happens when its Gained, so we don't care any more
			foreach (Player playerLoop in _CardBoughtHandlers.Keys)
				playerLoop.CardBought -= _CardBoughtHandlers[playerLoop];
			_CardBoughtHandlers.Clear();
		}
		public override void Play(Player player)
		{
			base.Play(player);

			Choice choiceTrash = new Choice("Choose a card to trash", this, player.Hand, player);
			ChoiceResult resultTrash = player.MakeChoice(choiceTrash);
			player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards));

			if (resultTrash.Cards.Count > 0)
			{
				Cost trashedCardCost = player._Game.ComputeCost(resultTrash.Cards[0]);

				SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply =>
					supply.CanGain() &&
					(supply.CurrentCost == (trashedCardCost + new Coin(1)) ||
						trashedCardCost.Coin > 0 && supply.CurrentCost == (trashedCardCost - new Coin(1))));

				Choice choice = new Choice("Gain a card to put on your deck", this, gainableSupplies, player, false);
				ChoiceResult result = player.MakeChoice(choice);
				if (result.Supply != null)
				{
					player.Gain(result.Supply, DeckLocation.Deck, DeckPosition.Top);

					if (!(result.Supply.CurrentCost <= trashedCardCost))
						gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && trashedCardCost.Coin > 0 &&
							supply.CurrentCost == (trashedCardCost - new Coin(1)));
					else
						gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost == (trashedCardCost + new Coin(1)));

					choice = new Choice("Gain a card to put on your deck", this, gainableSupplies, player, false);
					result = player.MakeChoice(choice);
					if (result.Supply != null)
						player.Gain(result.Supply, DeckLocation.Deck, DeckPosition.Top);
				}
			}
		}
		public override void Play(Player player)
		{
			base.Play(player);

			player.Draw(4, DeckLocation.Private);

			Choice choiceDiscard = new Choice("Choose cards to discard", this, player.Private, player, false, 0, player.Private.Count);
			ChoiceResult resultDiscard = player.MakeChoice(choiceDiscard);
			player.Discard(DeckLocation.Private, resultDiscard.Cards);

			Choice replaceChoice = new Choice("Choose order of cards to put back on your deck", this, player.Private, player, true, player.Private.Count, player.Private.Count);
			ChoiceResult replaceResult = player.MakeChoice(replaceChoice);
			player.AddCardsToDeck(player.RetrieveCardsFrom(DeckLocation.Private, replaceResult.Cards), DeckPosition.Top);
		}
Example #17
0
		public override void Play(Player player)
		{
			base.Play(player);

			player.Draw(3, DeckLocation.Revealed);

			CardCollection actionCards = player.Revealed[Cards.Category.Action];
			Choice replaceChoice = new Choice("Choose order of cards to put back on your deck", this, actionCards, player, true, actionCards.Count, actionCards.Count);
			ChoiceResult replaceResult = player.MakeChoice(replaceChoice);
			player.AddCardsToDeck(player.RetrieveCardsFrom(DeckLocation.Revealed, replaceResult.Cards), DeckPosition.Top);

			player.DiscardRevealed();
		}
Example #18
0
		public override void Play(Player player)
		{
			base.Play(player);

			if (player.CanDraw)
			{
				Card revealedCard = player.Draw(DeckLocation.Revealed);

				if (revealedCard != null)
				{
					Choice choice = new Choice(
						String.Format("Do you want to discard {0} or put it back on your deck?", revealedCard),
						this,
						new CardCollection() { this },
						new List<string>() { "Discard", "Put it back" },
						player);
					ChoiceResult result = player.MakeChoice(choice);
					if (result.Options.Contains("Discard"))
						player.DiscardRevealed();
					else
						player.AddCardsToDeck(player.RetrieveCardsFrom(DeckLocation.Revealed), DeckPosition.Top);

					CardBenefit benefit = new CardBenefit();

					if ((revealedCard.Category & Cards.Category.Action) == Cards.Category.Action)
						benefit.Actions = 1;
					if ((revealedCard.Category & Cards.Category.Treasure) == Cards.Category.Treasure)
						benefit.Currency += new Coin(1);
					if ((revealedCard.Category & Cards.Category.Victory) == Cards.Category.Victory)
						benefit.Cards = 1;

					player.ReceiveBenefit(this, benefit);
				}
			}
		}
Example #19
0
		public override void Play(Player player)
		{
			base.Play(player);

			Choice choiceTheFirst = new Choice("Choose one:", this, new CardCollection() { this }, new List<string>() { "Discard 2 cards", "Put a card on your deck", "Gain a Copper" }, player);
			ChoiceResult resultTheFirst = player.MakeChoice(choiceTheFirst);
			if (resultTheFirst.Options.Contains("Discard 2 cards"))
			{
				Choice choiceDiscard = new Choice("Discard 2 cards.", this, player.Hand, player, false, 2, 2);
				ChoiceResult resultDiscard = player.MakeChoice(choiceDiscard);
				player.Discard(DeckLocation.Hand, resultDiscard.Cards);
			}
			else if (resultTheFirst.Options.Contains("Put a card on your deck"))
			{
				Choice replaceChoice = new Choice("Choose a card to put back on your deck", this, player.Hand, player, false, 1, 1);
				ChoiceResult replaceResult = player.MakeChoice(replaceChoice);
				player.RetrieveCardsFrom(DeckLocation.Hand, replaceResult.Cards);
				player.AddCardsToDeck(replaceResult.Cards, DeckPosition.Top);
			}
			else
			{
				player.Gain(player._Game.Table.Copper);
			}

			Choice choiceTheSecond = new Choice("Choose one:", this, new CardCollection() { this }, new List<string>() { "+<coin>3</coin>", "Trash your hand", "Gain a Duchy" }, player);
			ChoiceResult resultTheSecond = player.MakeChoice(choiceTheSecond);
			if (resultTheSecond.Options.Contains("+<coin>3</coin>"))
			{
				player.ReceiveBenefit(this, new CardBenefit() { Currency = new Currency(3) });
			}
			else if (resultTheSecond.Options.Contains("Trash your hand"))
			{
				player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand));
			}
			else
			{
				player.Gain(player._Game.Table.Duchy);
			}
		}
Example #20
0
		public override void Play(Player player)
		{
			base.Play(player);

			Choice choice = Choice.CreateYesNoChoice("Do you want to trash 2 cards?", this, player);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Options[0] == "Yes")
			{
				Choice choiceTrash = new Choice("Choose 2 cards to trash", this, player.Hand, player, false, 2, 2);
				ChoiceResult resultTrash = player.MakeChoice(choiceTrash);
				player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards));

				if (resultTrash.Cards.Count == 2)
				{
					player.ReceiveBenefit(this, new CardBenefit() { Cards = 2, Currency = new Currency(2) });

					IEnumerator<Player> enumerator = player._Game.GetPlayersStartingWithEnumerator(player);
					enumerator.MoveNext();
					while (enumerator.MoveNext())
					{
						Player attackee = enumerator.Current;
						// Skip if the attack is blocked (Moat, Lighthouse, etc.)
						if (this.IsAttackBlocked[attackee])
							continue;

						Choice choiceDiscard = new Choice("Choose cards to discard.  You must discard down to 3 cards in hand", this, attackee.Hand, attackee, false, attackee.Hand.Count - 3, attackee.Hand.Count - 3);
						ChoiceResult resultDiscard = attackee.MakeChoice(choiceDiscard);
						attackee.Discard(DeckLocation.Hand, resultDiscard.Cards);
					}

				}
			}
		}
Example #21
0
		public override void Play(Player player)
		{
			base.Play(player);

			Choice choiceTrash = new Choice("Choose a card to trash", this, player.Hand, player);
			ChoiceResult resultTrash = player.MakeChoice(choiceTrash);
			player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards));

			SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost <= new Coin(5));
			Choice choice = new Choice("Gain a card costing up to <coin>5</coin>", this, gainableSupplies, player, false);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Supply != null)
				player.Gain(result.Supply);
		}
Example #22
0
		public override void Play(Player player)
		{
			base.Play(player);

			SupplyCollection availableSupplies = new SupplyCollection(player._Game.Table.Supplies.Where(kvp => kvp.Value.Randomizer != null && kvp.Value.Randomizer.GroupMembership != Group.None));
			CardCollection cards = new CardCollection();
			Choice choice = new Choice("Name a card", this, availableSupplies, player, false);
			foreach (Supply supply in player._Game.Table.Supplies.Values.Union(player._Game.Table.SpecialPiles.Values))
			{
				foreach (Type type in supply.CardTypes)
				{
					if (!choice.Supplies.Any(kvp => kvp.Value.CardType == type))
						cards.Add(Card.CreateInstance(type));
				}
			}
			cards.Sort();
			choice.AddCards(cards);

			ChoiceResult result = player.MakeChoice(choice);
			ICard namedCard = null;
			if (result.Supply != null)
				namedCard = result.Supply;
			else
				namedCard = result.Cards[0];

			player._Game.SendMessage(player, this, namedCard);
			if (player.CanDraw)
			{
				player.Draw(DeckLocation.Revealed);
				if (player.Revealed[namedCard.CardType].Count > 0)
				{
					player.AddCardsToHand(DeckLocation.Revealed);
				}
				else
				{
					player.AddCardsToDeck(player.RetrieveCardsFrom(DeckLocation.Revealed), DeckPosition.Top);
				}
			}
		}
Example #23
0
		public override void Play(Player player)
		{
			base.Play(player);
			Choice choice = Choice.CreateYesNoChoice("You may immediately put your deck into your discard pile.", this, this, player, null);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Options[0] == "Yes")
			{
				player._Game.SendMessage(player, this);
				CardCollection cc = player.RetrieveCardsFrom(DeckLocation.Deck);
				player.AddCardsInto(DeckLocation.Discard, cc);
			}
		}
Example #24
0
		public override void Play(Player player)
		{
			base.Play(player);
			// We're looking for 2 non-Golem Action cards
			player.BeginDrawing();
			while (player.Revealed[Category.Action].Count(c => c.CardType != Cards.Alchemy.TypeClass.Golem) < 2 && player.CanDraw)
				player.Draw(DeckLocation.Revealed);

			player.EndDrawing();

			player.Revealed.BeginChanges();
			CardCollection actions = player.Revealed[c => (c.Category & Category.Action) == Category.Action && c.CardType != Cards.Alchemy.TypeClass.Golem];
			player.DiscardRevealed(c => !actions.Contains(c));
			player.Revealed.EndChanges();

			CardCollection cardsToPlay = player.RetrieveCardsFrom(DeckLocation.Revealed);
			Choice choice = new Choice("Which card would you like to play first?", this, actions, player);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Cards.Count > 0)
			{
				actions.Remove(result.Cards[0]);

				// Play the first (selected) one
				player.AddCardInto(DeckLocation.Private, result.Cards[0]);
				player.Actions++;
				player.PlayCardInternal(result.Cards[0], "first");
			}
			else
				player.PlayNothing("first");

			if (actions.Count > 0)
			{
				// Play the other one
				player.AddCardInto(DeckLocation.Private, actions[0]);
				player.Actions++;
				player.PlayCardInternal(actions[0], "second");
			}
			else
				player.PlayNothing("second");
		}
Example #25
0
		public override void Play(Player player)
		{
			base.Play(player);
			CardCollection singleCopper = player.RetrieveCardsFrom(DeckLocation.Hand, Cards.Universal.TypeClass.Copper, 1);
			if (singleCopper.Count > 0)
			{
				player.Trash(singleCopper[0]);
				CardBenefit benefit = new CardBenefit();
				benefit.Currency += new Coin(3);
				player.ReceiveBenefit(this, benefit);
			}
		}
		internal void player_BuyMint(Player player, ref Players.CardBuyEventArgs e)
		{
			player.Trash(player.RetrieveCardsFrom(DeckLocation.InPlay, Category.Treasure));
			player.Trash(player.RetrieveCardsFrom(DeckLocation.SetAside, Category.Treasure));

			e.HandledBy.Add(TypeClass.Mint);

			// Clear out the Event Triggers -- this only happens when its Gained, so we don't care any more
			foreach (Player playerLoop in _CardBoughtHandlers.Keys)
				playerLoop.CardBought -= _CardBoughtHandlers[playerLoop];
			_CardBoughtHandlers.Clear();
		}
Example #27
0
		public override void Play(Player player)
		{
			base.Play(player);

			player.Gain(player._Game.Table[TypeClass.Rats]);

			CardCollection nonRats = player.Hand[c => c.CardType != TypeClass.Rats];
			if (nonRats.Count > 0)
			{
				Choice choiceTrash = new Choice("Choose a non-Rats card to trash", this, nonRats, player);
				ChoiceResult resultTrash = player.MakeChoice(choiceTrash);
				player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards));
			}
			else
			{
				player.ReturnHand(player.RevealHand());
			}
		}
		public override void Play(Player player)
		{
			base.Play(player);

			Choice choice = new Choice("Choose 2:", this, new CardCollection() { this }, new List<string>() { "+2<nbsp/>Cards", "+2<nbsp/>Actions", "+<coin>2</coin>", "Gain 4 Silvers & discard deck" }, player, null, false, 2, 2);
			ChoiceResult result = player.MakeChoice(choice);

			foreach (String option in result.Options)
			{
				CardBenefit benefit = new CardBenefit();
				if (option == "+2<nbsp/>Cards")
					benefit.Cards = 2;
				if (option == "+2<nbsp/>Actions")
					benefit.Actions += 2;
				if (option == "+<coin>2</coin>")
					benefit.Currency += new Coin(2);
				if (option == "Gain 4 Silvers & discard deck")
				{
					player.Gain(player._Game.Table.Silver, 4);

					player._Game.SendMessage(player, this);
					CardCollection cc = player.RetrieveCardsFrom(DeckLocation.Deck);
					player.AddCardsInto(DeckLocation.Discard, cc);
				}
				player.ReceiveBenefit(this, benefit);
			}
		}
Example #29
0
		public override void Play(Player player)
		{
			base.Play(player);

			CardCollection newCards = player.Draw(4, DeckLocation.Revealed);

			player.AddCardsToHand(player.RetrieveCardsFrom(DeckLocation.Revealed,
				c => c.CardType == Universal.TypeClass.Copper || c.CardType == Alchemy.TypeClass.Potion));

			Choice replaceChoice = new Choice("Choose order of cards to put back on your deck", this, player.Revealed, player, true, player.Revealed.Count, player.Revealed.Count);
			ChoiceResult replaceResult = player.MakeChoice(replaceChoice);
			player.RetrieveCardsFrom(DeckLocation.Revealed, replaceResult.Cards);
			player.AddCardsToDeck(replaceResult.Cards, DeckPosition.Top);
		}
Example #30
0
		public override void Play(Player player)
		{
			base.Play(player);
			Choice choice = Choice.CreateYesNoChoice("You may put your deck into your discard pile.", this, this, player, null);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Options[0] == "Yes")
			{
				player._Game.SendMessage(player, this);
				CardCollection cc = player.RetrieveCardsFrom(DeckLocation.Deck);
				player.AddCardsInto(DeckLocation.Discard, cc);
			}

			CardCollection cards = player.DiscardPile.LookThrough(c => true);
			Choice choiceTop = new Choice("Choose a card to put onto your deck", this, cards, player, false, 0, 1);
			ChoiceResult resultTop = player.MakeChoice(choiceTop);
			if (resultTop.Cards.Count > 0)
				player.AddCardsToDeck(player.DiscardPile.Retrieve(player, c => resultTop.Cards.Contains(c)), DeckPosition.Top);
		}