Package mage.game.permanent

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


    if (watcher != null && watcher.conditionMet()) {
      if (player != null) {
        player.damage(3, source.getId(), game, false, true);
      }
      if (creature != null) {
        creature.damage(3, source.getId(), game, true, false);
      }
    }
    else {
      if (player != null) {
        player.damage(1, source.getId(), game, false, true);
View Full Code Here


    else {
      if (player != null) {
        player.damage(1, source.getId(), game, false, true);
      }
      if (creature != null) {
        creature.damage(1, source.getId(), game, true, false);
      }
    }
    return true;
  }
View Full Code Here

      int damagePer = damage/numTargets;
      if (damagePer > 0) {
        for (UUID targetId: source.getTargets().get(0).getTargets()) {
          Permanent permanent = game.getPermanent(targetId);
          if (permanent != null) {
            permanent.damage(damagePer, source.getSourceId(), game, true, false);
          }
          else {
            Player player = game.getPlayer(targetId);
            if (player != null) {
              player.damage(damagePer, source.getSourceId(), game, false, true);
View Full Code Here

      card.moveToZone(Zone.HAND, source.getId(), game, false);
      int damage = card.getManaCost().convertedManaCost();
      if (!card.getCardType().contains(CardType.LAND)) {
        Permanent permanent = game.getPermanent(source.getTargets().get(1).getTargets().get(0));
        if (permanent != null) {
          permanent.damage(damage, source.getSourceId(), game, true, false);
          return true;
        }
        Player targetPlayer = game.getPlayer(source.getTargets().get(1).getTargets().get(0));
        if (targetPlayer != null) {
          targetPlayer.damage(damage, source.getSourceId(), game, false, true);
View Full Code Here

      choose(Outcome.Damage, target, game);
      if (targets.size() == 0 || targets.contains(target.getFirstTarget())) {
        int damageAmount = getAmount(0, remainingDamage, "Select amount", game);
        Permanent permanent = game.getPermanent(target.getFirstTarget());
        if (permanent != null) {
          permanent.damage(damageAmount, sourceId, game, true, false);
          remainingDamage -= damageAmount;
        }
        else {
          Player player = game.getPlayer(target.getFirstTarget());
          if (player != null) {
View Full Code Here

    List<UUID> wolves = new ArrayList<UUID>();
    Permanent target = game.getPermanent(source.getFirstTarget());
    if (target != null && game.getBattlefield().countAll(filter, source.getControllerId()) > 0) {
      for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId())) {
        permanent.tap(game);
        target.damage(permanent.getToughness().getValue(), permanent.getId(), game, true, false);
        wolves.add(permanent.getId());
      }
      Player player = game.getPlayer(target.getControllerId());
      player.assignDamage(target.getPower().getValue(), wolves, target.getId(), game);
      return true;
View Full Code Here

  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      Player player = game.getPlayer(permanent.getControllerId());
      if (player != null) {
        permanent.damage(4, source.getSourceId(), game, true, false);
        player.damage(2, source.getSourceId(), game, false, true);
        return true;
      }
    }
    return false;
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Card card = (Card) this.getValue("discardedCard");
        if (card != null && card.getColor().isRed()) {
            Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
            if (permanent != null) {
                permanent.damage(4, source.getSourceId(), game, false, true);
                return true;
            }

            Player player = game.getPlayer(targetPointer.getFirst(game, source));
            if (player != null) {
View Full Code Here

                Permanent creature1 = game.getPermanent(source.getTargets().get(0).getFirstTarget());

                // 20110930 - 701.10
                if (creature1 != null && sourcePermanent != null) {
                    if (creature1.getCardType().contains(CardType.CREATURE) && sourcePermanent.getCardType().contains(CardType.CREATURE)) {
                        creature1.damage(sourcePermanent.getPower().getValue(), sourcePermanent.getId(), game, false, true);
                        sourcePermanent.damage(creature1.getPower().getValue(), creature1.getId(), game, false, true);
                        return true;
                    }
                }
            }
View Full Code Here

        if (source.getTargets().size() > 0) {
            Target multiTarget = source.getTargets().get(0);
            for (UUID target: multiTarget.getTargets()) {
                Permanent permanent = game.getPermanent(target);
                if (permanent != null) {
                    permanent.damage(multiTarget.getTargetAmount(target), source.getSourceId(), game, false, true);
                }
                else {
                    Player player = game.getPlayer(target);
                    if (player != null) {
                        player.damage(multiTarget.getTargetAmount(target), source.getSourceId(), game, false, true);
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.