Package mage.constants

Examples of mage.constants.Zone


        //20091005 - 601.2a
        Card card = game.getCard(ability.getSourceId());
        if (card != null) {
            if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.CAST_SPELL, ability.getId(), ability.getSourceId(), playerId))) {
                int bookmark = game.bookmarkState();
                Zone fromZone = game.getState().getZone(card.getId());
                card.cast(game, fromZone, ability, playerId);
                Spell spell = game.getStack().getSpell(ability.getId());
                // some effects set sourceId to cast without paying mana costs
                if (ability.getSourceId().equals(getCastSourceIdWithoutMana())) {
                    noMana = true;
View Full Code Here


    @Override
    public boolean playLand(Card card, Game game) {
        //20091005 - 305.1
        if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.PLAY_LAND, card.getId(), card.getId(), playerId))) {
            // int bookmark = game.bookmarkState();
            Zone zone = game.getState().getZone(card.getId());
            if (card.putOntoBattlefield(game, zone, null, playerId)) {
                landsPlayed++;
                game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LAND_PLAYED, card.getId(), card.getId(), playerId));
                game.fireInformEvent(name + " plays " + card.getName());
                // game.removeBookmark(bookmark);
View Full Code Here

                    }
                }
            }
            // get cast commander if available
            if (!(this.getCommanderId() == null)) {
                Zone zone = game.getState().getZone(this.getCommanderId());
                if (zone != null && zone.equals(Zone.COMMAND)) {
                    MageObject object = game.getObject(this.getCommanderId());
                    if (object != null) {
                        for (ActivatedAbility ability : ((Commander) object).getAbilities().getActivatedAbilities(Zone.COMMAND)) {
                            if (canPlay(ability, availableMana, object, game)) {
                                playableActivated.put(ability.toString(), ability);
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Object object = getValue("attachedTo");
        if (object != null && object instanceof Permanent) {
            Card card = game.getCard(((Permanent)object).getId());
            if (card != null) {
                Zone currentZone = game.getState().getZone(card.getId());
                if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId())) {
                    return true;
                }
            }
        }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Card card = game.getCard(targetPointer.getFirst(game, source));
        if (card != null) {
            Zone currentZone = game.getState().getZone(card.getId());
            if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), card.getOwnerId())) {
                return true;
            }
        }
        return false;
View Full Code Here

        return true;
    }

    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Zone fromZone = ((ZoneChangeEvent) event).getFromZone();
        Card card = game.getCard(event.getTargetId());
        UUID sourceId = event.getSourceId();
        UUID controllerId = event.getPlayerId();

        // Aura enters the battlefield attached
        Object object = game.getState().getValue("attachTo:"+card.getId());
        if (object != null && object instanceof PermanentCard) {
            return false;
        }

        UUID targetId = null;
        MageObject sourceObject = game.getObject(sourceId);

        if (sourceObject instanceof Spell) {
            if (fromZone.equals(Zone.EXILED)) {
                // cast from exile (e.g. Neightveil Spector) -> no replacement
                return false;
            }
        }
        if (sourceObject instanceof StackAbility) {
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Object object = getValue("attachedTo");
        if (object != null && object instanceof Permanent) {
            Card card = game.getCard(((Permanent) object).getId());
            if (card != null) {
                Zone currentZone = game.getState().getZone(card.getId());
                if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), card.getOwnerId())) {
                    return true;
                }
            }
        }
View Full Code Here

        FilterCard filter = new FilterCard("card named Arachnus Web");
        filter.add(new NamePredicate("Arachnus Web"));

        Card card = null;
        Zone zone = null;
        if (player.chooseUse(Outcome.Neutral, "Search your graveyard for Arachnus Web?", 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

                    if (player == null) {
                        logger.warn("Was skipped: " + line);
                        continue;
                    }

                    Zone gameZone;
                    if ("hand".equalsIgnoreCase(zone)) {
                        gameZone = Zone.HAND;
                    } else if ("battlefield".equalsIgnoreCase(zone)) {
                        gameZone = Zone.BATTLEFIELD;
                    } else if ("graveyard".equalsIgnoreCase(zone)) {
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Card card = game.getCard(targetPointer.getFirst(game, source));
        if (card != null) {
            Zone currentZone = game.getState().getZone(card.getId());
            if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId())) {
                ContinuousEffect effect = new DreadSlaverContiniousEffect();
                effect.setTargetPointer(new FixedTarget(card.getId()));
                game.addEffect(effect, source);
                return true;
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.