Package mage.players

Examples of mage.players.Player.gainLife()


        if (player != null) {
            int newValue = player.getLibrary().size();
            int oldValue = player.getLife();

            if (newValue - oldValue > 0) {
                player.gainLife(newValue - oldValue, game);
            }
            if (oldValue - newValue > 0) {
                player.loseLife(oldValue - newValue, game);
            }
            return true;
View Full Code Here


            for (Permanent creature : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
                creature.addCounters(CounterType.P1P1.createInstance(), game);
            }
        }
        if (condition2) {
            you.gainLife(10, game);
        }
        return true;
    }
}
View Full Code Here

        Spell spell = game.getState().getStack().getSpell(getTargetPointer().getFirst(game, source));
        if (spell != null) {
            Player controller = game.getPlayer(source.getControllerId());
            if (controller != null) {
                int life = spell.getConvertedManaCost();
                controller.gainLife(life, game);
                return true;
            }
        }
        return false;
    }
View Full Code Here

            permanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
        }

        if (player != null && permanent != null) {
            if (!permanent.isTapped()) {
                player.gainLife(3, game);
            } else {
                for (UUID opponentId : player.getInRange()) {
                    Player opponent = game.getPlayer(opponentId);
                    if (opponent != null) {
                        opponent.loseLife(3, game);
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Integer amount = (Integer) this.getValue("damageAmount");

        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            player.gainLife(amount, game);
        }

        UUID attackerId = (UUID) this.getValue("attackerId");
        Player attacker = game.getPlayer(attackerId);
        if (attacker != null) {
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        DynamicValue value = new CardsInControllerGraveyardCount();
        if (player != null) {
            player.gainLife(value.calculate(game, source, this) * 2, game);
            player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
            player.getGraveyard().clear();
            player.shuffleLibrary(game);
            return true;
        }
View Full Code Here

        }
        if (creature != null) {
            int amount = creature.getToughness().getValue();
            Player player = game.getPlayer(source.getControllerId());
            if (player != null) {
                player.gainLife(amount, game);
            }
            return true;
        }
        return false;
    }
View Full Code Here

                    Card card = opponent.getLibrary().remove(targetId, game);
                    if (card != null) {
                        player.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.LIBRARY);
                        int cmc = card.getManaCost().convertedManaCost();
                        if (cmc > 0) {
                            player.gainLife(cmc, game);
                        }
                    }
                }
            }
            opponent.shuffleLibrary(game);
View Full Code Here

        Player player = game.getPlayer(source.getControllerId());
        if (sacrificed != null && player != null) {
            sacrificed.sacrifice(source.getSourceId(), game);
            Permanent lastKnownState = (Permanent) game.getLastKnownInformation(sacrificed.getId(), Zone.BATTLEFIELD);
            int power = lastKnownState.getPower().getValue();
            player.gainLife(power, game);
            player.drawCards(power, game);
            return true;
        }
        return false;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (player != null) {
            player.gainLife(5, game);
            if (permanent != null) {
                player.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, true, true);
            }
            player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
            player.getGraveyard().clear();
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.