Honor cards' own copy limits in deck legality

Cards like Relentless Rats (any number), Nazgûl (up to nine), and Once
More with Feeling (only one) override the format's copy limit. The limit
is parsed from oracle text at card-data import into a new
oracle_cards.copy_limit column; older reference dbs fall back to the
format rule until re-imported. The legality check and illegal-card
selection use it. Also count snow basics as basic lands.

Closes #27

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-26 23:10:23 +00:00
parent 99a579a697
commit ea689b0f2b
9 changed files with 176 additions and 18 deletions

View File

@@ -62,6 +62,10 @@ export interface DeckEntry extends CardRef {
claimed_by: DeckHolding[];
/** Where the card's library copies are stored ("" if unset). */
location: string;
/** The card's own exception to the format's copy limit ("A deck can have
* any number of cards named …"): null when the format's rule applies, 0
* for any number, else the most copies allowed. */
copy_limit: number | null;
}
export interface DeckHolding {