From 50c9258263e5332ac3da887435129ccbafe26830 Mon Sep 17 00:00:00 2001 From: Raphael-Schulz <72562197+Raphael-Schulz@users.noreply.github.com> Date: Sat, 3 Jul 2021 21:14:10 +0200 Subject: [PATCH] [AFR] Implemented Meteor Swarm (#7964) * [AFR] Implemented Meteor Swarm * [AFR] Adjusted implementation of Meteor Swarm --- Mage.Sets/src/mage/cards/m/MeteorSwarm.java | 56 +++++++++++++++++++ .../sets/AdventuresInTheForgottenRealms.java | 1 + 2 files changed, 57 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MeteorSwarm.java diff --git a/Mage.Sets/src/mage/cards/m/MeteorSwarm.java b/Mage.Sets/src/mage/cards/m/MeteorSwarm.java new file mode 100644 index 00000000000..320fa7d1636 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MeteorSwarm.java @@ -0,0 +1,56 @@ +package mage.cards.m; + +import mage.abilities.Ability; +import mage.abilities.effects.common.DamageMultiEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.Game; +import mage.target.common.TargetCreatureOrPlaneswalkerAmount; +import mage.target.targetadjustment.TargetAdjuster; + +import java.util.UUID; + +/** + * @author Raphael-Schulz + */ +public final class MeteorSwarm extends CardImpl { + + public MeteorSwarm(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}{R}{R}"); + + // Meteor Swarm deals 8 damage divided as you choose among X target creatures and/or planeswalkers. + this.getSpellAbility().addEffect( + new DamageMultiEffect(8). + setText("{this} deals 8 damage divided as you choose among X target creatures and/or planeswalkers.") + ); + this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalkerAmount(8)); + this.getSpellAbility().setTargetAdjuster(MeteorSwarmAdjuster.instance); + } + + private MeteorSwarm(final MeteorSwarm card) { + super(card); + } + + @Override + public MeteorSwarm copy() { + return new MeteorSwarm(this); + } +} + +enum MeteorSwarmAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + ability.getTargets().clear(); + int xManaSpent = ability.getManaCostsToPay().getX(); + if(xManaSpent != 0) { + TargetCreatureOrPlaneswalkerAmount targetCreatureOrPlaneswalkerAmount = new TargetCreatureOrPlaneswalkerAmount(8); + targetCreatureOrPlaneswalkerAmount.setMinNumberOfTargets(xManaSpent); + targetCreatureOrPlaneswalkerAmount.setMaxNumberOfTargets(xManaSpent); + ability.addTarget(targetCreatureOrPlaneswalkerAmount); + } + } +} + diff --git a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java index 3eb739f6234..1f7426ab865 100644 --- a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java +++ b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java @@ -98,6 +98,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet { cards.add(new SetCardInfo("Lightfoot Rogue", 111, Rarity.UNCOMMON, mage.cards.l.LightfootRogue.class)); cards.add(new SetCardInfo("Lolth, Spider Queen", 112, Rarity.MYTHIC, mage.cards.l.LolthSpiderQueen.class)); cards.add(new SetCardInfo("Manticore", 113, Rarity.COMMON, mage.cards.m.Manticore.class)); + cards.add(new SetCardInfo("Meteor Swarm", 155, Rarity.RARE, mage.cards.m.MeteorSwarm.class)); cards.add(new SetCardInfo("Mimic", 249, Rarity.COMMON, mage.cards.m.Mimic.class)); cards.add(new SetCardInfo("Minion of the Mighty", 156, Rarity.RARE, mage.cards.m.MinionOfTheMighty.class)); cards.add(new SetCardInfo("Moon-Blessed Cleric", 26, Rarity.UNCOMMON, mage.cards.m.MoonBlessedCleric.class));