49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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
124
125
126
127
128
129
130
131
132
133
|
# File 'lib/punks/punks.rb', line 49
def self.generate( *values, style: nil, patch: nil )
if values[0].is_a?( String )
if style
values = if style.downcase.index( 'natural') && style.downcase.index( '2')
["#{values[0]} (N2)"] + values[1..-1]
elsif style.downcase[0] == 'n' ["#{values[0]} (N)"] + values[1..-1]
else
puts "!! ERROR - unknown punk style #{style}; sorry"
exit 1
end
end
archetype_key = Sheet.normalize_key( values[0] )
if archetype_key.end_with?( 'bw' ) || archetype_key.end_with?( '1bit')
values = [values[0]] + values[1..-1].map do |attribute|
if attribute.is_a?( Pixelart::Image )
attribute
else
attribute_key = Sheet.normalize_key( attribute )
if ['wildhair'].include?( attribute_key ) attribute
elsif attribute_key.index( "black" )
attribute else
"#{attribute} B&W"
end
end
end
pp values
end
if archetype_key.index( 'female1' ) ||
archetype_key.index( 'female2' ) ||
archetype_key.index( 'female3' ) ||
archetype_key.index( 'female4' ) ||
archetype_key.index( 'zombiefemale' )
values = [values[0]] + values[1..-1].map do |attribute|
if attribute.is_a?( Pixelart::Image )
attribute
else
attribute_key = Sheet.normalize_key( attribute )
if attribute_key == 'smile' || attribute_key == 'frown'
attribute += if archetype_key.index( 'zombiefemale' ) then ' Zombie'
elsif archetype_key.index( 'female1' ) then ' 1'
elsif archetype_key.index( 'female2' ) then ' 2'
elsif archetype_key.index( 'female3' ) then ' 3'
elsif archetype_key.index( 'female4' ) then ' 4'
else
puts "!! ERROR - smile or frown (mouth expression) not supported for archetype:"
pp values
exit 1
end
end
attribute
end
end
end
end
generator.generate( *values, style: style, patch: patch )
end
|