[NEC] Implemented Ironsoul Enforcer

This commit is contained in:
Evan Kranzler 2022-02-10 19:12:51 -05:00
parent 1771bc6cd2
commit 4056afe520
2 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,72 @@
package mage.cards.i;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksAloneControlledTriggeredAbility;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterArtifactCard;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.ObjectSourcePlayer;
import mage.filter.predicate.ObjectSourcePlayerPredicate;
import mage.filter.predicate.mageobject.CommanderPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class IronsoulEnforcer extends CardImpl {
private static final FilterPermanent filter
= new FilterControlledPermanent("{this} or a commander you control");
private static final FilterCard filter2
= new FilterArtifactCard("artifact card from your graveyard");
static {
filter.add(IronsoulEnforcerPredicate.instance);
}
public IronsoulEnforcer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.SAMURAI);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Whenever Ironsoul Enforcer or a commander you control attacks alone, return target artifact card from your graveyard to the battlefield.
Ability ability = new AttacksAloneControlledTriggeredAbility(
new ReturnFromGraveyardToBattlefieldTargetEffect(), filter, false, false
);
ability.addTarget(new TargetCardInYourGraveyard(filter2));
this.addAbility(ability);
}
private IronsoulEnforcer(final IronsoulEnforcer card) {
super(card);
}
@Override
public IronsoulEnforcer copy() {
return new IronsoulEnforcer(this);
}
}
enum IronsoulEnforcerPredicate implements ObjectSourcePlayerPredicate<Permanent> {
instance;
@Override
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
return input.getObject().getId().equals(input.getSourceId())
|| CommanderPredicate.instance.apply(input.getObject(), game);
}
}

View file

@ -69,6 +69,7 @@ public final class NeonDynastyCommander extends ExpansionSet {
cards.add(new SetCardInfo("Hanna, Ship's Navigator", 139, Rarity.RARE, mage.cards.h.HannaShipsNavigator.class));
cards.add(new SetCardInfo("Hunter's Insight", 119, Rarity.UNCOMMON, mage.cards.h.HuntersInsight.class));
cards.add(new SetCardInfo("Indomitable Archangel", 85, Rarity.MYTHIC, mage.cards.i.IndomitableArchangel.class));
cards.add(new SetCardInfo("Ironsoul Enforcer", 7, Rarity.RARE, mage.cards.i.IronsoulEnforcer.class));
cards.add(new SetCardInfo("Jace, Architect of Thought", 93, Rarity.MYTHIC, mage.cards.j.JaceArchitectOfThought.class));
cards.add(new SetCardInfo("Kappa Cannoneer", 14, Rarity.RARE, mage.cards.k.KappaCannoneer.class));
cards.add(new SetCardInfo("Kodama's Reach", 120, Rarity.COMMON, mage.cards.k.KodamasReach.class));