mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08: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
|
|
@ -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
Add a link
Reference in a new issue