Package mage.game.permanent

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


                            return false;
                        }
                    }
                    Permanent permanent = game.getPermanent(target.getFirstTarget());
                    if (permanent != null) {
                        permanent.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                    }
                }
            }
        }
        used = true;
View Full Code Here


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

            if ( permanent != null ) {
                targetChosen = true;
                permanent.moveToZone(Zone.HAND, this.getId(), game, false);
            }
        }

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

                player.damage(1, attachmentid, game, false, true);
            }
        }
        Permanent razor = game.getPermanent(attachmentid);
        if (razor != null) {
            razor.moveToZone(Zone.HAND, id, game, true);
        }
        return true;
    }

    @Override
View Full Code Here

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

            if ( permanent != null ) {
                targetChosen = true;
                permanent.moveToZone(Zone.HAND, this.getId(), game, false);
            }
        }

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

            Player controller = game.getPlayer(source.getControllerId());
            if (controller != null) {
                if (target.canChoose(controller.getId(), game) && controller.chooseTarget(outcome, target, source, game)) {
                    Permanent returningCreature = game.getPermanent(target.getFirstTarget());
                    if (returningCreature != null) {
                        if (returningCreature.moveToZone(Zone.HAND, source.getSourceId(), game, true)) {
                            game.informPlayers(new StringBuilder("Cloudstone Curio: Returning ").append(returningCreature.getName()).append(" to owner's hand").toString());
                            return true;
                        }

                    }
View Full Code Here

    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Permanent permanent = ((ZoneChangeEvent) event).getTarget();
        if (permanent != null) {
            if (permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true)) {
                game.informPlayers(new StringBuilder(permanent.getName()).append(" was put on the top of its owner's library").toString());
                return true;
            }
        }
        return false;
View Full Code Here

        if (player == null) {
            return false;
        }
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (permanent != null) {
            permanent.moveToZone(Zone.LIBRARY, id, game, false);
            player.shuffleLibrary(game);
            return true;
        }
        return false;
    }
View Full Code Here

            Target target = new TargetControlledPermanent();
            if (target.canChoose(source.getSourceId(), player.getId(), game) && player.chooseTarget(outcome, target, source, game)) {
                Permanent permanent = game.getPermanent(target.getFirstTarget());
                if (permanent != null) {
                    game.informPlayers(player.getName() + " returns " + permanent.getName() + " to hand.");
                    return permanent.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                }
            }
        }
        return false;
    }
View Full Code Here

                        Target target = new TargetControlledPermanent(numberToSacrifice, numberToSacrifice, new FilterPermanent(), false);
                        targetPlayer.chooseTarget(Outcome.Sacrifice, target, source, game);
                        for (UUID uuid : target.getTargets()) {
                            Permanent permanent = game.getPermanent(uuid);
                            if (permanent != null) {
                                permanent.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, true);
                            }
                        }
                    }
                }
                return true;
View Full Code Here

            while (player.isInGame() && cards.size() > 1) {
                player.choose(Outcome.Neutral, cards, target, game);
                Permanent permanent = game.getPermanent(target.getFirstTarget());
                if (permanent != null) {
                    cards.remove(permanent);
                    permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
                }
                target.clearChosen();
            }
            if (cards.size() == 1) {
                Permanent permanent = game.getPermanent(cards.iterator().next());
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.