mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Implemented ForcedMarch.java
This commit is contained in:
parent
0c5fdb7301
commit
ee224a391f
1 changed files with 68 additions and 0 deletions
68
Mage.Sets/src/mage/sets/mercadianmasques/ForcedMarch.java
Normal file
68
Mage.Sets/src/mage/sets/mercadianmasques/ForcedMarch.java
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package mage.sets.mercadianmasques;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Rarity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author nick.myers
|
||||||
|
*/
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
|
|
||||||
|
public class ForcedMarch extends CardImpl {
|
||||||
|
|
||||||
|
public ForcedMarch(UUID ownerId) {
|
||||||
|
super(ownerId, 136, "Forced March", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{B}{B}{B}");
|
||||||
|
this.expansionSetCode = "MMQ";
|
||||||
|
|
||||||
|
// Destroy all creatures with converted mana cost X or less
|
||||||
|
this.getSpellAbility().addEffect(new ForcedMarchEffect());
|
||||||
|
}
|
||||||
|
|
||||||
|
public ForcedMarch(final ForcedMarch card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ForcedMarch copy() {
|
||||||
|
return new ForcedMarch(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ForcedMarchEffect extends OneShotEffect {
|
||||||
|
public ForcedMarchEffect() {
|
||||||
|
super(Outcome.DestroyPermanent);
|
||||||
|
staticText = "Destroy all creatures with converted mana cost X or less";
|
||||||
|
}
|
||||||
|
|
||||||
|
public ForcedMarchEffect(final ForcedMarchEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ForcedMarchEffect copy() {
|
||||||
|
return new ForcedMarchEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
for(Permanent permanent : game.getBattlefield().getAllActivePermanents(CardType.CREATURE)) {
|
||||||
|
if (permanent.getManaCost().convertedManaCost() <= source.getManaCostsToPay().getX()) {
|
||||||
|
permanent.destroy(source.getSourceId(), game, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue