mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +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 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,9 +89,20 @@ public class BoosterGenerator {
|
|||||||
sheetsUsed.add(ps);
|
sheetsUsed.add(ps);
|
||||||
|
|
||||||
if (foilInThisSlot && !foilAtEndOfPack) {
|
if (foilInThisSlot && !foilAtEndOfPack) {
|
||||||
|
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));
|
result.add(generateFoilCard(ps));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (hasFoil && foilAtEndOfPack) {
|
if (hasFoil && foilAtEndOfPack) {
|
||||||
List<PaperCard> foilCards = new ArrayList<>();
|
List<PaperCard> foilCards = new ArrayList<>();
|
||||||
@@ -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) {
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user