mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Added generation of Zendikar Expeditions foils in BFZ booster packs.
This commit is contained in:
@@ -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 foilAtEndOfPack = hasFoil && edition.getFoilAlwaysInCommonSlot();
|
||||
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()) {
|
||||
String slotType = slot.getLeft(); // add expansion symbol here?
|
||||
@@ -88,7 +89,18 @@ public class BoosterGenerator {
|
||||
sheetsUsed.add(ps);
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
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")
|
||||
public static PrintSheet makeSheet(String sheetKey, Iterable<PaperCard> src) {
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
|
||||
private FoilType foilType = FoilType.NOT_SUPPORTED;
|
||||
private double foilChanceInBooster = 0;
|
||||
private boolean foilAlwaysInCommonSlot = false;
|
||||
private String additionalSheetForFoils = "";
|
||||
private final CardInSet[] cards;
|
||||
|
||||
|
||||
@@ -157,6 +158,7 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
|
||||
public FoilType getFoilType() { return foilType; }
|
||||
public double getFoilChanceInBooster() { return foilChanceInBooster; }
|
||||
public boolean getFoilAlwaysInCommonSlot() { return foilAlwaysInCommonSlot; }
|
||||
public String getAdditionalSheetForFoils() { return additionalSheetForFoils; }
|
||||
public CardInSet[] getCards() { return cards; }
|
||||
|
||||
/** 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.foilAlwaysInCommonSlot = section.getBoolean("FoilAlwaysInCommonSlot", true);
|
||||
|
||||
res.additionalSheetForFoils = section.get("AdditionalSheetForFoils", "");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -961,4 +961,31 @@ Vine Snare|ORI
|
||||
Wild Instincts|ORI
|
||||
Woodland Bellower|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
|
||||
|
||||
@@ -6,6 +6,7 @@ Code2=BFZ
|
||||
Type=Expansion
|
||||
BoosterCovers=5
|
||||
Booster=10 Common, 3 Uncommon, 1 RareMythic, 1 BasicLand BFZ
|
||||
AdditionalSheetForFoils=fromSheet("EXP Lands")
|
||||
|
||||
[cards]
|
||||
U Adverse Conditions
|
||||
|
||||
Reference in New Issue
Block a user