Skip to content

PrototypeLayout

src.layouts.PrototypeLayout

Bases: NormalLayout

Prototype card layout, introduced in The Brothers' War.

Source code in src\layouts.py
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
class PrototypeLayout(NormalLayout):
    """Prototype card layout, introduced in The Brothers' War."""
    card_class: str = LayoutType.Prototype

    """
    * Text Info
    """

    @auto_prop_cached
    def oracle_text(self) -> str:
        return self.proto_details['oracle_text']

    """
    * Prototype Properties
    """

    @auto_prop_cached
    def proto_details(self) -> dict:
        """Returns dictionary containing prototype data and separated oracle text."""
        proto_text, rules_text = self.card.get('oracle_text').split("\n", 1)
        match = Reg.PROTOTYPE.match(proto_text)
        return {
            'oracle_text': rules_text,
            'mana_cost': match[1],
            'pt': match[2]
        }

    @auto_prop_cached
    def proto_mana_cost(self) -> str:
        """Mana cost of card when case with Prototype Ability."""
        return self.proto_details['mana_cost']

    @auto_prop_cached
    def proto_pt(self) -> str:
        """Power/Toughness of card when cast with Prototype ability."""
        return self.proto_details['pt']

    """
    * Prototype Colors
    """

    @auto_prop_cached
    def proto_color(self) -> str:
        """Color to use for colored prototype frame elements."""
        return self.color_identity[0] if len(self.color_identity) > 0 else LAYERS.ARTIFACT

Attributes

card_class: str = LayoutType.Prototype

  • Text Info

Functions

proto_color() -> str

Color to use for colored prototype frame elements.

Source code in src\layouts.py
831
832
833
834
@auto_prop_cached
def proto_color(self) -> str:
    """Color to use for colored prototype frame elements."""
    return self.color_identity[0] if len(self.color_identity) > 0 else LAYERS.ARTIFACT

proto_details() -> dict

Returns dictionary containing prototype data and separated oracle text.

Source code in src\layouts.py
806
807
808
809
810
811
812
813
814
815
@auto_prop_cached
def proto_details(self) -> dict:
    """Returns dictionary containing prototype data and separated oracle text."""
    proto_text, rules_text = self.card.get('oracle_text').split("\n", 1)
    match = Reg.PROTOTYPE.match(proto_text)
    return {
        'oracle_text': rules_text,
        'mana_cost': match[1],
        'pt': match[2]
    }

proto_mana_cost() -> str

Mana cost of card when case with Prototype Ability.

Source code in src\layouts.py
817
818
819
820
@auto_prop_cached
def proto_mana_cost(self) -> str:
    """Mana cost of card when case with Prototype Ability."""
    return self.proto_details['mana_cost']

proto_pt() -> str

Power/Toughness of card when cast with Prototype ability.

Source code in src\layouts.py
822
823
824
825
@auto_prop_cached
def proto_pt(self) -> str:
    """Power/Toughness of card when cast with Prototype ability."""
    return self.proto_details['pt']