---
title: "Layouts and Faces"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Layouts and Faces}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
library(scryr)
glimpse <- purrr::partial(dplyr::glimpse, width = 72)
```

The `layout` column categorizes the arrangement of card parts, faces, and other
bounded regions on cards. The layout can be used to programmatically determine
which other properties on a card you can expect.

Specifically:

- Cards with the layouts `split`, `flip`, `transform`, and `double_faced_token`
  will always have a `card_faces` column describing the distinct faces.
- Cards with the layout `meld` will always have a `all_parts` column
  pointing to the other meld parts.

| Layout                 | Description                                        |
| ---------------------- | -------------------------------------------------- |
| [`normal`](https://scryfall.com/search?q=layout%3Anormal)                         | A standard _Magic_ card with one face              |
| [`split`](https://scryfall.com/search?q=layout%3Asplit)                           | A split-faced card                                 |
| [`flip`](https://scryfall.com/search?q=layout%3Aflip)                             | Cards that invert vertically with the flip keyword |
| [`transform`](https://scryfall.com/search?q=layout%3Atransform)                   | Double-sided cards that transform                  |
| [`modal_dfc`](https://scryfall.com/search?q=layout%3Amodal_dfc)                   | Double-sided cards that can be played either-side  |
| [`meld`](https://scryfall.com/search?q=layout%3Ameld)                             | Cards with meld parts printed on the back          |
| [`leveler`](https://scryfall.com/search?q=layout%3Aleveler)                       | Cards with Level Up                                |
| [`class`](https://scryfall.com/search?q=layout%3Aclass)                           | Class-type enchantment cards                       |
| [`saga`](https://scryfall.com/search?q=layout%3Asaga)                             | Saga-type cards                                    |
| [`adventure`](https://scryfall.com/search?q=layout%3Aadventure)                   | Cards with an Adventure spell part                 |
| [`planar`](https://scryfall.com/search?q=layout%3Aplanar)                         | Plane and Phenomenon-type cards                    |
| [`scheme`](https://scryfall.com/search?q=layout%3Ascheme)                         | Scheme-type cards                                  |
| [`vanguard`](https://scryfall.com/search?q=layout%3Avanguard)                     | Vanguard-type cards                                |
| [`token`](https://scryfall.com/search?q=layout%3Atoken)                           | Token cards                                        |
| [`double_faced_token`](https://scryfall.com/search?q=layout%3Adouble_faced_token) | Tokens with another token printed on the back      |
| [`emblem`](https://scryfall.com/search?q=layout%3Aemblem)                         | Emblem cards                                       |
| [`augment`](https://scryfall.com/search?q=layout%3Aaugment)                       | Cards with Augment                                 |
| [`host`](https://scryfall.com/search?q=layout%3Ahost)                             | Host-type cards                                    |
| [`art_series`](https://scryfall.com/search?q=layout%3Aart_series)                 | Art Series collectable double-faced cards          |
| [`reversible_card`](https://scryfall.com/search?q=layout%3Areversible_card)       | A _Magic_ card with two sides that are unrelated   |

## Card Faces

_Magic_ cards can include multiple faces on a single piece of card stock.
Scryfall includes information about each of these card faces using the
`card_faces` column. Please note the following types of multi-face cards and how
Scryfall will describe them:

**Split cards** _(Comp. rules term)_: Split cards are sorceries or instant cards
that include two faces and the caster can choose which face to cast. The back of
a split card is the normal _Magic_ back.

```{r}
glimpse(scry_card("0f279560-7e9f-4a6d-9fd6-6c8c6bd94a1b"))
```

**Flip cards** _(Comp. rules term)_: Flip cards have two parts of a permanent
printed vertically on one side of the card. During play, an ability on the card
causes the permanent to flip (rotate 180°) to the other side. The back of a flip
card is the normal _Magic_ back.

```{r}
glimpse(scry_card("0b61d772-2d8b-4acf-9dd2-b2e8b03538c8"))
```

**Double-faced cards** _(Comp. rules term)_: These cards have two faces on
different sides of the cardstock that are related to each other. The whole card
is a single legal or deckbuilding object. Double-faced cards can either be
transforming or modal.

**Transforming double-faced cards** _(Comp. rules term)_: These cards can either
transform after entering the battlefield, or can be put onto the battlefield
already transformed. Scryfall will use the `card_faces` column to describe the
two different transformed modes of the card. These cards have their `layout` set
to "transform".

```{r}
glimpse(scry_card("b37aa12c-a6b3-4cf8-b5a4-0a999ff12d02"))
```

**Modal double-faced cards** _(Comp. rules term)_: Modal DFCs may be cast or
played as either half of the card. Scryfall will use the `card_faces` column to
describe the two different modes of the card. These cards have their `layout`
set to "modal_dfc".

```{r}
glimpse(scry_card("ba09360a-067e-48a5-bdc5-a19fd066a785"))
```

**Reversible cards** _(casual term)_: This term is used by both Scryfall and
WotC to describe a piece of cardstock with two distinct _Magic_ cards or tokens
printed on opposite sides. The two halves of the card are not related to each
other in any way and are treated as two separate objects for gameplay or
deckbuilding. The overall card will have its `layout` set to "reversible_card",
while the individual `card_face` objects will have their own `layout` columns
describing the distinct printings on both sides.

```{r}
glimpse(scry_card("3e3f0bcd-0796-494d-bf51-94b33c1671e9"))
```

**Multi-faced cards** _(casual term)_: This term has no rules meaning and is
used by Scryfall to describe any object with the nested `card_faces` property.

**Double-sided cards** _(casual term)_: This term has no rules meaning and is
used only casually to refer to any cards with gameplay information on both
sides.
