Package mage.constants

Examples of mage.constants.Zone


  }


  @Override
  public boolean moveToZone(Zone toZone, UUID sourceId, Game game, boolean flag) {
    Zone fromZone = game.getZone(objectId);
    Player controller = game.getPlayer(controllerId);
    if (controller != null && controller.removeFromBattlefield(this, game)) {
      ZoneChangeEvent event = new ZoneChangeEvent(this, sourceId, controllerId, fromZone, toZone);
      if (!game.replaceEvent(event)) {
        Card card = game.getCard(objectId);
View Full Code Here


  }


  @Override
  public boolean moveToExile(UUID exileId, String name, UUID sourceId, Game game) {
    Zone fromZone = game.getZone(objectId);
    Player controller = game.getPlayer(controllerId);
    if (controller != null && controller.removeFromBattlefield(this, game)) {
      ZoneChangeEvent event = new ZoneChangeEvent(this, sourceId, ownerId, fromZone, Zone.EXILED);
      if (!game.replaceEvent(event)) {
        Card card = game.getCard(this.objectId);
View Full Code Here

    return mana;
  }

  @Override
  public boolean moveToZone(Zone toZone, UUID sourceId, Game game, boolean flag) {
    Zone fromZone = game.getZone(objectId);
    ZoneChangeEvent event = new ZoneChangeEvent(this.objectId, sourceId, ownerId, fromZone, toZone);
    if (!game.replaceEvent(event)) {
      switch (event.getToZone()) {
        case GRAVEYARD:
          game.getPlayer(ownerId).putInGraveyard(this, game, !flag);
View Full Code Here

    return false;
  }

  @Override
  public boolean moveToExile(UUID exileId, String name, UUID sourceId, Game game) {
    Zone fromZone = game.getZone(objectId);
    ZoneChangeEvent event = new ZoneChangeEvent(this.objectId, sourceId, ownerId, fromZone, Zone.EXILED);
    if (!game.replaceEvent(event)) {
      if (exileId == null) {
        game.getExile().getPermanentExile().add(this);
      }
View Full Code Here

            String zone = m.group(1);
            String nickname = m.group(2);

            Player player = findPlayer(game, nickname);
            if (player != null) {
              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 isInUseableZone(Game game, MageObject source, boolean checkLKI) {
        // check it was previously on battlefield
        MageObject before = game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD);
        // check now it is in graveyard
        Zone after = game.getState().getZone(sourceId);
        return before != null && after != null && Zone.GRAVEYARD.match(after);
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Card card = game.getCard(source.getSourceId());
        if (card != null) {
            Player player = game.getPlayer(card.getOwnerId());
            if (player != null) {
                Zone fromZone = game.getState().getZone(card.getId());
                player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, fromZone, true, true);
                player.shuffleLibrary(game);
                return true;
            }
        }
View Full Code Here

        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            for (UUID targetId : getTargetPointer().getTargets(game, source)) {
                Permanent permanent = game.getPermanent(targetId);
                if (permanent != null) {
                    Zone currentZone = game.getState().getZone(permanent.getId());
                    if (!currentZone.equals(Zone.EXILED) && (onlyFromZone == null || onlyFromZone.equals(Zone.BATTLEFIELD))) {
                        controller.moveCardToExileWithInfo(permanent, exileId, exileZone, source.getSourceId(), game, currentZone);
                    }
                } else {
                    Card card = game.getCard(targetId);
                    if (card != null) {
                        Zone currentZone = game.getState().getZone(card.getId());
                        if (!currentZone.equals(Zone.EXILED) && (onlyFromZone == null || onlyFromZone.equals(currentZone))) {
                            controller.moveCardToExileWithInfo(card, exileId, exileZone, source.getSourceId(), game, currentZone);
                        }
                    }
                }
            }
View Full Code Here

        return moveToZone(toZone, sourceId, game, flag, null);
    }

    @Override
    public boolean moveToZone(Zone toZone, UUID sourceId, Game game, boolean flag, ArrayList<UUID> appliedEffects) {
        Zone fromZone = game.getState().getZone(objectId);       
        Player controller = game.getPlayer(controllerId);
        if (controller != null && controller.removeFromBattlefield(this, game)) {
            if (isFaceDown() && isMorphCard()) {
                setFaceDown(false);
                game.getCard(this.getId()).setFaceDown(false); //TODO: Do this in a better way
View Full Code Here

        return moveToExile(exileId, name, sourceId, game, null);
    }

    @Override
    public boolean moveToExile(UUID exileId, String name, UUID sourceId, Game game, ArrayList<UUID> appliedEffects) {
        Zone fromZone = game.getState().getZone(objectId);
        if (isMorphCard() && isFaceDown()) {
            setFaceDown(false);
            game.getCard(this.getId()).setFaceDown(false); //TODO: Do this in a better way
        }
        Player controller = game.getPlayer(controllerId);
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.