Package mage.constants

Examples of mage.constants.Zone


        FilterCard filter = new FilterCard("Aura card");
        filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
        filter.add(new SubtypePredicate("Aura"));

        Card card = null;
        Zone zone = null;
        if (player.chooseUse(Outcome.Neutral, "Search your graveyard for an Aura card?", game)) {
            TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filter);
            if (player.choose(Outcome.PutCardInPlay, player.getGraveyard(), target, game)) {
                card = game.getCard(target.getFirstTarget());
                if (card != null) {
View Full Code Here


            Permanent target = game.getPermanent(permanentId);
            if (target != null) {
                target.moveToExile(exileId, "Ghostly Flicker", source.getSourceId(), game);
                Card card = game.getCard(target.getId());
                if (card != null) {
                    Zone currentZone = game.getState().getZone(card.getId());
                    card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId());
                }
            }
        }
View Full Code Here

    public boolean applies(GameEvent event, Ability source, Game game) {
        if (event.getType() == GameEvent.EventType.TARGET) {
            Card targetCard = game.getCard(event.getTargetId());
            StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId());
            if (targetCard != null && stackObject != null) {
                Zone zone = game.getState().getZone(targetCard.getId());
                if (zone != null && zone.equals(Zone.GRAVEYARD)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
        if (enchantment != null && enchantment.getAttachedTo() != null) {
            Card card = game.getCard(enchantment.getAttachedTo());
            if (card != null) {
                Zone currentZone = game.getState().getZone(card.getId());
                if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), card.getOwnerId())) {
                    //create delayed triggered ability
                    Effect effect = new GiftOfImmortalityReturnEnchantmentEffect();
                    effect.setTargetPointer(new FixedTarget(card.getId()));
                    AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(effect);
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Card card = game.getCard(targetPointer.getFirst(game, source));
        if (card != null) {
            Integer zoneChanges = (Integer) getValue("zoneChanges");
            if (card.getZoneChangeCounter() == zoneChanges) {
                Zone currentZone = game.getState().getZone(card.getId());
                if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId())) {
                    Permanent creature = game.getPermanent(card.getId());
                    creature.addCounters(CounterType.P1P1.createInstance(), game);
                    ContinuousEffect effect = new GraveBetrayalContiniousEffect();
                    effect.setTargetPointer(new FixedTarget(creature.getId()));
View Full Code Here

        public boolean apply(Game game, Ability source) {
            Permanent artifact = game.getPermanent(getTargetPointer().getFirst(game, source));
            Card card = game.getCard(source.getTargets().get(1).getFirstTarget());
            Player controller = game.getPlayer(source.getControllerId());
            if (artifact != null && card != null && controller != null) {
                Zone currentZone = game.getState().getZone(card.getId());
                Player owner = game.getPlayer(card.getOwnerId());
                if (owner != null
                        && artifact.getCardType().contains(CardType.ARTIFACT)
                        && card.getCardType().contains(CardType.ARTIFACT)
                        && currentZone == Zone.GRAVEYARD
View Full Code Here

            StringBuilder sb = new StringBuilder();
            sb.append("Put the revealed cards into ").append(player.getName()).append("'s hand?");
            sb.append(" If you don't, those cards are put into his graveyard and he will draw five cards.");

            Zone zone = Zone.GRAVEYARD;
            if (opponent.chooseUse(Outcome.Neutral, sb.toString(), game)) {
                zone = Zone.HAND;
            } else {
                player.drawCards(5, game);
            }
View Full Code Here

                return false;
            }
            if (super.getSourceId().equals(event.getTargetId())
                    || permanent.getPower().getValue() > 4
                    && permanent.getControllerId().equals(controllerId)) {
                Zone after = game.getState().getZone(event.getTargetId());
                return after != null && Zone.GRAVEYARD.match(after);
            }
        }
        return false;
    }
View Full Code Here

        super(Zone.COMMAND, new PutCommanderOnBattlefieldEffect(), new ManaCostsImpl("{1}{G}{W}{U}"));
    }

    @Override
    public boolean canActivate(UUID playerId, Game game) {
        Zone currentZone = game.getState().getZone(this.getSourceId());
        if (currentZone == null || !currentZone.equals(Zone.COMMAND)) {
            return false;
        }
        return super.canActivate(playerId, game);
    }
View Full Code Here

                    pile2CardsIds.add(card.getId());
                }
            }
            boolean choice = player.choosePile(Outcome.DestroyPermanent, "Choose a pile to put into hand.", pile1, pile2, game);

            Zone pile1Zone = Zone.GRAVEYARD;
            Zone pile2Zone = Zone.HAND;
            if (choice) {
                pile1Zone = Zone.HAND;
                pile2Zone = Zone.GRAVEYARD;
            }

            StringBuilder sb = new StringBuilder("Sphinx of Uthuun: Pile 1, going to ").append(pile1Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (": ");
            int i = 0;
            for (UUID cardUuid : pile1CardsIds) {
                i++;
                Card card = game.getCard(cardUuid);
                if (card != null) {
                    sb.append(card.getName());
                    if (i < pile1CardsIds.size()) {
                        sb.append(", ");
                    }
                    card.moveToZone(pile1Zone, source.getSourceId(), game, false);
                }
            }
            game.informPlayers(sb.toString());

            sb = new StringBuilder("Sphinx of Uthuun: Pile 2, going to ").append(pile2Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (":");
            i = 0;
            for (UUID cardUuid : pile2CardsIds) {
                Card card = game.getCard(cardUuid);
                if (card != null) {
                    i++;
View Full Code Here

TOP

Related Classes of mage.constants.Zone

Copyright © 2018 www.massapicom. 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.