From e9000fa6b7ea887727e96fc194e03d0dc72c43ef Mon Sep 17 00:00:00 2001 From: Agetian Date: Sat, 24 Jan 2015 05:28:05 +0000 Subject: [PATCH] - Temporarily reintroduced the processing of !fromSheet (only in its inverted form) to fix M15 and CNS booster generation without breaking KTK/DGM booster generation (until a better solution is introduced). --- forge-core/src/main/java/forge/card/BoosterGenerator.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/forge-core/src/main/java/forge/card/BoosterGenerator.java b/forge-core/src/main/java/forge/card/BoosterGenerator.java index 8b2be2c75bb..d6ae4db05d3 100644 --- a/forge-core/src/main/java/forge/card/BoosterGenerator.java +++ b/forge-core/src/main/java/forge/card/BoosterGenerator.java @@ -188,6 +188,14 @@ public class BoosterGenerator { operator = StringUtils.strip(operator.substring(4), "() "); String[] cardNames = TextUtil.splitWithParenthesis(operator, ',', '"', '"'); toAdd = IPaperCard.Predicates.names(Lists.newArrayList(cardNames)); + } else if (operator.startsWith("fromSheet(") && invert) { + String sheetName = StringUtils.strip(operator.substring(9), "()\" "); + Iterable src = StaticData.instance().getPrintSheets().get(sheetName).toFlatList(); + ArrayList cardNames = Lists.newArrayList(); + for (PaperCard card : src) { + cardNames.add(card.getName()); + } + toAdd = IPaperCard.Predicates.names(Lists.newArrayList(cardNames)); } if(toAdd == null)