976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076 | class LOTRTemplate(VectorTemplate):
"""
* Lord of the Rings template introduced in Lord of The Rings: Tales of Middle Earth.
* Credit to Tupinambá (Pedro Neves) for the master template
* With additional support from CompC and MrTeferi
"""
template_suffix = 'Lord of the Rings'
# Static Properties
enabled_shapes = []
# Color Maps
pinlines_color_map = {
**pinlines_color_map.copy(),
'W': [230, 220, 185],
'U': [72, 142, 191],
'B': [126, 128, 127],
'R': [217, 94, 76],
'G': [97, 143, 102],
'Gold': [246, 213, 125],
'Land': [181, 162, 149],
'Artifact': [210, 219, 227],
'Colorless': [210, 219, 227]}
dark_color_map = {
**pinlines_color_map.copy(),
'W': [134, 123, 105],
'U': [44, 51, 103],
'B': [44, 43, 39],
'R': [118, 34, 34],
'G': [13, 68, 45],
'Gold': [158, 124, 78],
'Land': [103, 90, 74],
'Artifact': [61, 88, 109],
'Colorless': [78, 91, 101],
'Vehicle': [76, 51, 20]}
"""
* Colors
"""
@auto_prop_cached
def crown_colors(self) -> Union[SolidColor, list[dict]]:
"""Must be returned as SolidColor or gradient notation."""
return psd.get_pinline_gradient(
self.identity if 1 < len(self.identity) < self.color_limit else self.pinlines,
color_map=self.pinlines_color_map)
@auto_prop_cached
def twins_colors(self) -> Union[SolidColor, list[dict]]:
"""Must be returned as SolidColor or gradient notation."""
return psd.get_pinline_gradient(
colors=self.twins,
color_map=self.dark_color_map)
@auto_prop_cached
def pt_colors(self) -> Union[SolidColor, list[dict]]:
"""Must be returned as SolidColor or gradient notation."""
return psd.get_pinline_gradient(
colors=LAYERS.VEHICLE if self.is_vehicle else self.twins,
color_map=self.dark_color_map)
@auto_prop_cached
def textbox_colors(self) -> str:
"""str: Just use twins value for texture name."""
return self.twins
@auto_prop_cached
def background_colors(self) -> str:
"""str: Just use pinlines value for texture name."""
return self.pinlines
"""
* Groups
"""
@auto_prop_cached
def pinlines_groups(self) -> list[LayerSet]:
"""Pinlines and crown pinlines addon."""
groups = [self.pinlines_group]
if self.is_legendary:
groups.append(self.crown_group)
return groups
"""
* Masks
"""
@auto_prop_cached
def enabled_masks(self) -> list[Union[dict, list, ArtLayer, LayerSet, None]]:
"""Mask Pinlines if Legendary."""
if self.is_legendary:
return [self.pinlines_group]
return []
"""
* Frame Layer Methods
"""
def enable_crown(self) -> None:
"""Enable the Legendary crown group only."""
self.crown_group.visible = True
|