Fix Twinning Staff to only happen when one or more copies would be made, and not zero. (#9843)

* Fix Twinning Staff to only apply when you're copying the spell at least one time.

* Fix test so it works
This commit is contained in:
Grath 2023-01-27 22:10:03 -05:00 committed by GitHub
parent 7b8dd44e7a
commit 3044bf2e23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

View file

@ -82,7 +82,8 @@ class TwinningStaffEffect extends ReplacementEffectImpl {
@Override @Override
public boolean applies(GameEvent event, Ability source, Game game) { public boolean applies(GameEvent event, Ability source, Game game) {
return event.getPlayerId().equals(source.getControllerId()) return event.getPlayerId().equals(source.getControllerId())
&& game.getSpellOrLKIStack(event.getTargetId()) != null; && game.getSpellOrLKIStack(event.getTargetId()) != null
&& event.getAmount() >= 1;
} }
@Override @Override

View file

@ -85,4 +85,21 @@ public class TwinningStaffTest extends CardTestPlayerBase {
assertGraveyardCount(playerA, bear, 1); assertGraveyardCount(playerA, bear, 1);
assertGraveyardCount(playerA, elite, 1); assertGraveyardCount(playerA, elite, 1);
} }
@Test
public void testThousandYearStormZeroCopies() {
addCard(Zone.BATTLEFIELD, playerA, "Badlands", 2);
addCard(Zone.BATTLEFIELD, playerA, "Thousand-Year Storm");
addCard(Zone.BATTLEFIELD, playerA, staff);
addCard(Zone.HAND, playerA, "Lightning Bolt", 2);
castSpell(1, PhaseStep.UPKEEP, playerA, "Lightning Bolt", playerB);
checkLife("before", 1, PhaseStep.PRECOMBAT_MAIN, playerB, 20 - 3);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
setStrictChooseMode(false);
checkLife("copy", 1, PhaseStep.END_COMBAT, playerB, 20 - 3 - 3 * 3);
setStopAt(1, PhaseStep.END_TURN);
execute();
}
} }