Examples of ExileZone


Examples of mage.game.ExileZone

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            UUID exileId = source.getSourceId();
            ExileZone exile = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
            if (exile != null) {
                exile = exile.copy();
                for (UUID cardId : exile) {
                    Card card = game.getCard(cardId);
                    if (card != null) {
                        controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId());
                    }
View Full Code Here

Examples of mage.game.ExileZone

        return new ReturnExiledCreatureEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        ExileZone exile = game.getExile().getExileZone(source.getSourceId());
        MageObject sourceObject = game.getObject(source.getSourceId());
        if (exile != null && sourceObject != null) {
            LinkedList<UUID> cards = new LinkedList<>(exile);
            for (UUID cardId : cards) {
                Card card = game.getCard(cardId);
                card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
                game.informPlayers(new StringBuilder(sourceObject.getLogName()).append(": ").append(card.getName()).append(" returns to battlefield from exile").toString());
            }
            exile.clear();
            return true;
        }
        return false;
    }
View Full Code Here

Examples of mage.game.ExileZone

   
    @Override
    public boolean apply(MageObject input, Game game) {
        Set<String> cardNames = new HashSet<String>();
        UUID exileId = CardUtil.getCardExileZoneId(game, sourceId);
        ExileZone exileZone = game.getExile().getExileZone(exileId);
        if (exileZone != null) {
            for(Card card : exileZone.getCards(game)) {
                cardNames.add(card.getName());
            }
        }
        // If a player names a card, the player may name either half of a split card, but not both.
        // A split card has the chosen name if one of its two names matches the chosen name.
View Full Code Here

Examples of mage.game.ExileZone

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            ExileZone exile = game.getExile().getExileZone(source.getSourceId());
            MageObject sourceObject = game.getObject(source.getSourceId());
            if (exile != null && sourceObject != null) {
                LinkedList<UUID> cards = new LinkedList<>(exile);
                for (UUID cardId : cards) {
                    Card card = game.getCard(cardId);
                    card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
                    game.informPlayers(new StringBuilder(sourceObject.getName()).append(": ").append(card.getName()).append(" returns to battlefield from exile").toString());
                }
                exile.clear();
                return true;
            }

        }
        return false;
View Full Code Here

Examples of mage.game.ExileZone

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            ExileZone exile = game.getExile().getExileZone(source.getSourceId());
            Card sourceCard = game.getCard(source.getSourceId());
            if (exile != null && sourceCard != null) {
                LinkedList<UUID> cards = new LinkedList<>(exile);
                for (UUID cardId : cards) {
                    Card card = game.getCard(cardId);
                    card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
                    game.informPlayers(new StringBuilder(sourceCard.getName()).append(": ").append(card.getName()).append(" returns to battlefield from exile").toString());
                }
                exile.clear();
                return true;
            }           
        }
        return false;
    }
View Full Code Here

Examples of mage.game.ExileZone

    }

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getFirstTarget());
        ExileZone exile = game.getExile().getPermanentExile();
        if (player != null) {
            while (true) {
                if (player.getLibrary().getFromTop(game) == null) {
                    break;
                }
                Card card = player.getLibrary().removeFromTop(game);
                exile.add(card);
                game.setZone(card.getId(), Zone.EXILED);
            }
            for (Card card : player.getHand().getCards(game)) {
                card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
            }
View Full Code Here

Examples of mage.game.ExileZone

        this.exileId = effect.exileId;
    }

    @Override
    public boolean apply(Game game, Ability source) {
        ExileZone exile = game.getExile().getExileZone(exileId);
        if (exile != null) {
            Cards cards = new CardsImpl(); // needed because putOntoTheBattlefield removes from exile
            cards.addAll(exile);
            for (Card card: cards.getCards(game)) {
                card.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), source.getControllerId());
View Full Code Here

Examples of mage.game.ExileZone

    @Override
    public boolean applies(GameEvent event, Ability source, Game game) {
        if (event.getType() == EventType.CAST_SPELL && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
            MageObject object = game.getObject(event.getSourceId());
            if (object != null) {
                ExileZone exileZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
                if ((exileZone != null)) {
                    for(Card card:exileZone.getCards(game)) {
                        if ((card.getName().equals(object.getName()))) {
                            return true;
                        }
                    }                
                }
View Full Code Here

Examples of mage.game.ExileZone

            // sacrifice all creatures
            for (Permanent permanent :game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) {
                permanent.sacrifice(source.getSourceId(), game);
            }
            // put exiled cards to battlefield
            ExileZone exileZone = game.getState().getExile().getExileZone(source.getSourceId());
            if (exileZone != null) {
                for (Card card : exileZone.getCards(game)) {
                    Player player = game.getPlayer(card.getOwnerId());
                    if (player != null) {
                        player.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId());
                    }
                }
View Full Code Here

Examples of mage.game.ExileZone

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        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
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.