- Added generation of Zendikar Expeditions foils in BFZ booster packs.

This commit is contained in:
Agetian
2015-09-26 19:09:24 +00:00
parent 198589b6dd
commit 218feb0987
4 changed files with 58 additions and 2 deletions

View File

@@ -70,6 +70,7 @@ public class BoosterGenerator {
boolean hasFoil = edition != null && !template.getSlots().isEmpty() && MyRandom.getRandom().nextDouble() < edition.getFoilChanceInBooster() && edition.getFoilType() != FoilType.NOT_SUPPORTED; boolean hasFoil = edition != null && !template.getSlots().isEmpty() && MyRandom.getRandom().nextDouble() < edition.getFoilChanceInBooster() && edition.getFoilType() != FoilType.NOT_SUPPORTED;
boolean foilAtEndOfPack = hasFoil && edition.getFoilAlwaysInCommonSlot(); boolean foilAtEndOfPack = hasFoil && edition.getFoilAlwaysInCommonSlot();
String foilSlot = !hasFoil ? null : foilAtEndOfPack ? BoosterSlots.COMMON : Aggregates.random(template.getSlots()).getKey(); String foilSlot = !hasFoil ? null : foilAtEndOfPack ? BoosterSlots.COMMON : Aggregates.random(template.getSlots()).getKey();
String extraFoilSheetKey = edition != null ? edition.getAdditionalSheetForFoils() : "";
for(Pair<String, Integer> slot : template.getSlots()) { for(Pair<String, Integer> slot : template.getSlots()) {
String slotType = slot.getLeft(); // add expansion symbol here? String slotType = slot.getLeft(); // add expansion symbol here?
@@ -88,7 +89,18 @@ public class BoosterGenerator {
sheetsUsed.add(ps); sheetsUsed.add(ps);
if (foilInThisSlot && !foilAtEndOfPack) { if (foilInThisSlot && !foilAtEndOfPack) {
result.add(generateFoilCard(ps)); if (!extraFoilSheetKey.isEmpty()) {
List<PaperCard> foilCards = new ArrayList<>();
for (PaperCard card : ps.toFlatList()) {
if (!foilCards.contains(card)) {
foilCards.add(card);
}
}
addCardsFromExtraSheet(foilCards, sheetKey);
result.add(generateFoilCard(foilCards));
} else {
result.add(generateFoilCard(ps));
}
} }
} }
@@ -101,12 +113,24 @@ public class BoosterGenerator {
} }
} }
} }
if (!extraFoilSheetKey.isEmpty()) {
addCardsFromExtraSheet(foilCards, extraFoilSheetKey);
}
result.add(generateFoilCard(foilCards)); result.add(generateFoilCard(foilCards));
} }
return result; return result;
} }
public static void addCardsFromExtraSheet(List<PaperCard> dest, String printSheetKey) {
PrintSheet extraSheet = getPrintSheet(printSheetKey);
for (PaperCard card : extraSheet.toFlatList()) {
if (!dest.contains(card)) {
dest.add(card);
}
}
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static PrintSheet makeSheet(String sheetKey, Iterable<PaperCard> src) { public static PrintSheet makeSheet(String sheetKey, Iterable<PaperCard> src) {

View File

@@ -105,6 +105,7 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
private FoilType foilType = FoilType.NOT_SUPPORTED; private FoilType foilType = FoilType.NOT_SUPPORTED;
private double foilChanceInBooster = 0; private double foilChanceInBooster = 0;
private boolean foilAlwaysInCommonSlot = false; private boolean foilAlwaysInCommonSlot = false;
private String additionalSheetForFoils = "";
private final CardInSet[] cards; private final CardInSet[] cards;
@@ -157,6 +158,7 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
public FoilType getFoilType() { return foilType; } public FoilType getFoilType() { return foilType; }
public double getFoilChanceInBooster() { return foilChanceInBooster; } public double getFoilChanceInBooster() { return foilChanceInBooster; }
public boolean getFoilAlwaysInCommonSlot() { return foilAlwaysInCommonSlot; } public boolean getFoilAlwaysInCommonSlot() { return foilAlwaysInCommonSlot; }
public String getAdditionalSheetForFoils() { return additionalSheetForFoils; }
public CardInSet[] getCards() { return cards; } public CardInSet[] getCards() { return cards; }
/** The Constant fnGetName. */ /** The Constant fnGetName. */
@@ -291,6 +293,8 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
res.foilChanceInBooster = section.getDouble("FoilChanceInBooster", 21.43F) / 100.0F; res.foilChanceInBooster = section.getDouble("FoilChanceInBooster", 21.43F) / 100.0F;
res.foilAlwaysInCommonSlot = section.getBoolean("FoilAlwaysInCommonSlot", true); res.foilAlwaysInCommonSlot = section.getBoolean("FoilAlwaysInCommonSlot", true);
res.additionalSheetForFoils = section.get("AdditionalSheetForFoils", "");
return res; return res;
} }

View File

@@ -962,3 +962,30 @@ Wild Instincts|ORI
Woodland Bellower|ORI Woodland Bellower|ORI
Yeva's Forcemage|ORI Yeva's Forcemage|ORI
Zendikar's Roil|ORI Zendikar's Roil|ORI
[EXP Lands]
Prairie Stream|EXP
Sunken Hollow|EXP
Smoldering Marsh|EXP
Cinder Glade|EXP
Canopy Vista|EXP
Hallowed Fountain|EXP
Watery Grave|EXP
Blood Crypt|EXP
Stomping Ground|EXP
Temple Garden|EXP
Godless Shrine|EXP
Steam Vents|EXP
Overgrown Tomb|EXP
Sacred Foundry|EXP
Breeding Pool|EXP
Flooded Strand|EXP
Polluted Delta|EXP
Bloodstained Mire|EXP
Wooded Foothills|EXP
Windswept Heath|EXP
Marsh Flats|EXP
Scalding Tarn|EXP
Verdant Catacombs|EXP
Arid Mesa|EXP
Misty Rainforest|EXP

View File

@@ -6,6 +6,7 @@ Code2=BFZ
Type=Expansion Type=Expansion
BoosterCovers=5 BoosterCovers=5
Booster=10 Common, 3 Uncommon, 1 RareMythic, 1 BasicLand BFZ Booster=10 Common, 3 Uncommon, 1 RareMythic, 1 BasicLand BFZ
AdditionalSheetForFoils=fromSheet("EXP Lands")
[cards] [cards]
U Adverse Conditions U Adverse Conditions