Skip to content

AdventureVectorTemplate

src.templates.adventure.AdventureVectorTemplate

Bases: AdventureVectorMod, VectorTemplate

Vector template for Adventure cards introduced in Throne of Eldraine.

Source code in src\templates\adventure.py
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
class AdventureVectorTemplate(AdventureVectorMod, VectorTemplate):
    """Vector template for Adventure cards introduced in Throne of Eldraine."""

    """
    * Groups
    """

    @auto_prop_cached
    def crown_group(self) -> LayerSet:
        return psd.getLayerSet(LAYERS.LEGENDARY_CROWN, LAYERS.LEGENDARY_CROWN)

    @auto_prop_cached
    def pinlines_group(self) -> LayerSet:
        return psd.getLayerSet(LAYERS.PINLINES, LAYERS.PINLINES)

    """
    * Shapes
    """

    @auto_prop_cached
    def pinlines_legendary_shape(self) -> Optional[ArtLayer]:
        if self.is_legendary:
            return psd.getLayer(LAYERS.LEGENDARY, [self.pinlines_group, LAYERS.SHAPE])
        return

    @auto_prop_cached
    def pt_shape(self) -> Optional[ArtLayer]:
        if self.is_creature:
            return psd.getLayer(LAYERS.SHAPE, LAYERS.PT_BOX)
        return

    @auto_prop_cached
    def enabled_shapes(self) -> list[Union[ArtLayer, LayerSet, None]]:
        return [self.border_shape, self.pinlines_legendary_shape, self.pt_shape]

    """
    METHODS
    """

    def enable_crown(self) -> None:
        self.crown_group.parent.visible = True
        super().enable_crown()