forked from External/mage
[ECL] Implement Emptiness
This commit is contained in:
parent
d46a258044
commit
1498dded50
3 changed files with 123 additions and 0 deletions
68
Mage.Sets/src/mage/cards/e/Emptiness.java
Normal file
68
Mage.Sets/src/mage/cards/e/Emptiness.java
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.TwoOfManaColorSpentCondition;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.abilities.keyword.EvokeAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.mageobject.ManaValuePredicate;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class Emptiness extends CardImpl {
|
||||
|
||||
private static final FilterCard filter
|
||||
= new FilterCreatureCard("creature card with mana value 3 or less from your graveyard");
|
||||
|
||||
static {
|
||||
filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, 4));
|
||||
}
|
||||
|
||||
public Emptiness(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W/B}{W/B}");
|
||||
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
this.subtype.add(SubType.INCARNATION);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// When this creature enters, if {W}{W} was spent to cast it, return target creature card with mana value 3 or less from your graveyard to the battlefield.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect())
|
||||
.withInterveningIf(TwoOfManaColorSpentCondition.WHITE);
|
||||
ability.addTarget(new TargetCardInYourGraveyard(filter));
|
||||
this.addAbility(ability);
|
||||
|
||||
// When this creature enters, if {B}{B} was spent to cast it, put three -1/-1 counters on up to one target creature.
|
||||
ability = new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.M1M1.createInstance(2)))
|
||||
.withInterveningIf(TwoOfManaColorSpentCondition.BLACK);
|
||||
ability.addTarget(new TargetCreaturePermanent(0, 1));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Evoke {W/B}{W/B}
|
||||
this.addAbility(new EvokeAbility("{W/B}{W/B}"));
|
||||
}
|
||||
|
||||
private Emptiness(final Emptiness card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Emptiness copy() {
|
||||
return new Emptiness(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -25,6 +25,8 @@ public final class LorwynEclipsed extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Bitterbloom Bearer", 88, Rarity.MYTHIC, mage.cards.b.BitterbloomBearer.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Blood Crypt", 262, Rarity.RARE, mage.cards.b.BloodCrypt.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Blood Crypt", 349, Rarity.RARE, mage.cards.b.BloodCrypt.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Emptiness", 222, Rarity.MYTHIC, mage.cards.e.Emptiness.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Emptiness", 294, Rarity.MYTHIC, mage.cards.e.Emptiness.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Hallowed Fountain", 265, Rarity.RARE, mage.cards.h.HallowedFountain.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Hallowed Fountain", 347, Rarity.RARE, mage.cards.h.HallowedFountain.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Mutable Explorer", 186, Rarity.RARE, mage.cards.m.MutableExplorer.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.constants.AbilityType;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
import mage.game.Game;
|
||||
import mage.util.CardUtil;
|
||||
import mage.watchers.common.ManaSpentToCastWatcher;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum TwoOfManaColorSpentCondition implements Condition {
|
||||
WHITE(ColoredManaSymbol.W),
|
||||
BLUE(ColoredManaSymbol.U),
|
||||
BLACK(ColoredManaSymbol.B),
|
||||
RED(ColoredManaSymbol.R),
|
||||
GREEN(ColoredManaSymbol.G);
|
||||
|
||||
private final ColoredManaSymbol coloredManaSymbol;
|
||||
|
||||
TwoOfManaColorSpentCondition(ColoredManaSymbol coloredManaSymbol) {
|
||||
this.coloredManaSymbol = coloredManaSymbol;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (source.getAbilityType() == AbilityType.SPELL) {
|
||||
return source.getManaCostsToPay().getUsedManaToPay().getColor(coloredManaSymbol) >= 2;
|
||||
}
|
||||
ManaSpentToCastWatcher watcher = game.getState().getWatcher(ManaSpentToCastWatcher.class);
|
||||
if (watcher == null) {
|
||||
return false;
|
||||
}
|
||||
Mana payment = watcher.getManaPayment(CardUtil.getSourceStackMomentReference(game, source));
|
||||
if (payment == null) {
|
||||
return false;
|
||||
}
|
||||
return payment.getColor(coloredManaSymbol) >= 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean caresAboutManaColor() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{" + coloredManaSymbol + "}{" + coloredManaSymbol + "} was spent to cast it";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue