diff --git a/Mage.Sets/src/mage/cards/s/SwordOfSinewAndSteel.java b/Mage.Sets/src/mage/cards/s/SwordOfSinewAndSteel.java new file mode 100644 index 0000000000..0ca554787d --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SwordOfSinewAndSteel.java @@ -0,0 +1,63 @@ +package mage.cards.s; + +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.DealsDamageToAPlayerAttachedTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continuous.BoostEquippedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.target.common.TargetArtifactPermanent; +import mage.target.common.TargetPlaneswalkerPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SwordOfSinewAndSteel extends CardImpl { + + public SwordOfSinewAndSteel(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); + + this.subtype.add(SubType.EQUIPMENT); + + // Equipped creature gets +2/+2 and has protection from black and from red. + Ability ability = new SimpleStaticAbility(new BoostEquippedEffect(2, 2)); + ability.addEffect(new GainAbilityAttachedEffect(ProtectionAbility.from( + ObjectColor.BLACK, ObjectColor.RED + ), AttachmentType.EQUIPMENT).setText("and has protection from black and from red")); + this.addAbility(ability); + + // Whenever equipped creature deals combat damage to a player, destroy up to one target planeswalker and up to one target artifact. + ability = new DealsDamageToAPlayerAttachedTriggeredAbility( + new DestroyTargetEffect(false, true) + .setText("destroy up to one target planeswalker and up to one target artifact."), + "equipped", false + ); + ability.addTarget(new TargetPlaneswalkerPermanent(0, 1)); + ability.addTarget(new TargetArtifactPermanent(0, 1)); + this.addAbility(ability); + + // Equip {2} + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); + } + + private SwordOfSinewAndSteel(final SwordOfSinewAndSteel card) { + super(card); + } + + @Override + public SwordOfSinewAndSteel copy() { + return new SwordOfSinewAndSteel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ModernHorizons.java b/Mage.Sets/src/mage/sets/ModernHorizons.java index 8556e44793..e1852aa1cb 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons.java @@ -120,6 +120,7 @@ public final class ModernHorizons extends ExpansionSet { cards.add(new SetCardInfo("Squirrel Nest", 182, Rarity.UNCOMMON, mage.cards.s.SquirrelNest.class)); cards.add(new SetCardInfo("Stream of Thought", 71, Rarity.COMMON, mage.cards.s.StreamOfThought.class)); cards.add(new SetCardInfo("Sunbaked Canyon", 247, Rarity.RARE, mage.cards.s.SunbakedCanyon.class)); + cards.add(new SetCardInfo("Sword of Sinew and Steel", 228, Rarity.MYTHIC, mage.cards.s.SwordOfSinewAndSteel.class)); cards.add(new SetCardInfo("Sword of Truth and Justice", 229, Rarity.MYTHIC, mage.cards.s.SwordOfTruthAndJustice.class)); cards.add(new SetCardInfo("Tempered Sliver", 183, Rarity.UNCOMMON, mage.cards.t.TemperedSliver.class)); cards.add(new SetCardInfo("The First Sliver", 200, Rarity.MYTHIC, mage.cards.t.TheFirstSliver.class)); diff --git a/Mage/src/main/java/mage/filter/StaticFilters.java b/Mage/src/main/java/mage/filter/StaticFilters.java index dba8893667..27e4b7db7a 100644 --- a/Mage/src/main/java/mage/filter/StaticFilters.java +++ b/Mage/src/main/java/mage/filter/StaticFilters.java @@ -151,13 +151,13 @@ public final class StaticFilters { FILTER_PERMANENTS.setLockedFilter(true); } - public static final FilterPermanent FILTER_PERMANENT_ARTIFACT = new FilterArtifactPermanent("artifact"); + public static final FilterArtifactPermanent FILTER_PERMANENT_ARTIFACT = new FilterArtifactPermanent("artifact"); static { FILTER_PERMANENT_ARTIFACT.setLockedFilter(true); } - public static final FilterPermanent FILTER_PERMANENT_ARTIFACT_AN = new FilterArtifactPermanent("an artifact"); + public static final FilterArtifactPermanent FILTER_PERMANENT_ARTIFACT_AN = new FilterArtifactPermanent("an artifact"); static { FILTER_PERMANENT_ARTIFACT_AN.setLockedFilter(true); diff --git a/Mage/src/main/java/mage/target/common/TargetArtifactPermanent.java b/Mage/src/main/java/mage/target/common/TargetArtifactPermanent.java index 2f53904aea..4f68a5977e 100644 --- a/Mage/src/main/java/mage/target/common/TargetArtifactPermanent.java +++ b/Mage/src/main/java/mage/target/common/TargetArtifactPermanent.java @@ -1,7 +1,6 @@ - - package mage.target.common; +import mage.filter.StaticFilters; import mage.filter.common.FilterArtifactPermanent; import mage.target.TargetPermanent; @@ -9,22 +8,22 @@ import mage.target.TargetPermanent; * @author ayratn */ public class TargetArtifactPermanent extends TargetPermanent { - + public TargetArtifactPermanent() { - this(1, 1, new FilterArtifactPermanent(), false); + this(1, 1, StaticFilters.FILTER_PERMANENT_ARTIFACT, false); } - + public TargetArtifactPermanent(FilterArtifactPermanent filter) { this(1, 1, filter, false); } public TargetArtifactPermanent(int numTargets) { - this(numTargets, numTargets, new FilterArtifactPermanent(), false); + this(numTargets, numTargets, StaticFilters.FILTER_PERMANENT_ARTIFACT, false); } public TargetArtifactPermanent(int minNumTargets, int maxNumTargets) { - this(minNumTargets, maxNumTargets, new FilterArtifactPermanent(), false); + this(minNumTargets, maxNumTargets, StaticFilters.FILTER_PERMANENT_ARTIFACT, false); } public TargetArtifactPermanent(int minNumTargets, int maxNumTargets, FilterArtifactPermanent filter, boolean notTarget) { diff --git a/Mage/src/main/java/mage/target/common/TargetPlaneswalkerPermanent.java b/Mage/src/main/java/mage/target/common/TargetPlaneswalkerPermanent.java new file mode 100644 index 0000000000..c8163e33c8 --- /dev/null +++ b/Mage/src/main/java/mage/target/common/TargetPlaneswalkerPermanent.java @@ -0,0 +1,40 @@ +package mage.target.common; + +import mage.filter.StaticFilters; +import mage.filter.common.FilterPlaneswalkerPermanent; +import mage.target.TargetPermanent; + +/** + * @author TheElk801 + */ +public class TargetPlaneswalkerPermanent extends TargetPermanent { + + public TargetPlaneswalkerPermanent() { + this(1, 1, StaticFilters.FILTER_PERMANENT_PLANESWALKER, false); + } + + public TargetPlaneswalkerPermanent(FilterPlaneswalkerPermanent filter) { + this(1, 1, filter, false); + } + + public TargetPlaneswalkerPermanent(int numTargets) { + this(numTargets, numTargets, StaticFilters.FILTER_PERMANENT_PLANESWALKER, false); + } + + public TargetPlaneswalkerPermanent(int minNumTargets, int maxNumTargets) { + this(minNumTargets, maxNumTargets, StaticFilters.FILTER_PERMANENT_PLANESWALKER, false); + } + + public TargetPlaneswalkerPermanent(int minNumTargets, int maxNumTargets, FilterPlaneswalkerPermanent filter, boolean notTarget) { + super(minNumTargets, maxNumTargets, filter, notTarget); + } + + private TargetPlaneswalkerPermanent(final TargetPlaneswalkerPermanent target) { + super(target); + } + + @Override + public TargetPlaneswalkerPermanent copy() { + return new TargetPlaneswalkerPermanent(this); + } +}