Examples of damage()


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

  public boolean apply(Game game, Ability source) {
    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.getId(), game, true, false);
      }
      else {
        Player player = game.getPlayer(target);
        if (player != null) {
          player.damage(multiTarget.getTargetAmount(target), source.getId(), game, false, true);
View Full Code Here

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

  public boolean replaceEvent(GameEvent event, Ability source, Game game) {
    DamageEvent damageEvent = (DamageEvent)event;
    Permanent permanent = game.getPermanent(redirectTarget.getFirstTarget());
    Ability damageSource = getSource(damageEvent.getSourceId(), game);
    if (permanent != null) {
      permanent.damage(damageEvent.getAmount(), damageSource.getId(), game, damageEvent.isPreventable(), damageEvent.isCombatDamage());
      return true;
    }
    Player player = game.getPlayer(redirectTarget.getFirstTarget());
    if (player != null) {
      player.damage(damageEvent.getAmount(), damageSource.getId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable());
View Full Code Here

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

  @Override
  public boolean apply(Game game, Ability source) {
    int amount = source.getManaCosts().getVariableCosts().get(0).getAmount();
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      permanent.damage(amount, source.getId(), game, true, false);
      return true;
    }
    Player player = game.getPlayer(source.getFirstTarget());
    if (player != null) {
      player.damage(amount, source.getId(), game, false, true);
View Full Code Here

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

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

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

      player.choose(Outcome.Damage, target, game);
      Permanent permanent = game.getPermanent(target.getFirstTarget());
      Permanent cyclops = game.getPermanent(source.getSourceId());
      if (permanent != null && cyclops != null) {
        permanent.damage(cyclops.getPower().getValue(), cyclops.getId(), game, true, false);
        cyclops.damage(permanent.getPower().getValue(), permanent.getId(), game, true, false);
        return true;
      }
    }
    return false;
  }
View Full Code Here

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

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

    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

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

      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

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

      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

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

      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
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.