From 8d2db4815d167af4485c56598d6156cbdb8b359f Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 5 Feb 2022 20:13:37 -0500 Subject: [PATCH] [NEO] Implemented Regent's Authority --- .../src/mage/cards/r/RegentsAuthority.java | 73 +++++++++++++++++++ .../src/mage/sets/KamigawaNeonDynasty.java | 1 + 2 files changed, 74 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RegentsAuthority.java diff --git a/Mage.Sets/src/mage/cards/r/RegentsAuthority.java b/Mage.Sets/src/mage/cards/r/RegentsAuthority.java new file mode 100644 index 0000000000..147d87140f --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RegentsAuthority.java @@ -0,0 +1,73 @@ +package mage.cards.r; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RegentsAuthority extends CardImpl { + + public RegentsAuthority(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}"); + + // Target creature gets +2/+2 until end of turn. If it's an enchantment creature or legendary creature, instead put a +1/+1 counter on it and it gets +1/+1 until end of turn. + this.getSpellAbility().addEffect(new RegentsAuthorityEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + private RegentsAuthority(final RegentsAuthority card) { + super(card); + } + + @Override + public RegentsAuthority copy() { + return new RegentsAuthority(this); + } +} + +class RegentsAuthorityEffect extends OneShotEffect { + + RegentsAuthorityEffect() { + super(Outcome.Benefit); + staticText = "target creature gets +2/+2 until end of turn. If it's an enchantment creature " + + "or legendary creature, instead put a +1/+1 counter on it and it gets +1/+1 until end of turn"; + } + + private RegentsAuthorityEffect(final RegentsAuthorityEffect effect) { + super(effect); + } + + @Override + public RegentsAuthorityEffect copy() { + return new RegentsAuthorityEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent == null) { + return false; + } + if (!permanent.isEnchantment(game) + && (!permanent.isCreature(game) + || !permanent.isLegendary())) { + game.addEffect(new BoostTargetEffect(2, 2), source); + return true; + } + permanent.addCounters(CounterType.P1P1.createInstance(), source, game); + game.addEffect(new BoostTargetEffect(1, 1), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index f7ca49c932..d46c141baf 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -198,6 +198,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Raiyuu, Storm's Edge", 232, Rarity.RARE, mage.cards.r.RaiyuuStormsEdge.class)); cards.add(new SetCardInfo("Reality Heist", 75, Rarity.UNCOMMON, mage.cards.r.RealityHeist.class)); cards.add(new SetCardInfo("Reckoner Bankbuster", 255, Rarity.RARE, mage.cards.r.ReckonerBankbuster.class)); + cards.add(new SetCardInfo("Regent's Authority", 32, Rarity.COMMON, mage.cards.r.RegentsAuthority.class)); cards.add(new SetCardInfo("Reinforced Ronin", 158, Rarity.UNCOMMON, mage.cards.r.ReinforcedRonin.class)); cards.add(new SetCardInfo("Reito Sentinel", 256, Rarity.UNCOMMON, mage.cards.r.ReitoSentinel.class)); cards.add(new SetCardInfo("Repel the Vile", 33, Rarity.COMMON, mage.cards.r.RepelTheVile.class));