Added foil basic lands to FRF boosters and updated the way foil cards are generated to account for multiple cards in printsheets. There should now be a more equal distribution of foil rarity.

This commit is contained in:
Krazy
2015-01-24 18:27:14 +00:00
parent 31d1d7da8c
commit f3a30793c5
3 changed files with 22 additions and 3 deletions

View File

@@ -56,6 +56,11 @@ public class BoosterGenerator {
return StaticData.instance().getCommonCards().getFoiled(sheet.random(1, true).get(0));
}
private static PaperCard generateFoilCard(List<PaperCard> cardList) {
Collections.shuffle(cardList);
return StaticData.instance().getCommonCards().getFoiled(cardList.get(0));
}
public static List<PaperCard> getBoosterPack(SealedProduct.Template template) {
List<PaperCard> result = new ArrayList<>();
List<PrintSheet> sheetsUsed = new ArrayList<>();
@@ -87,8 +92,15 @@ public class BoosterGenerator {
}
if (hasFoil && foilAtEndOfPack) {
PrintSheet foilSheet = Aggregates.random(sheetsUsed);
result.add(generateFoilCard(foilSheet));
List<PaperCard> foilCards = new ArrayList<>();
for (PrintSheet printSheet : sheetsUsed) {
for (PaperCard card : printSheet.toFlatList()) {
if (!foilCards.contains(card)) {
foilCards.add(card);
}
}
}
result.add(generateFoilCard(foilCards));
}
return result;