Package mage.players

Examples of mage.players.Player.damage()


    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            Player player = game.getPlayer(targetPointer.getFirst(game, source));
            if (player != null) {
                player.damage(2, source.getSourceId(), game, false, true);
                used = true;
                return true;
            }
            Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
            if (permanent != null) {
View Full Code Here


            }
        }
        if (power > 0) {
            Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));
            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);
                }
View Full Code Here

        Watcher watcher = game.getState().getWatchers().get("LandPlayed", source.getControllerId());
        Player player = game.getPlayer(source.getTargets().get(0).getFirstTarget());
        Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
        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);
            }
        }
View Full Code Here

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

                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);
            }
        }
        return false;
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(targetPointer.getFirst(game, source));
        if (player != null) {
            GenericManaCost cost = new GenericManaCost(2);
            if (!cost.pay(source, game, player.getId(), player.getId(), false)) {
                player.damage(2, source.getSourceId(), game, false, true);
            }
            return true;
        }
        return false;
    }
View Full Code Here

                    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);
                    return true;
                }
            }
        }
        return false;
View Full Code Here

            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);
            }

            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

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getFirstTarget());
        if (player != null) {
           int damage = source.getManaCostsToPay().getX();
            if (damage > 0)  {
                player.damage(damage, source.getSourceId(), game, false, true);
                for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) {
                    perm.damage(damage, source.getSourceId(), game, false, true);
                }
            }
            return 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.