fix UntilYourNextTurnDelayedTriggeredAbility

was wrongly limited to triggering once.
This commit is contained in:
Susucre 2024-05-17 12:22:19 +02:00
parent 6e4e52373b
commit 6cc3c5384a
2 changed files with 30 additions and 5 deletions

View file

@ -44,6 +44,31 @@ public class JaceArchitectOfThoughtTest extends CardTestPlayerBase {
}
@Test
public void test_DelayedTrigger_TriggerTwice() {
setStrictChooseMode(true);
addCard(Zone.BATTLEFIELD, playerA, "Jace, Architect of Thought");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
addCard(Zone.BATTLEFIELD, playerB, "Grizzly Bears", 1);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Until your next turn, whenever a creature an opponent controls attacks, it gets -1/-0 until end of turn.");
attack(2, playerB, "Silvercoat Lion");
attack(2, playerB, "Grizzly Bears");
setChoice(playerA, "Until"); // stack triggers
setStopAt(2, PhaseStep.END_COMBAT);
execute();
assertCounterCount("Jace, Architect of Thought", CounterType.LOYALTY, 5);
assertPowerToughness(playerB, "Silvercoat Lion", 1, 2);
assertLife(playerA, 20 - 2);
assertLife(playerB, 20);
}
@Test
public void testAbilit1lastOnlyUntilNextTurn() {
setStrictChooseMode(true);
@ -74,7 +99,7 @@ public class JaceArchitectOfThoughtTest extends CardTestPlayerBase {
@Test
public void testAbility1AfterJacesWasExiled() {
setStrictChooseMode(true);
addCard(Zone.BATTLEFIELD, playerA, "Jace, Architect of Thought");
// Sorcery {R}{B}

View file

@ -25,16 +25,16 @@ public class UntilYourNextTurnDelayedTriggeredAbility extends DelayedTriggeredAb
private final TriggeredAbility ability;
public UntilYourNextTurnDelayedTriggeredAbility(TriggeredAbility ability) {
super(null, Duration.UntilYourNextTurn);
super(null, Duration.UntilYourNextTurn, false);
if (ability.isLeavesTheBattlefieldTrigger()) {
this.setLeavesTheBattlefieldTrigger(true);
}
this.ability = ability;
}
protected UntilYourNextTurnDelayedTriggeredAbility(final UntilYourNextTurnDelayedTriggeredAbility ability) {
super(ability);
this.ability = ability.ability.copy();
protected UntilYourNextTurnDelayedTriggeredAbility(final UntilYourNextTurnDelayedTriggeredAbility triggeredAbility) {
super(triggeredAbility);
this.ability = triggeredAbility.ability.copy();
}
@Override