Package mage.players

Examples of mage.players.Player.gainLife()


            Permanent artefact = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
            if (artefact != null) {
                int cost = artefact.getManaCost().convertedManaCost();
                Player player = game.getPlayer(source.getControllerId());
                if (player != null) {
                    player.gainLife(cost, game);
                }
            }
            return true;
        }
View Full Code Here


    @Override
    public boolean apply(Game game, Ability source) {
        Permanent target = game.getPermanent(source.getFirstTarget());
        Player player = game.getPlayer(source.getControllerId());
        if (target != null && player != null) {
            player.gainLife(target.getPower().getValue(), game);
            return true;
        }
        return false;
    }
View Full Code Here

        Player controller = game.getPlayer(source.getControllerId());
        Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
        if (controller != null && creature != null) {
            creature.destroy(source.getSourceId(), game, false);
            if (ClashEffect.getInstance().apply(game, source)) {
                controller.gainLife(creature.getToughness().getValue(), game);
            }
            return true;
        }
        return false;
    }
View Full Code Here

            if (permanent != null) {
                permanent.sacrifice(source.getSourceId(), game);
                affectedTargets++;
                Player controller = game.getPlayer(source.getControllerId());
                if (controller != null) {
                    controller.gainLife(permanent.getPower().getValue(), game);
                }
            }
        }
        return affectedTargets > 0;
    }
View Full Code Here

        PreventionEffectData preventEffectData = preventDamageAction(event, source, game);
        if (preventEffectData.getPreventedDamage() > 0) {
            used = true;
            Player player = game .getPlayer(source.getControllerId());
            if(player != null){
                player.gainLife(preventEffectData.getPreventedDamage(), game);
            }
        }
        return false;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        for (UUID playerId : game.getOpponents(source.getControllerId())) {
            Player player = game.getPlayer(playerId);
            player.gainLife(1, game);
        }
        return true;
    }

    @Override
View Full Code Here

    public boolean apply(Game game, Ability source) {
        int amount = (Integer) getValue("damage");
        if (amount > 0) {
            Player controller = game.getPlayer(source.getControllerId());
            if (controller != null) {
                controller.gainLife(amount, game);
                return true;
            }
        }
        return false;
    }
View Full Code Here

        Player player = game.getPlayer(source.getControllerId());
        if (p == null) {
            p = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
        }
        if (p != null && player != null) {
            player.gainLife(p.getCounters().getCount(CounterType.CHARGE), game);
            return true;
        }
        return false;
    }
View Full Code Here

        Permanent permanent = game.getPermanent(source.getFirstTarget());
        Player player = game.getPlayer(source.getControllerId());
        if (permanent != null && player != null) {
            int amount = permanent.getPower().getValue();
            if (amount > 0) {
                player.gainLife(amount, game);
                return true;
            }
        }
        return false;
    }
View Full Code Here

        Player you = game.getPlayer(source.getControllerId());
        if (targetPlayer != null) {
            targetPlayer.loseLife(1, game);
        }
        if (you != null) {
            you.gainLife(1, game);
        }
        return true;
    }

    @Override
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.