Skip to content

NyxMod

src.templates._cosmetic.NyxMod

Bases: BaseTemplate

Modifier for 'Nyxtouched' supported templates.

Modifies
  • 'is_hollow_crown': Enabled for Nyxtouched cards
  • 'background_layer': Use 'Nyx' layer for Nyxtouched cards
Source code in src\templates\_cosmetic.py
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class NyxMod (BaseTemplate):
    """
    Modifier for 'Nyxtouched' supported templates.

    Modifies:
        - 'is_hollow_crown': Enabled for Nyxtouched cards
        - 'background_layer': Use 'Nyx' layer for Nyxtouched cards
    """

    """
    * Bool
    """

    @auto_prop_cached
    def is_hollow_crown(self) -> bool:
        """Enable hollow crown for Nyx cards."""
        if self.is_nyx:
            return True
        return super().is_hollow_crown

    """
    * Layers
    """

    @auto_prop_cached
    def background_layer(self) -> Optional[ArtLayer]:
        """Try finding a Nyx background layer if the card is a 'Nyxtouched' frame."""
        if self.is_nyx:
            if layer := psd.getLayer(self.background, LAYERS.NYX):
                return layer
        return super().background_layer

Functions

background_layer() -> Optional[ArtLayer]

Try finding a Nyx background layer if the card is a 'Nyxtouched' frame.

Source code in src\templates\_cosmetic.py
117
118
119
120
121
122
123
@auto_prop_cached
def background_layer(self) -> Optional[ArtLayer]:
    """Try finding a Nyx background layer if the card is a 'Nyxtouched' frame."""
    if self.is_nyx:
        if layer := psd.getLayer(self.background, LAYERS.NYX):
            return layer
    return super().background_layer

is_hollow_crown() -> bool

Enable hollow crown for Nyx cards.

Source code in src\templates\_cosmetic.py
106
107
108
109
110
111
@auto_prop_cached
def is_hollow_crown(self) -> bool:
    """Enable hollow crown for Nyx cards."""
    if self.is_nyx:
        return True
    return super().is_hollow_crown