예제 #1
0
 protected sealed override async Task ReactAsync(IActionHost host, string attacker)
 {
     if (attacker != host.Player && await host.YesNo(Name, $@"<run>Reveal</run><card>{Name}</card><run>from your hand?</run>"))
     {
         host.Reveal(Name);
         await ReactAsync(host.Isolate());
     }
 }
예제 #2
0
        public static ICard[] Reveal(this IActionHost host, Zone from)
        {
            var cards = host.Examine(from);

            if (cards.Any())
            {
                host.Reveal(cards, from);
            }
            return(cards);
        }
예제 #3
0
        protected override void Act(IActionHost host)
        {
            host.AddActions(2);

            var hand = host.Reveal(Zone.Hand);

            if (!hand.Any(card => card.Types.Contains(CardType.Action)))
            {
                host.DrawCards(2);
            }
        }
예제 #4
0
        protected override async Task ActAsync(IActionHost host)
        {
            var hand = host.Examine(Zone.Hand);

            if (hand.Names().Contains("Province") && await host.YesNo("Explorer", "<run>Reveal a</run><card>Province</card><run>from your hand?</run>"))
            {
                host.Reveal("Province");
                await host.Gain("Gold", Zone.Hand);
            }
            else
            {
                await host.Gain("Silver", Zone.Hand);
            }
        }
예제 #5
0
        protected override async Task ActAsync(IActionHost host)
        {
            var revealed = await host.SelectCard("Choose a card to reveal.");

            if (revealed != null)
            {
                host.Reveal(revealed);
                await host.ChooseMultiple("Courtier", revealed.Types.Length,
                                          new NamedOption("<bold>+1 Action</bold>", () => host.AddActions(1)),
                                          new NamedOption("<bold>+1 Buy</bold>", () => host.AddBuys(1)),
                                          new NamedOption("<bold><sym>+coin3</sym></bold>", () => host.AddCoins(3)),
                                          new NamedOption("<run>Gain a</run><card>Gold</card>", () => host.Gain("Gold"))
                                          );
            }
        }
예제 #6
0
        protected override async Task ActAsync(IActionHost host)
        {
            host.DrawCards(1);
            host.AddActions(1);

            var named = await host.SelectCard("Name a card.", Zone.SupplyAll);

            host.Name(named);

            var top1 = host.Reveal(Zone.DeckTop(1));

            if (named.Equals(top1.SingleOrDefault()))
            {
                host.PutIntoHand(named, Zone.Deck);
            }
        }
예제 #7
0
        protected override async Task ActAsync(IActionHost host)
        {
            var revealed = await host.SelectCard("Choose a card to reveal.");

            if (revealed != null)
            {
                host.Reveal(revealed);
                var hand   = host.Examine(Zone.Hand);
                var copies = hand.Where(c => c == revealed);

                var returned = await host.SelectCards("Choose copies to return.", copies);

                host.ReturnToSupply(returned);

                await host.Attack(target => target.Gain(revealed));
            }
        }
예제 #8
0
        protected override async Task ActAsync(IActionHost host)
        {
            host.DrawCards(1);
            host.AddActions(1);

            var top4     = host.Reveal(Zone.DeckTop(4));
            var drawn    = top4.Where(card => card.Name == "Copper" || card.Name == "Potion").ToArray();
            var notDrawn = top4.Without(drawn).ToArray();

            host.PutIntoHand(drawn, Zone.Deck);

            if (notDrawn.Length > 1)
            {
                var reordered = await host.OrderCards("Put these cards back in any order.", notDrawn);

                host.Reorder(reordered, Zone.DeckTop(notDrawn.Length));
            }
        }
예제 #9
0
        protected override async Task ActAsync(IActionHost host)
        {
            host.DrawCards(3);

            var top4 = host.Reveal(Zone.DeckTop(4));
            var victoryOrCurseCards = top4.Where(card => card.Types.Contains(CardType.Victory) || card.Name == "Curse").ToArray();

            if (victoryOrCurseCards.Length > 0)
            {
                host.PutIntoHand(victoryOrCurseCards, Zone.Deck);

                if (victoryOrCurseCards.Length < 3)
                {
                    var zone           = Zone.DeckTop(4 - victoryOrCurseCards.Length);
                    var reorderedCards = await host.OrderCards("Put these cards back in any order.", zone);

                    host.Reorder(reorderedCards, zone);
                }
            }
        }
예제 #10
0
파일: Scout.cs 프로젝트: gulbanana/cardgame
        protected override async Task ActAsync(IActionHost host)
        {
            host.AddActions(1);

            var top4            = host.Reveal(Zone.DeckTop(4));
            var victoryCards    = top4.Where(c => c.Types.Contains(CardType.Victory)).ToArray();
            var nonVictoryCards = top4.Where(c => !c.Types.Contains(CardType.Victory)).ToArray();

            if (victoryCards.Any())
            {
                host.PutIntoHand(victoryCards, Zone.Deck);
            }

            if (nonVictoryCards.Count() > 1)
            {
                var zone           = Zone.DeckTop(nonVictoryCards.Count());
                var reorderedCards = await host.OrderCards("Put these cards back in any order.", zone);

                host.Reorder(reorderedCards, zone);
            }
        }
예제 #11
0
        protected override void Act(IActionHost host)
        {
            var foundTreasures = 0;
            var reshuffles     = host.ShuffleCount;

            while (foundTreasures < 2 && host.ShuffleCount - reshuffles < 2)
            {
                var top1 = host.Reveal(Zone.DeckTop(1)).SingleOrDefault();
                if (top1 != null)
                {
                    if (top1.Types.Contains(CardType.Treasure))
                    {
                        foundTreasures++;
                        host.PutIntoHand(top1, Zone.Deck);
                    }
                    else
                    {
                        host.Discard(top1, Zone.Deck);
                    }
                }
            }
        }
예제 #12
0
 public static void Reveal(this IActionHost host, string card)
 {
     host.Reveal(new[] { card }, Zone.Hand);
 }
예제 #13
0
 public static void Reveal(this IActionHost host, string card, Zone from)
 {
     host.Reveal(new[] { card }, from);
 }
예제 #14
0
 public static void Reveal(this IActionHost host, ICard[] cards, Zone from)
 {
     host.Reveal(cards.Names(), from);
 }
예제 #15
0
 public static void Reveal(this IActionHost host, ICard card)
 {
     host.Reveal(new[] { card.Name }, Zone.Hand);
 }
예제 #16
0
 public static void Reveal(this IActionHost host, ICard card, Zone from)
 {
     host.Reveal(new[] { card.Name }, from);
 }
예제 #17
0
 public static void Reveal(this IActionHost host, ICard[] cards)
 {
     host.Reveal(cards.Names(), Zone.Hand);
 }