Skip to content

LevelerLayout

src.layouts.LevelerLayout

Bases: NormalLayout

Leveler card layout, introduced in Rise of the Eldrazi.

Source code in src\layouts.py
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
class LevelerLayout(NormalLayout):
    """Leveler card layout, introduced in Rise of the Eldrazi."""
    card_class: str = LayoutType.Leveler

    """
    * Leveler Text
    """

    @auto_prop_cached
    def leveler_match(self) -> Optional[Match[str]]:
        """Unpack leveler text fields from oracle text string."""
        return Reg.LEVELER.match(self.oracle_text)

    @auto_prop_cached
    def level_up_text(self) -> str:
        """Main text that defines the 'Level up' cost."""
        return self.leveler_match[1] if self.leveler_match else ''

    @auto_prop_cached
    def middle_level(self) -> str:
        """Level number(s) requirement of middle stage, e.g. 1-2."""
        return self.leveler_match[2] if self.leveler_match else ''

    @auto_prop_cached
    def middle_power_toughness(self) -> str:
        """Creature Power/Toughness applied at middle stage."""
        return self.leveler_match[3] if self.leveler_match else ''

    @auto_prop_cached
    def middle_text(self) -> str:
        """Rules text applied at middle stage."""
        return self.leveler_match[4] if self.leveler_match else ''

    @auto_prop_cached
    def bottom_level(self) -> str:
        """Level number(s) requirement of bottom stage, e.g. 5+."""
        return self.leveler_match[5] if self.leveler_match else ''

    @auto_prop_cached
    def bottom_power_toughness(self) -> str:
        """Creature Power/Toughness applied at bottom stage."""
        return self.leveler_match[6] if self.leveler_match else ''

    @auto_prop_cached
    def bottom_text(self) -> str:
        """Rules text applied at bottom stage."""
        return self.leveler_match[7] if self.leveler_match else ''

Attributes

card_class: str = LayoutType.Leveler

  • Leveler Text

Functions

bottom_level() -> str

Level number(s) requirement of bottom stage, e.g. 5+.

Source code in src\layouts.py
1086
1087
1088
1089
@auto_prop_cached
def bottom_level(self) -> str:
    """Level number(s) requirement of bottom stage, e.g. 5+."""
    return self.leveler_match[5] if self.leveler_match else ''

bottom_power_toughness() -> str

Creature Power/Toughness applied at bottom stage.

Source code in src\layouts.py
1091
1092
1093
1094
@auto_prop_cached
def bottom_power_toughness(self) -> str:
    """Creature Power/Toughness applied at bottom stage."""
    return self.leveler_match[6] if self.leveler_match else ''

bottom_text() -> str

Rules text applied at bottom stage.

Source code in src\layouts.py
1096
1097
1098
1099
@auto_prop_cached
def bottom_text(self) -> str:
    """Rules text applied at bottom stage."""
    return self.leveler_match[7] if self.leveler_match else ''

level_up_text() -> str

Main text that defines the 'Level up' cost.

Source code in src\layouts.py
1066
1067
1068
1069
@auto_prop_cached
def level_up_text(self) -> str:
    """Main text that defines the 'Level up' cost."""
    return self.leveler_match[1] if self.leveler_match else ''

leveler_match() -> Optional[Match[str]]

Unpack leveler text fields from oracle text string.

Source code in src\layouts.py
1061
1062
1063
1064
@auto_prop_cached
def leveler_match(self) -> Optional[Match[str]]:
    """Unpack leveler text fields from oracle text string."""
    return Reg.LEVELER.match(self.oracle_text)

middle_level() -> str

Level number(s) requirement of middle stage, e.g. 1-2.

Source code in src\layouts.py
1071
1072
1073
1074
@auto_prop_cached
def middle_level(self) -> str:
    """Level number(s) requirement of middle stage, e.g. 1-2."""
    return self.leveler_match[2] if self.leveler_match else ''

middle_power_toughness() -> str

Creature Power/Toughness applied at middle stage.

Source code in src\layouts.py
1076
1077
1078
1079
@auto_prop_cached
def middle_power_toughness(self) -> str:
    """Creature Power/Toughness applied at middle stage."""
    return self.leveler_match[3] if self.leveler_match else ''

middle_text() -> str

Rules text applied at middle stage.

Source code in src\layouts.py
1081
1082
1083
1084
@auto_prop_cached
def middle_text(self) -> str:
    """Rules text applied at middle stage."""
    return self.leveler_match[4] if self.leveler_match else ''