コード例 #1
0
ファイル: Base.cs プロジェクト: micahpaul/dominion_net_multi
		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();
		}
コード例 #2
0
		public override void Play(Player player)
		{
			base.Play(player);
			player.Draw(3, DeckLocation.Revealed);

			IEnumerator<Player> enumerator = player._Game.GetPlayersStartingWithEnumerator(player);
			enumerator.MoveNext(); // Gets us... which we don't care about here.
			enumerator.MoveNext(); // Get the player to our left

			Player leftPlayer = enumerator.Current;
			Choice choice = new Choice(String.Format("Choose a card of {0}'s to discard", player), this, player.Revealed, player);
			ChoiceResult result = leftPlayer.MakeChoice(choice);
			// Discard the chosen card
			if (result.Cards.Count > 0)
				player.Discard(DeckLocation.Revealed, result.Cards[0]);
			player.AddCardsToHand(DeckLocation.Revealed);
		}
コード例 #3
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);
		}
コード例 #4
0
		public override void Play(Player player)
		{
			base.Play(player);

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

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

			player.BeginDrawing();
			// Keep flipping cards until we hit a non-Action card, thus making the counts different
			while (player.CanDraw && player.Revealed[Category.Action].Count == player.Revealed.Count)
				player.Draw(DeckLocation.Revealed);

			player.EndDrawing();
			player.AddCardsToHand(DeckLocation.Revealed);
		}
コード例 #5
0
		public override void Play(Player player)
		{
			base.Play(player);

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

			Choice choice = new Choice(
				String.Format("Do you want to discard {0} or put them back on top?", String.Join(" and ", newCards.Select(c => c.Name))),
				this,
				newCards,
				new List<string>() { "Discard", "Put them into your hand" },
				player);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Options[0] == "Discard")
			{
				player.Discard(DeckLocation.Private);
				player.DrawHand(3);
			}
			else
			{
				player.AddCardsToHand(DeckLocation.Private);
			}
		}
コード例 #6
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);
		}
コード例 #7
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);
				}
			}
		}
コード例 #8
0
		public override void Play(Player player)
		{
			base.Play(player);

			int copperCount = player.DiscardPile.LookThrough(c => c.CardType == Cards.Universal.TypeClass.Copper).Count;
			List<String> options = new List<string>();
			for (int i = 0; i <= copperCount; i++)
				options.Add(i.ToString());
			Choice choice = new Choice("How many Copper cards would you like to reveal and put into your hand?", this, new CardCollection() { this }, options, player);
			ChoiceResult result = player.MakeChoice(choice);
			int number = int.Parse(result.Options[0]);
			player.AddCardsInto(DeckLocation.Revealed, player.RetrieveCardsFrom(DeckLocation.Discard, Cards.Universal.TypeClass.Copper, number));
			player.AddCardsToHand(DeckLocation.Revealed);
		}
コード例 #9
0
		public override void Play(Player player)
		{
			base.Play(player);

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

			player.AddCardsToHand(player.RetrieveCardsFrom(DeckLocation.Revealed, Category.Victory));

			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);
		}
コード例 #10
0
		public override void Play(Player player)
		{
			base.Play(player);

			Choice choice = new Choice("Choose one:", this, new CardCollection() { this }, new List<string>() { "Set aside the top card of your deck face down on your Native Village mat", "Put all the cards from your mat into your hand" }, player);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Options.Contains("Set aside the top card of your deck face down on your Native Village mat"))
			{
				if (player.CanDraw)
					player.Draw(TypeClass.NativeVillageMat);
			}
			else
			{
				player.AddCardsToHand(player.RetrieveCardsFrom(TypeClass.NativeVillageMat));
			}
		}
コード例 #11
0
		public override void PlayDuration(Player player)
		{
			base.PlayDuration(player);
			if (_HavenedCards.Count > 0)
			{
				player.AddCardsToHand(_HavenedCards);
				_HavenedCards.Clear();
			}
		}
コード例 #12
0
		public override void Play(Player player)
		{
			base.Play(player);
			Boolean provinceRevealed = false;
			if (player.Hand[Cards.Universal.TypeClass.Province].Count > 0)
			{
				Choice choice = Choice.CreateYesNoChoice("You may reveal a Province card to gain a Gold in your hand.  Otherwise, gain a Silver in your hand.  Do you want to reveal?", this, player);
				ChoiceResult result = player.MakeChoice(choice);
				if (result.Options.Contains("Yes"))
				{
					CardCollection singleProvince = player.RetrieveCardsFrom(DeckLocation.Hand, Cards.Universal.TypeClass.Province, 1);
					player.AddCardInto(DeckLocation.Revealed, singleProvince[0]);
					provinceRevealed = true;
					player.Gain(player._Game.Table.Gold, DeckLocation.Hand, DeckPosition.Bottom);
					player.AddCardsToHand(DeckLocation.Revealed);
				}
			}
			if (!provinceRevealed)
				player.Gain(player._Game.Table.Silver, DeckLocation.Hand, DeckPosition.Bottom);
		}