Package mage.game.events

Examples of mage.game.events.ZoneChangeEvent


    }

    @Override
    public boolean applies(GameEvent event, Ability source, Game game) {
        if (event.getType() == EventType.ZONE_CHANGE) {
            ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
            if (zEvent.getToZone() == Zone.GRAVEYARD
                    && ((ZoneChangeEvent) event).getTargetId() == cardid) {
                return true;
            }
        }
        return false;
View Full Code Here


    }
   
    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == EventType.ZONE_CHANGE) {
            ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
            Permanent LKIpermanent = game.getPermanentOrLKIBattlefield(zEvent.getTargetId());
            Card card = game.getCard(zEvent.getTargetId());

            if (card != null && LKIpermanent != null &&
                    card.getOwnerId().equals(this.controllerId) &&
                    zEvent.getToZone() == Zone.GRAVEYARD &&
                    zEvent.getFromZone() == Zone.BATTLEFIELD &&
                    card.getCardType().contains(CardType.CREATURE) &&
                    LKIpermanent.getPower().getValue() <= 1) {
                for (Effect effect : this.getEffects()) {
                    effect.setTargetPointer(new FixedTarget(zEvent.getTargetId()));
                }
                return true;
            }
        }
        return false;
View Full Code Here

                if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) {
                    return false;
                }
            }

            ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
            Permanent permanent = zEvent.getTarget();

            if (permanent != null &&
                zEvent.getToZone() == Zone.GRAVEYARD &&
                zEvent.getFromZone() == Zone.BATTLEFIELD &&
                (permanent.getControllerId().equals(this.getControllerId()) &&
                permanent.hasSubtype("Vampire") || permanent.getId().equals(this.getSourceId())))
            {
                return true;
            }
View Full Code Here

    }

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == EventType.ZONE_CHANGE) {
            ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
            if (zEvent.getFromZone() == Zone.GRAVEYARD
                    && zEvent.getToZone() == Zone.EXILED) {
                return true;

            }
        }
        return false;
View Full Code Here

    }

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
            ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
            if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
                Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
                if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.hasSubtype("Human")
                        && !permanent.getId().equals(this.getSourceId())) {
                    return true;
                }
View Full Code Here

                discard();
                return false;
            }
        }
        if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(source.getSourceId())) {
            ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
            if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
                discard();
                return false;
            }
        }
View Full Code Here

            condition = true;
            game.replaceEvent(event);
            return;
        }
        if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(sourceId)) {
            ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
            if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
                condition = true;
                game.replaceEvent(event);
            }
        }
    }
View Full Code Here

    }

    @Override
    public boolean applies(GameEvent event, Ability source, Game game) {
        if (event.getType() == GameEvent.EventType.ZONE_CHANGE && source.getSourceId().equals(event.getTargetId())) {
            ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
            if(zEvent.getToZone().equals(Zone.BATTLEFIELD)){
                return true;
            }
        }
        return false;
    }
View Full Code Here

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (GameEvent.EventType.ZONE_CHANGE.equals(event.getType()) &&
                game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId()))) {
            ZoneChangeEvent zce = (ZoneChangeEvent) event;
            if (Zone.BATTLEFIELD.equals(zce.getFromZone()) && Zone.GRAVEYARD.equals(zce.getToZone())) {
                Permanent targetPermanent = zce.getTarget();
                if (targetPermanent.getCardType().contains(CardType.LAND) && targetPermanent.getControllerId().equals(getControllerId())) {
                    MageObject mageObject = game.getShortLivingLKI(event.getSourceId(), Zone.STACK);
                    if (mageObject instanceof StackObject) {
                        getEffects().get(0).setTargetPointer(new FixedTarget(targetPermanent.getId()));
                        return true;
View Full Code Here

                if (game.getLastKnownInformation(sourceCardId, Zone.BATTLEFIELD) == null) {
                    return false;
                }
            }

            ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
            Permanent permanent = zEvent.getTarget();

            if (permanent != null &&
                    zEvent.getToZone() == Zone.GRAVEYARD &&
                    zEvent.getFromZone() == Zone.BATTLEFIELD &&
                    !(permanent instanceof PermanentToken) &&
                    permanent.getCardType().contains(CardType.CREATURE)) {

                getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
                return true;
View Full Code Here

TOP

Related Classes of mage.game.events.ZoneChangeEvent

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.