protected override async Task ActAsync(IActionHost host) { host.DrawCards(2); host.AddActions(1); var inserted = await host.SelectCard("Choose a card to put in your deck.", Zone.Hand); var deckSize = host.Count(Zone.Deck); if (deckSize == 0) { host.PutOnDeck(inserted); } else { var options = Enumerable.Range(0, deckSize + 1).Select(i => { var label = i == 0 ? "Top" : i == deckSize ? "Bottom" : i.ToString(); return(new NamedOption(label, () => host.InsertIntoDeck(inserted.Name, i))); }); await host.ChooseOne($"Choose where to put {inserted.Name}.", options.ToArray()); } }
protected override async Task ActAsync(IActionHost host) { host.DrawCards(3); var put = await host.SelectCard("Choose a card to put onto your deck."); host.PutOnDeck(put); }
protected override async Task ReactAsync(IActionHost host) { host.DrawCards(2); var put = await host.SelectCards("Choose cards to put back.", Zone.Hand, 2, 2); host.PutOnDeck(put); var ordered = await host.OrderCards("Choose the order of the cards put back.", Zone.DeckTop(2)); host.Reorder(ordered, Zone.Deck); }
protected override async Task OnDiscardFromPlayAsync(IActionHost host) { // XXX RAW you choose discard order, but we elide that for UI reasons. in practice we trigger all IReactor discards first var playedPotion = host.Examine(Zone.InPlay).Any(card => card.Name == "Potion"); if (playedPotion && await host.YesNo("Alchemist", "<run>Put</run><card>Alchemist</card><run>back onto your deck?</run>")) { host.PutOnDeck("Alchemist", Zone.Discard); } }
protected override async Task OnDiscardFromPlayAsync(IActionHost host) { var bought = host.Examine(Zone.RecentBuys); var boughtVictories = bought.Any(card => card.Types.Contains(CardType.Victory)); if (!boughtVictories && await host.YesNo("Treasury", "<run>Put</run><card>Treasury</card><run>back onto your deck?</run>")) { host.PutOnDeck("Treasury", Zone.Discard); } }
protected override async Task ActAsync(IActionHost host) { host.DrawCards(1); host.AddActions(1); var bottomCard = host.Examine(Zone.DeckBottom).SingleOrDefault(); if (bottomCard != null && await host.YesNo("Pearl Diver", $"<run>Put</run><card>{bottomCard.Name}</card><run>on top of your deck?</run>")) { host.PutOnDeck(bottomCard, Zone.DeckBottom); } }
protected override async Task ActAsync(IActionHost host) { host.DrawCards(1); host.AddActions(1); var selected = await host.SelectCards("Choose up to one card from your discard pile.", Zone.Discard, 0, 1); if (selected.Any()) { host.PutOnDeck(selected.Single(), Zone.Discard); } }
protected override async Task OnDiscardFromPlayAsync(IActionHost host) { var playedTreasures = host.Examine(Zone.RecentPlays).Any(card => card.Types.Contains(CardType.Treasure)); if (playedTreasures) { var putBack = await host.SelectCards( "Choose a Treasure, or none, to put back onto your deck.", Zone.InPlay, card => card.Types.Contains(CardType.Treasure), 0, 1 ); host.PutOnDeck(putBack, Zone.InPlay); } }
protected override async Task ActAsync(IActionHost host) { var gainedCard = await host.SelectCard( "Choose a card to gain.", Zone.SupplyAvailable, card => card.GetCost(host).LessThanOrEqual(5) ); await host.Gain(gainedCard.Name, Zone.Hand); var placedCard = await host.SelectCard( "Choose a card to put onto your deck.", Zone.Hand ); host.PutOnDeck(placedCard, Zone.Hand); }
public static void PutOnDeck(this IActionHost host, ICard card) { host.PutOnDeck(new[] { card.Name }, Zone.Hand); }
public static void PutOnDeck(this IActionHost host, ICard[] cards) { host.PutOnDeck(cards.Names(), Zone.Hand); }
public static void PutOnDeck(this IActionHost host, ICard[] cards, Zone from) { host.PutOnDeck(cards.Names(), from); }
public static void PutOnDeck(this IActionHost host, ICard card, Zone from) { host.PutOnDeck(new[] { card.Name }, from); }
public static void PutOnDeck(this IActionHost host, string card, Zone from) { host.PutOnDeck(new[] { card }, from); }