mtg-wizard-core (master) doxdox documentation

Core Functions for MTG Wizard

# bodyText()

The printed text of the card. This is as the text is printed on the card so this will be in foreign language or differ from the Oracle type if it has received errata. This will also format split/aftermath cards to display both halves of the card together

# Card()

This is a wrapper around the JSON data returned from the Scryfall API with additional properties for geting various formatted information about the card.

# constructor(data)

Creates an instance of Card.

Parameters

Name Types Description
data * Scryfall API card json

# displayName()

The name of the card or the name of the currently displayed face of a DFC

# flip()

Flips the current card face if this is a DFC.

# id()

The scryfall card ID

# image()

Large image URI of the card This will show the currently selected face if a DFC

# isDFC()

Gets whether the card is a double-face card having two sides printed.

# isSplitCard()

Gets whether the card is equivalent to a "split" card having two parts on the same card. For example, "Split", "Aftermath", "Adventure". This is not the same as a DFC.

# manaCost()

The mana cost of the card e.g. {2}{G} This will show the cost on the currently selected face if a DFC, and both if a split card e.g. "{1}{R} // {W}"

# manaCostAndType()

Formats the mana cost and typeline into a string depending on card type. Uses the printed text

# name()

The printed name of the card. This is as the name is printed on the card so this will be the name in a foreign language etc

# oracleManaCostAndType()

Formats the mana cost and typeline into a string depending on card type. Uses the Oracle text

# oracleName()

The name of the card as it appears in the Oracle

# oracleText()

The printed text of the card as it appears in the Oracle This will also format split/aftermath cards to display both halves of the card together

# oracleType()

The type of the card as it appears in the Oracle

# prices()

The current average prices of the card from Scryfall

# rarity()

The rarity of the card

# safeData()

Gets the current face of a card in the case of it being a DFC, Otherwise it will just give you the data.

# set()

Set code of the current card e.g. "M20"

# setAndRarity()

The set and the rarity separated with a "-" character

# setName()

Set name of the current card e.g. "Core Set 2020"

# this.currentFace()

The current "face" of the card being viewed if it is a DFC (double-faced card). This will be 0 for all cards and the front card and 1 for the "back". Use @see flip to change.

# this.data()

The full data object returned by the Scryfall API

# thumbnail()

Thumbnail image URI of the card This will show the currently selected face if a DFC

# type()

The printed type of the card. This is as the type is printed on the card so this will be the name in a foreign language or different from the Oracle type if it has received errata

# module.exports.findPrints(Card)

Gets an array of reprints of a single card

Parameters

Name Types Description
Card Card object

# module.exports.getCard(cardId)

Gets a single card with a given ID

Parameters

Name Types Description
cardId string

# module.exports.getSets()

Gets a list of sets

# module.exports.searchCards(query)

Searches Scryfall for cards. Uses searching syntax from https://scryfall.com/docs/syntax

Parameters

Name Types Description
query string Search query