mtg-deck-checker
v1.2.1
Published
Magic the Gathering deck validator for all formats.
Downloads
20
Maintainers
Readme
Usage:
npm i --save mtg-deck-checker
const Deck = require('mtg-deck-checker');
var decklist assumes cockatrice deck editor format.
var newDeck = new Deck.Deck(decklist, format);
Deck constructor will automatically run newDeck.check()
console.log(newDeck.isLegal, newDeck.errors);
You can see you deck hash with newDeck.hash
If you want to keep the same obj but update the deck or format
newDeck.check(decklist, format);
You can add cards to your deck, then check if it is still legal
newDeck.addCard("Ancestral Recall", 1);
newDeck.check();
console.log(newDeck.errors) // => ["Ancestral Recall not legal in modern!"]
Access mainboard/sideboard directly with newDeck.main, newDeck.side
Update new cardData.json with Deck.updateCardData()
TODO:
- add checks for commander to make sure all cards are within commanders color identity