Package mage.game.permanent

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


        Permanent creature2 = game.getPermanent(source.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;
            }
        }
        return false;
    }
View Full Code Here


                used = true;
                return true;
            }
            Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
            if (permanent != null) {
                permanent.damage(2, source.getSourceId(), game, false, true);
                used = true;
                return true;
            }
        }
        return false;
View Full Code Here

            if (player != null) {
                player.damage(power, source.getSourceId(), game, false, true);
            } else {
                Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
                if (creature != null) {
                    creature.damage(power, source.getSourceId(), game, false, true);
                }
            }
        }
        return true;
    }
View Full Code Here

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

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

                if (creatureInGraveyard != null) {
                    if (creatureInGraveyard.moveToZone(Zone.LIBRARY, id, game, true)) {
                        int power = creatureInGraveyard.getPower().getValue();
                        Permanent creature = game.getPermanent(target2.getFirstTarget());
                        if (creature != null) {
                            creature.damage(power, id, game, true, true);
                            return true;
                        }
                    }
                }
            }
View Full Code Here

            */

            Permanent permanent = game.getPermanent(dealDamageTo);
            if (permanent != null) {
                game.informPlayers("Dealing " + prevented + " to " + permanent.getName() + " instead");
                permanent.damage(prevented, source.getSourceId(), game, false, true);
            }
            Player player = game.getPlayer(dealDamageTo);
            if (player != null) {
                game.informPlayers("Dealing " + prevented + " to " + player.getName() + " instead");
                player.damage(prevented, source.getSourceId(), game, false, true);
View Full Code Here

            if (player != null) {
                player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.HAND);
                int damage = card.getPower().getValue();
                Permanent creature = game.getPermanent(source.getTargets().get(1).getTargets().get(0));
                if (creature != null) {
                    creature.damage(damage, source.getSourceId(), game, false, true);
                    return true;
                }
                Player targetPlayer = game.getPlayer(source.getTargets().get(1).getTargets().get(0));
                if (targetPlayer != null) {
                    targetPlayer.damage(damage, source.getSourceId(), game, true, false);
View Full Code Here

            sourcePermanent.addCounters(CounterType.CHARGE.createInstance(), game);
            int amount = sourcePermanent.getCounters().getCount(CounterType.CHARGE);

            Permanent permanent = game.getPermanent(source.getFirstTarget());
            if (permanent != null) {
                permanent.damage(amount, source.getSourceId(), game, false, true);
            }
            Player player = game.getPlayer(source.getFirstTarget());
            if (player != null) {
                player.damage(amount, source.getSourceId(), game, false, true);
            }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        for (UUID permanentId : game.getBattlefield().getAllPermanentIds()) {
            Permanent p = game.getPermanent(permanentId);
            if (p != null && p.getCardType().contains(CardType.CREATURE)) {
                p.damage(1, source.getSourceId(), game, false, true);
            }
        }
        for (UUID playerId : game.getPlayerList()) {
            Player p = game.getPlayer(playerId);
            if (p != 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.