Fix #10561 Misery's Shadow (and 3 other cards) replacement effects (#10562)

Did not test the final code for Stone of Erech, when a filter was added to the ReplacementEffect :(

Added an unit test, just to be safer this time around.
This commit is contained in:
Susucre 2023-07-04 17:47:22 +02:00 committed by GitHub
parent 47456bf9c4
commit 652358a481
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View file

@ -128,4 +128,26 @@ public class WouldDieExileInsteadTest extends CardTestPlayerBase {
assertGraveyardCount(playerB, hGiant, 1);
assertExileCount(playerB, hGiant, 0);
}
@Test
public void miseryShadowReplacement() {
// Misery's Shadow {1}{B} - 2/2 Creature
// If a creature an opponent controls would die, exile it instead.
// {1}: Miserys Shadow gets +1/+1 until end of turn.
addCard(Zone.BATTLEFIELD, playerA, "Misery's Shadow", 1);
// Doom Blade {1}{B} - Instant
// Destroy target non-black creature.
addCard(Zone.HAND, playerA, "Doom Blade", 1);
// Giant Spider - 2/4 Creature
// Reach
addCard(Zone.BATTLEFIELD, playerB, "Giant Spider", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Doom Blade", "Giant Spider");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerB, "Giant Spider", 0);
assertExileCount("Giant Spider", 1);
}
}

View file

@ -22,6 +22,7 @@ public class CreaturesAreExiledOnDeathReplacementEffect extends ReplacementEffec
public CreaturesAreExiledOnDeathReplacementEffect(FilterPermanent filter) {
super(Duration.WhileOnBattlefield, Outcome.Exile);
staticText = "If " + CardUtil.addArticle(filter.getMessage()) + " would die, exile it instead";
this.filter = filter;
}
private CreaturesAreExiledOnDeathReplacementEffect(final CreaturesAreExiledOnDeathReplacementEffect effect) {