Package mage.game.permanent

Examples of mage.game.permanent.Permanent.moveToZone()


    @Override
    public boolean apply(Game game, Ability source) {
        for ( UUID target : targetPointer.getTargets(game, source) ) {
            Permanent permanent = game.getPermanent(target);
            if ( permanent != null ) {
                permanent.moveToZone(Zone.HAND, source.getSourceId(), game, true);
            }
        }
        return true;
    }
View Full Code Here


                final StringBuilder sb = new StringBuilder("Pay {1} otherwise ").append(targetCreature.getName()).append(" will be returned to its owner's hand)");
                if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) {
                    cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), true);
                }
                if (!cost.isPaid()) {
                    return targetCreature.moveToZone(Zone.HAND, source.getSourceId(), game, true);
                }
            }
        }
        return false;
    }
View Full Code Here

    @Override
    public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
        Permanent permanent = game.getPermanent(sourceId);
        if (permanent == null)
            return false;
        paid = permanent.moveToZone(Zone.HAND, sourceId, game, false);
        return paid;
    }

    @Override
    public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
View Full Code Here

        SourceDidDamageWatcher watcher = (SourceDidDamageWatcher) game.getState().getWatchers().get("SourceDidDamageWatcher");
        if (watcher != null) {
            for (UUID permId :watcher.damageSources) {
                Permanent perm = game.getPermanent(permId);
                if (perm != null) {
                    perm.moveToZone(Zone.HAND, source.getSourceId(), game, true);
                }
            }
            return true;
        }       
        return false;
View Full Code Here

            attachments.addAll(target.getAttachments());
            for (UUID attachmentId : attachments) {
                Permanent attachment = game.getPermanent(attachmentId);
                if (attachment != null && attachment.getControllerId().equals(source.getControllerId())
                        && attachment.getSubtype().contains("Aura")) {
                    attachment.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                }
            }
            if (target.getControllerId().equals(source.getControllerId())) {
                target.moveToZone(Zone.HAND, source.getSourceId(), game, false);
            }
View Full Code Here

                    Card card = owner.getLibrary().removeFromTop(game);
                    cards.add(card);
                    cardIds.push(card.getId());
                }
                // return cards back to library
                permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
                game.informPlayers(new StringBuilder(controller.getName())
                        .append(" puts ").append(permanent.getName())
                        .append(" beneath the top ").append(xValue)
                        .append(" cards of ").append(owner.getName()).append("'s library").toString());
                while(!cardIds.isEmpty()) {
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
        if (permanent != null) {
            if (permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true) ) {
                game.getPlayer(permanent.getOwnerId()).shuffleLibrary(game);
                return true;
            }
        }
        return false;
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent perm = game.getPermanent(source.getSourceId());
        if (perm != null) {
            Player player = game.getPlayer(perm.getOwnerId());
            if (player != null) {
                perm.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
                player.shuffleLibrary(game);
                Cards cards = new CardsImpl();
                while (true) {
                    Card card = player.getLibrary().removeFromTop(game);
                    if (card == null)
View Full Code Here

            Card card = null;
            if (owner.getLibrary().size() > 0) {
                card = owner.getLibrary().removeFromTop(game);
            }

            permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
            if (card != null) {
                owner.getLibrary().putOnTop(card, game);
            }
            return true;
        }
View Full Code Here

                final StringBuilder sb = new StringBuilder("Pay {1} otherwise ").append(targetCreature.getName()).append(" will be returned to its owner's hand)");
                if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) {
                    cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), true);
                }
                if (!cost.isPaid()) {
                    return targetCreature.moveToZone(Zone.HAND, source.getSourceId(), game, true);
                }
            }
        }
        return false;
    }
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.