Fix Blitz not being cleaned up when the permanent leaved the BF (#9775)

A onCard: false parameter was necessary to clean the effect once the blitz creature leaved the battlefield.
This commit is contained in:
Susucre 2023-06-12 05:55:23 +02:00 committed by GitHub
parent 2cdfb255cf
commit 70fa98f492
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 1 deletions

View file

@ -104,6 +104,54 @@ public class BlitzTest extends CardTestPlayerBase {
assertLife(playerA, 20);
}
@Test
public void testTenaciousUnderdogTwice() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10);
addCard(Zone.GRAVEYARD, playerA, underdog);
addCard(Zone.HAND, playerA, "Go for the Throat");
addCard(Zone.LIBRARY, playerA, "Plains", 5);
skipInitShuffling();
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, underdog + withBlitz);
castSpell(1, PhaseStep.BEGIN_COMBAT, playerA, "Go for the Throat", underdog);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, underdog + withBlitz);
// There are two delayed triggers, only one will actually sacrifice the underdog.
setChoice(playerA, "At the beginning of the");
setStrictChooseMode(true);
setStopAt(2, PhaseStep.UPKEEP);
execute();
assertHandCount(playerA, "Plains", 2);
assertLife(playerA, 16);
assertGraveyardCount(playerA, underdog, 1);
}
@Test
public void testTenaciousUnderdogSTP() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
addCard(Zone.GRAVEYARD, playerA, underdog);
addCard(Zone.LIBRARY, playerA, "Plains", 5);
addCard(Zone.BATTLEFIELD, playerB, "Plains");
addCard(Zone.HAND, playerB, "Swords to Plowshares");
skipInitShuffling();
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, underdog + withBlitz);
castSpell(1, PhaseStep.BEGIN_COMBAT, playerB, "Swords to Plowshares", underdog);
setStrictChooseMode(true);
setStopAt(2, PhaseStep.UPKEEP);
execute();
assertHandCount(playerA, "Plains", 0);
assertLife(playerA, 20 - 2 + 3);
assertGraveyardCount(playerA, underdog, 0);
}
@Test
public void testTenaciousUnderdogBlitz() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);

View file

@ -38,7 +38,7 @@ public class BlitzAbility extends SpellAbility {
);
ability.addEffect(new GainAbilitySourceEffect(new DiesSourceTriggeredAbility(
new DrawCardSourceControllerEffect(1)
).setTriggerPhrase("When this creature dies, ")));
).setTriggerPhrase("When this creature dies, "), Duration.Custom, false));
ability.addEffect(new BlitzAddDelayedTriggeredAbilityEffect());
ability.setRuleVisible(false);
addSubAbility(ability);