Examples of damage()


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

    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

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

  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

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

    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

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

                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

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

        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

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

                if (manaCosts.pay(source, game, source.getSourceId(), controller.getId(), false)) {
                    int amount = creature.getPower().getValue();
                    UUID target = source.getTargets().getFirstTarget();
                    Permanent targetCreature = game.getPermanent(target);
                    if (targetCreature != null) {
                        targetCreature.damage(amount, creature.getId(), game, false, true);
                    } else {
                        Player player = game.getPlayer(target);
                        if (player != null) {
                            player.damage(amount, creature.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(targetPointer.getFirst(game, source));
        if (permanent != null && sourceId != null) {
            permanent.damage(2, sourceId, game, false, true);
            return true;
        }
        Player player = game.getPlayer(targetPointer.getFirst(game, source));
        if (player != null && sourceId != null) {
            player.damage(2, sourceId, game, false, true);
View Full Code Here

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

        if (sourceCreature != null && targetCreature != null
                && sourceCreature.getCardType().contains(CardType.CREATURE)
                && targetCreature.getCardType().contains(CardType.CREATURE)) {
            targetCreature.damage(sourceCreature.getPower().getValue(), sourceCreature.getId(), game, false, true);
            if (sourceOnBattlefield) {
                sourceCreature.damage(targetCreature.getPower().getValue(), targetCreature.getId(), game, false, true);
            }
            return true;
        }
        return false;
    }
View Full Code Here

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

                targetId = targets.get(rnd.nextInt(targets.size()));
                amount = rnd.nextInt(damage + 1);
            }
            Permanent permanent = game.getPermanent(targetId);
            if (permanent != null) {
                permanent.damage(amount, sourceId, game, false, true);
                remainingDamage -= amount;
            }
            else {
                Player player = game.getPlayer(targetId);
                if (player != null) {
View Full Code Here

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

                Permanent creature2 = game.getPermanent(source.getTargets().get(1).getFirstTarget());
                // 20110930 - 701.10
                if (creature1 != null && creature2 != null) {
                    if (creature1.getCardType().contains(CardType.CREATURE) && creature2.getCardType().contains(CardType.CREATURE)) {
                        creature1.damage(creature2.getPower().getValue(), creature2.getId(), game, false, true);
                        creature2.damage(creature1.getPower().getValue(), creature1.getId(), game, false, true);
                        return true;
                    }
                }
            }
            game.informPlayers(card.getName() + " has been fizzled.");
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.