From ca518ed7df667e6633ebfe2f23c904521b7648b9 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 18 Sep 2019 21:57:01 -0400 Subject: [PATCH] Implemented Acclaimed Contender --- .../src/mage/cards/a/AcclaimedContender.java | 79 +++++++++++++++++++ Mage.Sets/src/mage/sets/ThroneOfEldraine.java | 1 + 2 files changed, 80 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AcclaimedContender.java diff --git a/Mage.Sets/src/mage/cards/a/AcclaimedContender.java b/Mage.Sets/src/mage/cards/a/AcclaimedContender.java new file mode 100644 index 0000000000..7dfaf13e36 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AcclaimedContender.java @@ -0,0 +1,79 @@ +package mage.cards.a; + +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class AcclaimedContender extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledPermanent(SubType.KNIGHT); + private static final FilterCard filter2 + = new FilterCard("a Knight, Aura, Equipment, or legendary artifact card"); + + static { + filter.add(AnotherPredicate.instance); + filter2.add(Predicates.or( + new SubtypePredicate(SubType.KNIGHT), + new SubtypePredicate(SubType.AURA), + new SubtypePredicate(SubType.EQUIPMENT), + Predicates.and( + new SupertypePredicate(SuperType.LEGENDARY), + new CardTypePredicate(CardType.ARTIFACT) + ) + )); + } + + private static final Condition condition = new PermanentsOnTheBattlefieldCondition(filter); + + public AcclaimedContender(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.KNIGHT); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Acclaimed Contender enters the battlefield, if you control another Knight, look at the top five cards of your library. You may reveal a Knight, Aura, Equipment, or legendary artifact 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 ConditionalInterveningIfTriggeredAbility( + new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect( + new StaticValue(5), false, new StaticValue(1), filter2, Zone.LIBRARY, false, + true, false, Zone.HAND, true, false, false + ).setBackInRandomOrder(true)), condition, "When {this} enters the battlefield, " + + "if you control another Knight, look at the top five cards of your library. " + + "You may reveal a Knight, Aura, Equipment, or legendary artifact card from among them " + + "and put it into your hand. Put the rest on the bottom of your library in a random order." + )); + } + + private AcclaimedContender(final AcclaimedContender card) { + super(card); + } + + @Override + public AcclaimedContender copy() { + return new AcclaimedContender(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java index 5c5fd7af27..b1f538f47a 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java @@ -28,6 +28,7 @@ public final class ThroneOfEldraine extends ExpansionSet { this.ratioBoosterMythic = 8; this.maxCardNumberInBooster = 269; // unconfirmed for now + cards.add(new SetCardInfo("Acclaimed Contender", 1, Rarity.RARE, mage.cards.a.AcclaimedContender.class)); cards.add(new SetCardInfo("Alela, Artful Provocateur", 324, Rarity.MYTHIC, mage.cards.a.AlelaArtfulProvocateur.class)); cards.add(new SetCardInfo("All That Glitters", 2, Rarity.UNCOMMON, mage.cards.a.AllThatGlitters.class)); cards.add(new SetCardInfo("Animating Faerie", 38, Rarity.UNCOMMON, mage.cards.a.AnimatingFaerie.class));