Implemented Macabre Mockery

This commit is contained in:
Evan Kranzler 2019-01-10 20:20:48 -05:00
parent 8971b937d0
commit 2d6f07f0c8
3 changed files with 118 additions and 32 deletions

View file

@ -0,0 +1,92 @@
package mage.cards.m;
import mage.abilities.Ability;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeTargetEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInOpponentsGraveyard;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class MacabreMockery extends CardImpl {
public MacabreMockery(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}{R}");
// Put target creature card from an opponent's graveyard onto the battlefield under your control. It gets +2/+0 and gains haste until end of turn. Sacrifice it at the beginning of the next end step.
this.getSpellAbility().addEffect(new MacabreMockeryEffect());
this.getSpellAbility().addTarget(new TargetCardInOpponentsGraveyard(StaticFilters.FILTER_CARD_CREATURE));
}
private MacabreMockery(final MacabreMockery card) {
super(card);
}
@Override
public MacabreMockery copy() {
return new MacabreMockery(this);
}
}
class MacabreMockeryEffect extends OneShotEffect {
MacabreMockeryEffect() {
super(Outcome.PutCreatureInPlay);
staticText = "Put target creature card from an opponent's graveyard onto the battlefield under your control. " +
"It gets +2/+0 and gains haste until end of turn. Sacrifice it at the beginning of the next end step.";
}
private MacabreMockeryEffect(final MacabreMockeryEffect effect) {
super(effect);
}
@Override
public MacabreMockeryEffect copy() {
return new MacabreMockeryEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (card == null) {
return false;
}
Player controller = game.getPlayer(source.getControllerId());
if (controller == null || !controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
return false;
}
Permanent permanent = game.getPermanent(card.getId());
if (permanent != null) {
return false;
}
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
effect = new BoostTargetEffect(2, 0, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
Effect sacrificeEffect = new SacrificeTargetEffect("exile " + permanent.getLogName());
sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
sacrificeEffect, TargetController.YOU
), source);
return true;
}
}

View file

@ -1,7 +1,6 @@
package mage.cards.p;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
@ -17,12 +16,7 @@ import mage.abilities.keyword.PersistAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -31,15 +25,15 @@ import mage.target.Target;
import mage.target.common.TargetCardInOpponentsGraveyard;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*
*/
public final class PuppeteerClique extends CardImpl {
public PuppeteerClique(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
this.subtype.add(SubType.FAERIE);
this.subtype.add(SubType.WIZARD);
@ -59,7 +53,7 @@ public final class PuppeteerClique extends CardImpl {
this.addAbility(new PersistAbility());
}
public PuppeteerClique(final PuppeteerClique card) {
private PuppeteerClique(final PuppeteerClique card) {
super(card);
}
@ -71,12 +65,12 @@ public final class PuppeteerClique extends CardImpl {
class PuppeteerCliqueEffect extends OneShotEffect {
public PuppeteerCliqueEffect() {
PuppeteerCliqueEffect() {
super(Outcome.PutCreatureInPlay);
staticText = "put target creature card from an opponent's graveyard onto the battlefield under your control. It gains haste. At the beginning of your next end step, exile it";
}
public PuppeteerCliqueEffect(final PuppeteerCliqueEffect effect) {
private PuppeteerCliqueEffect(final PuppeteerCliqueEffect effect) {
super(effect);
}
@ -87,26 +81,25 @@ class PuppeteerCliqueEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
boolean result = false;
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (card != null) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
Permanent permanent = game.getPermanent(card.getId());
if (permanent != null) {
ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
hasteEffect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(hasteEffect, source);
ExileTargetEffect exileEffect = new ExileTargetEffect("exile " + permanent.getLogName());
exileEffect.setTargetPointer(new FixedTarget(permanent, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect, TargetController.YOU);
game.addDelayedTriggeredAbility(delayedAbility, source);
result = true;
}
}
}
if (card == null) {
return false;
}
return result;
Player controller = game.getPlayer(source.getControllerId());
if (controller == null || !controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
return false;
}
Permanent permanent = game.getPermanent(card.getId());
if (permanent != null) {
return false;
}
ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
hasteEffect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(hasteEffect, source);
ExileTargetEffect exileEffect = new ExileTargetEffect("exile " + permanent.getLogName());
exileEffect.setTargetPointer(new FixedTarget(permanent, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect, TargetController.YOU);
game.addDelayedTriggeredAbility(delayedAbility, source);
return true;
}
}

View file

@ -127,6 +127,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
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));
cards.add(new SetCardInfo("Lumbering Battlement", 15, Rarity.RARE, mage.cards.l.LumberingBattlement.class));
cards.add(new SetCardInfo("Macabre Mockery", 191, Rarity.UNCOMMON, mage.cards.m.MacabreMockery.class));
cards.add(new SetCardInfo("Mass Manipulation", 42, Rarity.RARE, mage.cards.m.MassManipulation.class));
cards.add(new SetCardInfo("Mesmerizing Benthid", 43, Rarity.MYTHIC, mage.cards.m.MesmerizingBenthid.class));
cards.add(new SetCardInfo("Ministrant of Obligation", 16, Rarity.UNCOMMON, mage.cards.m.MinistrantOfObligation.class));