Implemented Windgrace's Judgment

This commit is contained in:
Evan Kranzler 2018-07-27 11:56:44 -04:00
parent e70b1fadbe
commit a66df1082f
2 changed files with 61 additions and 0 deletions

View file

@ -0,0 +1,60 @@
package mage.cards.w;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterNonlandPermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPermanent;
/**
*
* @author TheElk801
*/
public final class WindgracesJudgment extends CardImpl {
public WindgracesJudgment(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{B}{G}");
// For any number of opponents, destroy target nonland permanent that player controls.
this.getSpellAbility().addEffect(
new DestroyTargetEffect().
setText("For any number of opponents, "
+ "destroy target nonland permanent "
+ "that player controls")
);
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability instanceof SpellAbility) {
ability.getTargets().clear();
game.getOpponents(ability.getControllerId()).forEach(playerId -> {
Player player = game.getPlayer(playerId);
if (player != null) {
FilterNonlandPermanent filter = new FilterNonlandPermanent(
"nonland permanent controlled by "
+ player.getLogName()
);
filter.add(new ControllerIdPredicate(playerId));
ability.addTarget(new TargetPermanent(0, 1, filter, false));
}
});
}
}
public WindgracesJudgment(final WindgracesJudgment card) {
super(card);
}
@Override
public WindgracesJudgment copy() {
return new WindgracesJudgment(this);
}
}

View file

@ -98,6 +98,7 @@ public final class Commander2018 extends ExpansionSet {
cards.add(new SetCardInfo("Varchild, Betrayer of Kjeldor", 28, Rarity.RARE, mage.cards.v.VarchildBetrayerOfKjeldor.class));
cards.add(new SetCardInfo("Varina, Lich Queen", 48, Rarity.MYTHIC, mage.cards.v.VarinaLichQueen.class));
cards.add(new SetCardInfo("Whiptongue Hydra", 36, Rarity.RARE, mage.cards.w.WhiptongueHydra.class));
cards.add(new SetCardInfo("Windgrace's Judgment", 49, Rarity.RARE, mage.cards.w.WindgracesJudgment.class));
cards.add(new SetCardInfo("Winds of Rath", 79, Rarity.RARE, mage.cards.w.WindsOfRath.class));
cards.add(new SetCardInfo("Yennet, Crypt Sovereign", 51, Rarity.MYTHIC, mage.cards.y.YennetCryptSovereign.class));
}