From c9c28f1737740f6f3188ef74f8521db78e92320c Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Fri, 28 May 2021 20:43:16 -0500 Subject: [PATCH] [MH2] Implemented Constable of the Realm (#7855) --- .../src/mage/cards/c/ConstableOfTheRealm.java | 59 +++++++++++++++++++ Mage.Sets/src/mage/sets/ModernHorizons2.java | 1 + 2 files changed, 60 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/ConstableOfTheRealm.java diff --git a/Mage.Sets/src/mage/cards/c/ConstableOfTheRealm.java b/Mage.Sets/src/mage/cards/c/ConstableOfTheRealm.java new file mode 100644 index 0000000000..5b5dec4ad1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ConstableOfTheRealm.java @@ -0,0 +1,59 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.OneOrMoreCountersAddedTriggeredAbility; +import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.ExileUntilSourceLeavesEffect; +import mage.constants.SubType; +import mage.abilities.keyword.RenownAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.common.FilterNonlandPermanent; +import mage.filter.predicate.mageobject.AnotherPredicate; +import mage.target.common.TargetNonlandPermanent; + +/** + * + * @author weirddan455 + */ +public final class ConstableOfTheRealm extends CardImpl { + + private static final FilterNonlandPermanent filter = new FilterNonlandPermanent("other nonland permanent"); + + static { + filter.add(AnotherPredicate.instance); + } + + public ConstableOfTheRealm(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}"); + + this.subtype.add(SubType.GIANT); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Renown 2 + this.addAbility(new RenownAbility(2)); + + // Whenever one or more +1/+1 counters are put on Constable of the Realm, exile up to one other target nonland permanent until Constable of the Realm leaves the battlefield. + Ability ability = new OneOrMoreCountersAddedTriggeredAbility(new ExileUntilSourceLeavesEffect("").setText( + "exile up to one other target nonland permanent until {this} leaves the battlefield" + )); + ability.addTarget(new TargetNonlandPermanent(0, 1, filter, false)); + ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility())); + this.addAbility(ability); + } + + private ConstableOfTheRealm(final ConstableOfTheRealm card) { + super(card); + } + + @Override + public ConstableOfTheRealm copy() { + return new ConstableOfTheRealm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ModernHorizons2.java b/Mage.Sets/src/mage/sets/ModernHorizons2.java index ef2a99db03..531cd7cf04 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons2.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons2.java @@ -47,6 +47,7 @@ public final class ModernHorizons2 extends ExpansionSet { cards.add(new SetCardInfo("Calibrated Blast", 118, Rarity.RARE, mage.cards.c.CalibratedBlast.class)); cards.add(new SetCardInfo("Chance Encounter", 277, Rarity.RARE, mage.cards.c.ChanceEncounter.class)); cards.add(new SetCardInfo("Chatterstorm", 152, Rarity.COMMON, mage.cards.c.Chatterstorm.class)); + cards.add(new SetCardInfo("Constable of the Realm", 10, Rarity.UNCOMMON, mage.cards.c.ConstableOfTheRealm.class)); cards.add(new SetCardInfo("Counterspell", 267, Rarity.UNCOMMON, mage.cards.c.Counterspell.class)); cards.add(new SetCardInfo("Dakkon, Shadow Slayer", 192, Rarity.MYTHIC, mage.cards.d.DakkonShadowSlayer.class)); cards.add(new SetCardInfo("Darkmoss Bridge", 245, Rarity.COMMON, mage.cards.d.DarkmossBridge.class));