diff --git a/Mage.Sets/src/mage/cards/b/BelbesPortal.java b/Mage.Sets/src/mage/cards/b/BelbesPortal.java index 3364c22b2b6..ac0c13bab54 100644 --- a/Mage.Sets/src/mage/cards/b/BelbesPortal.java +++ b/Mage.Sets/src/mage/cards/b/BelbesPortal.java @@ -30,7 +30,7 @@ public final class BelbesPortal extends CardImpl { this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.PutCreatureInPlay))); // {3}, {tap}: You may put a creature card of the chosen type from your hand onto the battlefield. FilterCreatureCard filter = new FilterCreatureCard("a creature card of the chosen type"); - filter.add(new ChosenSubtypePredicate()); + filter.add(ChosenSubtypePredicate.instance); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutCardFromHandOntoBattlefieldEffect(filter), new ManaCostsImpl("{3}")); diff --git a/Mage.Sets/src/mage/cards/b/BrassHerald.java b/Mage.Sets/src/mage/cards/b/BrassHerald.java index 870ccda042a..2b5d3d4f295 100644 --- a/Mage.Sets/src/mage/cards/b/BrassHerald.java +++ b/Mage.Sets/src/mage/cards/b/BrassHerald.java @@ -69,7 +69,7 @@ class BrassHeraldEntersEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { FilterCard filter = new FilterCard("creature cards of the chosen type"); - filter.add(new ChosenSubtypePredicate()); + filter.add(ChosenSubtypePredicate.instance); return new RevealLibraryPutIntoHandEffect(4, filter, Zone.LIBRARY).apply(game, source); } } diff --git a/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java b/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java index 37eb08abbed..b95405da59a 100644 --- a/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java +++ b/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java @@ -61,7 +61,7 @@ enum CallerOfTheHuntAdjuster implements CostAdjuster { if (mageObject != null && effect.apply(game, ability)) { FilterPermanent filter = new FilterPermanent(); - filter.add(new ChosenSubtypePredicate()); + filter.add(ChosenSubtypePredicate.instance); ContinuousEffect effectPower = new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.Custom); ContinuousEffect effectToughness = new SetToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.Custom); game.addEffect(effectPower, ability); diff --git a/Mage.Sets/src/mage/cards/e/EtchingsOfTheChosen.java b/Mage.Sets/src/mage/cards/e/EtchingsOfTheChosen.java new file mode 100644 index 00000000000..7e9e5e2c3b9 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/EtchingsOfTheChosen.java @@ -0,0 +1,71 @@ +package mage.cards.e; + +import mage.abilities.Ability; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.ChooseCreatureTypeEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ChosenSubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetControlledPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class EtchingsOfTheChosen extends CardImpl { + + private static final FilterCreaturePermanent filter + = new FilterCreaturePermanent("creatures you control of the chosen type"); + private static final FilterControlledPermanent filter2 + = new FilterControlledCreaturePermanent("a creature of the chosen type"); + + static { + filter.add(ChosenSubtypePredicate.instance); + filter.add(new ControllerPredicate(TargetController.YOU)); + filter2.add(ChosenSubtypePredicate.instance); + } + + public EtchingsOfTheChosen(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{B}"); + + // As Etchings of the Chosen enters the battlefield, choose a creature type. + this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.BoostCreature))); + + // Creatures you control of the chosen type get +1/+1. + this.addAbility(new SimpleStaticAbility(new BoostAllEffect( + 1, 1, Duration.WhileOnBattlefield, filter, false + ))); + + // {1}, Sacrifice a creature of the chosen type: Target creature you control gains indestructible until end of turn. + Ability ability = new SimpleActivatedAbility(new GainAbilityTargetEffect( + IndestructibleAbility.getInstance(), Duration.EndOfTurn + ), new GenericManaCost(1)); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter2))); + this.addAbility(ability); + } + + private EtchingsOfTheChosen(final EtchingsOfTheChosen card) { + super(card); + } + + @Override + public EtchingsOfTheChosen copy() { + return new EtchingsOfTheChosen(this); + } +} diff --git a/Mage.Sets/src/mage/cards/k/KindredBoon.java b/Mage.Sets/src/mage/cards/k/KindredBoon.java index 979ade1ccf8..b30002cc8d3 100644 --- a/Mage.Sets/src/mage/cards/k/KindredBoon.java +++ b/Mage.Sets/src/mage/cards/k/KindredBoon.java @@ -42,7 +42,7 @@ public final class KindredBoon extends CardImpl { // {1}{W}: Put a divinity counter on target creature you control of the chosen type. FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature you control of the chosen type"); - filter.add(new ChosenSubtypePredicate()); + filter.add(ChosenSubtypePredicate.instance); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.DIVINITY.createInstance()), new ManaCostsImpl("{1}{W}")); ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/k/KindredDiscovery.java b/Mage.Sets/src/mage/cards/k/KindredDiscovery.java index 9dc8464b32d..d85ed68e1ea 100644 --- a/Mage.Sets/src/mage/cards/k/KindredDiscovery.java +++ b/Mage.Sets/src/mage/cards/k/KindredDiscovery.java @@ -27,7 +27,7 @@ public final class KindredDiscovery extends CardImpl { // Whenever a creature you control of the chosen type enters the battlefield or attacks, draw a card. FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a creature you control of the chosen type"); - filter.add(new ChosenSubtypePredicate()); + filter.add(ChosenSubtypePredicate.instance); this.addAbility(new EntersBattlefieldOrAttacksAllTriggeredAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), filter, false)); } diff --git a/Mage.Sets/src/mage/cards/m/MirrorOfTheForebears.java b/Mage.Sets/src/mage/cards/m/MirrorOfTheForebears.java index f959f3abb8d..39ebe93b95e 100644 --- a/Mage.Sets/src/mage/cards/m/MirrorOfTheForebears.java +++ b/Mage.Sets/src/mage/cards/m/MirrorOfTheForebears.java @@ -31,7 +31,7 @@ public final class MirrorOfTheForebears extends CardImpl { private static final FilterPermanent filter = new FilterControlledCreaturePermanent(); static { - filter.add(new ChosenSubtypePredicate()); + filter.add(ChosenSubtypePredicate.instance); } public MirrorOfTheForebears(UUID ownerId, CardSetInfo setInfo) { diff --git a/Mage.Sets/src/mage/cards/m/MorophonTheBoundless.java b/Mage.Sets/src/mage/cards/m/MorophonTheBoundless.java index 654b54714e3..7be7ed27aa5 100644 --- a/Mage.Sets/src/mage/cards/m/MorophonTheBoundless.java +++ b/Mage.Sets/src/mage/cards/m/MorophonTheBoundless.java @@ -28,7 +28,7 @@ public final class MorophonTheBoundless extends CardImpl { = new FilterCreaturePermanent("creatures you control of the chosen type"); static { - filter.add(new ChosenSubtypePredicate()); + filter.add(ChosenSubtypePredicate.instance); filter2.add(new ControllerPredicate(TargetController.YOU)); } diff --git a/Mage.Sets/src/mage/cards/p/PlagueEngineer.java b/Mage.Sets/src/mage/cards/p/PlagueEngineer.java index af2ec5d3c55..ad710e65b62 100644 --- a/Mage.Sets/src/mage/cards/p/PlagueEngineer.java +++ b/Mage.Sets/src/mage/cards/p/PlagueEngineer.java @@ -27,7 +27,7 @@ public final class PlagueEngineer extends CardImpl { = new FilterOpponentsCreaturePermanent("creatures of the chosen type your opponents control"); static { - filter.add(new ChosenSubtypePredicate()); + filter.add(ChosenSubtypePredicate.instance); } public PlagueEngineer(UUID ownerId, CardSetInfo setInfo) { diff --git a/Mage.Sets/src/mage/cards/t/TravelersCloak.java b/Mage.Sets/src/mage/cards/t/TravelersCloak.java index 9145af115df..474de5cc44d 100644 --- a/Mage.Sets/src/mage/cards/t/TravelersCloak.java +++ b/Mage.Sets/src/mage/cards/t/TravelersCloak.java @@ -50,7 +50,7 @@ public final class TravelersCloak extends CardImpl { // Enchanted creature has landwalk of the chosen type. FilterLandPermanent filter = new FilterLandPermanent("Landwalk of the chosen type"); - filter.add(new ChosenSubtypePredicate()); + filter.add(ChosenSubtypePredicate.instance); Ability landwalkAbility = new LandwalkAbility(filter); Effect effect = new GainAbilityAttachedEffect(landwalkAbility, AttachmentType.AURA); effect.setText("Enchanted creature has landwalk of the chosen type"); diff --git a/Mage.Sets/src/mage/sets/ModernHorizons.java b/Mage.Sets/src/mage/sets/ModernHorizons.java index fb5ecc807c9..572d1e8c5d8 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons.java @@ -43,6 +43,7 @@ public final class ModernHorizons extends ExpansionSet { cards.add(new SetCardInfo("Dismantling Blow", 5, Rarity.UNCOMMON, mage.cards.d.DismantlingBlow.class)); cards.add(new SetCardInfo("Dregscape Sliver", 88, Rarity.UNCOMMON, mage.cards.d.DregscapeSliver.class)); cards.add(new SetCardInfo("Elvish Fury", 162, Rarity.COMMON, mage.cards.e.ElvishFury.class)); + cards.add(new SetCardInfo("Etchings of the Chosen", 198, Rarity.UNCOMMON, mage.cards.e.EtchingsOfTheChosen.class)); cards.add(new SetCardInfo("Exclude", 48, Rarity.UNCOMMON, mage.cards.e.Exclude.class)); cards.add(new SetCardInfo("Fact or Fiction", 50, Rarity.UNCOMMON, mage.cards.f.FactOrFiction.class)); cards.add(new SetCardInfo("Farmstead Gleaner", 222, Rarity.UNCOMMON, mage.cards.f.FarmsteadGleaner.class)); diff --git a/Mage/src/main/java/mage/filter/predicate/mageobject/ChosenSubtypePredicate.java b/Mage/src/main/java/mage/filter/predicate/mageobject/ChosenSubtypePredicate.java index 576783bdc7a..aaf85181934 100644 --- a/Mage/src/main/java/mage/filter/predicate/mageobject/ChosenSubtypePredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/mageobject/ChosenSubtypePredicate.java @@ -9,13 +9,10 @@ import mage.filter.predicate.ObjectSourcePlayer; import mage.game.Game; /** - * * @author LoneFox */ -public class ChosenSubtypePredicate implements ObjectPlayerPredicate> { - - public ChosenSubtypePredicate() { - } +public enum ChosenSubtypePredicate implements ObjectPlayerPredicate> { + instance; @Override public boolean apply(ObjectSourcePlayer input, Game game) {