Implemented Narset, Parter of Veils

This commit is contained in:
Evan Kranzler 2019-04-17 19:07:11 -04:00
parent 2fe85fae0e
commit 086fdb13ea
2 changed files with 95 additions and 0 deletions

View file

@ -0,0 +1,94 @@
package mage.cards.n;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.players.Player;
import mage.watchers.common.CardsAmountDrawnThisTurnWatcher;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class NarsetParterOfVeils extends CardImpl {
private static final FilterCard filter = new FilterCard("noncreature, nonland card");
static {
filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
}
public NarsetParterOfVeils(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{1}{U}{U}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.NARSET);
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// Each opponent can't draw more than one card each turn.
this.addAbility(new SimpleStaticAbility(new NarsetParterOfVeilsEffect()));
// -2: Look at the top four cards of your library. You may reveal a noncreature, nonland card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(
new StaticValue(4), false, new StaticValue(1), filter,
Zone.LIBRARY, false, true, false, Zone.HAND,
true, false, false
).setBackInRandomOrder(true).setText("Look at the top four cards of your library. " +
"You may reveal a noncreature, nonland card from among them and put it into your hand. " +
"Put the rest on the bottom of your library in a random order."
), -2));
}
private NarsetParterOfVeils(final NarsetParterOfVeils card) {
super(card);
}
@Override
public NarsetParterOfVeils copy() {
return new NarsetParterOfVeils(this);
}
}
class NarsetParterOfVeilsEffect extends ContinuousRuleModifyingEffectImpl {
NarsetParterOfVeilsEffect() {
super(Duration.WhileOnBattlefield, Outcome.Detriment, false, false);
staticText = "Each opponent can't draw more than one card each turn";
}
private NarsetParterOfVeilsEffect(final NarsetParterOfVeilsEffect effect) {
super(effect);
}
@Override
public NarsetParterOfVeilsEffect copy() {
return new NarsetParterOfVeilsEffect(this);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DRAW_CARD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
CardsAmountDrawnThisTurnWatcher watcher = game.getState().getWatcher(CardsAmountDrawnThisTurnWatcher.class);
Player controller = game.getPlayer(source.getControllerId());
return watcher != null && controller != null && watcher.getAmountCardsDrawn(event.getPlayerId()) >= 1
&& game.isOpponent(controller, event.getPlayerId());
}
}

View file

@ -166,6 +166,7 @@ public final class WarOfTheSpark extends ExpansionSet {
cards.add(new SetCardInfo("Naga Eternal", 60, Rarity.COMMON, mage.cards.n.NagaEternal.class));
cards.add(new SetCardInfo("Nahiri's Stoneblades", 139, Rarity.COMMON, mage.cards.n.NahirisStoneblades.class));
cards.add(new SetCardInfo("Nahiri, Storm of Stone", 233, Rarity.UNCOMMON, mage.cards.n.NahiriStormOfStone.class));
cards.add(new SetCardInfo("Narset, Parter of Veils", 61, Rarity.UNCOMMON, mage.cards.n.NarsetParterOfVeils.class));
cards.add(new SetCardInfo("Neheb, Dreadhorde Champion", 140, Rarity.RARE, mage.cards.n.NehebDreadhordeChampion.class));
cards.add(new SetCardInfo("Neoform", 206, Rarity.UNCOMMON, mage.cards.n.Neoform.class));
cards.add(new SetCardInfo("Nicol Bolas, Dragon-God", 207, Rarity.MYTHIC, mage.cards.n.NicolBolasDragonGod.class));