RequestPlayerTrashCardFromHandAndGainCard() private method

private RequestPlayerTrashCardFromHandAndGainCard ( GameState gameState, CardPredicate acceptableCardsToTrash, CostConstraint costConstraint, int cost, CardRelativeCost cardRelativeCost, bool isOptionalToTrash = false, bool isOptionalToGain = false, DeckPlacement defaultLocation = DeckPlacement.Discard ) : Dominion.Card
gameState GameState
acceptableCardsToTrash CardPredicate
costConstraint CostConstraint
cost int
cardRelativeCost CardRelativeCost
isOptionalToTrash bool
isOptionalToGain bool
defaultLocation DeckPlacement
return Dominion.Card
Beispiel #1
0
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.RequestPlayerTrashCardFromHandAndGainCard(
         gameState,
         acceptableCard => true,
         CostConstraint.UpTo,
         5,
         CardRelativeCost.AbsoluteCost);
 }
Beispiel #2
0
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.RequestPlayerTrashCardFromHandAndGainCard(
                 gameState,
                 card => card.isTreasure,
                 CostConstraint.UpTo,
                 3,
                 CardRelativeCost.RelativeCost,
                 isOptionalToTrash: false,
                 isOptionalToGain: false,
                 defaultLocation: DeckPlacement.Hand);
 }
Beispiel #3
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            PlayerActionChoice playerChoice = currentPlayer.RequestPlayerChooseBetween(gameState, acceptableChoice =>
                acceptableChoice == PlayerActionChoice.GainCard ||
                acceptableChoice == PlayerActionChoice.PlusCard ||
                acceptableChoice == PlayerActionChoice.Trash);

            switch (playerChoice)
            {
                case PlayerActionChoice.PlusCard:
                    {
                        currentPlayer.DrawAdditionalCardsIntoHand(3, gameState);
                        foreach (PlayerState otherPlayer in gameState.players.OtherPlayers)
                        {
                            otherPlayer.DrawAdditionalCardsIntoHand(1, gameState);
                        }
                        break;
                    }
                case PlayerActionChoice.GainCard:
                    {
                        currentPlayer.GainCardFromSupply(gameState, Gold.card);
                        foreach (PlayerState otherPlayer in gameState.players.OtherPlayers)
                        {
                            otherPlayer.GainCardFromSupply(gameState, Silver.card);
                        }
                        break;
                    }
                case PlayerActionChoice.Trash:
                    {
                        currentPlayer.RequestPlayerTrashCardFromHandAndGainCard(
                            gameState,
                            acceptableCardsToTrash => true,
                            CostConstraint.Exactly,
                            2,
                            CardRelativeCost.RelativeCost,
                            isOptionalToTrash: true,
                            isOptionalToGain: false);

                        foreach (PlayerState otherPlayer in gameState.players.OtherPlayers)
                        {
                            otherPlayer.RequestPlayerTrashCardFromHandAndGainCard(
                                gameState,
                                acceptableCardsToTrash => true,
                                CostConstraint.Exactly,
                                1,
                                CardRelativeCost.RelativeCost,
                                isOptionalToTrash: true,
                                isOptionalToGain: false);
                        }
                        break;
                    }
            }
        }
Beispiel #4
0
 public override void DoSpecializedWhenBuy(PlayerState currentPlayer, GameState gameState)
 {
     Card card = currentPlayer.RequestPlayerTrashCardFromHandAndGainCard(
         gameState,
         acceptableCard => true,
         CostConstraint.Exactly,
         2,
         CardRelativeCost.RelativeCost);
 }
Beispiel #5
0
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     for (int i = 0; i < 2; ++i)
     {
         Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHandAndGainCard(
             gameState,
             card => true,
             CostConstraint.Exactly,
             1,
             CardRelativeCost.RelativeCost);
     }
 }
Beispiel #6
0
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.RequestPlayerTrashCardFromHandAndGainCard(
         gameState,
         acceptableCardsToTrash => true,
         CostConstraint.Exactly,
         1,
         CardRelativeCost.RelativeCost,
         isOptionalToTrash: false,
         isOptionalToGain: false);
 }
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     Card cardToTrash = currentPlayer.RequestPlayerTrashCardFromHandAndGainCard(gameState,
         card => true,
         CostConstraint.UpTo,
         3,
         CardRelativeCost.RelativeCost);
 }