[NEO] Implemented Naomi, Pillar of Order

This commit is contained in:
Evan Kranzler 2022-01-30 16:30:08 -05:00
parent 6a6b591549
commit a76f6fbdf8
5 changed files with 112 additions and 21 deletions

View file

@ -1,18 +1,14 @@
package mage.cards.b; package mage.cards.b;
import mage.abilities.condition.CompoundCondition; import mage.abilities.condition.common.ControlArtifactAndEnchantmentCondition;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.hint.ConditionHint; import mage.abilities.hint.common.ControlArtifactAndEnchantmentHint;
import mage.abilities.hint.Hint;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.TappedPredicate; import mage.filter.predicate.permanent.TappedPredicate;
import mage.game.permanent.token.SamuraiToken; import mage.game.permanent.token.SamuraiToken;
@ -39,17 +35,6 @@ public final class BanishingSlash extends CardImpl {
)); ));
} }
private static final Condition condition = new CompoundCondition(
new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT),
new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_CONTROLLED_PERMANENT_ENCHANTMENT)
);
private static final Hint hint1 = new ConditionHint(new PermanentsOnTheBattlefieldCondition(
StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT
), "You control an artifact");
private static final Hint hint2 = new ConditionHint(new PermanentsOnTheBattlefieldCondition(
StaticFilters.FILTER_CONTROLLED_PERMANENT_ENCHANTMENT
), "You control an enchantment");
public BanishingSlash(UUID ownerId, CardSetInfo setInfo) { public BanishingSlash(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}{W}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}{W}");
@ -57,11 +42,10 @@ public final class BanishingSlash extends CardImpl {
this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetPermanent(0, 1, filter)); this.getSpellAbility().addTarget(new TargetPermanent(0, 1, filter));
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new CreateTokenEffect(new SamuraiToken()), condition, "Then if you control " + new CreateTokenEffect(new SamuraiToken()), ControlArtifactAndEnchantmentCondition.instance, "Then " +
"an artifact and an enchantment, create a 2/2 white Samurai creature token with vigilance" "if you control an artifact and an enchantment, create a 2/2 white Samurai creature token with vigilance"
)); ));
this.getSpellAbility().addHint(hint1); this.getSpellAbility().addHint(ControlArtifactAndEnchantmentHint.instance);
this.getSpellAbility().addHint(hint2);
} }
private BanishingSlash(final BanishingSlash card) { private BanishingSlash(final BanishingSlash card) {

View file

@ -0,0 +1,48 @@
package mage.cards.n;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldOrAttacksSourceTriggeredAbility;
import mage.abilities.condition.common.ControlArtifactAndEnchantmentCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.hint.common.ControlArtifactAndEnchantmentHint;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.game.permanent.token.SamuraiToken;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class NaomiPillarOfOrder extends CardImpl {
public NaomiPillarOfOrder(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{B}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ADVISOR);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Whenever Naomi, Pillar of Order enters the battlefield or attacks, if you control an artifact and an enchantment, create a 2/2 white Samurai creature token with vigilance.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldOrAttacksSourceTriggeredAbility(new CreateTokenEffect(new SamuraiToken())),
ControlArtifactAndEnchantmentCondition.instance, "Whenever {this} enters the battlefield or " +
"attacks, if you control an artifact and an enchantment, create a 2/2 white Samurai creature token with vigilance."
).addHint(ControlArtifactAndEnchantmentHint.instance));
}
private NaomiPillarOfOrder(final NaomiPillarOfOrder card) {
super(card);
}
@Override
public NaomiPillarOfOrder copy() {
return new NaomiPillarOfOrder(this);
}
}

View file

@ -62,6 +62,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet {
cards.add(new SetCardInfo("Michiko's Reign of Truth", 29, Rarity.UNCOMMON, mage.cards.m.MichikosReignOfTruth.class)); cards.add(new SetCardInfo("Michiko's Reign of Truth", 29, Rarity.UNCOMMON, mage.cards.m.MichikosReignOfTruth.class));
cards.add(new SetCardInfo("Mountain", 299, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Mountain", 299, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Nameless Conqueror", 162, Rarity.COMMON, mage.cards.n.NamelessConqueror.class)); cards.add(new SetCardInfo("Nameless Conqueror", 162, Rarity.COMMON, mage.cards.n.NamelessConqueror.class));
cards.add(new SetCardInfo("Naomi, Pillar of Order", 229, Rarity.UNCOMMON, mage.cards.n.NaomiPillarOfOrder.class));
cards.add(new SetCardInfo("Plains", 293, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Plains", 293, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Portrait of Michiko", 29, Rarity.UNCOMMON, mage.cards.p.PortraitOfMichiko.class)); cards.add(new SetCardInfo("Portrait of Michiko", 29, Rarity.UNCOMMON, mage.cards.p.PortraitOfMichiko.class));
cards.add(new SetCardInfo("Satoru Umezawa", 234, Rarity.RARE, mage.cards.s.SatoruUmezawa.class)); cards.add(new SetCardInfo("Satoru Umezawa", 234, Rarity.RARE, mage.cards.s.SatoruUmezawa.class));

View file

@ -0,0 +1,24 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.filter.StaticFilters;
import mage.game.Game;
/**
* @author TheElk801
*/
public enum ControlArtifactAndEnchantmentCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return game.getBattlefield().contains(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT, source, game, 1)
&& game.getBattlefield().contains(StaticFilters.FILTER_CONTROLLED_PERMANENT_ENCHANTMENT, source, game, 1);
}
@Override
public String toString() {
return "you control an artifact and an enchantment";
}
}

View file

@ -0,0 +1,34 @@
package mage.abilities.hint.common;
import mage.abilities.Ability;
import mage.abilities.hint.Hint;
import mage.filter.StaticFilters;
import mage.game.Game;
/**
* @author TheElk801
*/
public enum ControlArtifactAndEnchantmentHint implements Hint {
instance;
@Override
public String getText(Game game, Ability ability) {
boolean artifact = game.getBattlefield().contains(
StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT, ability, game, 1
);
boolean enchantment = game.getBattlefield().contains(
StaticFilters.FILTER_CONTROLLED_PERMANENT_ENCHANTMENT, ability, game, 1
);
if (artifact) {
return "You control and artifact" + (enchantment ? " and an enchantment" : "");
} else if (enchantment) {
return "You control an enchantment";
}
return null;
}
@Override
public ControlArtifactAndEnchantmentHint copy() {
return this;
}
}