Package mage.game.permanent

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


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


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

  }

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    permanent.destroy(source.getId(), game, true);
    return true;
  }

  @Override
  public String getText(Ability source) {
View Full Code Here

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    String name = permanent.getName();

    permanent.destroy(source.getSourceId(), game, false);
    for (Permanent perm: game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
      if (perm.getName().equals(name))
        perm.destroy(source.getId(), game, false);
    }
View Full Code Here

    }

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
        if (permanent != null && permanent.destroy(source.getSourceId(), game, false)) { // if not destroyed or moved to other zone (replacement effect) it returns false
            new CreateTokenEffect(new VampireToken(permanent.getPower().getValue(), permanent.getToughness().getValue())).apply(game, source);
        }
        return true;
    }
}
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(source.getFirstTarget());
        String name = permanent.getName();

        permanent.destroy(source.getSourceId(), game, false);
        for (Permanent perm: game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
            if (perm.getName().equals(name)) {
                perm.destroy(source.getSourceId(), game, false);
            }
        }
View Full Code Here

        Permanent secondTarget = game.getPermanent(source.getTargets().get(1).getFirstTarget());
        if (firstTarget != null) {
            firstTarget.destroy(id, game, false);
        }
        if (secondTarget != null) {
            return secondTarget.destroy(id, game, false);
        }
        return true;
    }
}
View Full Code Here

        int affectedTargets = 0;
        for (Target target: source.getTargets()) {
            for (UUID permanentId: target.getTargets()) {
                Permanent permanent = game.getPermanent(permanentId);
                if (permanent != null) {
                    permanent.destroy(source.getSourceId(), game, noRegen);
                    affectedTargets++;
                }
            }
        }
        return affectedTargets > 0;
View Full Code Here

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

        if (source.getTargets().size() > 1 && targetPointer instanceof FirstTargetPointer) { // for Rain of Thorns
            for (Target target : source.getTargets()) {
                for (UUID permanentId : target.getTargets()) {
                    Permanent permanent = game.getPermanent(permanentId);
                    if (permanent != null) {
                        permanent.destroy(source.getSourceId(), game, noRegen);
                        affectedTargets++;
                    }
                }
            }
        }
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.