Package mage.game.events

Examples of mage.game.events.ZoneChangeEvent


    }

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


            game.getBattlefield().addPermanent(permanent);
            game.setZone(card.getId(), Zone.BATTLEFIELD);
            game.applyEffects();
            permanent.entersBattlefield(event.getSourceId(), game, fromZone, true);
            game.applyEffects();
            game.fireEvent(new ZoneChangeEvent(permanent, controllerId, fromZone, Zone.BATTLEFIELD));

            if (targetPermanent != null) {
                targetPermanent.addAttachment(permanent.getId(), game);
            }
            if (targetPlayer != null) {
View Full Code Here

    }

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

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

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

  }

  @Override
  public boolean checkTrigger(GameEvent event, Game game) {
    if (event.getType() == EventType.ZONE_CHANGE && !event.getTargetId().equals(this.getSourceId())) {
      ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
      if (zEvent.getToZone() == Zone.BATTLEFIELD) {
        Permanent permanent = game.getPermanent(event.getTargetId());
        if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getPower().getValue() > 2) {
          return true;
        }
      }
View Full Code Here

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

    }

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

        if (event.getType() == EventType.ZONE_CHANGE) {
            UUID targetId = event.getTargetId();
            MageObject card = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD);
            if (card != null && card instanceof Permanent && !(card instanceof PermanentToken)) {
                Permanent permanent = (Permanent) card;
                ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
                if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD
                        && permanent.getControllerId().equals(this.controllerId)
                        && (targetId.equals(this.getSourceId())
                            || (permanent.getCardType().contains(CardType.CREATURE)
                                && !targetId.equals(this.getSourceId())
                                && !(permanent instanceof PermanentToken)))) {
View Full Code Here

    }

    @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().equals(cardId)) {
                return true;
            }
        }
        return false;
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.