Skip to content

Duel Commander - #12090

Open
carldouglasbergentz-pixel wants to merge 13 commits into
Card-Forge:masterfrom
carldouglasbergentz-pixel:duel-commander
Open

carldouglasbergentz-pixel wants to merge 13 commits into
Card-Forge:masterfrom
carldouglasbergentz-pixel:duel-commander

Conversation

@carldouglasbergentz-pixel

@carldouglasbergentz-pixel carldouglasbergentz-pixel commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Adds Duel Commander as a game type and deck format, following the official rules at duelcommander.org (v2025.09.29) and its ban list (updated 2026-07-27).

This continues #6596 by @misha-colbourne, who said in #9156 that anyone was welcome to take it over. Thank you, Misha, for the groundwork. After #11885 the branch no longer rebased, so I re-implemented it on current master with #6596 as the blueprint. Misha is co-author on every commit that ports their work.

Closes #9156. Supersedes #6596.

Rules

Rule How
20 starting life (401.1) RegisteredPlayer. The base total, so other variants still layer on top.
No commander damage loss (403.1) Skipped in Player, as for Brawl and Tiny Leaders.
London mulligan (401.2) No change needed: a 2-player game already has no free first mulligan.
903.9a/b command zone choice Duel Commander joins the 903.9a graveyard/exile check. 903.9b works as in Commander.
Partners: only the first commander cast from the command zone stays castable there (404.1–404.4) A new NoOtherCommanderCastFromCommandZone card property on the commander effect's MayPlay. It reads the existing per-commander cast count, the one commander tax uses. Casting from other zones (e.g. after Command Beacon) is unaffected, and other variants don't get the property. The locked commander's card text says why it can't be cast.
Deck: 99 + commander, singleton (301) DeckFormat.DuelCommander.
No sideboard, but a companion is allowed (302.1, 302.2) The sideboard may hold at most one card, and only a companion that isn't banned as one.
Banned / banned as commander / banned as companion (304.2) res/formats/Casual/DuelCommander.txt. Format files can now name BannedAsCommander and BannedAsCompanion, read into GameFormat.DeckRules beside #12522's deck rules, so the lists stay editable without code changes, as suggested in #6596. A card banned as commander may still be in the 99.

UI

Duel Commander is an entry of the Format dropdown (#12521), under Commander, in the lobby and the deck editor on desktop and mobile, with the same exclusivity as the other Commander game types (Two-Headed Giant included).

Its decks are Commander decks, following the Canadian Highlander precedent (#12522): there is no deck folder, store or deck-editor tab of its own.

  • Lobby: choosing Duel Commander lists the Commander decks whose cards Duel Commander allows. The full deck check (99 + commander, the commander bans, the companion) runs at match start, as for any format. The slots share the Commander slots' saved state.
  • Deck editor: choosing Duel Commander builds and checks a Commander deck under Duel Commander's rules, offering only legal commanders, and saves it with the Commander decks.
  • Random and card-based deck generation, using the Commander matrix as Tiny Leaders does.
  • Net decks: the existing "Current Duel Commander Metagame" category.

sim -f DuelCommander -d ... registers commanders and 20 life, and reads decks from the Commander folder. Tournament mode (-t) is unchanged, and it doesn't register commanders for -f Commander either.

All new strings are localisation keys, added to all ten language files (English text in the other nine).

One change touches other formats: a randomly generated partner must now also be a legal commander of the format (DeckgenUtil.getRandomPartnerCommander).

  • Duel Commander needs it, because Rograkh and Vial Smasher are banned as commander but legal in the 99.
  • It also fixes Tiny Leaders and Brawl generation. Both could pair a "Choose a Background" commander with a Background, which neither format accepts as a commander, so the generated deck failed its own legality check.

Testing

  • Full suite. mvn -B clean test, as CI runs it, at 156d42c (the review changes): 3,437 tests, 0 failures, 13 skipped (leaving out the local test below), the same as master's own run at db50a13, with which the branch still merges cleanly. (The first version passed mvn -U -B clean -P windows-linux install from a clean checkout.)
  • Each commit compiles on its own.
  • Rules, checked locally. I used a local AITest-based test that is not part of this PR (no new CI tests). It checks:
    • the lock line on a mutated commander, which reads its real commander (from review);
    • the partner lock, including casting from hand;
    • commander damage, as a control with Commander;
    • starting life for each variant;
    • 903.9a return from the graveyard;
    • the ban lists, the companion-only sideboard and Lutri.
  • Simulations. sim -f DuelCommander with real Duel Commander lists:
    • partner decks never cast the locked partner, while the same decks under Commander cast both;
    • the Lurrus companion is put into hand and cast.
  • Played by hand on desktop before the merge: lobby, deck editor, partners, companion and the lock message. After the merge and the review changes: the suite, the local test, and the Duel Commander simulations again, with the decks read from the Commander folder (the locked partner was never cast, Lurrus was put into hand and cast, 20 life). Then played by hand on desktop: Duel Commander chosen in the Format dropdown of the lobby and the deck editor, with the decks kept among the Commander decks.

Known limitations

  • No Duel Commander achievement. It would need a trophy image.
  • Commander swapping between games (407) is not included. It needs a between-games choice in the match flow.
  • The AI may return a locked partner to the command zone, where it can no longer be cast. This is rules-legal, but not the best play.

Questions

  • The lobby's deck-type list. For Tiny Leaders, Brawl and Oathbreaker, the desktop lobby starts on the variant deck type, which the chooser can't list. The list is empty until you pick "Commander Decks". Should I fix that separately for all variants?
  • A visual marker. Would you like a marker on a locked commander in the command zone, beyond the card text? I'm happy to do it in a follow-up.

This was written with an AI coding agent (Claude Code), credited as co-author on the commits, per CONTRIBUTING.md.

Duel Commander (duelcommander.org) as a commander variant: 20 starting
life (401.1, documented in RegisteredPlayer), no commander damage loss
(403.1), and the 903.9a graveyard/exile choice like Commander. The deck
format is 99 + commander, singleton, with a sideboard of at most one card:
the format has no sideboard (302.1), but Forge keeps a companion there
(302.2). The mulligan needs no change: a 1v1 game already gets no free
first mulligan. The card pool and ban lists come next.

Based on Card-Forge#6596 by misha-colbourne.

Co-authored-by: misha-colbourne <mishacolbourne@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
res/formats/Casual/DuelCommander.txt holds the official lists
(duelcommander.org/banlist, updated 2026-07-27): banned in the deck,
banned as commander, and banned as companion (Lutri). The file also
carries the structural bans: conspiracies, ante, dexterity, attractions.

Format files can now name BannedAsCommander and BannedAsCompanion. They
are kept in a file, as kevlahnota asked on Card-Forge#6596, so the lists can be
edited without code changes. DeckFormat.DuelCommander uses them: a card
banned as commander may still be in the 99 (304.2). The sideboard may
hold only a companion that isn't banned as one (302.1, 302.2).

Based on Card-Forge#6596 by misha-colbourne.

Co-authored-by: misha-colbourne <mishacolbourne@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tays castable there

Duel Commander rules 404.1-404.4: with partners, once one of your
commanders has been cast from the command zone, the others can't be
cast from there for the rest of the game. They can still be cast from
any other zone, for example after Command Beacon. The new
NoOtherCommanderCastFromCommandZone card property reads the existing
per-commander cast count (the one commander tax uses), and only the Duel
Commander variant adds it to the command zone's MayPlay. The format's
description (lblDuelCommanderDesc) now mentions the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mirrors every Tiny Leaders hook in forge-gui for Duel Commander:
- its own deck folder (decks/duel_commander), storage, remembered deck
  and per-player lobby deck states;
- DeckType.DUEL_COMMANDER_DECK and DeckProxy.getAllDuelCommanderDecks;
- random and card-based deck generation, using the Commander card
  matrix as Tiny Leaders does;
- a net deck list holding the Current Duel Commander Metagame
  category (the Commander list is unchanged);
- the lobby treats it as a commander format, exclusive with the
  others, and the applied-variant preference round-trips it;
- FModel.getDuelCommanderCommander, the commanders the format allows;
- a Duel Commander tab in the default deck editor layout;
- the en-US labels the desktop and mobile commits use
  (lblDuelCommanderDeckEditor, lblDuelCommanderDecks,
  lblDuelCommanderDeck, lblDuelCommanderDeckRandomGenerated,
  lblSelectDuelCommanderDeckFor).

A randomly generated partner must now also be a legal commander of the
format (DeckgenUtil.getRandomPartnerCommander). Duel Commander needs
it: Rograkh and Vial Smasher are banned as commander but legal in the
99. It also changes Tiny Leaders and Brawl generation: they could pair
a "Choose a Background" commander with a Background, which neither
format accepts as a commander, so the generated deck failed its own
legality check.

Co-authored-by: misha-colbourne <mishacolbourne@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mirrors the Tiny Leaders hooks in forge-gui-desktop:
- a Duel Commander decks tab in the deck editor (VDuelCommanderDecks,
  CDuelCommanderDecks, EDocID.EDITOR_DUEL_COMMANDER), refreshed on
  save and hidden while a draft or sealed deck is edited, like the
  other constructed deck tabs;
- Duel Commander in the editor's format dropdown, with its own tab
  caption, commander pool, deck storage and singleton limit;
- opening, deleting and choosing Duel Commander decks from deck lists;
- Duel Commander in the lobby's format dropdown, with a commander deck
  chooser per player.

One deliberate difference from Tiny Leaders: the first lobby slot
starts on COMMANDER_DECK, as Commander does, not on the variant deck
type. The chooser lists the variant's own decks for COMMANDER_DECK (by
game type), but has no list for TINY_LEADERS_DECK and the like, so
starting there showed an empty list.

Co-authored-by: misha-colbourne <mishacolbourne@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mirrors the Tiny Leaders hooks in forge-gui-mobile:
- Duel Commander in the lobby's variant list and multi-variant
  selection, with a Duel Commander deck button and chooser per player
  and its own saved deck state;
- a Duel Commander deck type in the deck manager, and a deck editor
  config that keeps the catalog to cards the format allows;
- testing a Duel Commander deck starts a single match, as for the
  other commander formats.

Co-authored-by: misha-colbourne <mishacolbourne@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two deck-check messages Duel Commander adds (a sideboard that holds
anything but a companion, and a companion banned as one) now go through
the Localizer. Every Duel Commander key is added to all ten language
files, with English text in the other nine, as new keys usually are.

Two wordings change with it: the sideboard message now names the card
that doesn't belong there ("can't have X in its sideboard: Duel
Commander allows only a companion there"), and the description no
longer says "1v1", which the lobby doesn't enforce.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`sim -f DuelCommander` registers each player with their commanders and
20 life (RegisteredPlayer.forVariants). Without this they joined as in
Constructed, with no commander at all. Deck names are looked up in the
Duel Commander deck folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Once one of a player's commanders has been cast from the command zone,
the others can't be cast from there (404). Nothing on screen said so:
the card just stopped being playable. A locked commander now shows one
more line in its card text, under the existing "Cast from command
zone N times".

The line is derived from the cast counts PlayerView already holds (keyed
by card id, so it follows the commander through zone changes), plus a
player flag that the Duel Commander commander effect sets. It reaches
desktop, mobile and network clients alike, and can't disagree with the
cast-count line next to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Commander list already holds the "Current Duel Commander Metagame"
category, so the separate net-decks-duelcommander.txt only repeated it
(review comment by paulsnoops). Duel Commander now reads the Commander
list, and the extra file, its constant and its cache go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Duel Commander joins the unified Format dropdown (Card-Forge#12521) as one of
FormatChoices.COMMANDER_GAME_TYPES, in the lobby and the deck editor on
desktop and mobile, in place of its own entry in the old lists.

Its banned-as-commander and banned-as-companion lists move into
GameFormat.DeckRules (Card-Forge#12522), read from the same format file keys, so
the format's own rules stay in one record.

Duel Commander also leaves Two-Headed Giant (Card-Forge#12587), as the other
Commander variants with their own life totals do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@carldouglasbergentz-pixel

Copy link
Copy Markdown
Contributor Author

I've merged master into the branch (4ab6740), as it had conflicted since #12521, #12522 and #12523.

The full suite (mvn -B clean test) passes as it does on master, and the PR description's Testing section is updated with what I ran after the merge. @MostCromulent, since this now builds on your format dropdown, I'd value a look if you have time.

The workflow runs from the first push expired without being approved. Could a maintainer approve them for this push?

carldouglasbergentz-pixel added a commit to carldouglasbergentz-pixel/mtg-oracle that referenced this pull request Nov 30, 2026
Our Forge build was from 2026-10-14 while the database syncs daily, so
newer cards (Star Trek, Secret Lair Countdown) were missing in play.
tools/forge-dc is now mtg-oracle-forge with Forge's master of
2026-11-30 merged in (Card-Forge/forge#12090 kept mergeable).

The seat follows Forge's new GUI interface: a prompt's marks arrive as
one Selection, manipulateCardList names its second pile, getGamestate
is gone, getUserAgent is new, MATCH_EXPERIMENTAL_RESTORE was removed.

Tests: Duress reads Forge's own sentence now; a scenario's key press
waits for the board to be drawn (Space was lost on a prompt not yet
shown); the watch test waits for the hands to be drawn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MostCromulent

Copy link
Copy Markdown
Contributor

⚠️ Initial Claude review: Issues found.

The Duel Commander rules are implemented correctly and the merge with master holds up, but two small misses need fixing (items 2 and 3), and the deck-storage approach is open for maintainers (item 1). The rules the PR implements (20 life, no commander damage, the 404 partner lock, the commander and companion bans) match the Duel Commander rules (v2025.09.29). The format file's commander and companion lists match the official banlist (updated 2026-07-27) exactly, and its Banned list holds every card the page names. The three adaptations made when merging master are correct: FormatChoices.COMMANDER_GAME_TYPES, the two lists in GameFormat.DeckRules, and Two-Headed Giant and Duel Commander removing each other in GameLobby.

A separate design review by Claude Fable 5.2 found the game type, rules hooks and partner-lock property well designed, and the deck-storage block heavier than the format needs.

For maintainers:

  1. Deck storage: Duel Commander decks have Commander's shape (Range.is(99)), but get their own folder, store, deck-editor tab, DeckType, deck preference and eight lobby prefs, copied from Tiny Leaders. The alternative is the Canadian Highlander route: Commander decks filtered by DeckFormat.DuelCommander when Duel Commander is chosen in the Format dropdown. That drops VDuelCommanderDecks, CDuelCommanderDecks, the tab edits in the limited editors and the "Reset layout" limitation, and item 2 with them. GameType.DuelCommander and DeckFormat.DuelCommander stay either way, because the engine rules need them.

Fix before merge:
2. The Rogue Commander deck editor, which came in with the master merge, hides every other deck-list tab but not the Duel Commander one. Add the field, removeTab(VDuelCommanderDecks...) and restore next to Tiny Leaders' in CEditorRogue.java:394 and :358, as the PR does in CEditorLimited and the draft editors.
3. After a Duel Commander commander mutates, its info text says it can't be cast from the command zone, though it can. The host tracks only a game-wide flag (CommandZoneCastLock), and PlayerView.isCommanderLockedInCommandZone works the lock out again from the view's CommanderCast map. updateMergedCommanderCast (PlayerView.java:422) adds a second entry to that map with the same count, so the total doubles. Compute the lock on the host with the NoOtherCommanderCastFromCommandZone test and track the result per commander, as CardView does for CommanderAltType, or drop the line.

First-pass adversarial review by Claude Opus 5.5 at 4ab6740, ahead of maintainer review. The partner lock, the master-merge adaptations and the commander info text traced in code, the ban lists compared with duelcommander.org, with a separate design review, not built or run. Read by the poster before posting.

@MostCromulent

Copy link
Copy Markdown
Contributor

Further to item 1 in the Claude review above:

I appreciate this PR is just building on what already exists, however I'm not a fan of creating separate deck editor tabs and infrastructure for new formats:

  • the Commander / Oathbreaker / Tiny Leaders / Brawl tabs are already unintuitive and users often don't realise what they are
  • they are involved in a heap of UI bugs and seem to appear/disappear randomly
  • it adds visual bloat as new formats are added, and they already disappear off the side of the editor page
  • there's an open PR trying to get rid of them entirely: Add unified Deck Browser for home and deck editor #10636

imo we should be trying to move away from that rather than add to it.

Could this be done more like the Canadian Highlander precedent where we re-use the existing Commander deck editor type and it just filters when the format dropdown is set to Duel Commander?

@MostCromulent MostCromulent added Enhancement New feature or request Game Mechanics labels Nov 30, 2026
As MostCromulent suggested in review, Duel Commander follows the
Canadian Highlander precedent instead of growing its own deck
infrastructure: a Duel Commander deck is a Commander deck, listed for
Duel Commander when its cards are legal there.

Removed: the duel_commander deck folder and store, the Duel Commander
deck-editor tab (VDuelCommanderDecks, CDuelCommanderDecks, its EDocID
and editor.xml entry, and the tab handling in the draft and limited
editors), DeckType.DUEL_COMMANDER_DECK, the Duel Commander deck
preference and the eight lobby deck-state preferences.

Kept: choosing Duel Commander in the lobby lists the Commander decks
Duel Commander allows (DeckProxy.getAllDuelCommanderDecks), and in the
deck editor it builds and checks a Commander deck under Duel Commander
rules, saved with the Commander decks. The lobby slots share the
Commander slots' saved state. sim -f DuelCommander reads decks from the
Commander folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The commander's card text said a mutated commander could not be cast
from the command zone: PlayerView summed its CommanderCast map, where a
merged permanent has a second entry with the same count.

CardView.updateCommander now sets LockedInCommandZone, as it sets
CommanderAltType, from the real commander, and a cast refreshes the
other commanders. Player.isCommanderLockedInCommandZone is the one test,
which NoOtherCommanderCastFromCommandZone uses too; the player-wide
CommandZoneCastLock is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@carldouglasbergentz-pixel

Copy link
Copy Markdown
Contributor Author

Thanks, both of you. Done in two commits:

  • Deck storage (item 1, and your comment). a8ff393 follows the Canadian Highlander precedent: a Duel Commander deck is a Commander deck. Choosing Duel Commander in the lobby lists the Commander decks whose cards it allows, with the full check at match start; in the deck editor it builds and checks a Commander deck under Duel Commander's rules and saves it with the Commander decks. Gone: the duel_commander folder and store, the deck-editor tab (VDuelCommanderDecks, CDuelCommanderDecks, its EDocID and editor.xml entry, the tab handling in the draft and limited editors), DeckType.DUEL_COMMANDER_DECK, the deck preference and the eight lobby deck-state prefs. That also settles item 2, since there is no tab left for the Rogue Commander editor to hide, and the "Reset layout" limitation. The PR is down from 55 files to 43.
  • The lock line after a mutate (item 3). 156d42c works the lock out on the host, per commander: CardView.updateCommander sets LockedInCommandZone from the real commander, as it sets CommanderAltType, and a cast refreshes the other commanders. Player.isCommanderLockedInCommandZone is the one test, which NoOtherCommanderCastFromCommandZone uses too. PlayerView no longer sums CommanderCast, and the player-wide CommandZoneCastLock is gone. My local test now covers a commander mutating onto a creature.

The full suite passes as master's does, the branch still merges cleanly, and the description is updated. I haven't played the shared deck lists by hand yet.

@Agetian

Agetian commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Looks alright to me 👍 Not sure if we want basic translations in place immediately or that should be covered later (currently all translations duplicate the English text), otherwise it looks good, though I admit I'm not an expert on UI code intrinsics, so I'll vote Accept but I'd appreciate if someone else also took an additional look :)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request Game Mechanics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Duel Commander mode

4 participants