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); 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); } } }
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); }
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(); }
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); } } }
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); } }
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); 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); }
internal void player_GainInn(Player player, ref Players.CardGainEventArgs e) { CardCollection actionCards = player.DiscardPile.LookThrough(c => (c.Category & Cards.Category.Action) == Cards.Category.Action); Choice choice = new Choice("Choose cards to reveal and shuffle into your deck", this, actionCards, player, false, 0, actionCards.Count); ChoiceResult result = player.MakeChoice(choice); // We lose track of Inn if we put it on top of the deck and shuffle if (result.Cards.Contains(this)) e.IsLostTrackOf = true; player.AddCardsInto(DeckLocation.Revealed, player.DiscardPile.Retrieve(player, c => result.Cards.Contains(c))); player.AddCardsToDeck(player.Revealed.Retrieve(player, c => result.Cards.Contains(c)), DeckPosition.Top); player.ShuffleDrawPile(); e.HandledBy.Add(TypeClass.Inn); // 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(); }
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); CardCollection newCards = player.Draw(3, DeckLocation.Revealed); player.Trash(player.RetrieveCardsFrom(DeckLocation.Revealed, c => c.Name == namedCard.Name)); 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); }
public override void Overpay(Player player, Currency amount) { Choice choice = new Choice("Choose cards to put on top of your deck", this, player.DiscardPile.LookThrough(c => true), player, false, amount.Coin.Value, amount.Coin.Value); ChoiceResult result = player.MakeChoice(choice); player.AddCardsInto(DeckLocation.Revealed, player.DiscardPile.Retrieve(player, c => result.Cards.Contains(c))); player.AddCardsToDeck(player.Revealed.Retrieve(player, c => result.Cards.Contains(c)), DeckPosition.Top); }
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; } } }
internal void player_RevealSecretChamber(Player player, ref AttackedEventArgs e) { player.AddCardInto(DeckLocation.Revealed, player.RetrieveCardFrom(DeckLocation.Hand, this.PhysicalCard)); player.AddCardToHand(player.RetrieveCardFrom(DeckLocation.Revealed, this.PhysicalCard)); player.Draw(2, DeckLocation.Hand); Choice replaceChoice = new Choice("Choose order of cards to put back on your deck", this, new CardCollection() { e.AttackCard }, player.Hand, player, true, 2, 2); ChoiceResult replaceResult = player.MakeChoice(replaceChoice); player.RetrieveCardsFrom(DeckLocation.Hand, replaceResult.Cards); player.AddCardsToDeck(replaceResult.Cards, DeckPosition.Top); e.HandledBy.Add(TypeClass.SecretChamber); // Attack isn't cancelled... it's just mitigated }
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); }
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); // 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.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(); }
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); }
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); }
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); }