예제 #1
0
        protected override async Task ActAsync(IActionHost host)
        {
            host.AddActions(1);

            await host.ChooseOne("Lurker",
                                 new NamedOption("Trash an Action card from the Supply", async() =>
            {
                var trashed = await host.SelectCard("Choose a card to trash.", Zone.SupplyAvailable, cards => cards.OfType <IActionCard>());
                host.Trash(trashed, Zone.SupplyAvailable);
            }),
                                 new NamedOption("Gain an Action card from the Trash", async() =>
            {
                var gained = await host.SelectCard("Choose a card to gain.", Zone.Trash, cards => cards.OfType <IActionCard>());
                await host.GainFrom(gained, Zone.Trash);
            })
                                 );
        }
예제 #2
0
        protected override async Task ActAsync(IActionHost host)
        {
            host.AddActions(1);

            var trashed = await host.SelectCard("Choose a card to trash.", Zone.DeckTop(3));

            if (trashed != null)
            {
                host.Trash(trashed, Zone.Deck);

                var discarded = await host.SelectCard("Choose a card to discard.", Zone.DeckTop(2));

                if (discarded != null)
                {
                    host.Discard(discarded, Zone.Deck);
                }
            }
        }
예제 #3
0
        protected override async Task ActAsync(IActionHost host)
        {
            host.DrawCards(1);
            host.AddActions(1);

            var trashed = await host.SelectCard("Choose a card to trash.", Zone.Hand);

            if (trashed != null)
            {
                host.Trash(trashed);

                var value  = trashed.GetCost(host).Plus(1);
                var gained = await host.SelectCard("Choose a card to gain.", Zone.SupplyAvailable, card => card.GetCost(host).Equals(value));

                if (gained != null)
                {
                    await host.Gain(gained);
                }
            }
        }
예제 #4
0
        protected override async Task ActAsync(IActionHost host)
        {
            host.DrawCards(2);

            var selections = new Dictionary <IActionHost, string>();
            await host.AllPlayers(async player =>
            {
                var selected       = await player.SelectCard("Choose a card to pass to your left.", Zone.Hand);
                selections[player] = selected.Name;
            });

            foreach (var kvp in selections)
            {
                kvp.Key.PassCard(kvp.Key.GetPlayerToLeft(), kvp.Value);
            }

            var trashed = await host.SelectCards("Choose up to one card to trash.", Zone.Hand, 0, 1);

            if (trashed.Any())
            {
                host.Trash(trashed);
            }
        }
예제 #5
0
파일: Mine.cs 프로젝트: gulbanana/cardgame
        protected override async Task ActAsync(IActionHost host)
        {
            var modifiers = host.GetModifiers();

            var trashedCard = await host.SelectCard(
                "Choose a Treasure to trash.",
                cards => cards.OfType <ITreasureCard>()
                );

            if (trashedCard != null)
            {
                host.Trash(trashedCard);

                var gainedCard = await host.SelectCard(
                    "Choose a Treasure to gain.",
                    Zone.SupplyAvailable,
                    cards => cards
                    .OfType <ITreasureCard>()
                    .Where(card => card.GetCost(modifiers).LessThanOrEqual(trashedCard.GetCost(modifiers).Plus(3)))
                    );

                await host.Gain(gainedCard.Name, Zone.Hand);
            }
        }
예제 #6
0
 public static void Trash(this IActionHost host, string card)
 {
     host.Trash(new[] { card }, Zone.Hand);
 }
예제 #7
0
 public static void Trash(this IActionHost host, ICard card, Zone from)
 {
     host.Trash(new[] { card.Name }, from);
 }
예제 #8
0
 public static void Trash(this IActionHost host, ICard[] cards, Zone from)
 {
     host.Trash(cards.Names(), from);
 }
예제 #9
0
 public static void Trash(this IActionHost host, string card, Zone from)
 {
     host.Trash(new[] { card }, from);
 }
예제 #10
0
 public static void Trash(this IActionHost host, ICard card)
 {
     host.Trash(new[] { card.Name }, Zone.Hand);
 }
예제 #11
0
 public static void Trash(this IActionHost host, ICard[] cards)
 {
     host.Trash(cards.Names(), Zone.Hand);
 }