AddBuys() private method

private AddBuys ( int actionAmount ) : void
actionAmount int
return void
Esempio n. 1
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            if (currentPlayer.RequestPlayerTrashCardFromHand(gameState, card => card.isTreasure, isOptional:true) != null)
            {
                PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(
                    gameState,
                    acceptableChoice => acceptableChoice == PlayerActionChoice.PlusCard || acceptableChoice == PlayerActionChoice.PlusCoin);

                switch (choice)
                {
                    case PlayerActionChoice.PlusCard:
                    {
                        currentPlayer.DrawAdditionalCardsIntoHand(2);
                        currentPlayer.AddActions(1);
                        break;
                    }
                    case PlayerActionChoice.PlusCoin:
                    {
                        currentPlayer.AddCoins(2);
                        currentPlayer.AddBuys(1);
                        break;
                    }
                    default:
                        throw new Exception();
                }
            }
        }
Esempio n. 2
0
 public override void DoSpecializedDurationActionAtBeginningOfTurn(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.DrawAdditionalCardsIntoHand(2);
     currentPlayer.AddBuys(1);
 }
Esempio n. 3
0
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     // TODO:  How does the player know whether he is discarding for action or buy?
     if (currentPlayer.RequestPlayerDiscardCardFromHand(gameState, card => true, isOptional: true))
     {
         currentPlayer.AddActions(1);
     }
     if (currentPlayer.RequestPlayerDiscardCardFromHand(gameState, card => true, isOptional: true))
     {
         currentPlayer.AddBuys(1);
     }
 }
Esempio n. 4
0
 private void DoActionChoice(PlayerState currentPlayer, PlayerActionChoice actionChoice)
 {
     switch (actionChoice)
     {
         case PlayerActionChoice.PlusCard: currentPlayer.DrawOneCardIntoHand(); break;
         case PlayerActionChoice.PlusAction: currentPlayer.AddActions(1); break;
         case PlayerActionChoice.PlusBuy: currentPlayer.AddBuys(1); break;
         case PlayerActionChoice.PlusCoin: currentPlayer.AddCoins(1); break;
         default: throw new Exception("Invalid pawn action choice");
     }
 }
Esempio n. 5
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            int countEmpty = gameState.supplyPiles.Where(pile => pile.IsEmpty).Count();

            if (countEmpty >= 1)
            {
                currentPlayer.DrawOneCardIntoHand(gameState);

                if (countEmpty >= 2)
                {
                    currentPlayer.AddCoins(1);
                    currentPlayer.AddBuys(1);
                }
            }
        }
Esempio n. 6
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState,
                acceptableChoice =>
                    acceptableChoice == PlayerActionChoice.PlusAction ||
                    acceptableChoice == PlayerActionChoice.PlusBuy ||
                    acceptableChoice == PlayerActionChoice.GainCard);

            switch (choice)
            {
                case PlayerActionChoice.PlusAction: currentPlayer.AddActions(2); break;
                case PlayerActionChoice.PlusBuy: currentPlayer.AddBuys(2); break;
                case PlayerActionChoice.GainCard: currentPlayer.GainCardFromSupply(Cards.Silver, gameState); break;
                default: throw new Exception();
            }
        }
Esempio n. 7
0
 private static void DelayedAction(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.DrawAdditionalCardsIntoHand(5, gameState);
     currentPlayer.AddBuys(1);
     currentPlayer.AddActions(1);
 }