Skip to content

AdventureVectorMod

src.templates.adventure.AdventureVectorMod

Bases: AdventureMod, VectorTemplate

  • A vector template modifier for adding steps required for Adventure type cards introduced in Throne of Eldraine.
Adds
  • AdventureMod features.
  • Adventure textbox, pinline, wings, and titles.
Source code in src\templates\adventure.py
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
class AdventureVectorMod(AdventureMod, VectorTemplate):
    """
    * A vector template modifier for adding steps required for Adventure type cards introduced in Throne of Eldraine.

    Adds:
        * AdventureMod features.
        * Adventure textbox, pinline, wings, and titles.
    """

    # Color Maps
    """Maps color values to adventure name box."""
    adventure_name_color_map = {
        'W': [179, 172, 156],
        'U': [43, 126, 167],
        'B': [104, 103, 102],
        'R': [159, 83, 59],
        'G': [68, 96, 63],
        'Colorless': [],
        'Gold': [166, 145, 80],
        'Land': [177, 166, 169]
    }
    """Maps color values to adventure typeline box."""
    adventure_typeline_color_map = {
        'W': [129, 120, 103],
        'U': [3, 94, 127],
        'B': [44, 41, 40],
        'R': [124, 51, 33],
        'G': [11, 53, 30],
        'Colorless': [],
        'Gold': [117, 90, 40],
        'Land': [154, 137, 130]
    }
    """Maps color values to adventure typeline accent box."""
    adventure_typeline_accent_color_map = {
        'W': [90, 82, 71],
        'U': [2, 67, 96],
        'B': [20, 17, 19],
        'R': [81, 34, 22],
        'G': [2, 34, 16],
        'Colorless': [],
        'Gold': [75, 62, 37],
        'Land': [115, 98, 89]
    }
    """Maps color values to adventure wings."""
    adventure_wings_color_map = {
        'W': [213, 203, 181],
        'U': [181, 198, 213],
        'B': [162, 155, 152],
        'R': [192, 142, 115],
        'G': [174, 174, 155],
        'Colorless': [],
        'Gold': [196, 172, 131],
        'Land': [194, 178, 177]
    }

    """
    * Mixin Methods
    """

    @auto_prop_cached
    def frame_layer_methods(self) -> list[Callable]:
        """Add Adventure frame layers step."""
        funcs = [self.enable_adventure_layers] if isinstance(self.layout, AdventureLayout) else []
        return [*super().frame_layer_methods, *funcs]

    """
    * Groups
    """

    @auto_prop_cached
    def textbox_group(self) -> LayerSet:
        """LayerSet: Use right page of storybook as main textbox group."""
        return psd.getLayerSet(LAYERS.RIGHT, self.adventure_group)

    """
    * Adventure Groups
    """

    @auto_prop_cached
    def adventure_group(self) -> LayerSet:
        """Adventure storybook group."""
        return psd.getLayerSet(LAYERS.STORYBOOK)

    @auto_prop_cached
    def adventure_pinlines_group(self) -> LayerSet:
        """Pinline at the bottom of adventure storybook."""
        return psd.getLayerSet(LAYERS.PINLINES, self.adventure_group)

    @auto_prop_cached
    def adventure_textbox_group(self) -> LayerSet:
        """Left side storybook page, contains adventure text."""
        return psd.getLayerSet(LAYERS.LEFT, self.adventure_group)

    @auto_prop_cached
    def adventure_name_group(self) -> LayerSet:
        """Plate to color for adventure name."""
        return psd.getLayerSet(LAYERS.ADVENTURE_NAME, self.adventure_group)

    @auto_prop_cached
    def adventure_typeline_group(self) -> LayerSet:
        """Plate to color for adventure typeline."""
        return psd.getLayerSet(LAYERS.ADVENTURE_TYPELINE, self.adventure_group)

    @auto_prop_cached
    def adventure_typeline_accent_group(self) -> LayerSet:
        """Plate to color for adventure typeline accent."""
        return psd.getLayerSet(LAYERS.ADVENTURE_TYPELINE_ACCENT, self.adventure_group)

    @auto_prop_cached
    def adventure_wings_group(self) -> LayerSet:
        """Group containing wings on each side of adventure storybook."""
        return psd.getLayerSet(LAYERS.WINGS, self.adventure_group)

    """
    * Adventure Colors
    """

    @auto_prop_cached
    def adventure_textbox_colors(self) -> str:
        """Colors to use for adventure textbox textures."""
        return self.layout.adventure_colors

    @auto_prop_cached
    def adventure_name_colors(self) -> list[int]:
        """Colors to use for adventure name box."""
        return self.adventure_name_color_map.get(self.layout.adventure_colors)

    @auto_prop_cached
    def adventure_typeline_colors(self) -> list[int]:
        """Colors to use for adventure typeline box."""
        return self.adventure_typeline_color_map.get(self.layout.adventure_colors)

    @auto_prop_cached
    def adventure_typeline_accent_colors(self) -> list[int]:
        """Colors to use for adventure typeline accent box."""
        return self.adventure_typeline_accent_color_map.get(self.layout.adventure_colors)

    @auto_prop_cached
    def adventure_wings_colors(self) -> Union[list[int], list[dict]]:
        """Colors to use for adventure wings."""
        return psd.get_pinline_gradient(
            self.identity if 1 < len(self.identity) < self.color_limit else self.pinlines,
            color_map=self.adventure_wings_color_map)

    """
    * Adventure Blending Masks
    """

    @auto_prop_cached
    def adventure_textbox_masks(self) -> list[ArtLayer]:
        """Masks to use for adventure textbox texture blending."""
        return []

    @auto_prop_cached
    def textbox_masks(self) -> list[ArtLayer]:
        return [psd.getLayer(LAYERS.HALF, [LAYERS.MASKS, LAYERS.RIGHT])]

    """
    * Adventure Frame Methods
    """

    def enable_adventure_layers(self) -> None:
        """Add and modify layers required for Adventure cards."""

        # Pinlines
        self.generate_layer(
            group=self.adventure_pinlines_group,
            colors=self.pinlines_colors)

        # Wings
        self.generate_layer(
            group=self.adventure_wings_group,
            colors=self.adventure_wings_colors)

        # textbox
        self.generate_layer(
            group=self.adventure_textbox_group,
            colors=self.adventure_textbox_colors,
            masks=self.adventure_textbox_masks)

        # Adventure Name
        self.generate_layer(
            group=self.adventure_name_group,
            colors=self.adventure_name_colors)

        # Adventure Typeline
        self.generate_layer(
            group=self.adventure_typeline_group,
            colors=self.adventure_typeline_colors)

        # Adventure Accent
        self.generate_layer(
            group=self.adventure_typeline_accent_group,
            colors=self.adventure_typeline_accent_colors)

Attributes

adventure_name_color_map = {'W': [179, 172, 156], 'U': [43, 126, 167], 'B': [104, 103, 102], 'R': [159, 83, 59], 'G': [68, 96, 63], 'Colorless': [], 'Gold': [166, 145, 80], 'Land': [177, 166, 169]}

Maps color values to adventure typeline box.

adventure_typeline_accent_color_map = {'W': [90, 82, 71], 'U': [2, 67, 96], 'B': [20, 17, 19], 'R': [81, 34, 22], 'G': [2, 34, 16], 'Colorless': [], 'Gold': [75, 62, 37], 'Land': [115, 98, 89]}

Maps color values to adventure wings.

adventure_typeline_color_map = {'W': [129, 120, 103], 'U': [3, 94, 127], 'B': [44, 41, 40], 'R': [124, 51, 33], 'G': [11, 53, 30], 'Colorless': [], 'Gold': [117, 90, 40], 'Land': [154, 137, 130]}

Maps color values to adventure typeline accent box.

adventure_wings_color_map = {'W': [213, 203, 181], 'U': [181, 198, 213], 'B': [162, 155, 152], 'R': [192, 142, 115], 'G': [174, 174, 155], 'Colorless': [], 'Gold': [196, 172, 131], 'Land': [194, 178, 177]}

  • Mixin Methods

Functions

adventure_group() -> LayerSet

Adventure storybook group.

Source code in src\templates\adventure.py
190
191
192
193
@auto_prop_cached
def adventure_group(self) -> LayerSet:
    """Adventure storybook group."""
    return psd.getLayerSet(LAYERS.STORYBOOK)

adventure_name_colors() -> list[int]

Colors to use for adventure name box.

Source code in src\templates\adventure.py
234
235
236
237
@auto_prop_cached
def adventure_name_colors(self) -> list[int]:
    """Colors to use for adventure name box."""
    return self.adventure_name_color_map.get(self.layout.adventure_colors)

adventure_name_group() -> LayerSet

Plate to color for adventure name.

Source code in src\templates\adventure.py
205
206
207
208
@auto_prop_cached
def adventure_name_group(self) -> LayerSet:
    """Plate to color for adventure name."""
    return psd.getLayerSet(LAYERS.ADVENTURE_NAME, self.adventure_group)

adventure_pinlines_group() -> LayerSet

Pinline at the bottom of adventure storybook.

Source code in src\templates\adventure.py
195
196
197
198
@auto_prop_cached
def adventure_pinlines_group(self) -> LayerSet:
    """Pinline at the bottom of adventure storybook."""
    return psd.getLayerSet(LAYERS.PINLINES, self.adventure_group)

adventure_textbox_colors() -> str

Colors to use for adventure textbox textures.

Source code in src\templates\adventure.py
229
230
231
232
@auto_prop_cached
def adventure_textbox_colors(self) -> str:
    """Colors to use for adventure textbox textures."""
    return self.layout.adventure_colors

adventure_textbox_group() -> LayerSet

Left side storybook page, contains adventure text.

Source code in src\templates\adventure.py
200
201
202
203
@auto_prop_cached
def adventure_textbox_group(self) -> LayerSet:
    """Left side storybook page, contains adventure text."""
    return psd.getLayerSet(LAYERS.LEFT, self.adventure_group)

adventure_textbox_masks() -> list[ArtLayer]

Masks to use for adventure textbox texture blending.

Source code in src\templates\adventure.py
260
261
262
263
@auto_prop_cached
def adventure_textbox_masks(self) -> list[ArtLayer]:
    """Masks to use for adventure textbox texture blending."""
    return []

adventure_typeline_accent_colors() -> list[int]

Colors to use for adventure typeline accent box.

Source code in src\templates\adventure.py
244
245
246
247
@auto_prop_cached
def adventure_typeline_accent_colors(self) -> list[int]:
    """Colors to use for adventure typeline accent box."""
    return self.adventure_typeline_accent_color_map.get(self.layout.adventure_colors)

adventure_typeline_accent_group() -> LayerSet

Plate to color for adventure typeline accent.

Source code in src\templates\adventure.py
215
216
217
218
@auto_prop_cached
def adventure_typeline_accent_group(self) -> LayerSet:
    """Plate to color for adventure typeline accent."""
    return psd.getLayerSet(LAYERS.ADVENTURE_TYPELINE_ACCENT, self.adventure_group)

adventure_typeline_colors() -> list[int]

Colors to use for adventure typeline box.

Source code in src\templates\adventure.py
239
240
241
242
@auto_prop_cached
def adventure_typeline_colors(self) -> list[int]:
    """Colors to use for adventure typeline box."""
    return self.adventure_typeline_color_map.get(self.layout.adventure_colors)

adventure_typeline_group() -> LayerSet

Plate to color for adventure typeline.

Source code in src\templates\adventure.py
210
211
212
213
@auto_prop_cached
def adventure_typeline_group(self) -> LayerSet:
    """Plate to color for adventure typeline."""
    return psd.getLayerSet(LAYERS.ADVENTURE_TYPELINE, self.adventure_group)

adventure_wings_colors() -> Union[list[int], list[dict]]

Colors to use for adventure wings.

Source code in src\templates\adventure.py
249
250
251
252
253
254
@auto_prop_cached
def adventure_wings_colors(self) -> Union[list[int], list[dict]]:
    """Colors to use for adventure wings."""
    return psd.get_pinline_gradient(
        self.identity if 1 < len(self.identity) < self.color_limit else self.pinlines,
        color_map=self.adventure_wings_color_map)

adventure_wings_group() -> LayerSet

Group containing wings on each side of adventure storybook.

Source code in src\templates\adventure.py
220
221
222
223
@auto_prop_cached
def adventure_wings_group(self) -> LayerSet:
    """Group containing wings on each side of adventure storybook."""
    return psd.getLayerSet(LAYERS.WINGS, self.adventure_group)

enable_adventure_layers() -> None

Add and modify layers required for Adventure cards.

Source code in src\templates\adventure.py
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
def enable_adventure_layers(self) -> None:
    """Add and modify layers required for Adventure cards."""

    # Pinlines
    self.generate_layer(
        group=self.adventure_pinlines_group,
        colors=self.pinlines_colors)

    # Wings
    self.generate_layer(
        group=self.adventure_wings_group,
        colors=self.adventure_wings_colors)

    # textbox
    self.generate_layer(
        group=self.adventure_textbox_group,
        colors=self.adventure_textbox_colors,
        masks=self.adventure_textbox_masks)

    # Adventure Name
    self.generate_layer(
        group=self.adventure_name_group,
        colors=self.adventure_name_colors)

    # Adventure Typeline
    self.generate_layer(
        group=self.adventure_typeline_group,
        colors=self.adventure_typeline_colors)

    # Adventure Accent
    self.generate_layer(
        group=self.adventure_typeline_accent_group,
        colors=self.adventure_typeline_accent_colors)

frame_layer_methods() -> list[Callable]

Add Adventure frame layers step.

Source code in src\templates\adventure.py
171
172
173
174
175
@auto_prop_cached
def frame_layer_methods(self) -> list[Callable]:
    """Add Adventure frame layers step."""
    funcs = [self.enable_adventure_layers] if isinstance(self.layout, AdventureLayout) else []
    return [*super().frame_layer_methods, *funcs]

textbox_group() -> LayerSet

Source code in src\templates\adventure.py
181
182
183
184
@auto_prop_cached
def textbox_group(self) -> LayerSet:
    """LayerSet: Use right page of storybook as main textbox group."""
    return psd.getLayerSet(LAYERS.RIGHT, self.adventure_group)