コード例 #1
0
ファイル: Transmute.cs プロジェクト: vladdou/Dominion
        public void Play(TurnContext context)
        {
            if (context.ActivePlayer.Hand.CardCount > 0)
            {
                var gainUtility = new GainUtility(context, context.ActivePlayer);

                var activity = Activities.SelectACardToTrash(context, context.ActivePlayer, this, card =>
                {
                    if (card is IActionCard)
                    {
                        gainUtility.Gain <Duchy>();
                    }
                    if (card is ITreasureCard)
                    {
                        gainUtility.Gain <Transmute>();
                    }
                    if (card is IVictoryCard)
                    {
                        gainUtility.Gain <Gold>();
                    }
                });

                context.AddSingleActivity(activity, this);
            }
        }
コード例 #2
0
 public void Play(TurnContext context)
 {
     context.DrawCards(3);
     if (context.ActivePlayer.Hand.CardCount > 0)
     {
         context.AddSingleActivity(Activities.PutCardFromHandOnTopOfDeck(context, this), this);
     }
 }
コード例 #3
0
ファイル: Explorer.cs プロジェクト: vladdou/Dominion
        public void Play(TurnContext context)
        {
            var    gainUtility = new GainUtility(context, context.ActivePlayer);
            Action gainSilver  = () => gainUtility.Gain <Silver>(context.ActivePlayer.Hand);
            Action gainGold    = () => gainUtility.Gain <Gold>(context.ActivePlayer.Hand);

            if (context.ActivePlayer.Hand.OfType <Province>().Any())
            {
                var activity = Activities.ChooseYesOrNo(
                    context.Game.Log,
                    context.ActivePlayer,
                    "Reveal a Province to gain a Gold?",
                    this,
                    gainGold,
                    gainSilver);
                context.AddSingleActivity(activity, this);
            }
            else
            {
                gainSilver();
            }
        }
コード例 #4
0
ファイル: Ironworks.cs プロジェクト: vladdou/Dominion
        public void Play(TurnContext context)
        {
            var activity = Activities.GainACardCostingUpToX(context.Game.Log, context.ActivePlayer, 4, this);

            activity.AfterCardGained = card =>
            {
                if (card is IActionCard)
                {
                    context.RemainingActions += 1;
                }
                if (card is ITreasureCard)
                {
                    context.AvailableSpend += 1;
                }
                if (card is IVictoryCard)
                {
                    context.DrawCards(1);
                }
            };

            context.AddSingleActivity(activity, this);
        }
コード例 #5
0
 public void Play(TurnContext context)
 {
     context.AddSingleActivity(
         Activities.GainACardCostingUpToX(context.Game.Log, context.ActivePlayer, 4, this), this);
 }
コード例 #6
0
 public void Play(TurnContext context)
 {
     context.RemainingActions += 1;
     context.AddSingleActivity(Activities.DiscardCardsToDrawCards(context, this), this);
 }
コード例 #7
0
 public void Play(TurnContext context)
 {
     context.RemainingActions += 2;
     context.AddSingleActivity(
         Activities.GainAnActionCardCostingUpToX(context.Game.Log, context.ActivePlayer, 5, this, true), this);
 }