mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
- little fix Deadbridge Chant. Now works well with Humility, etc.
This commit is contained in:
parent
b800585cc5
commit
6e49f4a21c
1 changed files with 7 additions and 10 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue