Examples of ExileZone


Examples of mage.game.ExileZone

    @Override
    public boolean canTarget(UUID id, Ability source, Game game) {
        Card card = game.getCard(id);
        if (card != null && game.getState().getZone(card.getId()) == Zone.EXILED) {
            ExileZone exile = null;
            Card sourceCard = game.getCard(source.getSourceId());
            if (sourceCard != null) {
                UUID exileId = CardUtil.getCardExileZoneId(game, source);
                exile = game.getExile().getExileZone(exileId);
            }
            if (exile != null && exile.contains(id)) {
                return filter.match(card, source.getControllerId(), game);
            }
        }
        return false;
    }
View Full Code Here

Examples of mage.game.ExileZone

                MageObject sourceObject = game.getObject(source.getSourceId());
                if (sourceObject == null) {
                    return false;
                }
                UUID exileId = CardUtil.getCardExileZoneId(game, source);
                ExileZone exile = game.getExile().getExileZone(exileId);
                if (exile != null && exile.contains(objectId)) {
                    Cards cards = new CardsImpl(card);
                    Player controller = game.getPlayer(source.getControllerId());
                    if (controller != null) {
                        controller.lookAtCards("Exiled with " + sourceObject.getLogName(), cards, game);
                    }
View Full Code Here

Examples of mage.game.ExileZone

                }
            }
            player.shuffleLibrary(game);
        }

        ExileZone jaceExileZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
        if (jaceExileZone == null) {
            return true;
        }
        FilterCard filter = new FilterCard("card to cast without mana costs");
        TargetCardInExile target = new TargetCardInExile(filter, source.getSourceId());
        while (jaceExileZone.count(filter, game) > 0 && controller.choose(Outcome.PlayForFree, jaceExileZone, target, game)) {
                Card card = game.getCard(target.getFirstTarget());
                if (card != null) {

                    if (controller.cast(card.getSpellAbility(), game, true))
                    {
View Full Code Here

Examples of mage.game.ExileZone

        return new ReturnExiledCreatureChainedToTheRocksEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        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

                    Card topCard = controller.getLibrary().getFromTop(game);
                    controller.moveCardToExileWithInfo(topCard, source.getSourceId(), "Cards exiled by Epic Experiment",  source.getSourceId(), game, Zone.LIBRARY);
                }
            }
            // cast the possible cards without paying the mana
            ExileZone epicExperimentExileZone = game.getExile().getExileZone(source.getSourceId());
            FilterCard filter = filterStatic.copy();
            filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, source.getManaCostsToPay().getX() + 1));
            filter.setMessage("instant and sorcery cards with converted mana cost "+ source.getManaCostsToPay().getX() +" or less");
            while (epicExperimentExileZone != null && epicExperimentExileZone.count(filter, game) > 0
                    && controller.chooseUse(Outcome.PlayForFree, "Cast cards exiled with Epic Experiment without paying its mana cost?", game)) {
                TargetCardInExile target = new TargetCardInExile(filter, source.getSourceId());
                while (epicExperimentExileZone.count(filter, game) > 0 && controller.choose(Outcome.PlayForFree, epicExperimentExileZone, target, game)) {
                        Card card = game.getCard(target.getFirstTarget());
                        if (card != null) {                           
                            if (controller.cast(card.getSpellAbility(), game, true))
                            {
                                game.getExile().removeCard(card, game);
                            }
                        }
                        target.clearChosen();
                }
            }
            // move cards not cast to graveyard
            ExileZone exile = game.getExile().getExileZone(source.getSourceId());
            if (exile != null) {
                for (Card card : exile.getCards(game)) {
                    controller.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.EXILED);
                }
            }
            return true;
        }
View Full Code Here

Examples of mage.game.ExileZone

        Player controller = game.getPlayer(source.getControllerId());
        Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
        if (controller != null && sourcePermanent != null) {
            UUID exileId = CardUtil.getCardExileZoneId(game, source);
            int numberOfCards = 0;
            ExileZone exileZone = game.getExile().getExileZone(exileId);
            if (exileZone != null) {
                for (Card card:  exileZone.getCards(game)) {
                    if (card.getOwnerId().equals(controller.getId())) {
                        numberOfCards++;
                        card.setFaceDown(false);
                        card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
                    }
View Full Code Here

Examples of mage.game.ExileZone

    }

    @Override
    public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
        if (affectedControllerId.equals(source.getControllerId())) {
                ExileZone zone = game.getExile().getExileZone(exileId);
                if (zone != null && zone.contains(objectId)) {
                    return true;
                }
        }
        return false;
    }
View Full Code Here

Examples of mage.game.ExileZone

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(source.getFirstTarget());
        if (permanent != null) {
            if (permanent.moveToExile(source.getSourceId(), "Otherworldly Journey", source.getSourceId(), game)) {
                ExileZone exile = game.getExile().getExileZone(source.getSourceId());
                // only if permanent is in exile (tokens would be stop to exist)
                if (exile != null && !exile.isEmpty()) {
                    //create delayed triggered ability
                    AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(
                            new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, "return that card to the battlefield under its owner's control with a +1/+1 counter on it"));
                    delayedAbility.setSourceId(source.getSourceId());
                    delayedAbility.setControllerId(source.getControllerId());
View Full Code Here

Examples of mage.game.ExileZone

        return new RealmRazerEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        ExileZone exZone = game.getExile().getExileZone(source.getSourceId());
        if (exZone != null) {
            for (Card card : exZone.getCards(game)) {
                if (card != null) {
                    if(card.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), card.getOwnerId())){
                        game.getPermanent(card.getId()).setTapped(true);
                    }
                }
View Full Code Here

Examples of mage.game.ExileZone

                Player player = game.getPlayer(playerId);
                if (player != null) {
                    String exileKey = new StringBuilder(playerId.toString()).append(CardUtil.getCardExileZoneId(game, source)).toString();
                    UUID exileId = exileIds.get(exileKey);
                    if (exileId != null) {
                        ExileZone exileZone = game.getState().getExile().getExileZone(exileId);
                        if (exileZone != null) {
                            for(Card card: exileZone.getCards(game)) {
                                card.setFaceDown(false);
                                if (CardUtil.isPermanentCard(card)) {
                                    player.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId());
                                }
                            }
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.