MoveCardFromPlayToTrash() private method

private MoveCardFromPlayToTrash ( GameState gameState ) : bool
gameState GameState
return bool
Beispiel #1
0
 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)
        {
            Card trashedCard = null;
            if (currentPlayer.actions.ShouldTrashCard(gameState, Cards.Raze))
            {
                if (currentPlayer.MoveCardFromPlayToTrash(gameState))
                    trashedCard = Cards.Raze;
            }
            else
            {
                trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, c => true, isOptional: false);
            }

            if (trashedCard == null)
                return;

            int cardsToLookAt = trashedCard.CurrentCoinCost(currentPlayer);
            if (cardsToLookAt == 0)
                return;

            currentPlayer.LookAtCardsFromDeck(cardsToLookAt, gameState);
            currentPlayer.RequestPlayerMoveRevealedCardToHand(gameState, c => true);
            currentPlayer.MoveLookedAtCardsToDiscard(gameState);
        }
Beispiel #3
0
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.MoveCardFromPlayToTrash(gameState);
     PileOfCards cardPile = currentPlayer.RequestPlayerChooseCardPileFromSupply(gameState);
     gameState.AddEmbargoTokenToPile(cardPile);
 }
Beispiel #4
0
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     if (currentPlayer.MoveCardFromPlayToTrash(gameState))
     {
         if (currentPlayer.TrashCardFromHandOfType(TreasureMap.card, gameState, guaranteeInHand: false) != null)
         {
             currentPlayer.GainCardsFromSupply(gameState, Gold.card, 4, DeckPlacement.TopOfDeck);
         }
     }
 }
Beispiel #5
0
        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);
            }
        }
Beispiel #6
0
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     if (currentPlayer.actions.ShouldTrashCard(gameState, this))
     {
         if (currentPlayer.MoveCardFromPlayToTrash(gameState))
         {
             gameState.gameLog.PushScope();
             currentPlayer.AddCoins(2);
             gameState.gameLog.PopScope();
         }
     }
 }
Beispiel #7
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            currentPlayer.MoveCardFromPlayToTrash(gameState);

            PlayerState.AttackAction attackAction = delegate(PlayerState currentPlayer2, PlayerState otherPlayer, GameState gameState2)
            {
                if (otherPlayer.Hand.Count >= 5)
                {
                    // TODO: make other player discard a good card
                    otherPlayer.RequestPlayerDiscardCardFromOtherPlayersHand(gameState, otherPlayer);
                }
            };
            currentPlayer.AttackOtherPlayers(gameState, attackAction);

            currentPlayer.GainCardsFromSupply(gameState, Cards.Spoils, 2);
        }
Beispiel #8
0
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     Card cardToTrash = currentPlayer.RequestPlayerTrashCardFromHand(gameState,
         card => card.isAction,
         true);
     if (cardToTrash == null)
     {
         currentPlayer.MoveCardFromPlayToTrash(gameState);
     }
 }
Beispiel #9
0
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     Card cardToPlay = currentPlayer.RequestPlayerChooseCardToRemoveFromHandForPlay(gameState, Delegates.IsTreasureCardPredicate, isTreasure: true, isAction: false, isOptional: true);
     if (cardToPlay != null)
     {
         currentPlayer.DoPlayTreasure(cardToPlay, gameState);
         currentPlayer.DoPlayTreasure(cardToPlay, gameState);
         currentPlayer.MoveCardFromPlayToTrash(gameState);
     }
 }