Examples of gainLife()


Examples of mage.players.Player.gainLife()

        this.used = true;
        this.discard(); // only one use
        if (preventionData.getPreventedDamage() > 0) {
            Player player = game.getPlayer(source.getControllerId());
            if (player != null) {
                player.gainLife(preventionData.getPreventedDamage(), game);
            }           
        }       
        return true;
    }
View Full Code Here

Examples of mage.players.Player.gainLife()

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            player.gainLife((Integer) this.getValue("damageAmount"), game);
        }
        return true;
    }

}
View Full Code Here

Examples of mage.players.Player.gainLife()

        for (Cost cost : source.getCosts()) {
            if (cost instanceof SacrificeTargetCost) {
                amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getToughness().getValue();
                Player player = game.getPlayer(source.getControllerId());
                if (amount > 0 && player != null) {
                    player.gainLife(amount, game);
                    return true;
                }
            }
        }
        return false;
View Full Code Here

Examples of mage.players.Player.gainLife()

            }
            if (power > 0) {
                controller.drawCards(power, game);
            }
            if (toughness > 0) {
                controller.gainLife(toughness, game);
            }
            return true;
        }
        return false;
View Full Code Here

Examples of mage.players.Player.gainLife()

        RevealTargetFromHandCost cost = (RevealTargetFromHandCost) source.getCosts().get(0);
        if (cost != null) {
            Player player = game.getPlayer(source.getControllerId());
            int CMC = cost.convertedManaCosts;
            if (player != null) {
                player.gainLife(CMC, game);
            }
        }
        return true;
    }
View Full Code Here

Examples of mage.players.Player.gainLife()

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        for (Permanent permanent: game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
            if (permanent.destroy(source.getSourceId(), game, false)) {
                controller.gainLife(2, game);
            }
        }
        return false;
    }
}
View Full Code Here

Examples of mage.players.Player.gainLife()

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            int lifeToGain = game.getBattlefield().count(new FilterCreaturePermanent(), source.getSourceId(), source.getControllerId(), game);
            lifeToGain += game.getBattlefield().count(new FilterArtifactPermanent(), source.getSourceId(), source.getControllerId(), game);
            player.gainLife(lifeToGain, game);
        }
        return true;
    }

}
View Full Code Here

Examples of mage.players.Player.gainLife()

    public boolean apply(Game game, Ability source) {
        Permanent permanent = (Permanent)game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
        if (permanent != null) {
            Player player = game.getPlayer(permanent.getControllerId());
            if (player != null) {
                player.gainLife(permanent.getToughness().getValue(), game);
                return true;
            }
        }
        return false;
    }
View Full Code Here

Examples of mage.players.Player.gainLife()

    public boolean apply(Game game, Ability source) {
        Permanent target = (Permanent) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.BATTLEFIELD);
        if (target != null) {
            Player player = game.getPlayer(target.getControllerId());
            if (player != null) {
                player.gainLife(4, game);
                return true;
            }
        }
        return false;
    }
View Full Code Here

Examples of mage.players.Player.gainLife()

            if (sacrificedCreature != null) {
                int damage = sacrificedCreature.getPower().getValue();
                if (damage > 0) {
                    int damageDealt = targetPlayer.damage(damage, source.getSourceId(), game, false, true);
                    if (damageDealt > 0) {
                        controller.gainLife(damage, game);
                    }

                }
                return true;
            }
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.