AddCoins() private method

private AddCoins ( int coinAmount ) : void
coinAmount int
return void
コード例 #1
0
ファイル: Intrigue.cs プロジェクト: peterhal/Dominulator
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     if (currentPlayer.RequestPlayerDiscardCardFromHand(gameState, acceptableCard => acceptableCard == Estate.card, isOptional: true))
     {
         currentPlayer.AddCoins(4);
     }
     else
     {
         currentPlayer.GainCardFromSupply(Estate.card, gameState);
     }
 }
コード例 #2
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            PlayerActionChoice actionChoice = currentPlayer.RequestPlayerChooseBetween(
                gameState,
                acceptableChoice => acceptableChoice == PlayerActionChoice.GainCard ||
                                    acceptableChoice == PlayerActionChoice.PlusCoin ||
                                    acceptableChoice == PlayerActionChoice.Trash);

            switch (actionChoice)
            {
                case PlayerActionChoice.GainCard: currentPlayer.GainCardFromSupply(Silver.card, gameState); break;
                case PlayerActionChoice.PlusCoin: currentPlayer.AddCoins(1); break;
                case PlayerActionChoice.Trash: currentPlayer.RequestPlayerTrashCardsFromHand(gameState, 1, false); break;
                default: throw new Exception("Invalid case");
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
ファイル: Seaside.cs プロジェクト: peterhal/Dominulator
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     Card card = currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => true, isOptional: false);
     if (card != null)
     {
         currentPlayer.AddCoins(card.CurrentCoinCost(currentPlayer));
     }
 }
コード例 #5
0
ファイル: Seaside.cs プロジェクト: peterhal/Dominulator
 public override void DoSpecializedDurationActionAtBeginningOfTurn(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.AddCoins(2);
 }
コード例 #6
0
ファイル: Hinterlands.cs プロジェクト: peterhal/Dominulator
        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();
                }
            }
        }
コード例 #7
0
ファイル: Cornucopia.cs プロジェクト: peterhal/Dominulator
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.RevealCardsFromDeck(4);
     currentPlayer.AddCoins(currentPlayer.cardsBeingRevealed.CountTypes);
     currentPlayer.MoveRevealedCardsToDiscard(gameState);
 }
コード例 #8
0
ファイル: Intrigue.cs プロジェクト: peterhal/Dominulator
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     while (!currentPlayer.hand.IsEmpty)
     {
         if (!currentPlayer.RequestPlayerDiscardCardFromHand(gameState, acceptableCard => true, isOptional: true))
         {
             break;
         }
         currentPlayer.AddCoins(1);
     }
 }
コード例 #9
0
ファイル: DarkAges.cs プロジェクト: peterhal/Dominulator
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            bool[] otherPlayersAffectedByAttacks = new bool[gameState.players.OtherPlayers.Count()];

            // from rule book
            // "Players responding to this attack must choose to do so before you decide whether or not to trash 2 cards"
            int otherIndex = 0;
            foreach (PlayerState otherPlayer in gameState.players.OtherPlayers)
            {
                otherPlayersAffectedByAttacks[otherIndex++] = otherPlayer.IsAffectedByAttacks(gameState);
            }

            if (currentPlayer.RequestPlayerTrashCardsFromHand(gameState, 2, isOptional: true, allOrNone:true).Length == 2)
            {
                currentPlayer.DrawAdditionalCardsIntoHand(2);
                currentPlayer.AddCoins(2);

                otherIndex = 0;
                foreach (PlayerState otherPlayer in gameState.players.OtherPlayers)
                {
                    if (otherPlayersAffectedByAttacks[otherIndex++])
                    {
                        otherPlayer.RequestPlayerDiscardDownToCountInHand(gameState, 3);
                    }
                }
            }
        }
コード例 #10
0
ファイル: DarkAges.cs プロジェクト: peterhal/Dominulator
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            currentPlayer.RevealCardsFromDeck(1);
            Card revealedCard  = currentPlayer.CardsBeingRevealed.First();

            currentPlayer.RequestPlayerDiscardRevealedCard(gameState);
            currentPlayer.MoveRevealedCardToTopOfDeck();

            if (revealedCard.isAction)
            {
                currentPlayer.AddActions(1);
            }

            if (revealedCard.isTreasure)
            {
                currentPlayer.AddCoins(1);
            }

            if (revealedCard.isVictory)
            {
                currentPlayer.DrawOneCardIntoHand();
            }
        }
コード例 #11
0
ファイル: DarkAges.cs プロジェクト: peterhal/Dominulator
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => true, isOptional: false);
     currentPlayer.AddCoins(CurrentCoinValue(gameState));
 }
コード例 #12
0
ファイル: DarkAges.cs プロジェクト: peterhal/Dominulator
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState,
                acceptableChoice => acceptableChoice == PlayerActionChoice.Discard ||
                                    acceptableChoice == PlayerActionChoice.GainCard ||
                                    acceptableChoice == PlayerActionChoice.TopDeck);

            switch (choice)
            {
                case PlayerActionChoice.Discard: currentPlayer.RequestPlayerDiscardCardsFromHand(gameState, 2, isOptional: false); break;
                case PlayerActionChoice.GainCard: currentPlayer.GainCardFromSupply(Cards.Copper, gameState); break;
                case PlayerActionChoice.TopDeck: currentPlayer.RequestPlayerTopDeckCardFromHand(gameState, acceptableCard => true, isOptional: false); break;
            }

            PlayerActionChoice choice2 = currentPlayer.RequestPlayerChooseBetween(gameState,
                acceptableChoice => acceptableChoice == PlayerActionChoice.PlusCoin ||
                                    acceptableChoice == PlayerActionChoice.Trash ||
                                    acceptableChoice == PlayerActionChoice.GainCard);

            switch (choice2)
            {
                case PlayerActionChoice.PlusCoin: currentPlayer.AddCoins(3); break;
                case PlayerActionChoice.Trash: currentPlayer.TrashHand(gameState); break;
                case PlayerActionChoice.GainCard: currentPlayer.GainCardFromSupply(Cards.Duchy, gameState); break;
            }
        }
コード例 #13
0
ファイル: DarkAges.cs プロジェクト: peterhal/Dominulator
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            int discardedCount = currentPlayer.RequestPlayerDiscardCardsFromHand(gameState, currentPlayer.Hand.Count, isOptional:true);
            currentPlayer.DrawAdditionalCardsIntoHand(discardedCount);
            discardedCount = currentPlayer.RequestPlayerDiscardCardsFromHand(gameState, currentPlayer.Hand.Count, isOptional: true);
            currentPlayer.AddCoins(discardedCount);

            // TODO:  How does the player know they are discarding for coins or for card?
            // throw new NotImplementedException();
        }
コード例 #14
0
ファイル: DarkAges.cs プロジェクト: peterhal/Dominulator
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            currentPlayer.RevealHand();

            currentPlayer.AddCoins(0 - currentPlayer.Hand.CountWhere(card => card.isTreasure));
        }
コード例 #15
0
 private static void ApplyChoice(PlayerActionChoice choice, PlayerState currentPlayer, GameState gameState)
 {
     switch (choice)
     {
         case PlayerActionChoice.PlusCard: currentPlayer.DrawAdditionalCardsIntoHand(2, gameState); break;
         case PlayerActionChoice.PlusAction: currentPlayer.AddActions(2); break;
         case PlayerActionChoice.PlusCoin: currentPlayer.AddCoins(2); break;
         case PlayerActionChoice.GainCard: currentPlayer.GainCardsFromSupply(gameState, Cards.Silver, 4); break;
         default: throw new Exception();
     }
 }
コード例 #16
0
ファイル: Intrigue.cs プロジェクト: peterhal/Dominulator
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            // Choose one: ...
            PlayerActionChoice actionChoice = currentPlayer.RequestPlayerChooseBetween(
                gameState,
                acceptableChoice => acceptableChoice == PlayerActionChoice.Discard || acceptableChoice == PlayerActionChoice.PlusCoin);

            PlayerState.AttackAction attackAction = this.DoEmptyAttack;

            if (actionChoice == PlayerActionChoice.PlusCoin)
            {
                // +2 coin;
                currentPlayer.AddCoins(2);
            }
            else
            {
                // discard your hand,
                currentPlayer.DiscardHand(gameState);
                // +4 cards
                currentPlayer.DrawAdditionalCardsIntoHand(4);

                attackAction = this.DoSpecializedAttackInternal;
            }

            currentPlayer.AttackOtherPlayers(gameState, attackAction);
        }
コード例 #17
0
ファイル: Intrigue.cs プロジェクト: peterhal/Dominulator
 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");
     }
 }
コード例 #18
0
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     int bankValue = currentPlayer.cardsBeingPlayed.CountWhere(card => card.isTreasure); // +1 because bank is already in the played set
     currentPlayer.AddCoins(bankValue);
 }
コード例 #19
0
ファイル: Intrigue.cs プロジェクト: peterhal/Dominulator
        private void GainBenefitFromCard(Card card, PlayerState currentPlayer)
        {
            if (card.isAction)
            {
                currentPlayer.AddActions(2);
            }

            if (card.isTreasure)
            {
                currentPlayer.AddCoins(2);
            }

            if (card.isVictory)
            {
                currentPlayer.DrawAdditionalCardsIntoHand(2);
            }
        }
コード例 #20
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            int additionalCoins = gameState.supplyPiles.Where(pile => pile.ProtoTypeCard.isVictory && gameState.HasCardEverBeenGainedFromPile(pile)).Count();
            currentPlayer.AddCoins(additionalCoins);

            currentPlayer.RequestPlayerTrashCardFromHand(gameState, card => true, isOptional: false);
        }
コード例 #21
0
ファイル: Hinterlands.cs プロジェクト: peterhal/Dominulator
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     if (!currentPlayer.CardsInPlay.Where(c => c == FoolsGold.card).Any())
     {
         currentPlayer.AddCoins(1);
     }
     else
     {
         currentPlayer.AddCoins(4);
     }
 }
コード例 #22
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            int cardDiscardCount = currentPlayer.RequestPlayerDiscardCardsFromHand(gameState, int.MaxValue, isOptional: true);
            currentPlayer.AddCoins(cardDiscardCount);

            foreach (PlayerState otherPlayer in gameState.players.OtherPlayers)
            {
                PlayerActionChoice choice = otherPlayer.RequestPlayerChooseBetween(gameState,
                    isValidChoice => isValidChoice == PlayerActionChoice.Discard ||
                                     isValidChoice == PlayerActionChoice.Nothing);

                switch (choice)
                {
                    case PlayerActionChoice.Discard:
                        {
                            int cardCount = otherPlayer.RequestPlayerDiscardCardsFromHand(gameState, 2, isOptional: false);
                            if (cardCount == 2)
                            {
                                otherPlayer.DrawOneCardIntoHand(gameState);
                            }
                            break;
                        }
                    case PlayerActionChoice.Nothing:
                        break;
                }
            }
        }
コード例 #23
0
ファイル: Alchemy.cs プロジェクト: NathanTeeuwen/Dominulator
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     int stoneValue = (currentPlayer.CardsInDeck.Count + currentPlayer.discard.Count) / 5;
     currentPlayer.AddCoins(stoneValue);
 }
コード例 #24
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);
                }
            }
        }
コード例 #25
0
ファイル: Seaside.cs プロジェクト: peterhal/Dominulator
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState,
                acceptableChoice =>
                    acceptableChoice == PlayerActionChoice.PlusCoin ||
                    acceptableChoice == PlayerActionChoice.Trash);

            PlayerState.AttackAction attackAction = this.DoEmptyAttack;

            bool wasACardTrashed = false;

            if (choice == PlayerActionChoice.PlusCoin)
            {
                currentPlayer.AddCoins(currentPlayer.pirateShipTokenCount);
            }
            else if (choice == PlayerActionChoice.Trash)
            {
                throw new NotImplementedException();
            }

            currentPlayer.AttackOtherPlayers(gameState, attackAction);

            if (wasACardTrashed)
            {
                currentPlayer.pirateShipTokenCount++;
            }
        }
コード例 #26
0
ファイル: Intrigue.cs プロジェクト: peterhal/Dominulator
        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();
            }
        }
コード例 #27
0
ファイル: BaseSet.cs プロジェクト: NathanTeeuwen/Dominulator
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     Card card = currentPlayer.TrashCardFromHandOfType(Copper.card, gameState, guaranteeInHand: false);
     if (card != null)
     {
         currentPlayer.AddCoins(3);
     }
 }
コード例 #28
0
ファイル: Intrigue.cs プロジェクト: peterhal/Dominulator
 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();
         }
     }
 }
コード例 #29
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState, c =>
                c == PlayerActionChoice.PutCopperOnTavernMat ||
                c == PlayerActionChoice.PlusCoinPerCoppperOnTavernMat);

            switch (choice)
            {
                case PlayerActionChoice.PutCopperOnTavernMat:
                {
                    currentPlayer.MoveCardFromHandToTavernMatt(Cards.Copper);
                    break;
                }
                case PlayerActionChoice.PlusCoinPerCoppperOnTavernMat:
                {
                    int copperCount = PlayerMiserValue(currentPlayer);
                    currentPlayer.AddCoins(copperCount);
                    break;
                }
            }
        }
コード例 #30
0
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.AddCoins(currentPlayer.AvailableActions);
 }