using DominionBase.Enums; using DominionBase.Piles; using DominionBase.Players; using System.Diagnostics.Contracts; using System.Linq; namespace DominionBase.Cards.Nocturne { public class WillOWisp : Card { public const int BaseCount = 12; public WillOWisp() : base(Categories.Action | Categories.Spirit, Source.Nocturne, Location.Special, Traits.Cantrip | Traits.ConditionalBenefit | Traits.PlusAction | Traits.PlusCard) { BaseCost = new Cost(0, special: true); Benefit.Cards = 1; Benefit.Actions = 1; } public static void SetupSupply(IGame game) { Contract.Requires(game != null, "game cannot be null"); if (!game.Table.SpecialPiles.ContainsKey(TypeClass.WillOWisp)) { var supply = new Supply(game, game.Players, TypeClass.WillOWisp, BaseCount); supply.FullSetup(); game.Table.SpecialPiles.Add(TypeClass.WillOWisp, supply); } } public override void FollowInstructions(IPlayer player) { Contract.Requires(player != null, "player cannot be null"); base.FollowInstructions(player); var cards = player.Draw(1, DeckLocation.Revealed); player.AddCardsToHand(player.RetrieveCardsFrom(DeckLocation.Revealed, new ItemCollection(cards.Where(c => player._Game.ComputeCost(c) <= new Currency(2))))); player.AddCardsToDeck(player.RetrieveCardsFrom(DeckLocation.Revealed), DeckPosition.Top); } } }