Example #1
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 #2
0
		public override void Play(Player player)
		{
			base.Play(player);

			if (player.InPlay.Contains(this.PhysicalCard))
			{
				Card cardToReturn = player.RetrieveCardFrom(DeckLocation.InPlay, this.PhysicalCard);
				Supply supply = player._Game.Table.SpecialPiles[TypeClass.Spoils];
				player.Lose(this);
				supply.AddTo(this);
				player._Game.SendMessage(player, this, supply, 1);
			}
		}
Example #3
0
		public override void Play(Player player)
		{
			base.Play(player);

			if (player.InPlay.Contains(this.PhysicalCard))
			{
				Supply supply = player._Game.Table.SpecialPiles[TypeClass.Madman];
				Card cardToReturn = player.RetrieveCardFrom(DeckLocation.InPlay, this.PhysicalCard);
				player.Lose(this);
				supply.AddTo(this);
				player._Game.SendMessage(player, this, supply, 1);

				player.ReceiveBenefit(this, new CardBenefit() { Cards = player.Hand.Count });
			}
		}