mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
* Crop Sigil - Fixed that it can't be activated without both a creature and land in the graveyard (fixes #2079 ).
This commit is contained in:
parent
97e44d1000
commit
88d66784df
4 changed files with 19 additions and 21 deletions
|
|
@ -24,21 +24,19 @@
|
|||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
*/
|
||||
package mage.target;
|
||||
|
||||
import mage.constants.Zone;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Cards;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Cards;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -87,9 +85,12 @@ public class TargetCard extends TargetObject {
|
|||
@Override
|
||||
public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
|
||||
int possibleTargets = 0;
|
||||
for (UUID playerId: game.getState().getPlayersInRange(sourceControllerId, game)) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(sourceControllerId, game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
if (this.minNumberOfTargets == 0) {
|
||||
return true;
|
||||
}
|
||||
switch (zone) {
|
||||
case HAND:
|
||||
for (Card card : player.getHand().getCards(filter, sourceId, sourceControllerId, game)) {
|
||||
|
|
@ -200,7 +201,7 @@ public class TargetCard extends TargetObject {
|
|||
|
||||
public Set<UUID> possibleTargets(UUID sourceControllerId, Cards cards, Game game) {
|
||||
Set<UUID> possibleTargets = new HashSet<>();
|
||||
for (Card card: cards.getCards(filter, game)) {
|
||||
for (Card card : cards.getCards(filter, game)) {
|
||||
possibleTargets.add(card.getId());
|
||||
}
|
||||
return possibleTargets;
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ public class Targets extends ArrayList<Target> {
|
|||
}
|
||||
}
|
||||
// it is legal when either there is no target or not all targets are illegal
|
||||
return this.size() == 0 || this.size() != illegalCount;
|
||||
return this.isEmpty() || this.size() != illegalCount;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ package mage.target.common;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Cards;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
|
@ -122,10 +122,7 @@ public class TargetCardInYourGraveyard extends TargetCard {
|
|||
*/
|
||||
@Override
|
||||
public boolean canChoose(UUID sourceControllerId, Game game) {
|
||||
if (game.getPlayer(sourceControllerId).getGraveyard().count(filter, game) >= this.minNumberOfTargets) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return game.getPlayer(sourceControllerId).getGraveyard().count(filter, game) >= this.minNumberOfTargets;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue