forked from External/mage
Implemented Dismantling Wave
This commit is contained in:
parent
e91fc7d636
commit
ded22e904e
2 changed files with 74 additions and 0 deletions
73
Mage.Sets/src/mage/cards/d/DismantlingWave.java
Normal file
73
Mage.Sets/src/mage/cards/d/DismantlingWave.java
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.CycleTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.DestroyAllEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.keyword.CyclingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.targetadjustment.TargetAdjuster;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class DismantlingWave extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter
|
||||
= new FilterArtifactOrEnchantmentPermanent("artifacts and enchantments");
|
||||
|
||||
public DismantlingWave(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{W}");
|
||||
|
||||
// For each opponent, destroy up to one target artifact or enchantment that player controls.
|
||||
this.getSpellAbility().addEffect(new DestroyTargetEffect(false, true)
|
||||
.setText("For each opponent, destroy up to one target artifact or enchantment that player controls."));
|
||||
this.getSpellAbility().setTargetAdjuster(DismantlingWaveAdjuster.instance);
|
||||
|
||||
// Cycling {6}{W}{W}
|
||||
this.addAbility(new CyclingAbility(new ManaCostsImpl("{6}{W}{W}")));
|
||||
|
||||
// When you cycle Dismantling Wave, destroy all artifacts and enchantments.
|
||||
this.addAbility(new CycleTriggeredAbility(new DestroyAllEffect(filter)));
|
||||
}
|
||||
|
||||
private DismantlingWave(final DismantlingWave card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DismantlingWave copy() {
|
||||
return new DismantlingWave(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum DismantlingWaveAdjuster implements TargetAdjuster {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
ability.getTargets().clear();
|
||||
game.getOpponents(ability.getControllerId())
|
||||
.stream()
|
||||
.map(game::getPlayer)
|
||||
.filter(Objects::nonNull)
|
||||
.forEachOrdered(player -> {
|
||||
FilterPermanent filter = new FilterArtifactOrEnchantmentPermanent(
|
||||
"artifact or enchantment controlled by " + player.getName()
|
||||
);
|
||||
filter.add(new ControllerIdPredicate(player.getId()));
|
||||
ability.addTarget(new TargetPermanent(0, 1, filter, false));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -32,6 +32,7 @@ public final class Commander2020Edition extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Crop Rotation", 169, Rarity.COMMON, mage.cards.c.CropRotation.class));
|
||||
cards.add(new SetCardInfo("Curious Herd", 59, Rarity.RARE, mage.cards.c.CuriousHerd.class));
|
||||
cards.add(new SetCardInfo("Deadly Tempest", 131, Rarity.RARE, mage.cards.d.DeadlyTempest.class));
|
||||
cards.add(new SetCardInfo("Dismantling Wave", 25, Rarity.RARE, mage.cards.d.DismantlingWave.class));
|
||||
cards.add(new SetCardInfo("Eternal Dragon", 88, Rarity.RARE, mage.cards.e.EternalDragon.class));
|
||||
cards.add(new SetCardInfo("Flawless Maneuver", 26, Rarity.RARE, mage.cards.f.FlawlessManeuver.class));
|
||||
cards.add(new SetCardInfo("Fluctuator", 241, Rarity.COMMON, mage.cards.f.Fluctuator.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue