using DominionBase.Enums; using DominionBase.Piles; using DominionBase.Players; using System.Diagnostics.Contracts; namespace DominionBase.Cards.Menagerie { public class Horse : Card { public const int BaseCount = 30; public Horse() : base(Categories.Action, Source.Menagerie, Location.Special, Traits.DeckReduction | Traits.NetCardDraw | Traits.PlusAction | Traits.PlusCard) { BaseCost = new Cost(3, special: true); Benefit.Actions = 1; Benefit.Cards = 2; } public static void SetupSupply(IGame game) { Contract.Requires(game != null, "game cannot be null"); if (!game.Table.SpecialPiles.ContainsKey(TypeClass.Horse)) { var supply = new Supply(game, game.Players, TypeClass.Horse, BaseCount); supply.FullSetup(); game.Table.SpecialPiles.Add(TypeClass.Horse, supply); } } public override void FollowInstructions(IPlayer player) { Contract.Requires(player != null, "player cannot be null"); base.FollowInstructions(player); if (player.InPlay.Contains(PhysicalCard)) { player.RetrieveCardFrom(DeckLocation.InPlay, PhysicalCard); var supply = (ISupply)player._Game.Table[Type]; player.Lose(this); supply.AddTo(this); player._Game.SendMessage(player, this, "Return", supply); } } } }