Skip to content

ModalDoubleFacedLayout

src.layouts.ModalDoubleFacedLayout

Bases: NormalLayout

Modal Double Faced card layout, introduced in Zendikar Rising.

Source code in src\layouts.py
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
class ModalDoubleFacedLayout(NormalLayout):
    """Modal Double Faced card layout, introduced in Zendikar Rising."""

    # Static properties
    is_mdfc: bool = True

    @auto_prop_cached
    def card_class(self) -> str:
        """Card class separated by card face."""
        return LayoutType.MDFCFront if self.is_front else LayoutType.MDFCBack

    """
    * Text Info
    """

    @auto_prop_cached
    def oracle_text(self) -> str:
        """On MDFC alternate language data contains text from both sides, separate them."""
        if self.is_alt_lang and 'printed_text' in self.card:
            return get_lines(
                self.card.get('printed_text', ''),
                self.oracle_text_raw.count('\n') + 1)
        return self.oracle_text_raw

Functions

card_class() -> str

Card class separated by card face.

Source code in src\layouts.py
965
966
967
968
@auto_prop_cached
def card_class(self) -> str:
    """Card class separated by card face."""
    return LayoutType.MDFCFront if self.is_front else LayoutType.MDFCBack

oracle_text() -> str

On MDFC alternate language data contains text from both sides, separate them.

Source code in src\layouts.py
974
975
976
977
978
979
980
981
@auto_prop_cached
def oracle_text(self) -> str:
    """On MDFC alternate language data contains text from both sides, separate them."""
    if self.is_alt_lang and 'printed_text' in self.card:
        return get_lines(
            self.card.get('printed_text', ''),
            self.oracle_text_raw.count('\n') + 1)
    return self.oracle_text_raw