From d26f0f875433aba80955bada56d4712ab6684119 Mon Sep 17 00:00:00 2001 From: AhmadYProjects <104733598+AhmadYProjects@users.noreply.github.com> Date: Sun, 22 Jan 2023 10:06:32 -0500 Subject: [PATCH] Gleeful demolition (#9896) * Gleeful Demolition * Gleeful Demolition * Gleeful Demolition * Gleeful Demolition * Gleeful Demolition * Gleeful Demolition * Gleeful Demolition * Gleeful Demolition * Gleeful Demolition * Gleeful Demolition * Gleeful Demolition * Changed DestroyEffect to OneShotEffect added super constructor * Removed super constructor and added permanent.destroy * Removed super constructor and added permanent.destroy * testing removal of DestroyTargetEffect * removed redundant DestroyTargetEffect and cleaned up imports. card works as intended. Co-authored-by: AhmadYProjects <yousufa@kean.edu> Co-authored-by: Evan Kranzler <theelk801@gmail.com> --- .../src/mage/cards/g/GleefulDemolition.java | 80 +++++++++++++++++++ .../src/mage/sets/PhyrexiaAllWillBeOne.java | 1 + 2 files changed, 81 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/g/GleefulDemolition.java diff --git a/Mage.Sets/src/mage/cards/g/GleefulDemolition.java b/Mage.Sets/src/mage/cards/g/GleefulDemolition.java new file mode 100644 index 0000000000..154e6bdb7d --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GleefulDemolition.java @@ -0,0 +1,80 @@ +package mage.cards.g; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +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 mage.game.permanent.token.PhyrexianGoblinToken; +import mage.game.permanent.token.Token; +import mage.players.Player; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * + * @author AhmadYProjects + */ +public final class GleefulDemolition extends CardImpl { + + public GleefulDemolition(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{R}"); + + + // Destroy target artifact. If you controlled that artifact, creature three 1/1 red Phyrexian Goblin creature tokens. + this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT)); + this.getSpellAbility().addEffect(new GleefulDemolitionEffect()); + + + } + + private GleefulDemolition(final GleefulDemolition card) { + super(card); + } + + @Override + public GleefulDemolition copy() { + return new GleefulDemolition(this); + } +} + +class GleefulDemolitionEffect extends OneShotEffect { + GleefulDemolitionEffect(){ + super(Outcome.Benefit); + staticText = "destroy target artifact. " + + "if you controlled that artifact, create three 1/1 red Phyrexian Goblin creature tokens"; + } + + private GleefulDemolitionEffect(final GleefulDemolitionEffect effect) { + super(effect); + } + + @Override + public GleefulDemolitionEffect copy(){ + return new GleefulDemolitionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source){ + Player player = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(targetPointer.getFirst(game,source)); + + if ( + permanent == null || player == null) { + return false; + } + boolean isMine = permanent.isControlledBy(source.getControllerId()); + permanent.destroy(source, game, false); + if (isMine) { + Token token = new PhyrexianGoblinToken(); + token.putOntoBattlefield(3,game,source); + + } + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java b/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java index cde0106acb..3a02cdd220 100644 --- a/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java +++ b/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java @@ -47,6 +47,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet { cards.add(new SetCardInfo("Ezuri, Stalker of Spheres", 201, Rarity.RARE, mage.cards.e.EzuriStalkerOfSpheres.class)); cards.add(new SetCardInfo("Feed the Infection", 93, Rarity.UNCOMMON, mage.cards.f.FeedTheInfection.class)); cards.add(new SetCardInfo("Forest", 276, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Gleeful Demolition", 134, Rarity.UNCOMMON, mage.cards.g.GleefulDemolition.class)); cards.add(new SetCardInfo("Hexgold Slash", 137, Rarity.COMMON, mage.cards.h.HexgoldSlash.class)); cards.add(new SetCardInfo("Furnace Skullbomb", 228, Rarity.COMMON, mage.cards.f.FurnaceSkullbomb.class)); cards.add(new SetCardInfo("Goliath Hatchery", 408, Rarity.RARE, mage.cards.g.GoliathHatchery.class));