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()); } }
public static ICard[] Reveal(this IActionHost host, Zone from) { var cards = host.Examine(from); if (cards.Any()) { host.Reveal(cards, from); } return(cards); }
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); } }
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); } }
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")) ); } }
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); } }
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)); } }
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)); } }
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); } } }
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); } }
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); } } } }
public static void Reveal(this IActionHost host, string card) { host.Reveal(new[] { card }, Zone.Hand); }
public static void Reveal(this IActionHost host, string card, Zone from) { host.Reveal(new[] { card }, from); }
public static void Reveal(this IActionHost host, ICard[] cards, Zone from) { host.Reveal(cards.Names(), from); }
public static void Reveal(this IActionHost host, ICard card) { host.Reveal(new[] { card.Name }, Zone.Hand); }
public static void Reveal(this IActionHost host, ICard card, Zone from) { host.Reveal(new[] { card.Name }, from); }
public static void Reveal(this IActionHost host, ICard[] cards) { host.Reveal(cards.Names(), Zone.Hand); }