fix booster generation for quest modes

This commit is contained in:
Maxmtg
2013-04-26 03:07:14 +00:00
parent 423e3c6efa
commit 68fcb019ae
2 changed files with 6 additions and 6 deletions

View File

@@ -61,7 +61,7 @@ public class BoosterGenerator {
int numCards = slot.getRight().intValue();
String[] sType = TextUtil.splitWithParenthesis(slotType, ' ', '(', ')');
String sheetKey = sType.length == 1 ? slotType.trim() + " " + booster.getEdition() : slotType.trim();
String sheetKey = sType.length == 1 && booster.getEdition() != null ? slotType.trim() + " " + booster.getEdition() : slotType.trim();
PrintSheet ps = getPrintSheet(sheetKey);
result.addAll(ps.random(numCards, true));
@@ -167,7 +167,7 @@ public class BoosterGenerator {
* @return
*/
private static Predicate<CardPrinted> buildExtraPredicate(String[] operators) {
if ( operators.length == 0)
if ( operators.length <= 1)
return Predicates.alwaysTrue();
List<Predicate<CardPrinted>> conditions = new ArrayList<Predicate<CardPrinted>>();

View File

@@ -453,7 +453,7 @@ public final class QuestUtilCards {
* @param count
* the count
*/
public void generateBoostersInShop(final int count) {
private void generateBoostersInShop(final int count) {
for (int i = 0; i < count; i++) {
final int rollD100 = MyRandom.getRandom().nextInt(100);
Predicate<CardEdition> filter = rollD100 < 40 ? this.filterT2booster
@@ -472,7 +472,7 @@ public final class QuestUtilCards {
* @param count
* the count
*/
public void generateTournamentsInShop(final int count) {
private void generateTournamentsInShop(final int count) {
Predicate<CardEdition> formatFilter = CardEdition.Predicates.HAS_TOURNAMENT_PACK;
if (qc.getFormat() != null) {
formatFilter = Predicates.and(formatFilter, isLegalInQuestFormat(qc.getFormat()));
@@ -487,7 +487,7 @@ public final class QuestUtilCards {
* @param count
* the count
*/
public void generateFatPacksInShop(final int count) {
private void generateFatPacksInShop(final int count) {
Predicate<CardEdition> formatFilter = CardEdition.Predicates.HAS_FAT_PACK;
if (qc.getFormat() != null) {
formatFilter = Predicates.and(formatFilter, isLegalInQuestFormat(qc.getFormat()));
@@ -502,7 +502,7 @@ public final class QuestUtilCards {
* @param count
* the count
*/
public void generatePreconsInShop(final int count) {
private void generatePreconsInShop(final int count) {
final List<PreconDeck> meetRequirements = new ArrayList<PreconDeck>();
for (final PreconDeck deck : QuestController.getPrecons()) {
if (deck.getRecommendedDeals().meetsRequiremnts(this.qc.getAchievements()) &&