mirror of
https://github.com/correl/mage.git
synced 2025-03-07 20:53:18 -10:00
* Sepulchral Primordial - Fixed that its ETB ability doesn't trigger if at least one opponent in range had no creature in the graveyard (fixes #3257).
This commit is contained in:
parent
24596e82a3
commit
5b7fb59b52
3 changed files with 41 additions and 9 deletions
|
@ -100,6 +100,34 @@ public class PrimordialTest extends CardTestMultiPlayerBase {
|
|||
assertGraveyardCount(playerD, "Pillarfield Ox", 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* I'm almost certain now about how this happens: when Sepulchral Primordial
|
||||
* enters the battlefield, and there's at least one opponent without a
|
||||
* creature in the graveyard, the ability doesn't trigger at all. It should
|
||||
* trigger at least for the players with creatures in the yard.
|
||||
*/
|
||||
@Test
|
||||
public void SepulchralPrimordialFromGraveyardEmptyGraveTest() {
|
||||
// When Sepulchral Primordial enters the battlefield, for each opponent, you may put up to one
|
||||
// target creature card from that player's graveyard onto the battlefield under your control.
|
||||
addCard(Zone.HAND, playerA, "Sepulchral Primordial"); // {5}{B}{B}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 7);
|
||||
|
||||
// Player order: A -> D -> C -> B
|
||||
addCard(Zone.GRAVEYARD, playerC, "Walking Corpse"); // Not in Range
|
||||
addCard(Zone.GRAVEYARD, playerD, "Pillarfield Ox");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sepulchral Primordial");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Sepulchral Primordial", 1);
|
||||
assertPermanentCount(playerA, "Walking Corpse", 0);
|
||||
assertPermanentCount(playerA, "Pillarfield Ox", 1);
|
||||
assertGraveyardCount(playerC, "Walking Corpse", 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Diluvian Primordial ETB trigger never happened in a 3 player FFA
|
||||
* commander game. He just resolved, no ETB trigger occurred.
|
||||
|
|
|
@ -27,6 +27,10 @@
|
|||
*/
|
||||
package mage.target;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
import mage.MageItem;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Cards;
|
||||
|
@ -36,11 +40,6 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
@ -88,6 +87,9 @@ public class TargetCard extends TargetObject {
|
|||
@Override
|
||||
public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
|
||||
int possibleTargets = 0;
|
||||
if (getNumberOfTargets() == 0) { // if 0 target is valid, the canChoose is always true
|
||||
return true;
|
||||
}
|
||||
for (UUID playerId : game.getState().getPlayersInRange(sourceControllerId, game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
package mage.target.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.Game;
|
||||
import mage.target.TargetCard;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
|
||||
|
||||
public class TargetCardInOpponentsGraveyard extends TargetCard {
|
||||
|
@ -55,7 +54,7 @@ public class TargetCardInOpponentsGraveyard extends TargetCard {
|
|||
public boolean canChoose(UUID sourceControllerId, Game game) {
|
||||
return canChoose(null, sourceControllerId, game);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if there are enough {@link Card} that can be chosen.
|
||||
*
|
||||
|
@ -67,6 +66,9 @@ public class TargetCardInOpponentsGraveyard extends TargetCard {
|
|||
@Override
|
||||
public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
|
||||
int possibleTargets = 0;
|
||||
if (getNumberOfTargets() == 0) { // if 0 target is valid, the canChoose is always true
|
||||
return true;
|
||||
}
|
||||
for (UUID playerId: game.getState().getPlayersInRange(sourceControllerId, game)) {
|
||||
if (!playerId.equals(sourceControllerId)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
|
|
Loading…
Add table
Reference in a new issue