// You draw X cards and you lose X life, where X is your devotion to black.
DynamicValue blackDevotion = new DevotionCount(ColoredManaSymbol.B);
Effect effect = new DrawCardSourceControllerEffect(blackDevotion);
effect.setText("You draw X cards");
this.getSpellAbility().addEffect(effect);
effect = new LoseLifeSourceControllerEffect(blackDevotion);
effect.setText("and you lose X life, where X is your devotion to black");
this.getSpellAbility().addEffect(effect);
}