diff --git a/Mage.Sets/src/mage/cards/k/KayasWrath.java b/Mage.Sets/src/mage/cards/k/KayasWrath.java new file mode 100644 index 0000000000..b42c1212d4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KayasWrath.java @@ -0,0 +1,69 @@ +package mage.cards.k; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class KayasWrath extends CardImpl { + + public KayasWrath(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}{W}{B}{B}"); + + // Destroy all creatures. You gain life equal to the number of creatures you controlled that were destroyed this way. + this.getSpellAbility().addEffect(new KayasWrathEffect()); + } + + private KayasWrath(final KayasWrath card) { + super(card); + } + + @Override + public KayasWrath copy() { + return new KayasWrath(this); + } +} + +class KayasWrathEffect extends OneShotEffect { + + KayasWrathEffect() { + super(Outcome.Benefit); + staticText = "Destroy all creatures. You gain life equal to the number of " + + "creatures you controlled that were destroyed this way."; + } + + private KayasWrathEffect(final KayasWrathEffect effect) { + super(effect); + } + + @Override + public KayasWrathEffect copy() { + return new KayasWrathEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int counter = 0; + for (Permanent permanent : game.getBattlefield().getActivePermanents( + StaticFilters.FILTER_PERMANENT_CREATURE, + source.getControllerId(), source.getSourceId(), game + )) { + boolean isMine = permanent != null && permanent.getControllerId().equals(source.getControllerId()); + if (permanent.destroy(source.getSourceId(), game, false) && isMine) { + counter++; + } + } + return new GainLifeEffect(counter).apply(game, source); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/RavnicaAllegiance.java b/Mage.Sets/src/mage/sets/RavnicaAllegiance.java index 10eabc8225..7d264b1001 100644 --- a/Mage.Sets/src/mage/sets/RavnicaAllegiance.java +++ b/Mage.Sets/src/mage/sets/RavnicaAllegiance.java @@ -82,6 +82,7 @@ public final class RavnicaAllegiance extends ExpansionSet { cards.add(new SetCardInfo("Imperious Oligarch", 184, Rarity.COMMON, mage.cards.i.ImperiousOligarch.class)); cards.add(new SetCardInfo("Incubation // Incongruity", 226, Rarity.UNCOMMON, mage.cards.i.IncubationIncongruity.class)); cards.add(new SetCardInfo("Judith, the Scourge Diva", 185, Rarity.RARE, mage.cards.j.JudithTheScourgeDiva.class)); + cards.add(new SetCardInfo("Kaya's Wrath", 187, Rarity.RARE, mage.cards.k.KayasWrath.class)); cards.add(new SetCardInfo("Kaya, Orzhov Usurper", 186, Rarity.MYTHIC, mage.cards.k.KayaOrzhovUsurper.class)); cards.add(new SetCardInfo("Lavinia, Azorius Renegade", 189, Rarity.RARE, mage.cards.l.LaviniaAzoriusRenegade.class)); cards.add(new SetCardInfo("Light Up the Stage", 107, Rarity.UNCOMMON, mage.cards.l.LightUpTheStage.class));