From 8218d8fa3847ca4cd44849e47a9b6d2005042f8a Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Sat, 16 Apr 2022 12:21:36 -0500 Subject: [PATCH] [SNC] Implemented Revelation of Power --- .../src/mage/cards/r/RevelationOfPower.java | 75 +++++++++++++++++++ .../src/mage/sets/StreetsOfNewCapenna.java | 1 + 2 files changed, 76 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RevelationOfPower.java diff --git a/Mage.Sets/src/mage/cards/r/RevelationOfPower.java b/Mage.Sets/src/mage/cards/r/RevelationOfPower.java new file mode 100644 index 00000000000..6c8a400291e --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RevelationOfPower.java @@ -0,0 +1,75 @@ +package mage.cards.r; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.counters.Counter; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author weirddan455 + */ +public final class RevelationOfPower extends CardImpl { + + public RevelationOfPower(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}"); + + // Target creature gets +2/+2 until end of turn. If it has a counter on it, it also gains flying and lifelink until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2)); + this.getSpellAbility().addEffect(new RevelationOfPowerEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + private RevelationOfPower(final RevelationOfPower card) { + super(card); + } + + @Override + public RevelationOfPower copy() { + return new RevelationOfPower(this); + } +} + +class RevelationOfPowerEffect extends OneShotEffect { + + public RevelationOfPowerEffect() { + super(Outcome.BoostCreature); + this.staticText = "If it has a counter on it, it also gains flying and lifelink until end of turn"; + } + + private RevelationOfPowerEffect(final RevelationOfPowerEffect effect) { + super(effect); + } + + @Override + public RevelationOfPowerEffect copy() { + return new RevelationOfPowerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent targetCreature = game.getPermanent(source.getFirstTarget()); + if (targetCreature != null) { + for (Counter counter : targetCreature.getCounters(game).values()) { + if (counter.getCount() > 0) { + game.addEffect(new GainAbilityTargetEffect(FlyingAbility.getInstance()), source); + game.addEffect(new GainAbilityTargetEffect(LifelinkAbility.getInstance()), source); + return true; + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java index 416751a6ce4..c0def18c0fb 100644 --- a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java +++ b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java @@ -183,6 +183,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet { cards.add(new SetCardInfo("Refuse to Yield", 27, Rarity.UNCOMMON, mage.cards.r.RefuseToYield.class)); cards.add(new SetCardInfo("Reservoir Kraken", 56, Rarity.RARE, mage.cards.r.ReservoirKraken.class)); cards.add(new SetCardInfo("Revel Ruiner", 91, Rarity.COMMON, mage.cards.r.RevelRuiner.class)); + cards.add(new SetCardInfo("Revelation of Power", 28, Rarity.COMMON, mage.cards.r.RevelationOfPower.class)); cards.add(new SetCardInfo("Riveteers Charm", 217, Rarity.UNCOMMON, mage.cards.r.RiveteersCharm.class)); cards.add(new SetCardInfo("Riveteers Decoy", 156, Rarity.UNCOMMON, mage.cards.r.RiveteersDecoy.class)); cards.add(new SetCardInfo("Riveteers Initiate", 120, Rarity.COMMON, mage.cards.r.RiveteersInitiate.class));