public override void Play(Player player) { base.Play(player); Choice choice = new Choice("Trash a card. +<vp/> equal to half its cost in coins, rounded down.", this, player.Hand, player); ChoiceResult result = player.MakeChoice(choice); if (result.Cards.Count > 0) { Card trash = player.RetrieveCardFrom(DeckLocation.Hand, result.Cards[0]); Cost trashedCardCost = player._Game.ComputeCost(trash); player.Trash(trash); player.ReceiveBenefit(this, new CardBenefit() { VictoryPoints = trashedCardCost.Coin.Value / 2 }); } IEnumerator<Player> enumerator = player._Game.GetPlayersStartingWithEnumerator(player); enumerator.MoveNext(); // skip active player while (enumerator.MoveNext()) { Player otherPlayer = enumerator.Current; Choice choicePlayer = new Choice("Trash a card if you wish", this, otherPlayer.Hand, otherPlayer, false, 0, 1); ChoiceResult resultPlayer = otherPlayer.MakeChoice(choicePlayer); if (resultPlayer.Cards.Count > 0) { otherPlayer.Trash(otherPlayer.RetrieveCardFrom(DeckLocation.Hand, resultPlayer.Cards[0])); } } }
public override void Play(Player player) { base.Play(player); CardCollection singleCopper = player.RetrieveCardsFrom(DeckLocation.Hand, Cards.Universal.TypeClass.Copper, 1); if (singleCopper.Count > 0) { player.Trash(singleCopper[0]); CardBenefit benefit = new CardBenefit(); benefit.Currency += new Coin(3); player.ReceiveBenefit(this, benefit); } }
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 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 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); 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)); } } 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); Card foundCard = null; player.BeginDrawing(); while (player.CanDraw) { player.Draw(DeckLocation.Revealed); Card lastRevealed = player.Revealed.Last(); if ((lastRevealed.Category & Cards.Category.Victory) == Cards.Category.Victory && namedCard.Name != lastRevealed.Name) { foundCard = lastRevealed; break; } } player.EndDrawing(); if (foundCard != null) foundCard = player.RetrieveCardFrom(DeckLocation.Revealed, foundCard); player.DiscardRevealed(); if (foundCard != null) { player.Trash(foundCard); Cost trashedCardCost = player._Game.ComputeCost(foundCard); SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && (supply.Category & Cards.Category.Victory) == Cards.Category.Victory && supply.CurrentCost <= (trashedCardCost + new Coin(3))); Choice choiceGain = new Choice("Gain a Victory card", this, gainableSupplies, player, false); ChoiceResult resultGain = player.MakeChoice(choiceGain); if (resultGain.Supply != null) player.Gain(resultGain.Supply); } }
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(); }
internal void player_FoolsGold(Player player, ref Players.CardGainEventArgs e) { if (player.Hand.Contains(this.PhysicalCard)) { player.AddCardInto(DeckLocation.Revealed, player.RetrieveCardFrom(DeckLocation.Hand, this.PhysicalCard)); player.Trash(player.RetrieveCardFrom(DeckLocation.Revealed, this.PhysicalCard)); player.Gain(player._Game.Table.Gold, DeckLocation.Deck, DeckPosition.Top); e.HandledBy.Add(TypeClass.FoolsGold); } }
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); 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(1)) || trashedCardCost.Coin > 0 && supply.CurrentCost == (trashedCardCost - new Coin(1)))); Choice choice = new Choice("Gain a card to put on your deck", this, gainableSupplies, player, false); ChoiceResult result = player.MakeChoice(choice); if (result.Supply != null) { player.Gain(result.Supply, DeckLocation.Deck, DeckPosition.Top); if (!(result.Supply.CurrentCost <= trashedCardCost)) gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && trashedCardCost.Coin > 0 && supply.CurrentCost == (trashedCardCost - new Coin(1))); else gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost == (trashedCardCost + new Coin(1))); choice = new Choice("Gain a card to put on your deck", this, gainableSupplies, player, false); result = player.MakeChoice(choice); if (result.Supply != null) player.Gain(result.Supply, DeckLocation.Deck, DeckPosition.Top); } } }
internal void player_BuyFarmland(Player player, ref Players.CardBuyEventArgs e) { 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); } e.HandledBy.Add(TypeClass.Farmland); // Clear out the Event Triggers -- this only happens when its Gained, so we don't care any more foreach (Player playerLoop in _CardBoughtHandlers.Keys) playerLoop.CardBought -= _CardBoughtHandlers[playerLoop]; _CardBoughtHandlers.Clear(); }
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) { player.Gain(player._Game.Table.Silver, player._Game.ComputeCost(resultTrash.Cards[0]).Coin.Value); } }
public override void Play(Player player) { base.Play(player); Choice choice = new Choice("You may choose a Treasure card to trash", this, player.Hand[Cards.Category.Treasure], player, false, 0, 1); ChoiceResult result = player.MakeChoice(choice); if (result.Cards.Count > 0) { player.Trash(player.RetrieveCardFrom(DeckLocation.Hand, result.Cards[0])); CardBenefit benefit = new CardBenefit(); Choice choiceBenefit = new Choice("Choose either +2 Cards and +1 Action; or +<coin>2</coin> and +1 Buy", this, new CardCollection() { this }, new List<string>() { "+2<nbsp/>Cards and +1<nbsp/>Action", "+<coin>2</coin> and +1<nbsp/>Buy" }, player); ChoiceResult resultBenefit = player.MakeChoice(choiceBenefit); if (resultBenefit.Options[0] == "+2<nbsp/>Cards and +1<nbsp/>Action") { benefit.Cards = 2; benefit.Actions = 1; } else { benefit.Currency.Coin.Value = 2; benefit.Buys = 1; } player.ReceiveBenefit(this, benefit); } }
public override void Play(Player player) { base.Play(player); List<Type> cardTypes = new List<Type>(); foreach (Card card in player.InPlay) { Type t = card.CardType; if (!cardTypes.Contains(t)) cardTypes.Add(t); } foreach (Card card in player.SetAside) { Type t = card.CardType; if (!cardTypes.Contains(t)) cardTypes.Add(t); } Currencies.Coin uniqueCardsInPlay = new Currencies.Coin(cardTypes.Count); SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost <= uniqueCardsInPlay); Choice choice = new Choice("Gain a card.", this, gainableSupplies, player, false); ChoiceResult result = player.MakeChoice(choice); if (result.Supply != null) { player.Gain(result.Supply); if ((result.Supply.Category & Cards.Category.Victory) == Cards.Category.Victory) { player.RetrieveCardFrom(DeckLocation.InPlay, this); player.Trash(this); } } }
public override void Play(Player player) { this._CanCleanUp = true; base.Play(player); Choice choice = new Choice(String.Format("You may play an Action card twice", player), this, player.Hand[Cards.Category.Action], player, false, 0, 1); ChoiceResult result = player.MakeChoice(choice); if (result.Cards.Count > 0) { Card card = result.Cards[0]; card.ModifiedBy = this; player.Actions++; PlayerMode previousPlayerMode = player.PutCardIntoPlay(card, String.Empty); Card logicalCard = card.LogicalCard; player.PlayCard(card.LogicalCard, previousPlayerMode); player.Actions++; previousPlayerMode = player.PutCardIntoPlay(card, "again"); player.PlayCard(logicalCard, previousPlayerMode); this._CanCleanUp = logicalCard.CanCleanUp; if (player.InPlay.Contains(card)) player.Trash(DeckLocation.InPlay, card); Cost trashedCardCost = player._Game.ComputeCost(card); SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && (supply.Category & Cards.Category.Action) == Cards.Category.Action && supply.CurrentCost == (trashedCardCost + new Coin(1))); Choice choiceGain = new Choice("Gain an Action card", this, gainableSupplies, player, false); ChoiceResult resultGain = player.MakeChoice(choiceGain); if (resultGain.Supply != null) player.Gain(resultGain.Supply); } else player.PlayNothing(); }
public override void Play(Player player) { base.Play(player); Choice choice = new Choice("Choose one:", this, new CardCollection() { this }, new List<string>() { "Gain a card from the trash", "Trash an Action card from your hand" }, player); ChoiceResult result = player.MakeChoice(choice); if (result.Options.Contains("Gain a card from the trash")) { List<Cost> availableCosts = new List<Cost>() { new Cost(3), new Cost(4), new Cost(5), new Cost(6) }; IEnumerable<Card> availableTrashCards = player._Game.Table.Trash.Where(c => availableCosts.Any(cost => player._Game.ComputeCost(c) == cost)); Choice choiceFromTrash = new Choice("Choose a card to gain from the trash", this, availableTrashCards, player); ChoiceResult resultFromTrash = player.MakeChoice(choiceFromTrash); if (resultFromTrash.Cards.Count > 0) { player.Gain(player._Game.Table.Trash, resultFromTrash.Cards[0], DeckLocation.Deck, DeckPosition.Top); } } else { Choice choiceTrash = new Choice("Choose an Action card to trash", this, player.Hand[Cards.Category.Action], 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(3))); Choice choiceGain = new Choice("Gain a card", this, gainableSupplies, player, false); ChoiceResult resultGain = player.MakeChoice(choiceGain); if (resultGain.Supply != null) player.Gain(resultGain.Supply); } } }
public override void Play(Player player) { base.Play(player); player.Gain(player._Game.Table[TypeClass.Rats]); CardCollection nonRats = player.Hand[c => c.CardType != TypeClass.Rats]; if (nonRats.Count > 0) { Choice choiceTrash = new Choice("Choose a non-Rats card to trash", this, nonRats, player); ChoiceResult resultTrash = player.MakeChoice(choiceTrash); player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards)); } else { player.ReturnHand(player.RevealHand()); } }
internal void player_Action(Player player, ref CardsDiscardEventArgs e) { e.Cards.Remove(this.PhysicalCard); if (player.InPlay.Contains(this.PhysicalCard)) player.Trash(player.RetrieveCardFrom(DeckLocation.InPlay, this.PhysicalCard)); else if (player.SetAside.Contains(this.PhysicalCard)) player.Trash(player.RetrieveCardFrom(DeckLocation.SetAside, this.PhysicalCard)); player.Gain(player._Game.Table.SpecialPiles[TypeClass.Madman]); e.HandledBy.Add(this); _ShouldBeTrashed = false; }
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) { _ShouldBeTrashed = false; base.Play(player); CardCollection nonTreasures = player.DiscardPile.LookThrough(c => (c.Category & Cards.Category.Treasure) != Cards.Category.Treasure); nonTreasures.Add(new Universal.Dummy()); nonTreasures.AddRange(player.Hand[c => (c.Category & Cards.Category.Treasure) != Cards.Category.Treasure]); if (nonTreasures.Count > 1) { Choice choiceTrash = new Choice("You may choose a non-Treasure card to trash", this, nonTreasures, player, false, 0, 1); ChoiceResult resultTrash = player.MakeChoice(choiceTrash); if (resultTrash.Cards.Count > 0) { Card cardToTrash = null; if (player.Hand.Contains(resultTrash.Cards[0])) cardToTrash = player.RetrieveCardFrom(DeckLocation.Hand, resultTrash.Cards[0]); else cardToTrash = player.RetrieveCardFrom(DeckLocation.Discard, resultTrash.Cards[0]); player.Trash(cardToTrash); } } SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost <= new Coin(3)); Choice choice = new Choice("Gain a card costing up to <coin>3</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 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)); } }
internal void player_TrashHovel(Player player, ref Players.CardBuyEventArgs e) { player.Trash(player.RetrieveCardFrom(DeckLocation.Hand, this.PhysicalCard)); e.HandledBy.Add(this); }
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 void KnightAttack(Player player) { List<Cost> availableCosts = new List<Cost>() { new Cost(3), new Cost(4), new Cost(5), new Cost(6) }; Boolean anyKnightsTrashed = false; IEnumerator<Player> enumerator = player._Game.GetPlayersStartingWithEnumerator(player); enumerator.MoveNext(); while (enumerator.MoveNext()) { Player attackee = enumerator.Current; if (this.IsAttackBlocked[attackee]) continue; CardCollection attackeeCards = attackee.Draw(2, DeckLocation.Revealed); Choice choiceTrash = new Choice("Choose a card to trash", this, attackee.Revealed[c => availableCosts.Any(cost => player._Game.ComputeCost(c) == cost)], player); ChoiceResult resultTrash = attackee.MakeChoice(choiceTrash); if (resultTrash.Cards.Count > 0) { Card cardToTrash = attackee.RetrieveCardFrom(DeckLocation.Revealed, resultTrash.Cards[0]); if ((cardToTrash.Category & Cards.Category.Knight) == Cards.Category.Knight) anyKnightsTrashed = true; attackee.Trash(cardToTrash); } attackee.DiscardRevealed(); } if (anyKnightsTrashed && player.InPlay.Contains(this.PhysicalCard)) player.Trash(player.RetrieveCardFrom(DeckLocation.InPlay, this.PhysicalCard)); }
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); }
public override void Play(Player player) { base.Play(player); Choice choice = Choice.CreateYesNoChoice("Do you want to trash 2 cards?", this, player); ChoiceResult result = player.MakeChoice(choice); if (result.Options[0] == "Yes") { Choice choiceTrash = new Choice("Choose 2 cards to trash", this, player.Hand, player, false, 2, 2); ChoiceResult resultTrash = player.MakeChoice(choiceTrash); player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards)); if (resultTrash.Cards.Count == 2) { player.ReceiveBenefit(this, new CardBenefit() { Cards = 2, Currency = new Currency(2) }); 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; Choice choiceDiscard = new Choice("Choose cards to discard. You must discard down to 3 cards in hand", this, attackee.Hand, attackee, false, attackee.Hand.Count - 3, attackee.Hand.Count - 3); ChoiceResult resultDiscard = attackee.MakeChoice(choiceDiscard); attackee.Discard(DeckLocation.Hand, resultDiscard.Cards); } } } }
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); if (player.InPlay.Contains(this.PhysicalCard)) player.Trash(player.RetrieveCardFrom(DeckLocation.InPlay, this.PhysicalCard)); 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 (attackee.Hand.Count < 5) continue; attackee.RevealHand(); Choice choice = new Choice(String.Format("Choose a card for {0} to discard.", attackee), this, attackee.Revealed, attackee, false, 1, 1); ChoiceResult result = player.MakeChoice(choice); attackee.Discard(DeckLocation.Revealed, result.Cards); attackee.ReturnHand(attackee.Revealed[c => true]); } player.Gain(player._Game.Table.SpecialPiles[TypeClass.Spoils], 2); }
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); }
internal void player_BuyMint(Player player, ref Players.CardBuyEventArgs e) { player.Trash(player.RetrieveCardsFrom(DeckLocation.InPlay, Category.Treasure)); player.Trash(player.RetrieveCardsFrom(DeckLocation.SetAside, Category.Treasure)); e.HandledBy.Add(TypeClass.Mint); // Clear out the Event Triggers -- this only happens when its Gained, so we don't care any more foreach (Player playerLoop in _CardBoughtHandlers.Keys) playerLoop.CardBought -= _CardBoughtHandlers[playerLoop]; _CardBoughtHandlers.Clear(); }