Package mage.game.permanent

Examples of mage.game.permanent.Permanent


    return this.filter;
  }

  @Override
  public boolean canTarget(UUID id, Game game) {
    Permanent permanent = game.getPermanent(id);
    if (permanent != null) {
      return filter.match(permanent);
    }
    Player player = game.getPlayer(id);
    if (player != null)
View Full Code Here


    return false;
  }

  @Override
  public boolean canTarget(UUID id, Ability source, Game game) {
    Permanent permanent = game.getPermanent(id);
    MageObject targetSource = game.getObject(source.getSourceId());
    if (permanent != null) {
      if (source != null)
        return permanent.canBeTargetedBy(targetSource) && filter.match(permanent, source.getControllerId(), game);
      else
        return filter.match(permanent);
    }
    Player player = game.getPlayer(id);
    if (player != null)
View Full Code Here

  @Override
  public String getTargetedName(Game game) {
    StringBuilder sb = new StringBuilder();
    for (UUID targetId: getTargets()) {
      Permanent permanent = game.getPermanent(targetId);
      if (permanent != null) {
        sb.append(permanent.getName()).append(" ");
      }
      else {
        Player player = game.getPlayer(targetId);
        sb.append(player.getName()).append(" ");
      }
View Full Code Here

    return new GainControlTargetEffect(this);
  }

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      return permanent.changeControllerId(source.getControllerId(), game);
    }
    return false;
  }
View Full Code Here

  super(effect);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(source.getSourceId());
  if (permanent != null) {
            permanent.setTapped(false);
            return true;
  }
  return false;
    }
View Full Code Here

    return new AttachEffect(this);
  }

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      return permanent.addAttachment(source.getSourceId(), game);
    }
    return false;
  }
View Full Code Here

    return this.filter;
  }

  @Override
  public boolean canTarget(UUID id, Game game) {
    Permanent permanent = game.getPermanent(id);
    if (permanent != null) {
      return filter.match(permanent);
    }
    Player player = game.getPlayer(id);
    if (player != null)
View Full Code Here

    return false;
  }

  @Override
  public boolean canTarget(UUID id, Ability source, Game game) {
    Permanent permanent = game.getPermanent(id);
    MageObject targetSource = game.getObject(source.getSourceId());
    if (permanent != null) {
      if (source != null)
        return permanent.canBeTargetedBy(targetSource) && filter.match(permanent, source.getControllerId(), game);
      else
        return filter.match(permanent);
    }
    Player player = game.getPlayer(id);
    if (player != null)
View Full Code Here

  @Override
  public String getTargetedName(Game game) {
    StringBuilder sb = new StringBuilder();
    for (UUID targetId: getTargets()) {
      Permanent permanent = game.getPermanent(targetId);
      if (permanent != null) {
        sb.append(permanent.getName()).append(" ");
      }
      else {
        Player player = game.getPlayer(targetId);
        sb.append(player.getName()).append(" ");
      }
View Full Code Here

  @Override
  public boolean applies(GameEvent event, Ability source, Game game) {
    if (event.getType() == EventType.TARGET) {
      filterTarget.setTargetController(TargetController.YOU);
      Permanent permanent = game.getPermanent(event.getTargetId());
      if (permanent != null && filterTarget.match(permanent, source.getControllerId(), game)) {
        if (filterSource == null)
          return true;
        else {
          StackObject sourceObject = game.getStack().getStackObject(event.getSourceId());
View Full Code Here

TOP

Related Classes of mage.game.permanent.Permanent

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.