using DominionBase.Enums; using DominionBase.Piles; using System.Diagnostics.Contracts; namespace DominionBase.Cards.Nocturne { public class Leprechaun : Doom { public Leprechaun() : base(Categories.Action, Location.Kingdom, Traits.ConditionalBenefit | Traits.Gainer | Traits.IncludesExtraPiles | Traits.Terminal) { BaseCost = new Cost(3); } public override void SetupSupply(IGame game, ISupply supply) { Contract.Requires(game != null, "game cannot be null"); base.SetupSupply(game, supply); Wish.SetupSupply(game); } public override void FollowInstructions(IPlayer player) { Contract.Requires(player != null, "player cannot be null"); base.FollowInstructions(player); player.Gain(player._Game.Table.Gold, this); if (player.InPlayAndSetAside.Count == 7) { player.Gain((ISupply)player._Game.Table.SpecialPiles[TypeClass.Wish], this); } else { var supply = (IHexSupply)player._Game.Table.SpecialPiles[TypeClass.Hexes]; supply.TurnOverNextAndReceive(player); } } } }