mirror of
https://github.com/correl/mage.git
synced 2025-01-14 03:00:10 +00:00
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>
This commit is contained in:
parent
14a93dccb7
commit
d26f0f8754
2 changed files with 81 additions and 0 deletions
80
Mage.Sets/src/mage/cards/g/GleefulDemolition.java
Normal file
80
Mage.Sets/src/mage/cards/g/GleefulDemolition.java
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue