From 0c2651145ed653b8ed9de0f9fe59de8c1ca8c140 Mon Sep 17 00:00:00 2001 From: xenohedron Date: Sun, 4 Feb 2024 18:03:34 -0500 Subject: [PATCH 1/5] add test for Rise from the Grave --- .../single/m10/RiseFromTheGraveTest.java | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/single/m10/RiseFromTheGraveTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/m10/RiseFromTheGraveTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/m10/RiseFromTheGraveTest.java new file mode 100644 index 000000000000..ea634a601cc1 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/m10/RiseFromTheGraveTest.java @@ -0,0 +1,80 @@ +package org.mage.test.cards.single.m10; + +import mage.constants.PhaseStep; +import mage.constants.SubType; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * @author xenohedron + */ +public class RiseFromTheGraveTest extends CardTestPlayerBase { + + private static final String rise = "Rise from the Grave"; + // Put target creature card from a graveyard onto the battlefield under your control. + // That creature is a black Zombie in addition to its other colors and types. + + private static final String looter = "Merfolk Looter"; + private static final String unsummon = "Unsummon"; + private static final String unconventionalTactics = "Unconventional Tactics"; + // Whenever a Zombie enters the battlefield under your control, you may pay {W}. If you do, return Unconventional Tactics from your graveyard to your hand. + private static final String direUndercurrents = "Dire Undercurrents"; + // Whenever a blue creature enters the battlefield under your control, you may have target player draw a card. + // Whenever a black creature enters the battlefield under your control, you may have target player discard a card. + private static final String kraken = "Kraken Hatchling"; + + /* + * Related ruling for Chainer, Dementia Master + * As it enters the battlefield, it is already a black Nightmare (and perhaps some other creature types); + * it doesn't enter and then become a black Nightmare. (2022-12-08) + */ + + @Test + public void testGainedCharacteristicsRespectZCC() { + addCard(Zone.GRAVEYARD, playerB, looter); + addCard(Zone.HAND, playerA, rise); + addCard(Zone.HAND, playerB, unsummon); + addCard(Zone.HAND, playerA, kraken); + addCard(Zone.BATTLEFIELD, playerA, direUndercurrents); + addCard(Zone.GRAVEYARD, playerA, unconventionalTactics); + addCard(Zone.BATTLEFIELD, playerA, "Scrubland", 6); + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, rise, looter); + setChoice(playerA, "Whenever a blue"); // order triggers + addTarget(playerA, playerB); // to draw + setChoice(playerA, "Whenever a black"); // order triggers + addTarget(playerA, playerA); // to discard + setChoice(playerA, true); // pay {W} + setChoice(playerA, true); // to discard + setChoice(playerA, kraken); // discarded + setChoice(playerA, false); // no draw + + checkPT("looter", 1, PhaseStep.BEGIN_COMBAT, playerA, looter, 1, 1); + checkColor("looter", 1, PhaseStep.BEGIN_COMBAT, playerA, looter, "U", true); + checkColor("looter", 1, PhaseStep.BEGIN_COMBAT, playerA, looter, "B", true); + checkSubType("looter", 1, PhaseStep.BEGIN_COMBAT, playerA, looter, SubType.MERFOLK, true); + checkSubType("looter", 1, PhaseStep.BEGIN_COMBAT, playerA, looter, SubType.ZOMBIE, true); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, unsummon, looter); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, looter); + + checkPT("looter2", 2, PhaseStep.BEGIN_COMBAT, playerB, looter, 1, 1); + checkColor("looter2", 2, PhaseStep.BEGIN_COMBAT, playerB, looter, "U", true); + checkColor("looter2", 2, PhaseStep.BEGIN_COMBAT, playerB, looter, "B", false); + checkSubType("looter2", 2, PhaseStep.BEGIN_COMBAT, playerB, looter, SubType.MERFOLK, true); + checkSubType("looter2", 2, PhaseStep.BEGIN_COMBAT, playerB, looter, SubType.ZOMBIE, false); + + setStrictChooseMode(true); + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertGraveyardCount(playerA, rise, 1); + assertGraveyardCount(playerB, unsummon, 1); + assertHandCount(playerA, unconventionalTactics, 1); + assertGraveyardCount(playerA, kraken, 1); + } + +} From 48ab4f0880920fe1bf08bbe999be1bbab4df2008 Mon Sep 17 00:00:00 2001 From: xenohedron Date: Sun, 4 Feb 2024 23:09:29 -0500 Subject: [PATCH 2/5] fix Rise from the Grave with new effect classes --- .../src/mage/cards/r/RiseFromTheGrave.java | 22 ++--- .../PutOntoBattlefieldTargetEffect.java | 84 +++++++++++++++++++ ...ersWithContinuousEffectsAppliedEffect.java | 68 +++++++++++++++ 3 files changed, 164 insertions(+), 10 deletions(-) create mode 100644 Mage/src/main/java/mage/abilities/effects/common/PutOntoBattlefieldTargetEffect.java create mode 100644 Mage/src/main/java/mage/abilities/effects/common/replacement/EntersWithContinuousEffectsAppliedEffect.java diff --git a/Mage.Sets/src/mage/cards/r/RiseFromTheGrave.java b/Mage.Sets/src/mage/cards/r/RiseFromTheGrave.java index 542db946b830..bd8209aeddd4 100644 --- a/Mage.Sets/src/mage/cards/r/RiseFromTheGrave.java +++ b/Mage.Sets/src/mage/cards/r/RiseFromTheGrave.java @@ -1,31 +1,33 @@ - package mage.cards.r; -import java.util.UUID; -import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; -import mage.abilities.effects.common.continuous.AddCreatureTypeAdditionEffect; +import mage.ObjectColor; +import mage.abilities.effects.common.PutOntoBattlefieldTargetEffect; +import mage.abilities.effects.common.continuous.AddCardSubTypeTargetEffect; +import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.Duration; import mage.constants.SubType; import mage.filter.StaticFilters; -import mage.filter.common.FilterCreatureCard; import mage.target.common.TargetCardInGraveyard; +import java.util.UUID; + /** - * - * @author BetaSteward_at_googlemail.com + * @author xenohedron */ public final class RiseFromTheGrave extends CardImpl { public RiseFromTheGrave(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{B}"); - // Put target creature card from a graveyard onto the battlefield under your control. That creature is a black Zombie in addition to its other colors and types. this.getSpellAbility().addTarget(new TargetCardInGraveyard(StaticFilters.FILTER_CARD_CREATURE_A_GRAVEYARD)); - this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()); - this.getSpellAbility().addEffect(new AddCreatureTypeAdditionEffect(SubType.ZOMBIE, true)); + this.getSpellAbility().addEffect(new PutOntoBattlefieldTargetEffect(false) + .withContinuousEffects("That creature is a black Zombie in addition to its other colors and types", + new BecomesColorTargetEffect(ObjectColor.BLACK, true, Duration.Custom), + new AddCardSubTypeTargetEffect(SubType.ZOMBIE, Duration.Custom))); } private RiseFromTheGrave(final RiseFromTheGrave card) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/PutOntoBattlefieldTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/PutOntoBattlefieldTargetEffect.java new file mode 100644 index 000000000000..34adc4aff062 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/common/PutOntoBattlefieldTargetEffect.java @@ -0,0 +1,84 @@ +package mage.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.replacement.EntersWithContinuousEffectsAppliedEffect; +import mage.cards.Card; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author xenohedron + */ +public class PutOntoBattlefieldTargetEffect extends OneShotEffect { + + private final boolean tapped; + private final List effects = new ArrayList<>(); + private String description; + + /** + * Put [target card in a graveyard] onto the battlefield under your control + */ + public PutOntoBattlefieldTargetEffect(boolean tapped) { + super(Outcome.PutCreatureInPlay); + this.tapped = tapped; + } + + protected PutOntoBattlefieldTargetEffect(final PutOntoBattlefieldTargetEffect effect) { + super(effect); + this.tapped = effect.tapped; + this.effects.addAll(effect.effects); + this.description = effect.description; + } + + @Override + public PutOntoBattlefieldTargetEffect copy() { + return new PutOntoBattlefieldTargetEffect(this); + } + + public PutOntoBattlefieldTargetEffect withContinuousEffects(String description, ContinuousEffect... effects) { + this.description = description; + this.effects.addAll(Arrays.asList(effects)); + return this; + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + Set cardsToMove = getTargetPointer() + .getTargets(game, source) + .stream() + .map(game::getCard) + .filter(Objects::nonNull) + .collect(Collectors.toSet()); + if (cardsToMove.isEmpty()) { + return false; + } + if (!effects.isEmpty()) { + game.addEffect(new EntersWithContinuousEffectsAppliedEffect(effects) + .setTargetPointer(this.getTargetPointer().copy()), source); + } + controller.moveCards(cardsToMove, Zone.BATTLEFIELD, source, game, tapped, false, false, null); + return true; + } + + @Override + public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } + return "put " + getTargetPointer().describeTargets(mode.getTargets(), "that card") + + " onto the battlefield" + (tapped ? " tapped " : " ") + "under your control" + + (description == null || description.isEmpty() ? "" : ". " + description); + } +} diff --git a/Mage/src/main/java/mage/abilities/effects/common/replacement/EntersWithContinuousEffectsAppliedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/replacement/EntersWithContinuousEffectsAppliedEffect.java new file mode 100644 index 000000000000..5b4e12ab3108 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/common/replacement/EntersWithContinuousEffectsAppliedEffect.java @@ -0,0 +1,68 @@ +package mage.abilities.effects.common.replacement; + +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; +import mage.util.CardUtil; + +import java.util.List; + +/** + * @author xenohedron + */ +public class EntersWithContinuousEffectsAppliedEffect extends ReplacementEffectImpl { + + private final List effects; + + /** + * Use prior to an effect that puts a card onto the battlefield e.g. with additional color/subtype + * Text must be set manually (since printed out of order); intended for internal usage + */ + public EntersWithContinuousEffectsAppliedEffect(List effects) { + super(Duration.EndOfStep, Outcome.Neutral); + if (effects.isEmpty()) { + throw new IllegalArgumentException("Wrong code usage: empty effects list in EntersWithContinuousEffectsApplied"); + } + this.effects = effects; + } + + private EntersWithContinuousEffectsAppliedEffect(final EntersWithContinuousEffectsAppliedEffect effect) { + super(effect); + this.effects = CardUtil.deepCopyObject(effect.effects); + } + + @Override + public EntersWithContinuousEffectsAppliedEffect copy() { + return new EntersWithContinuousEffectsAppliedEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); + return permanent != null && getTargetPointer().getTargets(game, source).contains(permanent.getId()); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); + if (permanent != null) { + FixedTarget fixedTarget = new FixedTarget(permanent.getId(), permanent.getZoneChangeCounter(game) + 1); + for (ContinuousEffect effect : effects) { + game.addEffect(effect.copy().setTargetPointer(fixedTarget.copy()), source); + } + } + return false; + } +} From ab094013ca98847ec90cc698f9078f496175d719 Mon Sep 17 00:00:00 2001 From: xenohedron Date: Sun, 4 Feb 2024 23:43:58 -0500 Subject: [PATCH 3/5] use new class for other similar cards --- .../mage/cards/c/ChainerDementiaMaster.java | 68 ++++--------------- .../src/mage/cards/p/PortalToPhyrexia.java | 13 ++-- .../PutOntoBattlefieldTargetEffect.java | 3 + 3 files changed, 22 insertions(+), 62 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/ChainerDementiaMaster.java b/Mage.Sets/src/mage/cards/c/ChainerDementiaMaster.java index 6b4a0f825163..2e2e1bb8e4b9 100644 --- a/Mage.Sets/src/mage/cards/c/ChainerDementiaMaster.java +++ b/Mage.Sets/src/mage/cards/c/ChainerDementiaMaster.java @@ -1,7 +1,5 @@ - package mage.cards.c; -import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; @@ -10,25 +8,20 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.PayLifeCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileAllEffect; -import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.abilities.effects.common.PutOntoBattlefieldTargetEffect; +import mage.abilities.effects.common.continuous.AddCardSubTypeTargetEffect; import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; -import mage.abilities.effects.common.continuous.BecomesCreatureTypeTargetEffect; import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; import mage.filter.FilterPermanent; import mage.filter.StaticFilters; -import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreaturePermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetCardInGraveyard; -import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; /** * @@ -36,12 +29,8 @@ */ public final class ChainerDementiaMaster extends CardImpl { - private static final FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("Nightmare creatures"); - private static final FilterPermanent filterPermanent = new FilterPermanent("Nightmares"); - static { - filterCreature.add(SubType.NIGHTMARE.getPredicate()); - filterPermanent.add(SubType.NIGHTMARE.getPredicate()); - } + private static final FilterCreaturePermanent filterCreature = new FilterCreaturePermanent(SubType.NIGHTMARE, "All Nightmares"); + private static final FilterPermanent filterPermanent = new FilterPermanent(SubType.NIGHTMARE, "Nightmares"); public ChainerDementiaMaster(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}"); @@ -52,10 +41,14 @@ public ChainerDementiaMaster(UUID ownerId, CardSetInfo setInfo) { this.toughness = new MageInt(3); // Nightmare creatures get +1/+1. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filterCreature, false))); + this.addAbility(new SimpleStaticAbility(new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filterCreature, false))); // {B}{B}{B}, Pay 3 life: Put target creature card from a graveyard onto the battlefield under your control. That creature is black and is a Nightmare in addition to its other creature types. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ChainerDementiaMasterEffect(), new ManaCostsImpl<>("{B}{B}{B}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOntoBattlefieldTargetEffect(false) + .withContinuousEffects("That creature is black and is a Nightmare in addition to its other creature types", + new BecomesColorTargetEffect(ObjectColor.BLACK, Duration.Custom), + new AddCardSubTypeTargetEffect(SubType.NIGHTMARE, Duration.Custom)), + new ManaCostsImpl<>("{B}{B}{B}")); ability.addCost(new PayLifeCost(3)); ability.addTarget(new TargetCardInGraveyard(StaticFilters.FILTER_CARD_CREATURE_A_GRAVEYARD)); this.addAbility(ability); @@ -73,40 +66,3 @@ public ChainerDementiaMaster copy() { return new ChainerDementiaMaster(this); } } - -class ChainerDementiaMasterEffect extends OneShotEffect { - - ChainerDementiaMasterEffect() { - super(Outcome.PutCreatureInPlay); - this.staticText = "Put target creature card from a graveyard onto the battlefield under your control. That creature is black and is a Nightmare in addition to its other creature types"; - } - - private ChainerDementiaMasterEffect(final ChainerDementiaMasterEffect effect) { - super(effect); - } - - @Override - public ChainerDementiaMasterEffect copy() { - return new ChainerDementiaMasterEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - UUID cardId = this.getTargetPointer().getFirst(game, source); - new ReturnFromGraveyardToBattlefieldTargetEffect().apply(game, source); - Permanent permanent = game.getPermanent(cardId); - if (permanent != null) { - ContinuousEffectImpl effect = new BecomesColorTargetEffect(ObjectColor.BLACK, Duration.WhileOnBattlefield); - effect.setTargetPointer(new FixedTarget(permanent, game)); - game.addEffect(effect, source); - effect = new BecomesCreatureTypeTargetEffect(Duration.WhileOnBattlefield, SubType.NIGHTMARE, false); - effect.setTargetPointer(new FixedTarget(permanent, game)); - game.addEffect(effect, source); - } - return true; - } - return false; - } -} diff --git a/Mage.Sets/src/mage/cards/p/PortalToPhyrexia.java b/Mage.Sets/src/mage/cards/p/PortalToPhyrexia.java index 6cb416c830ba..5ed9ef3e85f4 100644 --- a/Mage.Sets/src/mage/cards/p/PortalToPhyrexia.java +++ b/Mage.Sets/src/mage/cards/p/PortalToPhyrexia.java @@ -3,17 +3,16 @@ import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.abilities.effects.common.PutOntoBattlefieldTargetEffect; import mage.abilities.effects.common.SacrificeOpponentsEffect; -import mage.abilities.effects.common.continuous.AddCreatureTypeAdditionEffect; +import mage.abilities.effects.common.continuous.AddCardSubTypeTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.Duration; import mage.constants.SubType; import mage.constants.TargetController; -import mage.filter.FilterCard; import mage.filter.StaticFilters; -import mage.filter.common.FilterCreatureCard; import mage.target.common.TargetCardInGraveyard; import java.util.UUID; @@ -33,9 +32,11 @@ public PortalToPhyrexia(UUID ownerId, CardSetInfo setInfo) { // At the beginning of your upkeep, put target creature card from a graveyard onto the battlefield under your control. It's a Phyrexian in addition to its other types. Ability ability = new BeginningOfUpkeepTriggeredAbility( - new ReturnFromGraveyardToBattlefieldTargetEffect(), TargetController.YOU, false + new PutOntoBattlefieldTargetEffect(false).withContinuousEffects( + "It's a Phyrexian in addition to its other types", + new AddCardSubTypeTargetEffect(SubType.PHYREXIAN, Duration.Custom) + ), TargetController.YOU, false ); - ability.addEffect(new AddCreatureTypeAdditionEffect(SubType.PHYREXIAN, false)); ability.addTarget(new TargetCardInGraveyard(StaticFilters.FILTER_CARD_CREATURE_A_GRAVEYARD)); this.addAbility(ability); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/PutOntoBattlefieldTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/PutOntoBattlefieldTargetEffect.java index 34adc4aff062..be0a2aa96275 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/PutOntoBattlefieldTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/PutOntoBattlefieldTargetEffect.java @@ -43,6 +43,9 @@ public PutOntoBattlefieldTargetEffect copy() { return new PutOntoBattlefieldTargetEffect(this); } + /** + * These effects are applied as the permanent enters the battlefield. Use Duration.Custom + */ public PutOntoBattlefieldTargetEffect withContinuousEffects(String description, ContinuousEffect... effects) { this.description = description; this.effects.addAll(Arrays.asList(effects)); From 8be948f5d2d7de38738279cd9f88fcc8e451feed Mon Sep 17 00:00:00 2001 From: xenohedron Date: Mon, 5 Feb 2024 00:30:20 -0500 Subject: [PATCH 4/5] (temp) add deprecation note --- .../effects/common/continuous/AddCreatureTypeAdditionEffect.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCreatureTypeAdditionEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCreatureTypeAdditionEffect.java index b5dbdd6f9808..d5d4c35ca0ba 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCreatureTypeAdditionEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCreatureTypeAdditionEffect.java @@ -14,6 +14,7 @@ public class AddCreatureTypeAdditionEffect extends ContinuousEffectImpl { private final SubType subType; private final boolean giveBlackColor; + @Deprecated // does not check zcc public AddCreatureTypeAdditionEffect(SubType subType, boolean giveBlackColor) { super(Duration.Custom, Outcome.Neutral); this.subType = subType; From 3bb7cd773381ca9c23ddb3bc7c907ddae05f664e Mon Sep 17 00:00:00 2001 From: xenohedron Date: Mon, 5 Feb 2024 00:30:58 -0500 Subject: [PATCH 5/5] remove deprecated effect from Grave Betrayal --- Mage.Sets/src/mage/cards/g/GraveBetrayal.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/cards/g/GraveBetrayal.java b/Mage.Sets/src/mage/cards/g/GraveBetrayal.java index af4674f4632d..bd80a6609121 100644 --- a/Mage.Sets/src/mage/cards/g/GraveBetrayal.java +++ b/Mage.Sets/src/mage/cards/g/GraveBetrayal.java @@ -1,7 +1,8 @@ - package mage.cards.g; import java.util.UUID; + +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.TriggeredAbilityImpl; @@ -10,7 +11,8 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.ReplacementEffectImpl; -import mage.abilities.effects.common.continuous.AddCreatureTypeAdditionEffect; +import mage.abilities.effects.common.continuous.AddCardSubTypeTargetEffect; +import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -153,10 +155,11 @@ public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); if (creature != null) { creature.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects()); - ContinuousEffect effect = new AddCreatureTypeAdditionEffect(SubType.ZOMBIE, true); - effect.setTargetPointer(new FixedTarget(creature.getId(), creature.getZoneChangeCounter(game) + 1)); - game.addEffect(effect, source); - //discard(); why? + FixedTarget fixedTarget = new FixedTarget(creature.getId(), creature.getZoneChangeCounter(game) + 1); + game.addEffect(new BecomesColorTargetEffect(ObjectColor.BLACK, true, Duration.Custom) + .setTargetPointer(fixedTarget.copy()), source); + game.addEffect(new AddCardSubTypeTargetEffect(SubType.ZOMBIE, Duration.Custom) + .setTargetPointer(fixedTarget.copy()), source); } return false; }