DoPlayAction() private method

private DoPlayAction ( Dominion.Card currentCard, GameState gameState, int countTimes = 1 ) : void
currentCard Dominion.Card
gameState GameState
countTimes int
return void
Beispiel #1
0
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     // TODO  Make sure throne room, Kings Court and procession stay in play when they play a duration card.
     // throw new NotImplementedException
     Card cardToPlay = currentPlayer.RequestPlayerChooseCardToRemoveFromHandForPlay(gameState, Delegates.IsActionCardPredicate, isTreasure: false, isAction: true, isOptional: false);
     if (cardToPlay != null)
     {
         currentPlayer.DoPlayAction(cardToPlay, gameState, countTimes: 2);
     }
 }
Beispiel #2
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            gameState.gameLog.PushScope();

            Card actionOne = DrawAndRevealTillFindAnActionIsntGolem(currentPlayer, gameState);
            Card actionTwo = DrawAndRevealTillFindAnActionIsntGolem(currentPlayer, gameState);

            currentPlayer.MoveRevealedCardsToDiscard(cardToMove => !cardToMove.Equals(actionOne) && !cardToMove.Equals(actionTwo), gameState);
            // set the cards asside in case golem plays other cards that also must be revealed.
            currentPlayer.MoveRevealedCardsToSetAside();

            if (actionOne != null && actionTwo != null)
            {
                Card cardToPlayFirst = currentPlayer.actions.ChooseCardToPlayFirst(gameState, actionOne, actionTwo);
                if (cardToPlayFirst != actionOne && cardToPlayFirst != actionTwo)
                {
                    throw new Exception("Must pick one of the actions to player first");
                }

                // swap order;
                if (cardToPlayFirst == actionTwo)
                {
                    actionTwo = actionOne;
                    actionOne = cardToPlayFirst;
                }
            }

            if (actionOne != null)
            {
                currentPlayer.cardsSetAside.RemoveCard(actionOne);
                currentPlayer.DoPlayAction(actionOne, gameState);
            }

            if (actionTwo != null)
            {
                currentPlayer.cardsSetAside.RemoveCard(actionTwo);
                currentPlayer.DoPlayAction(actionTwo, gameState);
            }

            gameState.gameLog.PopScope();
        }
Beispiel #3
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            Card revealedCard = currentPlayer.DrawAndRevealOneCardFromDeck(gameState);
            if (revealedCard == null)
                return;

            if (revealedCard.isAction)
            {
                currentPlayer.cardsBeingRevealed.RemoveCard(revealedCard);
                currentPlayer.DoPlayAction(revealedCard, gameState);
            }
            else
            {
                currentPlayer.MoveRevealedCardToTopOfDeck();
            }
        }
Beispiel #4
0
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     Card cardToPlay = currentPlayer.RequestPlayerChooseCardToRemoveFromHandForPlay(gameState, Delegates.IsActionCardPredicate, isTreasure: false, isAction: true, isOptional: false);
     if (cardToPlay != null)
     {
         currentPlayer.DoPlayAction(cardToPlay, gameState, countTimes: 2);
     }
 }
Beispiel #5
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            Card cardToPlay = currentPlayer.RequestPlayerChooseCardToRemoveFromHandForPlay(gameState, acceptableCard => acceptableCard.isAction, isTreasure: false, isAction: true, isOptional: true);
            if (cardToPlay != null)
            {
                currentPlayer.DoPlayAction(cardToPlay, gameState, countTimes: 2);
                currentPlayer.MoveCardFromPlayedAreaToTrash(cardToPlay, gameState);

                currentPlayer.RequestPlayerGainCardFromSupply(gameState,
                    acceptableCard =>
                        acceptableCard.CurrentCoinCost(currentPlayer) == cardToPlay.CurrentCoinCost(currentPlayer) + 1 &&
                        acceptableCard.potionCost == cardToPlay.potionCost &&
                        acceptableCard.isAction,
                    "must gain an action card costing exactly one more than the trashed card");
            }
        }