Exemple #1
0
        void IActionCard.Play(Dominion.Engine.Game game, Player player, Turn turn, object sidedata)
        {
            Enum newCardType = (Enum)sidedata;

            ICard newCard = game.DrawCard(newCardType);
            if (newCard == null)
                throw new Exception("Selected target type is not available");

            if (newCard.Cost > 4)
                throw new Exception("Target card is too expensive for Workshop");

            player.AddDiscard(newCard);
        }
Exemple #2
0
        void IActionCard.Play(Dominion.Engine.Game game, Player player, Turn turn, object sidedata)
        {
            RemodelData upgradeData = (RemodelData)sidedata;
            ICard origCard = (ICard)upgradeData.Card;

            ICard newCard = game.DrawCard(upgradeData.TargetType);
            if (newCard == null)
                throw new Exception("Selected target type is not available");

            if ((origCard.Cost + 2) < newCard.Cost)
                throw new Exception("Target card is too expensive to remodel");

            game.TrashCard(origCard);
            player.AddDiscard(newCard);
        }
Exemple #3
0
        void IActionCard.Play(Dominion.Engine.Game game, Player player, Turn turn, object sidedata)
        {
            MineData upgradeData = (MineData)sidedata;
            ICard origCard = (ICard)upgradeData.Card;

            if ((origCard.Type & CardType.Treasure) != CardType.Treasure)
                throw new Exception("Mine attempted on a non-treasure card");

            ICard newCard = game.DrawCard(upgradeData.TargetType);
            if (newCard == null)
                throw new Exception("Selected target type is not available for Mine");

            if ((origCard.Cost + 3) < newCard.Cost)
                throw new Exception("Target card is too expensive to mine into");

            player.TrashCard(origCard);
            player.AddToHand(newCard);
        }