Skip to content

AdventureLayout

src.layouts.AdventureLayout

Bases: NormalLayout

Adventure card layout, introduced in Throne of Eldraine.

Source code in src\layouts.py
class AdventureLayout(NormalLayout):
    """Adventure card layout, introduced in Throne of Eldraine."""
    card_class: str = LayoutType.Adventure

    """
    * Core Data
    """

    @cached_property
    def adventure(self) -> dict:
        """Card object for adventure side."""
        return self.scryfall['card_faces'][1]

    """
    * Adventure Text
    """

    @cached_property
    def mana_adventure(self) -> str:
        """Mana cost of the adventure side."""
        return self.adventure['mana_cost']

    @cached_property
    def name_adventure(self) -> str:
        """Name of the Adventure side."""
        if self.is_alt_lang and 'printed_name' in self.adventure:
            return self.adventure.get('printed_name', '')
        return self.adventure.get('name', '')

    @cached_property
    def type_line_adventure(self) -> str:
        """Type line of the Adventure side."""
        if self.is_alt_lang and 'printed_type_line' in self.adventure:
            return self.adventure.get('printed_type_line', '')
        return self.adventure.get('type_line', '')

    @cached_property
    def oracle_text_adventure(self) -> str:
        """Oracle text of the Adventure side."""
        if self.is_alt_lang and 'printed_text' in self.adventure:
            return self.adventure.get('printed_text', '')
        return self.adventure.get('oracle_text', '')

    @cached_property
    def flavor_text_adventure(self) -> str:
        """Flavor text of the Adventure side."""
        return self.adventure.get('flavor_text', '')

    """
    * Adventure Colors
    """

    @cached_property
    def color_identity_adventure(self) -> list[str]:
        """Colors present in the adventure side mana cost."""
        return [n for n in get_mana_cost_colors(self.mana_adventure)]

    @cached_property
    def adventure_colors(self) -> str:
        """Color identity of adventure side frame elements."""
        if check_hybrid_mana_cost(self.color_identity_adventure, self.mana_adventure):
            return LAYERS.LAND
        if len(self.color_identity_adventure) > 1:
            return LAYERS.GOLD
        if not self.color_identity_adventure:
            return LAYERS.COLORLESS
        return self.color_identity_adventure[0]

Attributes

adventure: dict

Card object for adventure side.

adventure_colors: str

Color identity of adventure side frame elements.

art_file: Path

artist: str

Card artist name, prioritizes user provided artist name. Controls for duplicate last names.

background: str

Identity of the background.

card: dict

Main card data object to pull most relevant data from.

card_class: str = LayoutType.Adventure

  • Core Data

card_count: Optional[int]

int | None: Number of cards within the card's release set. Only required in 'Normal' Collector Mode.

collector_data: str

collector_number: int

collector_number_raw: Optional[str]

str | None: Card number assigned within release set. Raw string representation, allows non-digits.

color_identity: list[str]

Commander relevant color identity array, e.g. [W, U].

color_identity_adventure: list[str]

Colors present in the adventure side mana cost.

color_indicator: str

Color indicator identity array, e.g. [W, U].

creator: str

date: date

display_name: str

Card name, GUI appropriate representation.

file: CardDetails

Dictionary containing parsed art file details.

first_print: dict

Card data fetched from Scryfall representing the first print of this card.

flavor_text: str

Card flavor text, alternate language version shares the same key.

flavor_text_adventure: str

Flavor text of the Adventure side.

frame: FrameDetails

Dictionary containing calculated frame information.

frame_effects: list[str]

Array of frame effects, e.g. nyxtouched, snow, etc.

identity: str

Frame appropriate color identity of the card.

input_name: str

Card name, version provided in art file name.

is_alt_lang: bool

True if language selected isn't English.

is_artifact: bool

True if card is an Artifact.

is_basic_land: bool

True if card is a Basic Land.

is_colorless: bool

True if card is colorless or devoid.

is_companion: bool

True if card is a Companion.

is_creature: bool

True if card is a Creature.

is_emblem: bool

is_front: bool

True if card is front face.

is_hybrid: bool

True if card is a hybrid frame.

is_land: bool

True if card is a Land.

is_legendary: bool

True if card is Legendary.

is_miracle: bool

True if card is a 'Miracle' card.

is_nyx: bool

True if card has Nyx enchantment background texture.

is_promo: bool

True if card is a promotional print.

is_snow: bool

True if card is a 'Snow' card.

is_token: bool

is_vehicle: bool

True if card is a Vehicle.

keywords: list[str]

Array of keyword abilities, e.g. Flying, Haste, etc.

lang: str

Card print language, uppercase enforced, falls back to settings defined value.

mana_adventure: str

Mana cost of the adventure side.

mana_cost: Optional[str]

Scryfall formatted card mana cost.

name: str

Card name, supports alternate language source.

name_adventure: str

Name of the Adventure side.

name_raw: str

Card name, enforced English representation.

nickname: str

Nickname, typically set inside template logic but can be passed in filename.

oracle_text: str

Card rules text, supports alternate language source.

oracle_text_adventure: str

Oracle text of the Adventure side.

oracle_text_raw: str

Card rules text, enforced English representation.

other_face: dict

Card data from opposing face if provided.

other_face_frame: Union[FrameDetails, dict]

Calculated frame information of opposing face, if provided.

other_face_left: Optional[str]

Abridged type of the opposing side to display on bottom MDFC bar.

other_face_mana_cost: str

Mana cost of opposing face.

other_face_oracle_text: str

Rules text of opposing face.

other_face_oracle_text_raw: str

Rules text of opposing face.

other_face_power: str

Creature power of opposing face, if provided.

other_face_right: str

Mana cost or mana ability of opposing side, depending on land or nonland.

other_face_toughness: str

Creature toughness of opposing face, if provided.

other_face_twins: str

Name and title box identity of opposing face.

other_face_type_line: str

Type line of opposing face.

other_face_type_line_raw: str

Type line of opposing face, English language enforced.

pinlines: str

Identity of the pinlines.

power: str

Creature power, if provided.

promo_types: list[str]

list[str]: Promo types this card matches, e.g. stamped, datestamped, etc.

rarity: str

Card rarity, interprets 'special' rarities based on card data.

rarity_letter: str

First letter of card rarity, uppercase enforced.

rarity_raw: str

Card rarity, doesn't interpret 'special' rarities.

rules_text: str

Utility definition comprised of rules and flavor text as available.

scryfall: dict

Card data fetched from Scryfall.

scryfall_scan: str

Scryfall large image scan, if available.

set: str

Card set code, uppercase enforced, falls back to 'MTG' if missing.

set_data: dict

Set data from the current hexproof.io data file.

set_type: str

subtypes: list[str]

Subtypes represented, e.g. Elf, Human, Goblin, etc.

supertypes: list[str]

Supertypes represented, e.g. Basic, Legendary, Snow, etc.

symbol_code: str

Code used to match a symbol to this card's set. Provided by hexproof.io.

symbol_svg: Optional[Path]

SVG path definition for card's expansion symbol.

template_file: Path

Template PSD file path, replaced before render process.

toughness: str

Creature toughness, if provided.

transform_icon: str

Transform icon if provided, data possibly deprecated in modern practice.

twins: str

Identity of the name and title boxes.

type_line: str

Card type line, supports alternate language source.

type_line_adventure: str

Type line of the Adventure side.

type_line_raw: str

Card type line, enforced English representation.

types: list[str]

Main cards types represented, e.g. Sorcery, Instant, Creature, etc.

types_raw: list[str]

List of types extracted from the raw typeline.

watermark: Optional[str]

Name of the card's watermark file that is actually used, if provided.

watermark_basic: Optional[Path]

Optional[Path]: Path to basic land watermark, if card is a Basic Land.

watermark_raw: Optional[str]

Name of the card's watermark from raw Scryfall data, if provided.

watermark_svg: Optional[Path]

Path to the watermark SVG file, if provided.