Add more theme data

This commit is contained in:
pfirpfel
2020-10-21 22:11:46 +02:00
parent 01992c62e6
commit 2b07183ef9
41 changed files with 90 additions and 14 deletions

View File

@@ -1,5 +1,8 @@
# Order, Tag, Label
1, DEFAULT, All sets (default)
2, CORE_SET, Core Sets
2, MASTER_SET, Masters Sets
3, RAVNICA, Ravnica (Plane)
11, MODERN, Modern legal expansions
12, PIONEER, Pioneer legal expansions
13, STANDARD, Standard legal expansions
21, CORE_SET, Core Sets
22, MASTERS_SET, Masters Sets (paper only)
31, RAVNICA, Ravnica (Plane)

View File

@@ -9,6 +9,7 @@ Border=White
BoosterCovers=1
Booster=11 Common, 3 Uncommon, 1 Rare
Foil=NotSupported
ChaosDraftThemes=CORE_SET
[cards]
163 U AEther Flash

View File

@@ -8,6 +8,7 @@ Type=Expansion
BoosterCovers=3
Booster=11 Common, 3 Uncommon, 1 Rare
FoilAlwaysInCommonSlot=False
ChaosDraftThemes=RAVNICA
[cards]
1 C Aurora Eidolon

View File

@@ -7,6 +7,7 @@ BoosterCovers=3
Booster=8 Common, 3 Uncommon, 2 RareMythic, 2 fromSheet("2XM Foils")
Foil=NotSupported
DoublePick=true
ChaosDraftThemes=MASTERS_SET
[cards]
1 M Karn Liberated

View File

@@ -7,6 +7,7 @@ MciCode=dgm
Type=Expansion
BoosterCovers=3
Booster=10 Common:!land, 3 Uncommon, 1 RareMythic:!land, 1 fromSheet("DGM Lands")
ChaosDraftThemes=RAVNICA
[cards]
1 C Boros Mastiff

View File

@@ -9,6 +9,7 @@ Border=White
BoosterCovers=5
Booster=10 Common, 3 Uncommon, 1 Rare, 1 BasicLand
FoilAlwaysInCommonSlot=False
ChaosDraftThemes=CORE_SET
[cards]
117 U Abyssal Specter

View File

@@ -7,6 +7,7 @@ Type=Reprint
BoosterCovers=3
Booster=11 Common, 3 Uncommon, 1 RareMythic
FoilChanceInBooster=100
ChaosDraftThemes=MASTERS_SET
[cards]
1 C Aven Riftwatcher

View File

@@ -9,6 +9,7 @@ Border=White
BoosterCovers=5
Booster=11 Common, 3 Uncommon, 1 Rare
Foil=NotSupported
ChaosDraftThemes=CORE_SET
[cards]
U AEther Storm

View File

@@ -9,6 +9,7 @@ Border=White
BoosterCovers=5
Booster=11 Common, 3 Uncommon, 1 Rare
Foil=NotSupported
ChaosDraftThemes=CORE_SET
[cards]
U Abomination

View File

@@ -7,6 +7,7 @@ MciCode=gtc
Type=Expansion
BoosterCovers=5
Booster=10 Common, 3 Uncommon, 1 RareMythic, 1 BasicLand RTR
ChaosDraftThemes=RAVNICA
[cards]
29 U AEtherize

View File

@@ -8,6 +8,7 @@ Type=Expansion
BoosterCovers=3
Booster=11 Common, 3 Uncommon, 1 Rare
FoilAlwaysInCommonSlot=False
ChaosDraftThemes=RAVNICA
[cards]
22 U AEtherplasm

View File

@@ -8,6 +8,7 @@ Type=Expansion
BoosterCovers=5
Booster=10 Common:!fromSheet("GRN Secret Cards"), 3 Uncommon:!fromSheet("GRN Secret Cards"), 1 RareMythic:!fromSheet("GRN Secret Cards"), 1 fromSheet("GRN Lands")
AdditionalSetUnlockedInQuest=GK1
ChaosDraftThemes=RAVNICA
[cards]
1 C Blade Instructor

View File

@@ -7,6 +7,7 @@ Type=Reprint
BoosterCovers=3
Booster=11 Common, 3 Uncommon, 1 RareMythic
FoilChanceInBooster=100
ChaosDraftThemes=MASTERS_SET
[cards]
1 C Scion of Ugin

View File

@@ -8,6 +8,7 @@ Type=Core
BoosterCovers=1
Booster=11 Common, 3 Uncommon, 1 Rare
Foil=NotSupported
ChaosDraftThemes=CORE_SET
[cards]
U Air Elemental

View File

@@ -7,6 +7,7 @@ MciCode=m10
Type=Core
BoosterCovers=5
Booster=10 Common, 3 Uncommon, 1 RareMythic, 1 BasicLand
ChaosDraftThemes=CORE_SET
[cards]
165 U Acidic Slime

View File

@@ -7,6 +7,7 @@ MciCode=m11
Type=Core
BoosterCovers=5
Booster=10 Common, 3 Uncommon, 1 RareMythic, 1 BasicLand
ChaosDraftThemes=CORE_SET
[cards]
41 C AEther Adept

View File

@@ -7,6 +7,7 @@ MciCode=m12
Type=Core
BoosterCovers=5
Booster=10 Common, 3 Uncommon, 1 RareMythic, 1 BasicLand
ChaosDraftThemes=CORE_SET
[cards]
41 C AEther Adept

View File

@@ -7,6 +7,7 @@ MciCode=m13
Type=Core
BoosterCovers=5
Booster=10 Common, 3 Uncommon, 1 RareMythic, 1 BasicLand
ChaosDraftThemes=CORE_SET
[cards]
159 U Acidic Slime

View File

@@ -7,6 +7,7 @@ MciCode=m14
Type=Core
BoosterCovers=5
Booster=10 Common, 3 Uncommon, 1 RareMythic, 1 BasicLand
ChaosDraftThemes=CORE_SET
[cards]
1 M Ajani, Caller of the Pride

View File

@@ -7,6 +7,7 @@ MciCode=m15
Type=Core
BoosterCovers=5
Booster=10 Common:!fromSheet("M15 Sample Cards"), 3 Uncommon:!fromSheet("M15 Sample Cards"), 1 RareMythic:!fromSheet("M15 Sample Cards"), 1 BasicLand
ChaosDraftThemes=CORE_SET
[cards]
1 M Ajani Steadfast

View File

@@ -7,6 +7,7 @@ MciCode=m19
Type=Core
BoosterCovers=5
Booster=10 Common:!fromSheet("M19 Secret Cards"), 3 Uncommon:!fromSheet("M19 Secret Cards"), 1 RareMythic:!fromSheet("M19 Secret Cards"), 1 fromSheet("M19 Lands")
ChaosDraftThemes=CORE_SET
[cards]
1 U Aegis of the Heavens

View File

@@ -6,6 +6,7 @@ MciCode=m20
Type=Core
BoosterCovers=3
Booster=10 Common:!fromSheet("M20 Secret Cards"), 3 Uncommon:!fromSheet("M20 Secret Cards"), 1 RareMythic:!fromSheet("M20 Secret Cards"), 1 fromSheet("M20 Lands")
ChaosDraftThemes=CORE_SET
[cards]
1 C Aerial Assault

View File

@@ -6,6 +6,7 @@ Type=Core
BoosterCovers=3
Booster=10 Common:!fromSheet("M21 Secret Cards"), 3 Uncommon:!fromSheet("M21 Secret Cards"), 1 RareMythic:!fromSheet("M21 Secret Cards"), 1 fromSheet("M21 Lands")
Prerelease=6 Boosters, 1 RareMythic+
ChaosDraftThemes=CORE_SET
[cards]
1 M Ugin, the Spirit Dragon

View File

@@ -7,6 +7,7 @@ MciCode=ori
Type=Core
BoosterCovers=5
Booster=10 Common:!fromSheet("ORI Sample Cards"), 3 Uncommon:!fromSheet("ORI Sample Cards"), 1 RareMythic:!fromSheet("ORI Sample Cards"), 1 BasicLand
ChaosDraftThemes=CORE_SET
[cards]
1 C Akroan Jailer

View File

@@ -7,6 +7,7 @@ Type=Reprint
BoosterCovers=3
Booster=11 Common, 3 Uncommon, 1 RareMythic
FoilChanceInBooster=100
ChaosDraftThemes=MASTERS_SET
[cards]
1 C Act of Heroism

View File

@@ -7,6 +7,7 @@ MciCode=mh1
Type=Other
BoosterCovers=5
Booster=10 Common:!fromSheet("MH1 Secret Cards"), 3 Uncommon:!fromSheet("MH1 Secret Cards"), 1 RareMythic:!fromSheet("MH1 Secret Cards"), 1 fromSheet("MH1 Lands")
ChaosDraftThemes=MASTERS_SET
[cards]

View File

@@ -7,6 +7,7 @@ Type=Reprint
BoosterCovers=3
Booster=11 Common, 3 Uncommon, 1 RareMythic
FoilChanceInBooster=100
ChaosDraftThemes=MASTERS_SET
[cards]
1 R All Is Dust

View File

@@ -7,6 +7,7 @@ Type=Reprint
BoosterCovers=3
Booster=11 Common, 3 Uncommon, 1 RareMythic
FoilChanceInBooster=100
ChaosDraftThemes=MASTERS_SET
[cards]
1 C Attended Knight

View File

@@ -7,6 +7,7 @@ Type=Reprint
BoosterCovers=3
Booster=11 Common, 3 Uncommon, 1 RareMythic
FoilChanceInBooster=100
ChaosDraftThemes=MASTERS_SET
[cards]
1 R Adarkar Valkyrie

View File

@@ -9,6 +9,7 @@ Border=White
BoosterCovers=5
Booster=10 Common, 3 Uncommon, 1 Rare, 1 BasicLand
FoilAlwaysInCommonSlot=False
ChaosDraftThemes=CORE_SET
[cards]
317 R Adarkar Wastes

View File

@@ -7,6 +7,7 @@ MciCode=rna
Type=Expansion
BoosterCovers=5
Booster=10 Common:!fromSheet("RNA Secret Cards"), 3 Uncommon:!fromSheet("RNA Secret Cards"), 1 RareMythic:!fromSheet("RNA Secret Cards"), 1 fromSheet("RNA Lands")
ChaosDraftThemes=RAVNICA
[cards]
1 M Angel of Grace

View File

@@ -8,6 +8,7 @@ Type=Expansion
BoosterCovers=5
Booster=11 Common, 3 Uncommon, 1 Rare
FoilAlwaysInCommonSlot=False
ChaosDraftThemes=RAVNICA
[cards]
190 R Agrus Kos, Wojek Veteran

View File

@@ -7,6 +7,7 @@ MciCode=rtr
Type=Expansion
BoosterCovers=5
Booster=10 Common, 3 Uncommon, 1 RareMythic, 1 BasicLand
ChaosDraftThemes=RAVNICA
[cards]
141 R Abrupt Decay

View File

@@ -9,6 +9,7 @@ Border=White
BoosterCovers=1
Booster=11 Common, 3 Uncommon, 1 Rare
Foil=NotSupported
ChaosDraftThemes=CORE_SET
[cards]
U Air Elemental

View File

@@ -10,6 +10,7 @@ BoosterCovers=5
Booster=10 Common, 3 Uncommon, 1 Rare, 1 BasicLand
Foil=OldStyle
FoilAlwaysInCommonSlot=False
ChaosDraftThemes=CORE_SET
[cards]
172 U AEther Flash

View File

@@ -7,6 +7,7 @@ MciCode=10e
Type=Core
BoosterCovers=5
Booster=10 Common, 3 Uncommon, 1 Rare, 1 BasicLand
ChaosDraftThemes=CORE_SET
[cards]
249 R Abundance

View File

@@ -8,6 +8,7 @@ Type=Reprint
BoosterCovers=3
Booster=11 Common, 3 Uncommon, 1 RareMythic
FoilChanceInBooster=100
ChaosDraftThemes=MASTERS_SET
[cards]
1 R All Is Dust

View File

@@ -9,6 +9,7 @@ Border=White
BoosterCovers=1
Booster=11 Common, 3 Uncommon, 1 Rare
Foil=NotSupported
ChaosDraftThemes=CORE_SET
[cards]
U Air Elemental

View File

@@ -8,6 +8,7 @@ Type=Expansion
BoosterCovers=3
Booster=10 Common:!fromSheet("WAR Secret Cards"), 3 Uncommon:!fromSheet("WAR Secret Cards"), 1 RareMythic:!fromSheet("WAR Secret Cards"), 1 BasicLand
BoosterMustContain=Planeswalker
ChaosDraftThemes=RAVNICA
[cards]
1 R Karn, the Great Creator

View File

@@ -186,9 +186,10 @@ public class BoosterDraft implements IBoosterDraft {
for (final ThemedChaosDraft theme : themeStorage) {
themes.add(theme);
}
Collections.sort(themes);
// TODO test oneOrNone behaviour
final ThemedChaosDraft theme = SGuiChoose.oneOrNone(Localizer.getInstance().getMessage("lblChooseChaosTheme"), themes);
final String dialogQuestion = Localizer.getInstance().getMessage("lblChooseChaosTheme");
final ThemedChaosDraft theme = SGuiChoose.oneOrNone(dialogQuestion, themes);
if (theme == null) {
return false;
}
@@ -196,7 +197,9 @@ public class BoosterDraft implements IBoosterDraft {
final Predicate<CardEdition> themeFilter = theme.getEditionFilter();
final CardEdition.Collection allEditions = StaticData.instance().getEditions();
final Iterable<CardEdition> chaosDraftEditions = Iterables.filter(allEditions.getOrderedEditions(), themeFilter);
final Iterable<CardEdition> chaosDraftEditions = Iterables.filter(
allEditions.getOrderedEditions(),
themeFilter);
final Supplier<List<PaperCard>> ChaosDraftSupplier;
try{

View File

@@ -4,6 +4,8 @@ import com.google.common.base.Function;
import com.google.common.base.Predicate;
import forge.card.CardEdition;
import forge.game.GameFormat;
import forge.model.FModel;
import forge.util.TextUtil;
import forge.util.storage.StorageReaderFile;
import org.apache.commons.lang3.tuple.Pair;
@@ -45,12 +47,20 @@ public class ThemedChaosDraft implements Comparable<ThemedChaosDraft> {
public int getOrderNumber() { return orderNumber; }
public Predicate<CardEdition> getEditionFilter() {
if (!tag.equals("DEFAULT")) {
System.out.println("Return themed filter for " + tag); // TODO remove
return themedFilter;
Predicate<CardEdition> filter;
switch(tag) {
case "DEFAULT":
filter = DEFAULT_FILTER;
break;
case "MODERN":
case "PIONEER":
case "STANDARD":
filter = getFormatFilter(tag);
break;
default:
filter = themedFilter;
}
System.out.println("Return default filter"); // TODO remove
return DEFAULT_FILTER;
return filter;
}
private final Predicate<CardEdition> themedFilter = new Predicate<CardEdition>() {
@@ -64,6 +74,28 @@ public class ThemedChaosDraft implements Comparable<ThemedChaosDraft> {
}
};
private Predicate<CardEdition> getFormatFilter(String formatName) {
GameFormat.Collection formats = FModel.getFormats();
GameFormat format;
switch(formatName) {
case "MODERN":
format = formats.getModern();
break;
case "PIONEER":
format = formats.getPioneer();
break;
case "STANDARD":
default:
format = formats.getStandard();
}
return new Predicate<CardEdition>() {
@Override
public boolean apply(final CardEdition cardEdition){
return format.isSetLegal(cardEdition.getCode());
}
};
}
private static final Predicate<CardEdition> DEFAULT_FILTER = new Predicate<CardEdition>() {
@Override
public boolean apply(final CardEdition cardEdition) {
@@ -116,9 +148,9 @@ public class ThemedChaosDraft implements Comparable<ThemedChaosDraft> {
*/
@Override
public int compareTo(ThemedChaosDraft other) {
int order = this.orderNumber - other.orderNumber;
if (order != 0) return order;
return this.label.compareTo(other.label);
return (this.orderNumber != other.orderNumber)
? this.orderNumber - other.orderNumber
: this.label.compareTo(other.label);
}
/*