Package mage.players

Examples of mage.players.Player.moveCardToHandWithInfo()


    public boolean apply(Game game, Ability source) {
        Card card = game.getCard(source.getFirstTarget());
        if (card != null) {
            Player player = game.getPlayer(card.getOwnerId());
            if (player != null) {
                player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.HAND);
                int damage = card.getPower().getValue();
                Permanent creature = game.getPermanent(source.getTargets().get(1).getTargets().get(0));
                if (creature != null) {
                    creature.damage(damage, source.getSourceId(), game, false, true);
                    return true;
View Full Code Here


                TargetCard target = new TargetCard(Zone.PICK, filterPutInHand);
                if (properCardFound && player.choose(Outcome.DrawCard, cards, target, game)) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {
                        cards.remove(card);
                        player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
                    }

                }

                for (UUID cardId : cards) {
View Full Code Here

                controller.choose(Outcome.ReturnToHand, target, source.getSourceId(), game);
                Permanent permanent = game.getPermanent(target.getFirstTarget());

                if ( permanent != null ) {
                    targetChosen = true;
                    controller.moveCardToHandWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD);
                }
            }

            if ( !targetChosen ) {
                new SacrificeSourceEffect().apply(game, source);
View Full Code Here

                controller.revealCards(sourceObject.getLogName(), cards, game);
                TargetCard target = new TargetCard(Zone.LIBRARY, filterPutInHand);
                if (properCardFound && controller.choose(Outcome.DrawCard, cards, target, game)) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {
                        controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
                        cards.remove(card);
                    }

                }
View Full Code Here

        if (controller == null) {
            return false;
        }
        Permanent permanent = game.getPermanent(source.getFirstTarget());
        if (permanent != null) {
            if (!controller.moveCardToHandWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD)){
                return false;
            }           
            Player player = game.getPlayer(permanent.getControllerId());
            if (player.chooseUse(Outcome.ReturnToHand, "Sacrifice a land to copy this spell?", game)){
                TargetControlledPermanent target = new TargetControlledPermanent(new FilterControlledLandPermanent());
View Full Code Here

            do {
                card = library.removeFromTop(game);
                if (card != null) {
                   
                    if (filter.match(card, game)) {
                        player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
                    } else {
                        cards.add(card);
                    }
                }
            } while (library.size() > 0 && card != null && !filter.match(card, game));
View Full Code Here

                    card = cards.get(target.getFirstTarget(), game);
                }
            }
            if (card != null) {
                cards.remove(card);
                controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
            }

            for (Card moveCard: cards.getCards(game)) {
                controller.moveCardToGraveyardWithInfo(moveCard, source.getSourceId(), game, Zone.LIBRARY);
            }
View Full Code Here

        if (controller != null) {
            ExileZone exZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
            if (exZone != null) {
                for (Card card : exZone.getCards(game)) {
                    if (card != null) {
                        controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.EXILED);
                    }
                }
                return true;
            }
        }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent target = game.getPermanent(source.getFirstTarget());
        if (target != null) {
            Player controller = game.getPlayer(target.getControllerId());
            if (controller != null) {
                controller.moveCardToHandWithInfo(target, source.getSourceId(), game, Zone.BATTLEFIELD);
                controller.discard(1, source, game);
                return true;
            }
        }
        return false;
View Full Code Here

                Card card = player.getLibrary().removeFromTop(game);
                if (card != null) {
                    Cards cards = new CardsImpl();
                    cards.add(card);
                    player.revealCards(sourcePermanent.getName(), cards, game);
                    player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
                    player.loseLife(card.getManaCost().convertedManaCost(), game);

                }
                return true;
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.