Skip to content

Commit 312d28d

Browse files
committed
fix(draft): conspiracy cards work in custom cube drafts
- CustomLimited.parse(): merge DeckSection.Conspiracy into the card pool so cards like Backup Plan appear in packs alongside regular cards. - GauntletMini.startRound(): call assignConspiracies() on each player before starting the match (LoadDraftScreen already did this; Gauntlet mode was the missing path). - FDeckEditor CatalogPage: pass forceCreateIfAbsent=true to getPageForSection() in onCardActivated() and buildMenu() so the Conspiracy tab is created on demand when a conspiracy card is drafted. - BackupPlanService.initializeExtraHands(): guard each extra-hand draw with a library-size check to prevent a turn-0 game loss when a player holds multiple Backup Plans. Use getMaxHandSize() instead of hardcoded 7.
1 parent be880ac commit 312d28d

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

forge-gui/src/main/java/forge/gamemodes/limited/CustomLimited.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import forge.deck.CardPool;
2222
import forge.deck.Deck;
2323
import forge.deck.DeckBase;
24+
import forge.deck.DeckSection;
2425
import forge.item.PaperCard;
2526
import forge.item.SealedTemplate;
2627
import forge.model.FModel;
@@ -121,7 +122,16 @@ public static CustomLimited parse(final List<String> dfData, final IStorage<Deck
121122
cd.numPlayers = data.getInt("NumPlayers");
122123
cd.customRankingsFile = data.get("CustomRankings", "rankings_cubecobra.txt");
123124
final Deck deckCube = cubes.get(data.get("DeckFile"));
124-
cd.cardPool = deckCube == null ? ItemPool.createFrom(FModel.getMagicDb().getCommonCards().getUniqueCards(), PaperCard.class) : deckCube.getMain();
125+
if (deckCube == null) {
126+
cd.cardPool = ItemPool.createFrom(FModel.getMagicDb().getCommonCards().getUniqueCards(), PaperCard.class);
127+
} else {
128+
// Include conspiracy cards (e.g. Backup Plan) in the draft pool alongside regular cards
129+
CardPool pool = new CardPool(deckCube.getMain());
130+
if (deckCube.has(DeckSection.Conspiracy)) {
131+
pool.addAll(deckCube.get(DeckSection.Conspiracy));
132+
}
133+
cd.cardPool = pool;
134+
}
125135

126136
return cd;
127137
}

forge-gui/src/main/java/forge/gamemodes/limited/GauntletMini.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ private void startRound() {
139139
starter.add(human);
140140
starter.add(aiOpponents.get(currentRound - 1).setPlayer(GamePlayerUtil.createAiPlayer()));
141141

142+
for (final RegisteredPlayer pl : starter) {
143+
pl.assignConspiracies();
144+
}
145+
142146
hostedMatch = GuiBase.getInterface().hostMatch();
143147
hostedMatch.startMatch(gauntletType, null, starter, human, GuiBase.getInterface().getNewGuiGame());
144148
}

0 commit comments

Comments
 (0)