Package mage.players

Examples of mage.players.Player.gainLife()


    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            int life = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) * 3;
            player.gainLife(life, game);
        }
        return true;
    }

    @Override
View Full Code Here


    public boolean apply(Game game, Ability source) {
        ManaCostsImpl cost = new ManaCostsImpl("{X}");
        cost.clearPaid();
        if (cost.payOrRollback(source, game, source.getSourceId(), source.getControllerId())) {
            Player player = game.getPlayer(source.getControllerId());
            player.gainLife(cost.getX(), game);
            return true;
        } else {
            return false;
        }
    }
View Full Code Here

        if (player != null) {
            player.loseLife(count, game);
        }
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            controller.gainLife(count, game);
        }
        return true;
    }

}
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        int life = 2 * game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);
        if (player != null) {
            player.gainLife(life, game);
        }
        return true;
    }

}
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        Permanent creature = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
        if (creature != null && controller != null) {
            controller.gainLife(creature.getPower().getValue(), game);
        }
        return false;
    }

    @Override
View Full Code Here

            if (permanent != null) {
                int life = permanent.getCounters().getCount(CounterType.DEVOTION);
                if (life > 0) {
                    Player controller = game.getPlayer(source.getControllerId());
                    if (controller != null) {
                        controller.gainLife(life, game);
                    }
                }
            }
        }
        return result;
View Full Code Here

            }
            Permanent permanent = game.getPermanent(target.getFirstTarget());
            if (permanent != null) {
                int gainLife = permanent.getToughness().getValue();
                permanent.sacrifice(source.getSourceId(), game);
                player.gainLife(gainLife, game);
            } else{
                return false;
            }
        }
        return true;
View Full Code Here

        if (target.canChoose(player.getId(), game)) {
            player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);

            Permanent permanent = game.getPermanent(target.getFirstTarget());
            if ( permanent != null ) {
                controller.gainLife(permanent.getToughness().getValue(), game);
                return permanent.sacrifice(source.getSourceId(), game);
            }
            return true;
        }
        return false;
View Full Code Here

                Card card = player.getGraveyard().get(source.getFirstTarget(), game);
                if (card == null) {
                    card = (Card)game.getLastKnownInformation(source.getFirstTarget(), Zone.GRAVEYARD);
                }
                if (card != null) {
                    player.gainLife(card.getManaCost().convertedManaCost(), game);
                }
            }
            return true;
        }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
        if (permanent != null) {
            Player player = game.getPlayer(source.getControllerId());
            if (player != null) {
                player.gainLife(permanent.getToughness().getValue(), game);
            }
        }
        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.