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); }) ); }
protected override async Task ActAsync(IActionHost host) { var trashed = new List <ICard>(); await host.Attack(async player => { var top2 = player.Reveal(Zone.DeckTop(2)); var treasures = top2.OfType <ITreasureCard>(); if (treasures.Any()) { if (treasures.Count() == 1 || treasures.First().Equals(treasures.Last())) { var soleTreasure = treasures.First(); player.Trash(soleTreasure, Zone.Deck); trashed.Add(soleTreasure); } else { var chosenTreasure = await host.SelectCard("Choose a Treasure to trash.", treasures); player.Trash(chosenTreasure, Zone.Deck); trashed.Add(chosenTreasure); } } }); if (trashed.Any()) { var gained = await host.SelectCards("Choose trashed Treasures to gain.", trashed); if (gained.Any()) { await host.GainFrom(gained, Zone.Trash); } } }
public static Task GainFrom(this IActionHost host, ICard card, Zone from) { return(host.GainFrom(new[] { card.Name }, from)); }
public static Task GainFrom(this IActionHost host, ICard[] cards, Zone from) { return(host.GainFrom(cards.Names(), from)); }