From 7ccb925d76fea435e5dd910bcf22f941ac476b0b Mon Sep 17 00:00:00 2001 From: Chris H Date: Fri, 25 Jul 2025 19:10:12 -0400 Subject: [PATCH] Some handling for the 4 Arena cards that are no longer associated to an edition file (#8207) --- .../main/java/forge/CardStorageReader.java | 4 ++- .../src/main/java/forge/card/CardDb.java | 4 +-- .../src/main/java/forge/card/CardRules.java | 4 +++ .../Archenemy Nicol Bolas Schemes.txt | 29 +++++++++++++++++++ 4 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 forge-gui/res/editions/Archenemy Nicol Bolas Schemes.txt diff --git a/forge-core/src/main/java/forge/CardStorageReader.java b/forge-core/src/main/java/forge/CardStorageReader.java index 299daf39804..063150bec88 100644 --- a/forge-core/src/main/java/forge/CardStorageReader.java +++ b/forge-core/src/main/java/forge/CardStorageReader.java @@ -391,7 +391,9 @@ public class CardStorageReader { try (InputStream fileInputStream = java.nio.file.Files.newInputStream(file.toPath())) { reader.reset(); final List lines = readScript(fileInputStream); - return reader.readCard(lines, Files.getNameWithoutExtension(file.getName())); + CardRules rules = reader.readCard(lines, Files.getNameWithoutExtension(file.getName())); + rules.setPath(file.getPath()); + return rules; } catch (final FileNotFoundException ex) { throw new RuntimeException("CardReader : run error -- file not found: " + file.getPath(), ex); } catch (final Exception ex) { diff --git a/forge-core/src/main/java/forge/card/CardDb.java b/forge-core/src/main/java/forge/card/CardDb.java index 3b4aa4e321a..55228e96d30 100644 --- a/forge-core/src/main/java/forge/card/CardDb.java +++ b/forge-core/src/main/java/forge/card/CardDb.java @@ -434,13 +434,13 @@ public final class CardDb implements ICardDatabase, IDeckGenPool { } if (upcomingSet != null) { - System.err.println("Upcoming set " + upcomingSet + " dated in the future. All unaccounted cards will be added to this set with unknown rarity."); + System.err.println("Upcoming set " + upcomingSet + " dated in the future. All `upcoming` cards will be added to this set with unknown rarity."); } for (CardRules cr : rulesByName.values()) { if (!contains(cr.getName())) { if (!cr.isCustom()) { - if (upcomingSet != null) { + if (upcomingSet != null && cr.getPath().contains("/upcoming/")) { addCard(new PaperCard(cr, upcomingSet.getCode(), CardRarity.Unknown)); } else if (enableUnknownCards && !this.filtered.contains(cr.getName())) { System.err.println("The card " + cr.getName() + " was not assigned to any set. Adding it to UNKNOWN set... to fix see res/editions/ folder. "); diff --git a/forge-core/src/main/java/forge/card/CardRules.java b/forge-core/src/main/java/forge/card/CardRules.java index f1a891e1511..8b58415977a 100644 --- a/forge-core/src/main/java/forge/card/CardRules.java +++ b/forge-core/src/main/java/forge/card/CardRules.java @@ -53,6 +53,7 @@ public final class CardRules implements ICardCharacteristics { private boolean addsWildCardColor; private int setColorID; private boolean custom; + private String path; public CardRules(ICardFace[] faces, CardSplitType altMode, CardAiHints cah) { splitType = altMode; @@ -193,6 +194,9 @@ public final class CardRules implements ICardCharacteristics { public String getNormalizedName() { return normalizedName; } public void setNormalizedName(String filename) { normalizedName = filename; } + public String getPath() { return path; } + public void setPath(String path) { this.path = path; } + public CardAiHints getAiHints() { return aiHints; } diff --git a/forge-gui/res/editions/Archenemy Nicol Bolas Schemes.txt b/forge-gui/res/editions/Archenemy Nicol Bolas Schemes.txt new file mode 100644 index 00000000000..150c32c2d9a --- /dev/null +++ b/forge-gui/res/editions/Archenemy Nicol Bolas Schemes.txt @@ -0,0 +1,29 @@ +[metadata] +Code=OE01 +Date=2017-06-16 +Name=Archenemy: Nicol Bolas Schemes +Type=Multiplayer +ScryfallCode=OE01 + +[cards] + +1* C Because I Have Willed It @Adrian Majkrzak +2* C Behold My Grandeur @Zack Stella +3* C Bow to My Command @Dan Murayama Scott +4* C Choose Your Demise @Nils Hamm +5* C Delight in the Hunt @Titus Lunter +6* C Every Dream a Nightmare @Mathias Kollros +7* C For Each of You, a Gift @Marco Nelor +8* C Know Evil @Anthony Palumbo +9* C Make Yourself Useful @David Gaillet +10* C The Mighty Will Fall @Volkan Baǵa +11* C My Forces Are Innumerable @Seb McKinnon +12* C My Laughter Echoes @Steve Argyle +13* C No One Will Hear Your Cries @McLean Kendree +14* C Pay Tribute to Me @Aaron Miller +15* C Power Without Equal @Christine Choi +16* C A Reckoning Approaches @Yeong-Hao Han +17* C There Is No Refuge @Tomasz Jedruszek +18* C This World Belongs to Me @Min Yum +19* C What's Yours Is Now Mine @Steve Argyle +20* C When Will You Learn? @Yohann Schepacz