Package mage.game.permanent

Examples of mage.game.permanent.Permanent.moveToExile()


      }
    }
    for (Iterator<Permanent> it = game.getBattlefield().getAllPermanents().iterator(); it.hasNext();) {
      Permanent perm = it.next();
      if (perm.getControllerId().equals(playerId)) {
        perm.moveToExile(null, "", null, game);
      }
    }
  }

  @Override
View Full Code Here


  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      return permanent.moveToExile(exileId, exileZone, source.getId(), game);
    }
    return false;
  }

  @Override
View Full Code Here

  @Override
  public boolean replaceEvent(GameEvent event, Ability source, Game game) {
    if (((ZoneChangeEvent)event).getFromZone() == Zone.BATTLEFIELD) {
      Permanent permanent = ((ZoneChangeEvent)event).getTarget();
      if (permanent != null) {
        return permanent.moveToExile(null, "", source.getId(), game);
      }
    }
    else {
      Card card = game.getCard(event.getTargetId());
      if (card != null) {
View Full Code Here

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      if (permanent.moveToExile(source.getSourceId(), "Mystifying Maze Exile", source.getId(), game)) {
        //create delayed triggered ability
        MystifyingMazeDelayedTriggeredAbility delayedAbility = new MystifyingMazeDelayedTriggeredAbility(source.getSourceId());
        delayedAbility.setSourceId(source.getSourceId());
        delayedAbility.setControllerId(source.getControllerId());
        game.addDelayedTriggeredAbility(delayedAbility);
View Full Code Here

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getSourceId());
    if (permanent != null) {
      return permanent.moveToExile(null, "", source.getId(), game);
    }
    return false;
  }

  @Override
View Full Code Here

  @Override
  public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
    Permanent permanent = game.getPermanent(sourceId);
    if (permanent != null) {
      paid = permanent.moveToExile(null, "", sourceId, game);
    }
    return paid;
  }

  @Override
View Full Code Here

        }       
        if (exileTarget != null) {
            Permanent permanentToExile = game.getPermanent(exileTarget.getFirstTarget());
            if (permanentToExile != null) {
                targetPlayerId = permanentToExile.getControllerId();
                result = permanentToExile.moveToExile(null, "", source.getSourceId(), game);
                this.applySearchAndExile(game, source, permanentToExile.getName(), targetPlayerId);               
            }
        }

View Full Code Here

    @Override
    public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
        Permanent permanent = game.getPermanent(sourceId);
        if (permanent != null) {
            paid = permanent.moveToExile(null, "", sourceId, game);
        }
        return paid;
    }

    @Override
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent equipment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
        if (equipment != null && equipment.getAttachedTo() != null) {
            Permanent creature = game.getPermanent(equipment.getAttachedTo());
            if (creature != null) {
                return creature.moveToExile(null, "", source.getSourceId(), game);
            }
        }
        return false;
    }
View Full Code Here

            if (target instanceof TargetCreaturePermanent) {
                Permanent targetCreature = game.getPermanent(target.getFirstTarget());
                if (targetCreature != null && !targetCreature.getControllerId().equals(source.getControllerId())) {
                    int amountLife = targetCreature.getPower().getValue();
                    Player controller = game.getPlayer(targetCreature.getControllerId());
                    targetCreature.moveToExile(null, null, source.getSourceId(), game);
                    if (controller != null && amountLife != 0) {
                        controller.gainLife(amountLife, game);
                    }
                }
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.