private RequestPlayerGainCardFromSupply ( |
||
gameState | ||
acceptableCard | CardPredicate | |
description | string | |
isOptional | bool | |
defaultLocation | DeckPlacement | |
return | Dominion.Card |
public override DeckPlacement DoSpecializedWhenGain(PlayerState currentPlayer, GameState gameState) { currentPlayer.RequestPlayerGainCardFromSupply( gameState, card => card.CurrentCoinCost(currentPlayer) < this.CurrentCoinCost(currentPlayer) && card.potionCost == 0, "Must gain a card costing less than this"); return DeckPlacement.Default; }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState, acceptableChoice => acceptableChoice == PlayerActionChoice.GainCard || acceptableChoice == PlayerActionChoice.Trash); if (choice == PlayerActionChoice.GainCard) { currentPlayer.RequestPlayerGainCardFromTrash(gameState, acceptableCard => CardValidToGainFromTrash(acceptableCard, currentPlayer), "Must gain a card costing between 3 and 6", defaultLocation: DeckPlacement.TopOfDeck); } else { Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => CardValidToTrash(acceptableCard), isOptional: false); if (trashedCard != null) { int maxCost = trashedCard.CurrentCoinCost(currentPlayer) + 3; currentPlayer.RequestPlayerGainCardFromSupply(gameState, acceptableCard => acceptableCard.CurrentCoinCost(currentPlayer) <= maxCost && acceptableCard.potionCost <= trashedCard.potionCost, "gain a card costing up to 3 more than the trashed card"); } } }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card.isTreasure, "Gain a Treasure"); }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { currentPlayer.MoveCardFromPlayToTrash(gameState); currentPlayer.RequestPlayerGainCardFromSupply( gameState, card => card.CurrentCoinCost(currentPlayer) <= 5 && card.potionCost == 0 , "cost of card up to 5"); }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card.isAction && card.CurrentCoinCost(currentPlayer) <= 5 && card.potionCost == 0, "May gain an action card costing up to 5", isOptional:true); }
private new void DoSpecializedActionOnBuyWhileInPlay(PlayerState currentPlayer, GameState gameState, Card boughtCard) { currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => !card.isVictory && card.CurrentCoinCost(currentPlayer) < boughtCard.CurrentCoinCost(currentPlayer) && card.potionCost <= boughtCard.potionCost, "Must gain a non victory card costing less than the bought card"); }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, card => true, false); int trashedCardCost = trashedCard.CurrentCoinCost(currentPlayer); currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card.CurrentCoinCost(currentPlayer) == (trashedCardCost - 1) && card.potionCost == trashedCard.potionCost, "Must gain a card costing one less than the trashed card.", isOptional: false, defaultLocation: DeckPlacement.TopOfDeck); currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card.CurrentCoinCost(currentPlayer) == (trashedCardCost + 1) && card.potionCost == trashedCard.potionCost, "Must gain a card costing exactly one more than the trashed card.", isOptional: false, defaultLocation: DeckPlacement.TopOfDeck); // TODO: put the cards on top of your deck in either order. //throw new NotImplementedException(); }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => acceptableCard.isTreasure, isOptional: true); PlayerState.AttackAction attackAction = this.DoEmptyAttack; if (trashedCard != null) { attackAction = delegate(PlayerState currentPlayer2, PlayerState otherPlayer, GameState gameState2) { if (otherPlayer.Hand.Count >= 5) { otherPlayer.DiscardCardFromHand(gameState, trashedCard); } }; currentPlayer.RequestPlayerGainCardFromSupply(gameState, acceptableCard => acceptableCard.isTreasure && acceptableCard.CurrentCoinCost(currentPlayer) <= trashedCard.CurrentCoinCost(currentPlayer) + 3 && acceptableCard.potionCost == 0, "Gain a card costing up to 3 more than the trashed card", isOptional: false, defaultLocation: DeckPlacement.TopOfDeck); } currentPlayer.AttackOtherPlayers(gameState, attackAction); }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { currentPlayer.RequestPlayerTrashCardFromHandOrDiscard(gameState, CanTrashCard, isOptional: true); currentPlayer.RequestPlayerGainCardFromSupply(gameState, acceptableCard => acceptableCard.CurrentCoinCost(currentPlayer) <= 3 && acceptableCard.potionCost == 0, "Gain a card costing up to 3"); }
public override void DoSpecializedTrash(PlayerState currentPlayer, GameState gameState) { currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card.CurrentCoinCost(currentPlayer) < this.CurrentCoinCost(currentPlayer) && card.potionCost == 0, "Must gain a card cheaper than this"); }
public override void DoSpecializedTrash(PlayerState currentPlayer, GameState gameState) { currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card.isAttack, "Must gain an attack card", isOptional: false); }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { Card cardType = currentPlayer.RequestPlayerNameACard(gameState); Card foundCard = null; gameState.gameLog.PushScope(); while (true) { foundCard = currentPlayer.DrawAndRevealOneCardFromDeck(); if (foundCard == null) break; if (foundCard.isVictory && foundCard != cardType) { break; } } currentPlayer.MoveRevealedCardsToDiscard(cardToMove => !cardToMove.Equals(foundCard), gameState); gameState.gameLog.PopScope(); if (foundCard != null) { int cardCost = foundCard.CurrentCoinCost(currentPlayer); currentPlayer.MoveRevealedCardToTrash(foundCard, gameState); currentPlayer.RequestPlayerGainCardFromSupply(gameState, acceptableCard => acceptableCard.isVictory && acceptableCard.CurrentCoinCost(currentPlayer) <= cardCost + 3 && acceptableCard.potionCost == foundCard.potionCost, "Gain a victory card costing up to 3 more than the trashed card."); } }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { bool someOtherPlayerRevealedProvince = false; bool didRevealProvince = currentPlayer.RequestPlayerRevealCardFromHand(card => card == Cards.Province, gameState) != null; foreach (PlayerState player in gameState.players.OtherPlayers) { someOtherPlayerRevealedProvince |= player.RequestPlayerRevealCardFromHand(card => card == Cards.Province, gameState) != null; player.MoveAllRevealedCardsToHand(); } if (didRevealProvince) { currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card == Cards.Duchy || card.IsType(Cards.Prize), "Must gain a duchy or a prize", isOptional: false, defaultLocation: DeckPlacement.TopOfDeck); } if (!someOtherPlayerRevealedProvince) { currentPlayer.DrawOneCardIntoHand(gameState); currentPlayer.AddCoins(1); } }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { // TODO: trashing potion card is included in total cost // throw NotImplemented() Card[] trashedCards = currentPlayer.RequestPlayerTrashCardsFromHand(gameState, currentPlayer.Hand.Count, isOptional: true); int totalCost = trashedCards.Select(card => card.CurrentCoinCost(currentPlayer)).Sum(); currentPlayer.RequestPlayerGainCardFromSupply( gameState, card => card.CurrentCoinCost(currentPlayer) == totalCost, "Must gain a card costing exactly equal to the total cost of the trashed cards>", isOptional: false); }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, card => true, false); int trashedCardCost = trashedCard.CurrentCoinCost(currentPlayer); CardPredicate validCard = card => (card.CurrentCoinCost(currentPlayer) == (trashedCardCost - 1) ^ card.CurrentCoinCost(currentPlayer) == (trashedCardCost + 1)) && card.potionCost == trashedCard.potionCost; Card gainedCard = currentPlayer.RequestPlayerGainCardFromSupply(gameState, validCard, "Must gain a card costing one less or one more than the trashed card.", isOptional: false, defaultLocation: DeckPlacement.TopOfDeck); if (gainedCard != null) { validCard = card => card.CurrentCoinCost(currentPlayer) == 2 * trashedCardCost - gainedCard.CurrentCoinCost(currentPlayer) && card.potionCost == trashedCard.potionCost; currentPlayer.RequestPlayerGainCardFromSupply(gameState, validCard, "Must gain a card with the right cost.", isOptional: false, defaultLocation: DeckPlacement.TopOfDeck); } }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { Card card = currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCardsToTrash => true, isOptional: false); if (card != null) { for (int i = 0; i < 2; ++i) { currentPlayer.RequestPlayerGainCardFromSupply( gameState, acceptableCard => acceptableCard.CurrentCoinCost(currentPlayer) < card.CurrentCoinCost(currentPlayer) && acceptableCard.potionCost <= card.potionCost, "Must gain 2 cards less than the trashed card"); } } }
public override void OverpayOnPurchase(PlayerState currentPlayer, GameState gameState, int overpayAmount) { // todo: over pay by potion // throw new NotImplementedException() for (int i = 0; i < 2; ++i) { currentPlayer.RequestPlayerGainCardFromSupply( gameState, acceptableCard => acceptableCard.isAction && acceptableCard.CurrentCoinCost(currentPlayer) == overpayAmount, "Must gain 2 action cards costing the amount overpaid"); } }
public override void DoSpecializedTrash(PlayerState currentPlayer, GameState gameState) { Card gainedCard = currentPlayer.RequestPlayerGainCardFromSupply(gameState, acceptableCard => acceptableCard == Cards.Duchy || acceptableCard == Cards.Estate, "Choose Duchy or 3 Estate"); if (gainedCard == null) return; if (gainedCard == Cards.Estate) { currentPlayer.GainCardsFromSupply(gameState, Cards.Estate, 2); // gain 2 more for total of 3. } }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { currentPlayer.AddCoinTokens(2); int coinCount = currentPlayer.actions.GetCoinAmountToUseInButcher(gameState); if (coinCount > currentPlayer.AvailableCoinTokens) throw new Exception("Tried to use too many coins"); Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, card => true, isOptional: true); if (trashedCard == null) return; currentPlayer.AddCoinTokens(-coinCount); currentPlayer.RequestPlayerGainCardFromSupply( gameState, card => card.CurrentCoinCost(currentPlayer) == trashedCard.CurrentCoinCost(currentPlayer) + coinCount && card.potionCost == trashedCard.potionCost, "Must gain a card costing exactly equal to the cost of the card trashed plus any coin spent"); }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { currentPlayer.RequestPlayerGainCardFromSupply( gameState, card => card.CurrentCoinCost(currentPlayer) <= 4 && card.potionCost == 0, "Gain a card costing up to 4", defaultLocation:DeckPlacement.TopOfDeck); }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { CollectionCards trashedCards = currentPlayer.RequestPlayerTrashCardsFromHand(gameState, currentPlayer.Hand.Count, isOptional: true); int totalCoinCost = trashedCards.Select(card => card.CurrentCoinCost(currentPlayer)).Sum(); int totalPotionCost = trashedCards.Select(card => card.potionCost).Sum(); currentPlayer.RequestPlayerGainCardFromSupply( gameState, card => card.CurrentCoinCost(currentPlayer) == totalCoinCost && card.potionCost == totalPotionCost, "Must gain a card costing exactly equal to the total cost of the trashed cards>", isOptional: false); }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { Card gainedCard = currentPlayer.RequestPlayerGainCardFromSupply(gameState, acceptableCard => acceptableCard.CurrentCoinCost(currentPlayer) <= 4 && acceptableCard.potionCost == 0, "Any card costing up to 4"); if (gainedCard.isAction) { currentPlayer.AddActions(1); } if (gainedCard.isTreasure) { currentPlayer.AddCoins(1); } if (gainedCard.isVictory) { currentPlayer.DrawOneCardIntoHand(); } }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card == Cards.Copper, "you may gain a copper", isOptional:true, defaultLocation: DeckPlacement.Hand); }
public override void DoSpecializedAttack(PlayerState currentPlayer, PlayerState otherPlayer, GameState gameState) { // Each other player reveals cards from the top of his deck Card revealedCard = otherPlayer.DrawAndRevealOneCardFromDeck(); while (revealedCard != null) { // until revealing one costing 3 or more if (revealedCard.CurrentCoinCost(otherPlayer) >= 3) { break; } revealedCard = otherPlayer.DrawAndRevealOneCardFromDeck(); } if (revealedCard != null) { // He trashess that card and otherPlayer.MoveRevealedCardToTrash(revealedCard, gameState); // may gain a card costing at most 2 less than it. otherPlayer.RequestPlayerGainCardFromSupply( gameState, acceptableCard => acceptableCard.CurrentCoinCost(currentPlayer) <= revealedCard.CurrentCoinCost(currentPlayer) - 2 && acceptableCard.potionCost <= revealedCard.potionCost, "Must gain a card costing at most 2 less than the trashed card", isOptional: true); } // he discards the other revealed cards otherPlayer.MoveRevealedCardsToDiscard(gameState); }
public override DeckPlacement DoSpecializedWhenGain(PlayerState currentPlayer, GameState gameState) { if (gameState.DoesGameHaveCard(Duchess.card)) { currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card == Duchess.card, "may gain a duchess", isOptional: true); } return DeckPlacement.Default; }
public override void DoSpecializedAttack(PlayerState currentPlayer, PlayerState otherPlayer, GameState gameState) { // Each other player trashes the top card of his deck ... Card trashedCard = otherPlayer.TrashCardFromTopOfDeck(gameState); if (trashedCard != null) { // ... and gains a card with the same cost that you choose currentPlayer.RequestPlayerGainCardFromSupply( gameState, otherPlayer, acceptableCard => acceptableCard.CurrentCoinCost(currentPlayer) == trashedCard.CurrentCoinCost(currentPlayer) && acceptableCard.potionCost == trashedCard.potionCost, "Card costing equal trashed card"); } }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { currentPlayer.RequestPlayerGainCardFromSupply( gameState, acceptableCard => acceptableCard.CurrentCoinCost(currentPlayer) <= 4 && acceptableCard.potionCost == 0, "Card must cost up to 4"); }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { int cardValue = currentPlayer.CardsInPlay.CountTypes; Card gainedCard = currentPlayer.RequestPlayerGainCardFromSupply(gameState, acceptableCard => acceptableCard.CurrentCoinCost(currentPlayer) <= cardValue && acceptableCard.potionCost == 0, "Must gain a card costing up to 1 per differently named card."); if (gainedCard.isVictory) { currentPlayer.MoveCardFromPlayToTrash(gameState); } }
public override void DoSpecializedWhenBuy(PlayerState currentPlayer, GameState gameState) { // if the first card bought this turn is messenger ... if (currentPlayer.CardsBoughtThisTurn.Count == 1) { Card gainedCard = currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card.CurrentCoinCost(currentPlayer) <= 4, "Gain a card costing up to 4"); if (gainedCard != null) { foreach(var player in gameState.players.OtherPlayers) { player.GainCardFromSupply(gainedCard, gameState); } } } }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { currentPlayer.RequestPlayerGainCardFromSupply(gameState, c => c.CurrentCoinCost(currentPlayer) <= 3, "Gain a card costing up to 3", isOptional:true); DoKnightAttack(gameState); }