当前位置: 首页>>代码示例>>C#>>正文


C# PlayerState.GainCardFromSupply方法代码示例

本文整理汇总了C#中Dominion.PlayerState.GainCardFromSupply方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerState.GainCardFromSupply方法的具体用法?C# PlayerState.GainCardFromSupply怎么用?C# PlayerState.GainCardFromSupply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dominion.PlayerState的用法示例。


在下文中一共展示了PlayerState.GainCardFromSupply方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoSpecializedAction

 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);
     }
 }
开发者ID:peterhal,项目名称:Dominulator,代码行数:11,代码来源:Intrigue.cs

示例2: DoSpecializedAction

        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");
            }
        }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:16,代码来源:Adventures.cs

示例3: DoSpecializedAttack

        public override void DoSpecializedAttack(PlayerState currentPlayer, PlayerState otherPlayer, GameState gameState)
        {
            otherPlayer.RevealCardsFromDeck(2);

            Card cardtoTrash = null;
            CardPredicate acceptableCards = card => card == Silver.card || card == Gold.card;
            if (otherPlayer.cardsBeingRevealed.HasCard(acceptableCards))
            {
                Card cardTypeToTrash = currentPlayer.actions.GetCardFromRevealedCardsToTrash(gameState, otherPlayer, acceptableCards);

                cardtoTrash = otherPlayer.cardsBeingRevealed.RemoveCard(cardTypeToTrash);
                if (cardtoTrash == null)
                {
                    throw new Exception("Must choose a revealed card to trash");
                }

                if (!acceptableCards(cardtoTrash))
                {
                    throw new Exception("Player Must choose a treasure card to trash");
                }

                otherPlayer.MoveCardToTrash(cardtoTrash, gameState);
            }

            if (!otherPlayer.CardsBeingRevealed.Where(card => card.isTreasure).Any())
            {
                otherPlayer.GainCardFromSupply(Copper.card, gameState);
            }

            if (cardtoTrash != null)
            {
                Card cardToGain = gameState.trash.RemoveCard(cardtoTrash);
                currentPlayer.GainCard(gameState, cardToGain, DeckPlacement.Trash, DeckPlacement.Discard);
            }

            otherPlayer.MoveRevealedCardsToDiscard(gameState);
        }
开发者ID:peterhal,项目名称:Dominulator,代码行数:37,代码来源:Hinterlands.cs

示例4: DoSpecializedAction

        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();
            }
        }
开发者ID:peterhal,项目名称:Dominulator,代码行数:16,代码来源:DarkAges.cs

示例5: DoSpecializedAction

        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            currentPlayer.GainCardFromSupply(Silver.card, gameState);

            // look at the top card of the deck and discard or put it back
            Card card = currentPlayer.DrawAndLookAtOneCardFromDeck();
            if (card != null)
            {
                if (currentPlayer.actions.ShouldPlayerDiscardCardFromDeck(gameState, currentPlayer, card))
                {
                    currentPlayer.gameLog.PushScope();
                    currentPlayer.MoveLookedAtCardsToDiscard(gameState);
                    currentPlayer.gameLog.PlayerDiscardCard(currentPlayer, card);
                    currentPlayer.gameLog.PopScope();
                }
                else
                {
                    currentPlayer.MoveLookedAtCardToTopOfDeck(card);
                }
            }

            currentPlayer.DrawUntilCountInHand(5);

            currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => !acceptableCard.isTreasure, isOptional: true);
        }
开发者ID:peterhal,项目名称:Dominulator,代码行数:25,代码来源:Hinterlands.cs

示例6: DoSpecializedAction

        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;
                    }
            }
        }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:53,代码来源:Promo.cs

示例7: DoSpecializedAttack

 public override void DoSpecializedAttack(PlayerState currentPlayer, PlayerState otherPlayer, GameState gameState)
 {
     if (!otherPlayer.RequestPlayerDiscardCardFromHand(gameState, card => card.isCurse, true))
     {
         otherPlayer.GainCardFromSupply(Cards.Curse, gameState);
         otherPlayer.GainCardFromSupply(Cards.Copper, gameState);
     }
 }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:8,代码来源:Prosperity.cs

示例8: DoSpecializedActionOnBuyWhileInPlay

 private new void DoSpecializedActionOnBuyWhileInPlay(PlayerState currentPlayer, GameState gameState, Card boughtCard)
 {
     if (boughtCard.CurrentCoinCost(currentPlayer) <= 4 && boughtCard.potionCost == 0 && !boughtCard.isVictory)
     {
         currentPlayer.GainCardFromSupply(gameState, boughtCard);
     }
 }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:7,代码来源:Prosperity.cs

示例9: DoSpecializedAction

        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            Card revealedCard = currentPlayer.RequestPlayerRevealCardFromHand(card => card.isTreasure, gameState);

            if (revealedCard != null)
            {
                currentPlayer.GainCardFromSupply(gameState, revealedCard);
            }
        }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:9,代码来源:Prosperity.cs

示例10: DoSpecializedActionOnTrashWhileInHand

        private new bool DoSpecializedActionOnTrashWhileInHand(PlayerState currentPlayer, GameState gameState, Card gainedCard)
        {
            if (currentPlayer.actions.ShouldPlayerDiscardCardFromHand(gameState, currentPlayer, this))
            {
                currentPlayer.DiscardCardFromHand(gameState, this);
                currentPlayer.GainCardFromSupply(Gold.card, gameState);
                return true;
            }

            return false;
        }
开发者ID:peterhal,项目名称:Dominulator,代码行数:11,代码来源:DarkAges.cs

示例11: DoSpecializedDiscardFromPlay

 public override void DoSpecializedDiscardFromPlay(PlayerState currentPlayer, GameState gameState)
 {
     if (currentPlayer.turnCounters.BuysUsed == 0)
     {
         currentPlayer.MoveCardBeingDiscardedToTrash(gameState);
         currentPlayer.GainCardFromSupply(Cards.Madman, gameState);
     }
 }
开发者ID:peterhal,项目名称:Dominulator,代码行数:8,代码来源:DarkAges.cs

示例12: DoSpecializedWhenGain

 public override DeckPlacement DoSpecializedWhenGain(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.GainCardFromSupply(Cards.Ruins, gameState);
     currentPlayer.GainCardFromSupply(Cards.Ruins, gameState);
     return DeckPlacement.Default;
 }
开发者ID:peterhal,项目名称:Dominulator,代码行数:6,代码来源:DarkAges.cs

示例13: DoSpecializedActionOnGainWhileInHand

        public new DeckPlacement DoSpecializedActionOnGainWhileInHand(PlayerState currentPlayer, GameState gameState, Card gainedCard)
        {
            if (currentPlayer.actions.ShouldRevealCardFromHandForCard(gameState, this, gainedCard))
            {
                currentPlayer.RevealAndReturnCardToHand(this, gameState);
                currentPlayer.GainCardFromSupply(Silver.card, gameState);
                return DeckPlacement.None;
            }

            return DeckPlacement.Default;
        }
开发者ID:peterhal,项目名称:Dominulator,代码行数:11,代码来源:Hinterlands.cs

示例14: DoSpecializedAction

 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     if (currentPlayer.RequestPlayerRevealCardFromHand(card => card == Province.card, gameState) != null)
     {
         currentPlayer.GainCardFromSupply(Gold.card, gameState);
     }
     else
     {
         currentPlayer.GainCardFromSupply(Silver.card, gameState);
     }
 }
开发者ID:peterhal,项目名称:Dominulator,代码行数:11,代码来源:Seaside.cs

示例15: DoSpecializedDiscardNonCleanup

 public override void DoSpecializedDiscardNonCleanup(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.GainCardFromSupply(Gold.card, gameState);
 }
开发者ID:peterhal,项目名称:Dominulator,代码行数:4,代码来源:Hinterlands.cs


注:本文中的Dominion.PlayerState.GainCardFromSupply方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。