mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Uses more reliable way to detect sets with all basic lands present
This commit is contained in:
@@ -32,6 +32,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import forge.Constant;
|
||||
import forge.Singletons;
|
||||
import forge.game.GameFormat;
|
||||
import forge.util.FileSection;
|
||||
@@ -247,7 +248,11 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
|
||||
public static final Predicate<CardEdition> hasBasicLands = new Predicate<CardEdition>() {
|
||||
@Override
|
||||
public boolean apply(CardEdition ed) {
|
||||
return null != CardDb.instance().tryGetCard("Plains", ed.getCode(), 0);
|
||||
for(String landName : Constant.Color.BASIC_LANDS) {
|
||||
if (null == CardDb.instance().tryGetCard(landName, ed.getCode(), 0))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -98,9 +98,12 @@ public final class QuestUtilCards {
|
||||
|
||||
if (usedFormat != null) {
|
||||
List<String> availableEditions = usedFormat.getAllowedSetCodes();
|
||||
for (String edition : availableEditions) {
|
||||
if (null != db.tryGetCard("Plains", edition)) {
|
||||
landCodes.add(edition);
|
||||
|
||||
for (String edCode : availableEditions) {
|
||||
CardEdition ed = Singletons.getModel().getEditions().get(edCode);
|
||||
// Duel decks might have only 2 types of basic lands
|
||||
if( CardEdition.Predicates.hasBasicLands.apply(ed) ) {
|
||||
landCodes.add(edCode);
|
||||
}
|
||||
}
|
||||
if (usedFormat.isSetLegal("ICE")) {
|
||||
|
||||
Reference in New Issue
Block a user