using DominionBase.Enums; using DominionBase.Players; using DominionBase.Properties; using System.Diagnostics.Contracts; using System.Linq; namespace DominionBase.Cards.Renaissance { public class Recruiter : Card { public Recruiter() : base(Categories.Action, Source.Renaissance, Location.Kingdom, Traits.Component | Traits.ConditionalBenefit | Traits.DeckReduction | Traits.NetCardDraw | Traits.PlusCard | Traits.PlusVillager | Traits.RemoveCurses | Traits.RemoveFromHand | Traits.Terminal | Traits.Trasher | Traits.TrashForBenefit) { BaseCost = new Cost(5); Benefit.Cards = 2; } public override void FollowInstructions(IPlayer player) { Contract.Requires(player != null, "player cannot be null"); base.FollowInstructions(player); var choice = new Choice(Resource.ChooseACardToTrash, this, player.Hand, ChoiceOutcome.Trash, player); var result = player.MakeChoice(choice); if (result.Cards.Any()) { player.Trash(this, player.RetrieveCardFrom(DeckLocation.Hand, result.Cards[0])); var cardCost = player._Game.ComputeCost(result.Cards[0]); player.ReceiveBenefit(this, new CardBenefit { Villagers = cardCost.Coin.Value }); } } } }