Merge branch 'jmp-packs' into 'master'

Playing Jumpstart with Sealed play

See merge request core-developers/forge!3056
This commit is contained in:
Michael Kamensky
2020-08-12 04:31:07 +00:00
5 changed files with 2074 additions and 4 deletions

View File

@@ -78,6 +78,16 @@ public class PrintSheet {
return fetchRoulette(sum + 1, roulette, toSkip); // start over from beginning, in case last cards were to skip
}
public List<PaperCard> all() {
List<PaperCard> result = new ArrayList<>();
for(Entry<PaperCard, Integer> kv : cardsWithWeights) {
for(int i = 0; i < kv.getValue(); i++) {
result.add(kv.getKey());
}
}
return result;
}
public List<PaperCard> random(int number, boolean wantUnique) {
List<PaperCard> result = new ArrayList<>();

View File

@@ -229,6 +229,13 @@ public class BoosterGenerator {
String sheetKey = StaticData.instance().getEditions().contains(setCode) ? slotType.trim() + " " + setCode
: slotType.trim();
if (sheetKey.startsWith("wholeSheet")) {
PrintSheet ps = getPrintSheet(sheetKey);
result.addAll(ps.all());
sheetsUsed.add(ps);
continue;
}
slotType = slotType.split("[ :!]")[0]; // add expansion symbol here?
boolean foilInThisSlot = hasFoil && (slotType.equals(foilSlot));
@@ -438,9 +445,10 @@ public class BoosterGenerator {
String mainCode = itMod.next();
if (mainCode.regionMatches(true, 0, "fromSheet", 0, 9)) { // custom print sheet
String sheetName = StringUtils.strip(mainCode.substring(9), "()\" ");
if (mainCode.regionMatches(true, 0, "fromSheet", 0, 9) ||
mainCode.regionMatches(true, 0, "wholeSheet", 0, 10)
) { // custom print sheet
String sheetName = StringUtils.strip(mainCode.substring(10), "()\" ");
src = StaticData.instance().getPrintSheets().get(sheetName).toFlatList();
setPred = Predicates.alwaysTrue();