Merge pull request #6245 from Dilnu/Despark

Allow players to block creatures attacking destroyed planeswalkers.
This commit is contained in:
Oleg Agafonov 2020-02-03 22:34:45 +01:00 committed by GitHub
commit 88f23bc0ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 0 deletions

View file

@ -127,4 +127,29 @@ public class AttackPlaneswalkerTest extends CardTestPlayerBase {
assertPermanentCount(playerB, "Silent Skimmer", 1); assertPermanentCount(playerB, "Silent Skimmer", 1);
assertCounterCount("Kiora, the Crashing Wave", CounterType.LOYALTY, 2); assertCounterCount("Kiora, the Crashing Wave", CounterType.LOYALTY, 2);
} }
@Test
public void testAttackedPlaneswalkerDestroyed() {
addCard(Zone.BATTLEFIELD, playerA, "Kiora, the Crashing Wave");
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears");
addCard(Zone.BATTLEFIELD, playerB, "Grizzly Bears");
addCard(Zone.BATTLEFIELD, playerB, "Plains");
addCard(Zone.BATTLEFIELD, playerB, "Swamp");
addCard(Zone.HAND, playerB, "Despark");
attack(2, playerB, "Grizzly Bears", "Kiora, the Crashing Wave");
castSpell(2, PhaseStep.DECLARE_ATTACKERS, playerB, "Despark");
setChoice(playerB, "Kiora, the Crashing Wave");
block(2, playerA, "Grizzly Bears", "Grizzly Bears");
setStopAt(2, PhaseStep.END_TURN);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertExileCount(playerA, "Kiora, the Crashing Wave", 1);
assertGraveyardCount(playerA, "Grizzly Bears", 1);
assertGraveyardCount(playerB, "Grizzly Bears", 1);
}
} }

View file

@ -1607,6 +1607,8 @@ public class Combat implements Serializable, Copyable<Combat> {
Permanent permanent = game.getPermanent(group.getDefenderId()); Permanent permanent = game.getPermanent(group.getDefenderId());
if (permanent != null) { if (permanent != null) {
playerDefenders.add(permanent.getControllerId()); playerDefenders.add(permanent.getControllerId());
} else {
playerDefenders.add(group.getDefendingPlayerId());
} }
} else { } else {
playerDefenders.add(group.getDefenderId()); playerDefenders.add(group.getDefenderId());