From 37a4ae27f11a58bda30b0499c981c046081befb2 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 7 Apr 2021 08:33:53 -0400 Subject: [PATCH] [STX] Implemented Explosive Welcome --- .../src/mage/cards/e/ExplosiveWelcome.java | 56 +++++++++++++++++++ .../mage/sets/StrixhavenSchoolOfMages.java | 1 + .../common/FilterPermanentOrPlayer.java | 7 +++ 3 files changed, 64 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/e/ExplosiveWelcome.java diff --git a/Mage.Sets/src/mage/cards/e/ExplosiveWelcome.java b/Mage.Sets/src/mage/cards/e/ExplosiveWelcome.java new file mode 100644 index 0000000000..f84c93da93 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/ExplosiveWelcome.java @@ -0,0 +1,56 @@ +package mage.cards.e; + +import mage.Mana; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.mana.BasicManaEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ManaType; +import mage.filter.common.FilterCreaturePlayerOrPlaneswalker; +import mage.filter.predicate.other.AnotherTargetPredicate; +import mage.target.Target; +import mage.target.common.TargetAnyTarget; +import mage.target.targetpointer.SecondTargetPointer; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ExplosiveWelcome extends CardImpl { + + private static final FilterCreaturePlayerOrPlaneswalker filter = new FilterCreaturePlayerOrPlaneswalker(); + + static { + filter.add(new AnotherTargetPredicate(2)); + } + + public ExplosiveWelcome(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{7}{R}"); + + // Explosive Welcome deals 5 damage to any target and 3 damage to any other target. Add {R}{R}{R}. + this.getSpellAbility().addEffect(new DamageTargetEffect(5)); + this.getSpellAbility().addEffect( + new DamageTargetEffect(3) + .setTargetPointer(new SecondTargetPointer()) + .setText("and 3 damage to any other target.") + ); + this.getSpellAbility().addEffect(new BasicManaEffect(new Mana(ManaType.RED, 3))); + Target target = new TargetAnyTarget(); + target.setTargetTag(1); + this.getSpellAbility().addTarget(target); + target = new TargetAnyTarget(filter); + target.setTargetTag(2); + this.getSpellAbility().addTarget(target); + } + + private ExplosiveWelcome(final ExplosiveWelcome card) { + super(card); + } + + @Override + public ExplosiveWelcome copy() { + return new ExplosiveWelcome(this); + } +} diff --git a/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java b/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java index 385b6f4111..f53e82c00e 100644 --- a/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java +++ b/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java @@ -94,6 +94,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet { cards.add(new SetCardInfo("Exhilarating Elocution", 185, Rarity.COMMON, mage.cards.e.ExhilaratingElocution.class)); cards.add(new SetCardInfo("Expanded Anatomy", 2, Rarity.COMMON, mage.cards.e.ExpandedAnatomy.class)); cards.add(new SetCardInfo("Expel", 18, Rarity.COMMON, mage.cards.e.Expel.class)); + cards.add(new SetCardInfo("Explosive Welcome", 100, Rarity.UNCOMMON, mage.cards.e.ExplosiveWelcome.class)); cards.add(new SetCardInfo("Exponential Growth", 130, Rarity.RARE, mage.cards.e.ExponentialGrowth.class)); cards.add(new SetCardInfo("Eyetwitch", 70, Rarity.UNCOMMON, mage.cards.e.Eyetwitch.class)); cards.add(new SetCardInfo("Field Trip", 131, Rarity.COMMON, mage.cards.f.FieldTrip.class)); diff --git a/Mage/src/main/java/mage/filter/common/FilterPermanentOrPlayer.java b/Mage/src/main/java/mage/filter/common/FilterPermanentOrPlayer.java index 327404dfd1..c885b03522 100644 --- a/Mage/src/main/java/mage/filter/common/FilterPermanentOrPlayer.java +++ b/Mage/src/main/java/mage/filter/common/FilterPermanentOrPlayer.java @@ -5,6 +5,8 @@ import mage.filter.FilterImpl; import mage.filter.FilterInPlay; import mage.filter.FilterPermanent; import mage.filter.FilterPlayer; +import mage.filter.predicate.ObjectPlayerPredicate; +import mage.filter.predicate.Predicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -44,6 +46,11 @@ public class FilterPermanentOrPlayer extends FilterImpl implements Fil return true; } + public void add(ObjectPlayerPredicate predicate) { + playerFilter.add((Predicate) predicate); + permanentFilter.add((Predicate) predicate); + } + @Override public boolean match(MageItem o, Game game) { if (super.match(o, game)) {