Disable custom cards conformity check in Adventure mode.

This commit is contained in:
Jetz
2025-08-17 21:11:51 -04:00
parent 514519b45b
commit b8db0fea5e
2 changed files with 12 additions and 4 deletions

View File

@@ -112,7 +112,13 @@ public enum DeckFormat {
} }
}, },
PlanarConquest ( Range.of(40, Integer.MAX_VALUE), Range.is(0), 1), PlanarConquest ( Range.of(40, Integer.MAX_VALUE), Range.is(0), 1),
Adventure ( Range.of(40, Integer.MAX_VALUE), Range.of(0, Integer.MAX_VALUE), 4), Adventure ( Range.of(40, Integer.MAX_VALUE), Range.of(0, Integer.MAX_VALUE), 4) {
@Override
public boolean allowCustomCards() {
//If the player has them, may as well allow them.
return true;
}
},
Vanguard ( Range.of(60, Integer.MAX_VALUE), Range.is(0), 4), Vanguard ( Range.of(60, Integer.MAX_VALUE), Range.is(0), 4),
Planechase ( Range.of(60, Integer.MAX_VALUE), Range.is(0), 4), Planechase ( Range.of(60, Integer.MAX_VALUE), Range.is(0), 4),
Archenemy ( Range.of(60, Integer.MAX_VALUE), Range.is(0), 4), Archenemy ( Range.of(60, Integer.MAX_VALUE), Range.is(0), 4),
@@ -402,7 +408,7 @@ public enum DeckFormat {
// Should group all cards by name, so that different editions of same card are really counted as the same card // Should group all cards by name, so that different editions of same card are really counted as the same card
for (final Entry<String, Integer> cp : Aggregates.groupSumBy(allCards, pc -> StaticData.instance().getCommonCards().getName(pc.getName(), true))) { for (final Entry<String, Integer> cp : Aggregates.groupSumBy(allCards, pc -> StaticData.instance().getCommonCards().getName(pc.getName(), true))) {
IPaperCard simpleCard = StaticData.instance().getCommonCards().getCard(cp.getKey()); IPaperCard simpleCard = StaticData.instance().getCommonCards().getCard(cp.getKey());
if (simpleCard != null && simpleCard.getRules().isCustom() && !StaticData.instance().allowCustomCardsInDecksConformance()) if (simpleCard != null && simpleCard.getRules().isCustom() && !allowCustomCards())
return TextUtil.concatWithSpace("contains a Custom Card:", cp.getKey(), "\nPlease Enable Custom Cards in Forge Preferences to use this deck."); return TextUtil.concatWithSpace("contains a Custom Card:", cp.getKey(), "\nPlease Enable Custom Cards in Forge Preferences to use this deck.");
// Might cause issues since it ignores "Special" Cards // Might cause issues since it ignores "Special" Cards
if (simpleCard == null) { if (simpleCard == null) {
@@ -533,6 +539,10 @@ public enum DeckFormat {
// Not needed by default // Not needed by default
} }
public boolean allowCustomCards() {
return StaticData.instance().allowCustomCardsInDecksConformance();
}
public boolean isLegalCard(PaperCard pc) { public boolean isLegalCard(PaperCard pc) {
if (cardPoolFilter == null) { if (cardPoolFilter == null) {
if (paperCardPoolFilter == null) { if (paperCardPoolFilter == null) {

View File

@@ -298,8 +298,6 @@ public class SettingsScene extends UIScene {
Forge.getLocalizer().getMessage("lblRestartRequired") + ")", ForgePreferences.FPref.UI_LOAD_UNKNOWN_CARDS, this::restartForge); Forge.getLocalizer().getMessage("lblRestartRequired") + ")", ForgePreferences.FPref.UI_LOAD_UNKNOWN_CARDS, this::restartForge);
addCheckBox(Forge.getLocalizer().getMessage("lblEnableNonLegalCards") + " (" + addCheckBox(Forge.getLocalizer().getMessage("lblEnableNonLegalCards") + " (" +
Forge.getLocalizer().getMessage("lblRestartRequired") + ")", ForgePreferences.FPref.UI_LOAD_NONLEGAL_CARDS, this::restartForge); Forge.getLocalizer().getMessage("lblRestartRequired") + ")", ForgePreferences.FPref.UI_LOAD_NONLEGAL_CARDS, this::restartForge);
addCheckBox(Forge.getLocalizer().getMessage("lblAllowCustomCardsInDecks") + " (" +
Forge.getLocalizer().getMessage("lblRestartRequired") + ")", ForgePreferences.FPref.ALLOW_CUSTOM_CARDS_IN_DECKS_CONFORMANCE, this::restartForge);
addCheckBox(Forge.getLocalizer().getMessage("lblDisposeTextures"), ForgePreferences.FPref.UI_ENABLE_DISPOSE_TEXTURES); addCheckBox(Forge.getLocalizer().getMessage("lblDisposeTextures"), ForgePreferences.FPref.UI_ENABLE_DISPOSE_TEXTURES);
} }