mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
fix booster generation for quest modes
This commit is contained in:
@@ -61,7 +61,7 @@ public class BoosterGenerator {
|
|||||||
int numCards = slot.getRight().intValue();
|
int numCards = slot.getRight().intValue();
|
||||||
|
|
||||||
String[] sType = TextUtil.splitWithParenthesis(slotType, ' ', '(', ')');
|
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);
|
PrintSheet ps = getPrintSheet(sheetKey);
|
||||||
result.addAll(ps.random(numCards, true));
|
result.addAll(ps.random(numCards, true));
|
||||||
@@ -167,7 +167,7 @@ public class BoosterGenerator {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private static Predicate<CardPrinted> buildExtraPredicate(String[] operators) {
|
private static Predicate<CardPrinted> buildExtraPredicate(String[] operators) {
|
||||||
if ( operators.length == 0)
|
if ( operators.length <= 1)
|
||||||
return Predicates.alwaysTrue();
|
return Predicates.alwaysTrue();
|
||||||
|
|
||||||
List<Predicate<CardPrinted>> conditions = new ArrayList<Predicate<CardPrinted>>();
|
List<Predicate<CardPrinted>> conditions = new ArrayList<Predicate<CardPrinted>>();
|
||||||
|
|||||||
@@ -453,7 +453,7 @@ public final class QuestUtilCards {
|
|||||||
* @param count
|
* @param count
|
||||||
* the count
|
* the count
|
||||||
*/
|
*/
|
||||||
public void generateBoostersInShop(final int count) {
|
private void generateBoostersInShop(final int count) {
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
final int rollD100 = MyRandom.getRandom().nextInt(100);
|
final int rollD100 = MyRandom.getRandom().nextInt(100);
|
||||||
Predicate<CardEdition> filter = rollD100 < 40 ? this.filterT2booster
|
Predicate<CardEdition> filter = rollD100 < 40 ? this.filterT2booster
|
||||||
@@ -472,7 +472,7 @@ public final class QuestUtilCards {
|
|||||||
* @param count
|
* @param count
|
||||||
* the count
|
* the count
|
||||||
*/
|
*/
|
||||||
public void generateTournamentsInShop(final int count) {
|
private void generateTournamentsInShop(final int count) {
|
||||||
Predicate<CardEdition> formatFilter = CardEdition.Predicates.HAS_TOURNAMENT_PACK;
|
Predicate<CardEdition> formatFilter = CardEdition.Predicates.HAS_TOURNAMENT_PACK;
|
||||||
if (qc.getFormat() != null) {
|
if (qc.getFormat() != null) {
|
||||||
formatFilter = Predicates.and(formatFilter, isLegalInQuestFormat(qc.getFormat()));
|
formatFilter = Predicates.and(formatFilter, isLegalInQuestFormat(qc.getFormat()));
|
||||||
@@ -487,7 +487,7 @@ public final class QuestUtilCards {
|
|||||||
* @param count
|
* @param count
|
||||||
* the count
|
* the count
|
||||||
*/
|
*/
|
||||||
public void generateFatPacksInShop(final int count) {
|
private void generateFatPacksInShop(final int count) {
|
||||||
Predicate<CardEdition> formatFilter = CardEdition.Predicates.HAS_FAT_PACK;
|
Predicate<CardEdition> formatFilter = CardEdition.Predicates.HAS_FAT_PACK;
|
||||||
if (qc.getFormat() != null) {
|
if (qc.getFormat() != null) {
|
||||||
formatFilter = Predicates.and(formatFilter, isLegalInQuestFormat(qc.getFormat()));
|
formatFilter = Predicates.and(formatFilter, isLegalInQuestFormat(qc.getFormat()));
|
||||||
@@ -502,7 +502,7 @@ public final class QuestUtilCards {
|
|||||||
* @param count
|
* @param count
|
||||||
* the count
|
* the count
|
||||||
*/
|
*/
|
||||||
public void generatePreconsInShop(final int count) {
|
private void generatePreconsInShop(final int count) {
|
||||||
final List<PreconDeck> meetRequirements = new ArrayList<PreconDeck>();
|
final List<PreconDeck> meetRequirements = new ArrayList<PreconDeck>();
|
||||||
for (final PreconDeck deck : QuestController.getPrecons()) {
|
for (final PreconDeck deck : QuestController.getPrecons()) {
|
||||||
if (deck.getRecommendedDeals().meetsRequiremnts(this.qc.getAchievements()) &&
|
if (deck.getRecommendedDeals().meetsRequiremnts(this.qc.getAchievements()) &&
|
||||||
|
|||||||
Reference in New Issue
Block a user