Implemented Force of Negation

This commit is contained in:
Evan Kranzler 2019-05-23 18:31:10 -04:00
parent 05e486f762
commit 24a6144687
2 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,54 @@
package mage.cards.f;
import mage.ObjectColor;
import mage.abilities.condition.common.NotMyTurnCondition;
import mage.abilities.costs.AlternativeCostSourceAbility;
import mage.abilities.costs.common.ExileFromHandCost;
import mage.abilities.effects.common.CounterTargetWithReplacementEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterOwnedCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.TargetSpell;
import mage.target.common.TargetCardInHand;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ForceOfNegation extends CardImpl {
private static final FilterOwnedCard filter = new FilterOwnedCard("a blue card from your hand");
static {
filter.add(new ColorPredicate(ObjectColor.BLUE));
}
public ForceOfNegation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}{U}");
// If it's not your turn, you may exile a blue card from your hand rather than pay this spell's mana cost.
this.addAbility(new AlternativeCostSourceAbility(
new ExileFromHandCost(new TargetCardInHand(filter)), NotMyTurnCondition.instance,
"If it's not your turn, you may exile a blue card from " +
"your hand rather than pay this spell's mana cost."
));
// Counter target noncreature spell. If that spell is countered this way, exile it instead of putting it into its owner's graveyard.
this.getSpellAbility().addEffect(new CounterTargetWithReplacementEffect(Zone.EXILED));
this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_SPELL_NON_CREATURE));
}
private ForceOfNegation(final ForceOfNegation card) {
super(card);
}
@Override
public ForceOfNegation copy() {
return new ForceOfNegation(this);
}
}

View file

@ -45,6 +45,7 @@ public final class ModernHorizons extends ExpansionSet {
cards.add(new SetCardInfo("Fiery Islet", 238, Rarity.RARE, mage.cards.f.FieryIslet.class));
cards.add(new SetCardInfo("Firebolt", 122, Rarity.UNCOMMON, mage.cards.f.Firebolt.class));
cards.add(new SetCardInfo("Flusterstorm", 255, Rarity.RARE, mage.cards.f.Flusterstorm.class));
cards.add(new SetCardInfo("Force of Negation", 52, Rarity.RARE, mage.cards.f.ForceOfNegation.class));
cards.add(new SetCardInfo("Frostwalk Bastion", 240, Rarity.UNCOMMON, mage.cards.f.FrostwalkBastion.class));
cards.add(new SetCardInfo("Generous Gift", 11, Rarity.UNCOMMON, mage.cards.g.GenerousGift.class));
cards.add(new SetCardInfo("Goblin Engineer", 128, Rarity.RARE, mage.cards.g.GoblinEngineer.class));