Package mage.players

Examples of mage.players.Player.loseLife()


    public boolean apply(Game game, Ability source) {
        Permanent creature = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
        if (creature != null) {
            Player controller = game.getPlayer(creature.getControllerId());
            if (controller != null) {
                controller.loseLife(3, game);
                return true;
            }
        }
        return false;
    }
View Full Code Here


        DynamicValue value = new PermanentsOnBattlefieldCount(filter);
        int count = value.calculate(game, source, this) * 2;

        Player player = game.getPlayer(source.getFirstTarget());
        if (player != null) {
            player.loseLife(count, game);
        }
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            controller.gainLife(count, game);
        }
View Full Code Here

        if(banewaspAffliction != null){
            Permanent creature = (Permanent) game.getLastKnownInformation(banewaspAffliction.getAttachedTo(), Zone.BATTLEFIELD);
            if(creature != null){
                Player player = game.getPlayer(creature.getOwnerId());
                if (player != null) {
                    player.loseLife(creature.getToughness().getValue(), game);
                    return true;
                }
            }
        }
        return false;
View Full Code Here

        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            for (UUID playerId : controller.getInRange()) {
                Player player = game.getPlayer(playerId);
                if (player != null) {
                    if (player.loseLife(1, game) > 0) {
                        counters++;
                    }
                }
            }
            Permanent bloodTyrant = game.getPermanent(source.getSourceId());
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        for (UUID opponentId : game.getOpponents(source.getControllerId())) {
            Player opponent = game.getPlayer(opponentId);
            if (opponent != null) {
                opponent.loseLife(2, game);
            }
        }
        return true;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(targetPointer.getFirst(game, source));
        Permanent sourcePermanent = game.getPermanent(source.getSourceId());
        if (player != null && sourcePermanent != null) {
            player.loseLife(sourcePermanent.getPower().getValue(), game);
            return true;
        }
        return false;
    }
View Full Code Here

                                card.moveToExile(id, "Suffer the Past", source.getSourceId(), game);
                                numberExiled ++;
                            }
                        }
                        you.gainLife(numberExiled, game);
                        targetPlayer.loseLife(numberExiled, game);
                    }
                }
                return true;
            }
        }
View Full Code Here

    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Player player = game.getPlayer(event.getPlayerId());
        if (player != null) {
            player.drawCards(2, game, event.getAppliedEffects());
            player.loseLife(1, game);
        }
        return true;
    }

    @Override
View Full Code Here

        if (creatureCard != null && controller != null) {
            boolean result = false;
            if (game.getState().getZone(creatureCard.getId()).equals(Zone.GRAVEYARD)) {
                result = controller.putOntoBattlefieldWithInfo(creatureCard, game, Zone.GRAVEYARD, source.getSourceId());
            }           
            controller.loseLife(creatureCard.getManaCost().convertedManaCost(), game);
            return result;
        }
        return false;
    }
}
View Full Code Here

        if (player != null && player.getHand().size() < 2) {
            Permanent sourcePermanent = game.getPermanent(source.getSourceId());
            if (sourcePermanent != null) {
                game.informPlayers(sourcePermanent.getName() + ": " + player.getName() + " loses 3 life");
            }
            player.loseLife(3, 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.