From d80938b8a4b3e63d579d97d815bb897b215970cb Mon Sep 17 00:00:00 2001 From: xenohedron Date: Wed, 23 Aug 2023 23:56:56 -0400 Subject: [PATCH] Implement [WOE] Regal Bunnicorn --- .../src/mage/cards/r/RegalBunnicorn.java | 51 +++++++++++++++++++ Mage.Sets/src/mage/sets/WildsOfEldraine.java | 1 + 2 files changed, 52 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RegalBunnicorn.java diff --git a/Mage.Sets/src/mage/cards/r/RegalBunnicorn.java b/Mage.Sets/src/mage/cards/r/RegalBunnicorn.java new file mode 100644 index 00000000000..cb7e42b47be --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RegalBunnicorn.java @@ -0,0 +1,51 @@ +package mage.cards.r; + +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; + +import java.util.UUID; + +/** + * @author xenohedron + */ +public final class RegalBunnicorn extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("nonland permanents you control"); + + static { + filter.add(Predicates.not(CardType.LAND.getPredicate())); + } + + private static final DynamicValue starValue = new PermanentsOnBattlefieldCount(filter); + + public RegalBunnicorn(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); + + this.subtype.add(SubType.RABBIT); + this.subtype.add(SubType.UNICORN); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Regal Bunnicorn's power and toughness are each equal to the number of nonland permanents you control. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(starValue))); + } + + private RegalBunnicorn(final RegalBunnicorn card) { + super(card); + } + + @Override + public RegalBunnicorn copy() { + return new RegalBunnicorn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/WildsOfEldraine.java b/Mage.Sets/src/mage/sets/WildsOfEldraine.java index 2f542cc7989..5f053cf2690 100644 --- a/Mage.Sets/src/mage/sets/WildsOfEldraine.java +++ b/Mage.Sets/src/mage/sets/WildsOfEldraine.java @@ -134,6 +134,7 @@ public final class WildsOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Realm-Scorcher Hellkite", 145, Rarity.MYTHIC, mage.cards.r.RealmScorcherHellkite.class)); cards.add(new SetCardInfo("Redcap Gutter-Dweller", 146, Rarity.RARE, mage.cards.r.RedcapGutterDweller.class)); cards.add(new SetCardInfo("Redtooth Vanguard", 180, Rarity.UNCOMMON, mage.cards.r.RedtoothVanguard.class)); + cards.add(new SetCardInfo("Regal Bunnicorn", 25, Rarity.RARE, mage.cards.r.RegalBunnicorn.class)); cards.add(new SetCardInfo("Restless Bivouac", 257, Rarity.RARE, mage.cards.r.RestlessBivouac.class)); cards.add(new SetCardInfo("Restless Cottage", 258, Rarity.RARE, mage.cards.r.RestlessCottage.class)); cards.add(new SetCardInfo("Restless Fortress", 259, Rarity.RARE, mage.cards.r.RestlessFortress.class));