Package mage.game.permanent

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


        Permanent targetCreature = game.getPermanent(source.getFirstTarget());
        Player controller = game.getPlayer(source.getControllerId());
        if (targetCreature != null && controller != null) {
            int damage = (Integer) this.getValue("damage");
            if (damage > 0) {
                targetCreature.damage(damage, source.getSourceId(), game, false, true);               
            }
            return true;
        }
        return false;
    }
View Full Code Here


            }
        }
        for (UUID playerId : game.getPlayerList()) {
            Player p = game.getPlayer(playerId);
            if (p != null) {
                p.damage(1, source.getSourceId(), game, true, false);
            }
        }
        return true;
    }
View Full Code Here

        Permanent ownCreature = game.getPermanent(source.getFirstTarget());
        if (ownCreature != null) {
            int damage = ownCreature.getPower().getValue();
            Permanent targetCreature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
            if (targetCreature != null) {
                targetCreature.damage(damage, ownCreature.getId(), game, false, true);
                return true;
            }
        }
        return false;
    }
View Full Code Here

                Permanent giant = game.getPermanent(target.getFirstTarget());               
                if (giant != null) {
                    game.informPlayers(new StringBuilder("Crush Underfoot: Choosen Giant is").append(giant.getName()).toString());
                    Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
                    if (targetCreature != null) {
                        targetCreature.damage(giant.getPower().getValue(), source.getSourceId(), game, false, true);
                        return true;
                    }
                }
            }
        }
View Full Code Here

            if (controller.getLibrary().size() > 0) {
                Card card = controller.getLibrary().getFromTop(game);
                controller.revealCards(sourceCard.getName(), new CardsImpl(card), game);
                Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
                if (targetCreature != null) {
                    targetCreature.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true);
                    return true;
                }
                Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
                if (targetPlayer != null) {
                    targetPlayer.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true);
View Full Code Here

        if (player != null) {
            player.damage(3, source.getSourceId(), game, false, true);
        }
        Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
        if (creature != null) {
            creature.damage(3, source.getSourceId(), game, false, true);
        }
        return true;
    }
}
View Full Code Here

                        maxCost = test;
                }
            }
            Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
            if (permanent != null) {
                permanent.damage(maxCost, source.getSourceId(), game, false, true);
                return true;
            }
            Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
            if (targetPlayer != null) {
                targetPlayer.damage(maxCost, source.getSourceId(), game, false, true);
View Full Code Here

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

            if (prevented > 0) {
                UUID damageTarget = source.getTargets().get(1).getFirstTarget();
                Permanent target = game.getPermanent(damageTarget);
                if (target != null) {
                    game.informPlayers("Dealing " + prevented + " to " + target.getName());
                    target.damage(prevented, source.getSourceId(), game, false, true);
                }
                Player player = game.getPlayer(damageTarget);
                if (player != null) {
                    game.informPlayers("Dealing " + prevented + " to " + player.getName());
                    player.damage(prevented, source.getSourceId(), game, true, false);
View Full Code Here

        if (you != null) {
            for (UUID uuid : this.getTargetPointer().getTargets(game, source)) {
                Permanent permanent = game.getPermanent(uuid);
                Player player = game.getPlayer(uuid);
                if (permanent != null) {
                    permanent.damage(damage, source.getSourceId(), game, false, true);
                }
                if (player != null) {
                    player.damage(damage, source.getSourceId(), game, true, false);
                }
            }
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.