Examples of ExileZone


Examples of mage.game.ExileZone

        this.cardId = effect.cardId;
    }

    @Override
    public boolean apply(Game game, Ability source) {
        ExileZone zone = game.getExile().getExileZone(this.cardId);
        if (zone == null || zone.isEmpty()) {
            return false;
        }
        Card reboundCard = zone.get(this.cardId, game);
        Player player = game.getPlayer(source.getControllerId());
        if (player != null && reboundCard != null) {
            SpellAbility ability = reboundCard.getSpellAbility();
            player.cast(ability, game, true);
            zone.remove(reboundCard.getId());
            return true;
        }
        return false;
    }
View Full Code Here

Examples of mage.game.ExileZone

                if (filter.match(card, sourceControllerId, game)) {
                    possibleTargets.add(card.getId());
                }
            }
        } else {
            ExileZone exileZone = game.getExile().getExileZone(zoneId);
            if (exileZone != null) {
                for(Card card : exileZone.getCards(game)) {
                    if (filter.match(card, sourceControllerId, game)) {
                        possibleTargets.add(card.getId());
                    }
                }
            }
View Full Code Here

Examples of mage.game.ExileZone

                if (numberTargets >= this.minNumberOfTargets) {
                    return true;
                }
            }
        } else {
            ExileZone exileZone = game.getExile().getExileZone(zoneId);
            if (exileZone != null) {
                if (exileZone.count(filter, sourceId, sourceControllerId, game) >= this.minNumberOfTargets) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

Examples of mage.game.ExileZone

        Card card = game.getCard(id);
        if (card != null && game.getState().getZone(card.getId()) == Zone.EXILED) {
            if (allExileZones) {
                return filter.match(card, source.getControllerId(), game);
            }
            ExileZone exile;
            if (zoneId != null) {
                exile = game.getExile().getExileZone(zoneId);
            } else {
                exile = game.getExile().getPermanentExile();
            }
            if (exile != null && exile.contains(id)) {
                return filter.match(card, source.getControllerId(), game);
            }
        }
        return false;
    }
View Full Code Here

Examples of mage.game.ExileZone

        return new ReturnExiledCreatureColossalWhaleEffect(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

        return new LegionsInitiativeReturnFromExileEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        ExileZone exile = game.getExile().getExileZone(source.getSourceId());
        if (exile != null) {
            exile = exile.copy();
            for (UUID cardId: exile) {
                Card card = game.getCard(cardId);
                card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
                Permanent returnedCreature = game.getPermanent(cardId);
                if (returnedCreature != null) {
View Full Code Here

Examples of mage.game.ExileZone

                        if(player.chooseUse(Outcome.PlayForFree, new StringBuilder("Cast ").append(card.getName()).append(" without paying cost?").toString(), game)) {
                            player.cast(card.getSpellAbility(), game, true);
                        }
                    }

                    ExileZone exile = game.getExile().getExileZone(source.getSourceId());
                    if (exile != null) {
                        while (exile.size() > 0) {
                            card = exile.getRandom(game);
                            exile.remove(card.getId());
                            card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
                        }
                    }

                }
View Full Code Here

Examples of mage.game.ExileZone

                    if (card != null) {
                        controller.moveCardToExileWithInfo(card, exileId, "Cards exiled by " + mageObject.getLogName(), source.getSourceId(), game, Zone.LIBRARY);
                    }
                }
            }
            ExileZone exileZone = game.getExile().getExileZone(exileId);
            while (exileZone != null && exileZone.count(filter, game) > 0
                    && controller.chooseUse(Outcome.PlayForFree, "Cast cards exiled with " + mageObject.getLogName() +"  without paying its mana cost?", game)) {
                TargetCardInExile target = new TargetCardInExile(0,1, filter, exileId, false);
                while (exileZone.count(filter, game) > 0 && controller.choose(Outcome.PlayForFree, exileZone, target, game)) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {                           
                        controller.cast(card.getSpellAbility(), game, true);
                    } else {
                        break;
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 controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            ExileZone exile = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
            Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
            if (exile != null && sourcePermanent != null) {
                LinkedList<UUID> cards = new LinkedList<>(exile);
                for (UUID cardId : cards) {
                    Card card = game.getCard(cardId);
                    controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.EXILED);
                }
                exile.clear();
                return 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.