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); }
public override void Play(Player player) { base.Play(player); if (player.Hand[Cards.Universal.TypeClass.Estate].Count > 0) { Choice choice = Choice.CreateYesNoChoice("You may discard an Estate card for +<coin>4</coin>. Do you want to discard?", this, player); ChoiceResult result = player.MakeChoice(choice); if (result.Options.Contains("Yes")) { player.Discard(DeckLocation.Hand, Cards.Universal.TypeClass.Estate, 1); CardBenefit benefit = new CardBenefit(); benefit.Currency.Coin += 4; player.ReceiveBenefit(this, benefit); return; } } player.Gain(player._Game.Table.Estate); }
public override void Play(Player player) { base.Play(player); Choice choice = new Choice("Discard 2 cards.", this, player.Hand, player, false, 2, 2); ChoiceResult result = player.MakeChoice(choice); player.Discard(DeckLocation.Hand, result.Cards); }
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); }
public override void Play(Player player) { base.Play(player); Choice choice = new Choice("You may choose a Treasure card to discard", this, player.Hand[Cards.Category.Treasure], player, false, 0, 1); ChoiceResult result = player.MakeChoice(choice); if (result.Cards.Count > 0) { player.Discard(DeckLocation.Hand, result.Cards[0]); CardBenefit benefit = new CardBenefit() { Cards = 3, Actions = 1 }; player.ReceiveBenefit(this, benefit); } }
public override void Play(Player player) { base.Play(player); CardCollection newCards = player.Draw(3, DeckLocation.Private); Choice trashChoice = new Choice("Choose a card to trash", this, newCards, player); ChoiceResult trashResult = player.MakeChoice(trashChoice); if (trashResult.Cards.Count > 0) { newCards.Remove(trashResult.Cards[0]); player.Trash(player.RetrieveCardFrom(DeckLocation.Private, trashResult.Cards[0])); } Choice discardChoice = new Choice("Choose a card to discard", this, newCards, player); ChoiceResult discardResult = player.MakeChoice(discardChoice); if (discardResult.Cards.Count > 0) { newCards.Remove(discardResult.Cards[0]); player.Discard(DeckLocation.Private, discardResult.Cards[0]); } player.AddCardsToDeck(player.RetrieveCardsFrom(DeckLocation.Private), DeckPosition.Top); }
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); } }
internal void player_RevealBeggar(Player player, ref AttackedEventArgs e) { player.Discard(DeckLocation.Hand, this.PhysicalCard); player.Gain(player._Game.Table.Silver, DeckLocation.Deck, DeckPosition.Top); player.Gain(player._Game.Table.Silver); e.HandledBy.Add(TypeClass.Beggar); // Attack isn't cancelled... it's just mitigated }
public override void Play(Player player) { base.Play(player); Choice choiceDiscardTheFirst = new Choice("Discard any number of cards. +1 Card per card discarded", this, player.Hand, player, false, 0, player.Hand.Count); ChoiceResult resultDiscardTheFirst = player.MakeChoice(choiceDiscardTheFirst); player.Discard(DeckLocation.Hand, resultDiscardTheFirst.Cards); player.ReceiveBenefit(this, new CardBenefit() { Cards = resultDiscardTheFirst.Cards.Count }); Choice choiceDiscardTheSecond = new Choice("Discard any number of cards. +<coin>1</coin> per card discarded.", this, player.Hand, player, false, 0, player.Hand.Count); ChoiceResult resultDiscardTheSecond = player.MakeChoice(choiceDiscardTheSecond); player.Discard(DeckLocation.Hand, resultDiscardTheSecond.Cards); player.ReceiveBenefit(this, new CardBenefit() { Currency = new Currency(resultDiscardTheSecond.Cards.Count) }); }
public override void Play(Player player) { base.Play(player); Choice choice = new Choice("Discard any number of cards. +<coin>1</coin> per card discarded.", this, player.Hand, player, false, 0, player.Hand.Count); ChoiceResult result = player.MakeChoice(choice); player.Discard(DeckLocation.Hand, result.Cards); CardBenefit benefit = new CardBenefit(); benefit.Currency += new Coin(result.Cards.Count); player.ReceiveBenefit(this, benefit); IEnumerator<Player> enumerator = player._Game.GetPlayersStartingWithEnumerator(player); enumerator.MoveNext(); // skip active player while (enumerator.MoveNext()) { Player otherPlayer = enumerator.Current; if (otherPlayer.Hand.Count >= 2) { Choice choicePlayer = Choice.CreateYesNoChoice("Do you want to discard 2 cards to draw 1 card?", this, otherPlayer); ChoiceResult resultPlayer = otherPlayer.MakeChoice(choicePlayer); if (resultPlayer.Options[0] == "Yes") { Choice choiceDiscard = new Choice("Choose 2 cards to discard", this, otherPlayer.Hand, otherPlayer, false, 2, 2); ChoiceResult discards = otherPlayer.MakeChoice(choiceDiscard); otherPlayer.Discard(DeckLocation.Hand, discards.Cards); if (otherPlayer.CanDraw) otherPlayer.Draw(DeckLocation.Hand); } } } this.Benefit.Currency.Coin.Value = 0; }
public override void Play(Player player) { base.Play(player); Choice choice = new Choice("You may choose a Treasure card to discard", this, player.Hand[Cards.Category.Treasure], player, false, 0, 1); ChoiceResult result = player.MakeChoice(choice); if (result.Cards.Count > 0) { player.Discard(DeckLocation.Hand, result.Cards[0]); player.AddToken(new CoinToken()); } }
public override void Overpay(Player player, Currency amount) { for (int i = 0; i < amount.Coin.Value; i++) { if (!player.CanDraw) break; Card card = player.Draw(DeckLocation.Private); Choice choice = new Choice(String.Format("Do you want to discard {0}, trash {0}, or put it back on top?", card.Name), this, new CardCollection() { card }, new List<string>() { "Discard", "Trash", "Put it back" }, player); ChoiceResult result = player.MakeChoice(choice); switch (result.Options[0]) { case "Discard": player.Discard(DeckLocation.Private); break; case "Trash": player.Trash(DeckLocation.Private, card); break; default: player.AddCardsToDeck(player.RetrieveCardsFrom(DeckLocation.Private), DeckPosition.Top); break; } } }
public override void Play(Player player) { base.Play(player); Choice choice = new Choice("Discard any number of cards. +<coin>1</coin> per card discarded.", this, player.Hand, player, false, 0, player.Hand.Count); ChoiceResult result = player.MakeChoice(choice); player.Discard(DeckLocation.Hand, result.Cards); CardBenefit benefit = new CardBenefit(); benefit.Currency += new Coin(result.Cards.Count); player.ReceiveBenefit(this, benefit); }
public override void Play(Player player) { base.Play(player); player.Draw(5, DeckLocation.Private); Choice keepDiscard = new Choice(String.Format("You drew: {1}{0}Do you want to discard them all or put them back on your deck?", System.Environment.NewLine, player.Private), this, new CardCollection(player.Private), new List<String>() { "Discard them all", "Put them back" }, player); ChoiceResult keepDiscardResult = player.MakeChoice(keepDiscard); if (keepDiscardResult.Options[0] == "Discard them all") { player.Discard(DeckLocation.Private, player.Private); } else { 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); } }
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); player.BeginDrawing(); while (player.Revealed[Category.Treasure].Count < 1 && player.CanDraw) player.Draw(DeckLocation.Revealed); player.EndDrawing(); CardCollection treasureCards = player.Revealed[c => (c.Category & Category.Treasure) == Category.Treasure]; if (treasureCards.Count > 0) { Card card = treasureCards[0]; Choice choice = new Choice(String.Format("You revealed a {0}.", card.Name), this, new CardCollection() { card }, new List<string>() { "Discard it", "Trash it" }, player); ChoiceResult result = player.MakeChoice(choice); if (result.Options[0] == "Discard it") { player.Discard(DeckLocation.Revealed, card); } else if (result.Options[0] == "Trash it") { player.Trash(player.RetrieveCardFrom(DeckLocation.Revealed, card)); } } player.DiscardRevealed(); }
internal void player_DiscardMarketSquare(Player player, ref TrashEventArgs e) { player.Discard(DeckLocation.Hand, this); player.Gain(player._Game.Table.Gold); e.HandledBy.Add(this); }
public override void Play(Player player) { base.Play(player); Choice choiceAction = new Choice("You may discard a card for +1 Action.", this, player.Hand, player, false, 0, 1); ChoiceResult resultAction = player.MakeChoice(choiceAction); if (resultAction.Cards.Count > 0) { player.Discard(DeckLocation.Hand, resultAction.Cards); player.ReceiveBenefit(this, new CardBenefit() { Actions = 1 }); } Choice choiceBuy = new Choice("You may discard a card for +1 Buy.", this, player.Hand, player, false, 0, 1); ChoiceResult resultBuy = player.MakeChoice(choiceBuy); if (resultBuy.Cards.Count > 0) { player.Discard(DeckLocation.Hand, resultBuy.Cards); player.ReceiveBenefit(this, new CardBenefit() { Buys = 1 }); } }
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); } } }
public override void Play(Player player) { base.Play(player); Boolean playerRevealedProvince = false; Boolean anyoneElseRevealedProvince = false; // Perform on every player (including you) IEnumerator<Player> enumerator = player._Game.GetPlayersStartingWithEnumerator(player); while (enumerator.MoveNext()) { Player actor = enumerator.Current; if (actor.Hand[Universal.TypeClass.Province].Count == 0) continue; Choice showChoice = Choice.CreateYesNoChoice("Do you want to reveal a Province from your hand?", this, actor); ChoiceResult showResult = actor.MakeChoice(showChoice); if (showResult.Options[0] == "Yes") { Card shownProvince = actor.RetrieveCardsFrom(DeckLocation.Hand, Universal.TypeClass.Province, 1)[0]; actor.AddCardInto(DeckLocation.Revealed, shownProvince); if (actor == player) { playerRevealedProvince = true; } else { actor.AddCardInto(DeckLocation.Hand, actor.RetrieveCardFrom(DeckLocation.Revealed, shownProvince)); anyoneElseRevealedProvince = true; } } } if (playerRevealedProvince) { player.Discard(DeckLocation.Revealed); Boolean isOptional = (player._Game.Table[Cards.Universal.TypeClass.Duchy].Count + player._Game.Table.SpecialPiles[TypeClass.PrizeSupply].Count) == 0; Choice prizeChoice = new Choice("Select a Prize or a Duchy", this, player._Game.Table.SpecialPiles[TypeClass.PrizeSupply], player, isOptional ? 0 : 1, 1); ((CardCollection)prizeChoice.Cards).Add(new Universal.Duchy()); ChoiceResult prizeResult = player.MakeChoice(prizeChoice); if (prizeResult.Cards.Count > 0) { if (prizeResult.Cards[0].CardType == Universal.TypeClass.Duchy) player.Gain(player._Game.Table.Duchy, DeckLocation.Deck, DeckPosition.Top); else player.Gain(player._Game.Table.SpecialPiles[TypeClass.PrizeSupply], prizeResult.Cards[0].CardType, DeckLocation.Deck, DeckPosition.Top); } } if (!anyoneElseRevealedProvince) { CardBenefit benefit = new CardBenefit() { Cards = 1 }; benefit.Currency += new Coin(1); player.ReceiveBenefit(this, benefit); } }
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); } }
public override void Play(Player player) { base.Play(player); // discard 2 cards Choice choiceDiscard = new Choice("Choose two cards to discard", this, player.Hand, player, false, 2, 2); ChoiceResult resultDiscard = player.MakeChoice(choiceDiscard); player.Discard(DeckLocation.Hand, resultDiscard.Cards); IEnumerator<Player> enumerator = player._Game.GetPlayersStartingWithEnumerator(player); enumerator.MoveNext(); while (enumerator.MoveNext()) { Player attackee = enumerator.Current; if (this.IsAttackBlocked[attackee]) continue; if (!attackee.TokenActOn(player, this)) continue; attackee.Gain(player._Game.Table.Curse); } }
public override void Play(Player player) { base.Play(player); Choice choiceDiscard = new Choice("Choose cards to discard", this, player.Hand, player, false, 0, player.Hand.Count); ChoiceResult resultDiscard = player.MakeChoice(choiceDiscard); player.Discard(DeckLocation.Hand, resultDiscard.Cards); player.ReceiveBenefit(this, new CardBenefit() { Cards = resultDiscard.Cards.Count }); }
public override void Play(Player player) { base.Play(player); player.Discard(DeckLocation.Hand); }