From f3a30793c5bfd67dccfc16bb81c6f83bd9dd6d50 Mon Sep 17 00:00:00 2001 From: Krazy Date: Sat, 24 Jan 2015 18:27:14 +0000 Subject: [PATCH] Added foil basic lands to FRF boosters and updated the way foil cards are generated to account for multiple cards in printsheets. There should now be a more equal distribution of foil rarity. --- .../main/java/forge/card/BoosterGenerator.java | 16 ++++++++++++++-- forge-gui/res/blockdata/printsheets.txt | 7 +++++++ forge-gui/res/editions/Fate Reforged.txt | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/forge-core/src/main/java/forge/card/BoosterGenerator.java b/forge-core/src/main/java/forge/card/BoosterGenerator.java index 08655a298b0..88c13810fcc 100644 --- a/forge-core/src/main/java/forge/card/BoosterGenerator.java +++ b/forge-core/src/main/java/forge/card/BoosterGenerator.java @@ -56,6 +56,11 @@ public class BoosterGenerator { return StaticData.instance().getCommonCards().getFoiled(sheet.random(1, true).get(0)); } + private static PaperCard generateFoilCard(List cardList) { + Collections.shuffle(cardList); + return StaticData.instance().getCommonCards().getFoiled(cardList.get(0)); + } + public static List getBoosterPack(SealedProduct.Template template) { List result = new ArrayList<>(); List sheetsUsed = new ArrayList<>(); @@ -87,8 +92,15 @@ public class BoosterGenerator { } if (hasFoil && foilAtEndOfPack) { - PrintSheet foilSheet = Aggregates.random(sheetsUsed); - result.add(generateFoilCard(foilSheet)); + List foilCards = new ArrayList<>(); + for (PrintSheet printSheet : sheetsUsed) { + for (PaperCard card : printSheet.toFlatList()) { + if (!foilCards.contains(card)) { + foilCards.add(card); + } + } + } + result.add(generateFoilCard(foilCards)); } return result; diff --git a/forge-gui/res/blockdata/printsheets.txt b/forge-gui/res/blockdata/printsheets.txt index c12e459c233..44a274dcbe3 100644 --- a/forge-gui/res/blockdata/printsheets.txt +++ b/forge-gui/res/blockdata/printsheets.txt @@ -38,6 +38,13 @@ 45 Tranquil Cove|FRF 45 Wind-Scarred Crag|FRF +[FRF Basic Lands] +1 Swamp|FRF +1 Plains|FRF +1 Forest|FRF +1 Mountain|FRF +1 Island|FRF + [GTC Boros Guild] 1 Act of Treason|GTC 1 Aerial Maneuver|GTC diff --git a/forge-gui/res/editions/Fate Reforged.txt b/forge-gui/res/editions/Fate Reforged.txt index 3794b2d04a3..57c61973e7c 100644 --- a/forge-gui/res/editions/Fate Reforged.txt +++ b/forge-gui/res/editions/Fate Reforged.txt @@ -4,7 +4,7 @@ Date=2015-01-23 Name=Fate Reforged Type=Expansion BoosterCovers=3 -Booster=10 Common:!land, 3 Uncommon, 1 RareMythic, 1 fromSheet("FRF Lands") +Booster=10 Common:!land, 3 Uncommon, 1 RareMythic, 1 fromSheet("FRF Lands"), 0 fromSheet("FRF Basic Lands") [cards] M Ugin, the Spirit Dragon