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); } } }
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); SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll( supply => supply.CanGain() && ((supply.Category & Cards.Category.Action) == Cards.Category.Action) && supply.CurrentCost <= new Coin(5)); Choice choice = new Choice("You may gain an Action card costing up to <coin>5</coin>", this, gainableSupplies, player, true); ChoiceResult result = player.MakeChoice(choice); if (result.Supply != null) player.Gain(result.Supply); }
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); }
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"); }
public override void Play(Player player) { base.Play(player); if (player.InPlay.Contains(this.PhysicalCard)) { Choice choice = Choice.CreateYesNoChoice("Do you want to set this card aside?", this, player); ChoiceResult result = player.MakeChoice(choice); if (result.Options[0] == "Yes") { player.AddCardInto(TypeClass.PrinceSetAside, player.RetrieveCardFrom(DeckLocation.InPlay, this.PhysicalCard)); if (_TurnStartedEventHandler != null) player.TurnStarted -= _TurnStartedEventHandler; _TurnStartedPlayer = player; _TurnStartedEventHandler = new Player.TurnStartedEventHandler(player_TurnStarted); _TurnStartedPlayer.TurnStarted += _TurnStartedEventHandler; Choice setAsideChoice = new Choice("Choose a card to set aside", this, player.Hand[c => (c.Category & Cards.Category.Action) == Cards.Category.Action && player._Game.ComputeCost(c) <= new Coin(4)], player, false, 1, 1); ChoiceResult setAsideResult = player.MakeChoice(setAsideChoice); if (setAsideResult.Cards.Count > 0) { _SetAsideCard = player.RetrieveCardFrom(DeckLocation.Hand, setAsideResult.Cards[0]); player.PlayerMats[TypeClass.PrinceSetAside].Refresh(player); player._Game.SendMessage(player, this, this._SetAsideCard); } } } }
public override void Play(Player player) { base.Play(player); SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost <= new Coin(4)); Choice choice = new Choice("Gain a card costing up to <coin>4</coin>", this, gainableSupplies, player, false); ChoiceResult result = player.MakeChoice(choice); if (result.Supply != null) player.Gain(result.Supply); }
public override void Play(Player player) { base.Play(player); // Perform attack on every player IEnumerator<Player> enumerator = player._Game.GetPlayersStartingWithEnumerator(player); enumerator.MoveNext(); CardCollection trashed = new CardCollection(); while (enumerator.MoveNext()) { Player attackee = enumerator.Current; // Skip if the attack is blocked (Moat, Lighthouse, etc.) if (this.IsAttackBlocked[attackee]) continue; attackee.Draw(2, DeckLocation.Revealed); CardCollection treasures = attackee.Revealed[Category.Treasure]; Choice choice = new Choice(String.Format("Choose a Treasure card of {0} to trash", attackee), this, treasures, attackee); ChoiceResult result = player.MakeChoice(choice); if (result.Cards.Count > 0) { Card trashCard = attackee.RetrieveCardFrom(DeckLocation.Revealed, result.Cards[0]); attackee.Trash(trashCard); trashed.Add(trashCard); } attackee.DiscardRevealed(); } Choice keepCards = new Choice("Choose which cards you'd like to gain from being trashed.", this, trashed, player, true, 0, trashed.Count); ChoiceResult keptCards = player.MakeChoice(keepCards); foreach (Card card in keptCards.Cards) player.Gain(player._Game.Table.Trash, card); }
public override void Play(Player player) { base.Play(player); // Perform attack on every player 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; attackee.Gain(player._Game.Table[TypeClass.RuinsSupply]); } if (player.Hand[TypeClass.Cultist].Count > 0) { Choice choicePlayer = Choice.CreateYesNoChoice("Do you want to play a Cultist from your hand?", this, player); ChoiceResult resultPlayer = player.MakeChoice(choicePlayer); if (resultPlayer.Options[0] == "Yes") { player.Actions++; player.PlayCardInternal(player.Hand[TypeClass.Cultist][0]); } } }
public override void Play(Player player) { base.Play(player); Choice choice = new Choice(String.Format("You may play a Treasure card twice", player), this, player.Hand[Cards.Category.Treasure], player, false, 0, 1); ChoiceResult result = player.MakeChoice(choice); if (result.Cards.Count > 0) { Card card = result.Cards[0]; player.PlayCardInternal(card); player.PlayCardInternal(card, " again"); if (player.InPlay.Contains(card)) player.Trash(player.RetrieveCardFrom(DeckLocation.InPlay, card)); } else player.PlayNothing(); }
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); 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); } }
internal void player_PlusCard(Player player, ref TrashEventArgs e) { SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost < player._Game.ComputeCost(this)); Choice choice = new Choice(String.Format("Gain a card costing less than {0}", player._Game.ComputeCost(this).ToString()), this, gainableSupplies, player, false); ChoiceResult result = player.MakeChoice(choice); if (result.Supply != null) player.Gain(result.Supply); e.HandledBy.Add(this); }
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); 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); while (player.Hand.Count < 7 && player.CanDraw) { Card card = player.Draw(DeckLocation.Private); if ((card.Category & Category.Action) == Category.Action) { Choice choice = Choice.CreateYesNoChoice(String.Format("Would you like to set aside {0}?", card.Name), this, card, player, null); ChoiceResult result = player.MakeChoice(choice); if (result.Options[0] == "Yes") { player.AddCardInto(DeckLocation.Revealed, player.RetrieveCardFrom(DeckLocation.Private, card)); } else if (result.Options[0] == "No") { player.AddCardToHand(player.RetrieveCardFrom(DeckLocation.Private, card)); } } else { player.AddCardToHand(player.RetrieveCardFrom(DeckLocation.Private, card)); } } player.DiscardRevealed(); }
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); } }
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)); } }
public override void Play(Player player) { this._CanCleanUp = true; base.Play(player); Choice choice = new Choice(String.Format("Choose an Action card to play twice", player), this, player.Hand[Cards.Category.Action], player); ChoiceResult result = player.MakeChoice(choice); if (result.Cards.Count > 0) { result.Cards[0].ModifiedBy = this; player.Actions++; PlayerMode previousPlayerMode = player.PutCardIntoPlay(result.Cards[0], String.Empty); Card logicalCard = result.Cards[0].LogicalCard; player.PlayCard(result.Cards[0].LogicalCard, previousPlayerMode); player.Actions++; previousPlayerMode = player.PutCardIntoPlay(result.Cards[0], "again"); player.PlayCard(logicalCard, previousPlayerMode); this._CanCleanUp = logicalCard.CanCleanUp; } else player.PlayNothing(); }
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); }
public override void Play(Player player) { base.Play(player); Choice choice = new Choice("Choose 1. You get the version in parenthesis; everyone else gets the other:", this, new CardCollection() { this }, new List<string>() { "+1 (+3) Cards", "Gain a Silver (Gold)", "You may trash a card from your hand and gain a card costing exactly <coin>1</coin> (<coin>2</coin>) more" }, player); ChoiceResult result = player.MakeChoice(choice); IEnumerator<Player> enumerator = player._Game.GetPlayersStartingWithEnumerator(player); while (enumerator.MoveNext()) { Player actee = enumerator.Current; if (result.Options.Contains("+1 (+3) Cards")) { // 3 or 1 cards, depending on who it is actee.ReceiveBenefit(this, new CardBenefit() { Cards = (actee == player ? 3 : 1) }); } else if (result.Options.Contains("Gain a Silver (Gold)")) { if (actee == player) actee.Gain(player._Game.Table.Gold); else actee.Gain(player._Game.Table.Silver); } else { Choice choiceTrash = new Choice("You may choose a card to trash", this, actee.Hand, actee, false, 0, 1); ChoiceResult resultTrash = actee.MakeChoice(choiceTrash); actee.Trash(actee.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards)); if (resultTrash.Cards.Count > 0) { Cost trashedCardCost = actee._Game.ComputeCost(resultTrash.Cards[0]); SupplyCollection gainableSupplies = actee._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost == (trashedCardCost + new Coin(actee == player ? 2 : 1))); Choice choiceGain = new Choice("Gain a card", this, gainableSupplies, actee, false); ChoiceResult resultGain = actee.MakeChoice(choiceGain); if (resultGain.Supply != null) actee.Gain(resultGain.Supply); } } } }
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()) }); }
public override void Play(Player player) { base.Play(player); Choice choice = new Choice("Choose a card to trash", this, player.Hand, player, false, 1, 1); ChoiceResult result = player.MakeChoice(choice); if (result.Cards.Count > 0) { player.Trash(player.RetrieveCardFrom(DeckLocation.Hand, result.Cards[0])); Cost cardCost = player._Game.ComputeCost(result.Cards[0]); int toDraw = cardCost.Coin.Value; if (cardCost.Potion.Value > 0) toDraw += 2; player.ReceiveBenefit(this, new CardBenefit() { Cards = toDraw }); } }
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 }); }
internal void player_Action(Player player, ref CardsDiscardEventArgs e) { Choice choice = new Choice("Select a treasure to place on your deck", this, e.Cards.Where(c => (c.Category & Category.Treasure) == Cards.Category.Treasure), player); ChoiceResult result = player.MakeChoice(choice); if (result.Cards.Count > 0) { e.Cards.Remove(result.Cards[0]); if (player.InPlay.Contains(result.Cards[0])) player.RetrieveCardFrom(DeckLocation.InPlay, result.Cards[0]); else player.RetrieveCardFrom(DeckLocation.SetAside, result.Cards[0]); player.AddCardToDeck(result.Cards[0], DeckPosition.Top); } e.HandledBy.Add(this); }
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); } }
public override void Play(Player player) { Choice choice = new Choice("Trash a card.", this, player.Hand, player); ChoiceResult result = player.MakeChoice(choice); if (result.Cards.Count > 0) { Card trash = player.RetrieveCardFrom(DeckLocation.Hand, result.Cards[0]); player.Trash(trash); if ((trash.Category & Category.Action) == Category.Action) player.Gain(player._Game.Table.Duchy); if ((trash.Category & Category.Treasure) == Category.Treasure) player.Gain(player._Game.Table[Cards.Alchemy.TypeClass.Transmute]); if ((trash.Category & Category.Victory) == Category.Victory) player.Gain(player._Game.Table.Gold); } base.Play(player); }
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)); }
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); if (player.InPlay.Contains(this.PhysicalCard)) { player.Trash(player.RetrieveCardFrom(DeckLocation.InPlay, this.PhysicalCard)); } 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); }