- little fix Deadbridge Chant. Now works well with Humility, etc.

This commit is contained in:
jeffwadsworth 2019-01-25 21:53:01 -06:00
parent b800585cc5
commit 6e49f4a21c

View file

@ -1,4 +1,3 @@
package mage.cards.d;
import java.util.UUID;
@ -21,13 +20,10 @@ 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}");
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;
}
}