little fix Deadbridge Chant.  Now works well with Humility, etc.
-
package mage.cards.d;
import java.util.UUID;
@@ -21,14 +20,11 @@ import mage.players.Player;
*
* @author LevelX2
*/
-
-
public final class DeadbridgeChant extends CardImpl {
public DeadbridgeChant(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}{G}");
-
// When Deadbridge Chant enters the battlefield, put the top ten cards of your library into your graveyard.
this.addAbility(new EntersBattlefieldTriggeredAbility(new PutTopCardOfLibraryIntoGraveControllerEffect(10)));
@@ -64,9 +60,10 @@ class DeadbridgeChantEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- if (player != null && !player.getGraveyard().isEmpty()) {
- Card card = player.getGraveyard().getRandom(game);
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null
+ && !controller.getGraveyard().isEmpty()) {
+ Card card = controller.getGraveyard().getRandom(game);
if (card != null) {
Zone targetZone = Zone.HAND;
String text = " put into hand of ";
@@ -74,8 +71,8 @@ class DeadbridgeChantEffect extends OneShotEffect {
targetZone = Zone.BATTLEFIELD;
text = " put onto battlefield for ";
}
- card.moveToZone(targetZone, source.getSourceId(), game, false);
- game.informPlayers("Deadbridge Chant: " + card.getName() + text + player.getLogName());
+ controller.moveCards(card, targetZone, source, game);
+ game.informPlayers("Deadbridge Chant: " + card.getName() + text + controller.getLogName());
return true;
}
}
