Package mage.players

Examples of mage.players.Player.loseLife()


            Player controller = game.getPlayer(creature.getControllerId());
            if (controller != null) {
                int lifeLoss = creature.getPower().getValue() + creature.getToughness().getValue();
                creature.destroy(source.getSourceId(), game, false);
                // the life loss happens also if the creature is indestructible or regenerated (legal targets)
                controller.loseLife(lifeLoss, game);
                return true;
            }
        }
        return false;
    }
View Full Code Here


        Player player = game.getPlayer(source.getControllerId());
        if (player != null && player.getLibrary().size() > 0) {
            Card card = player.getLibrary().removeFromTop(game);
            if (card != null) {
                card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                player.loseLife(card.getManaCost().convertedManaCost(), game);
                Cards cards = new CardsImpl();
                cards.add(card);
                player.revealCards("Dark Tutelage", cards, game);
                return true;
            }
View Full Code Here

            int damage = new DevotionCount(ColoredManaSymbol.B).calculate(game, source, this);
            if (damage > 0) {
                for (UUID playerId : game.getOpponents(source.getControllerId())) {
                    Player opponent = game.getPlayer(playerId);
                    if (opponent != null) {
                        lifeLost += opponent.loseLife(damage, game);
                    }
                }
            }
            controller.gainLife(lifeLost, game);
            return true;
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
            if ( controller != null ) {
                controller.drawCards(amount.calculate(game, source, this), game);
                controller.loseLife(amount.calculate(game, source, this), game);
                return true;
            }
        return false;
    }
}
View Full Code Here

                String message = new StringBuilder("Pay 2 life to put ").append(card.getName()).append(" into graveyard?").toString();
                while (!currentPlayer.getId().equals(player.getId())) {
                    if (currentPlayer.canPayLifeCost() &&
                            currentPlayer.getLife() >= 2 &&
                            currentPlayer.chooseUse(Outcome.Benefit, message, game)) {
                        currentPlayer.loseLife(2, game);
                        player.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
                       
                        game.getState().getRevealed().reset();

                        return true;
View Full Code Here

        Player caster = null;
        if (spell != null) {
            caster = game.getPlayer(spell.getControllerId());
        }
        if (caster != null) {
            caster.loseLife(1, game);
            return true;
        }
        return 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.