cryptopunks 2.0.1 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -3
- data/Manifest.txt +0 -3
- data/README.md +666 -526
- data/Rakefile +40 -32
- data/bin/cryptopunk +17 -17
- data/bin/punk +17 -17
- data/lib/cryptopunks/attributes.rb +147 -147
- data/lib/cryptopunks/colors.rb +162 -162
- data/lib/cryptopunks/composite.rb +38 -38
- data/lib/cryptopunks/contract/punksdata-assets.rb +338 -338
- data/lib/cryptopunks/contract/punksdata-contract.rb +55 -55
- data/lib/cryptopunks/contract/punksdata-meta.rb +2107 -2107
- data/lib/cryptopunks/dataset.rb +67 -67
- data/lib/cryptopunks/image.rb +35 -33
- data/lib/cryptopunks/structs.rb +161 -161
- data/lib/cryptopunks/tool.rb +382 -275
- data/lib/cryptopunks/version.rb +27 -23
- data/lib/cryptopunks.rb +66 -109
- metadata +16 -19
- data/config/spritesheet.csv +0 -402
- data/config/spritesheet.png +0 -0
- data/lib/cryptopunks/generator.rb +0 -223
data/config/spritesheet.csv
DELETED
@@ -1,402 +0,0 @@
|
|
1
|
-
id, name, gender, type, more_names
|
2
|
-
0, Human 1, m, Archetype - Human, Human Male 1 | Human 1 ♂ | Male 1 | Man 1 | ♂ 1
|
3
|
-
1, Human 2, m, Archetype - Human, Human Male 2 | Human 2 ♂ | Male 2 | Man 2 | ♂ 2
|
4
|
-
2, Human 3, m, Archetype - Human, Human Male 3 | Human 3 ♂ | Male 3 | Man 3 | ♂ 3
|
5
|
-
3, Human 4, m, Archetype - Human, Human Male 4 | Human 4 ♂ | Male 4 | Man 4 | ♂ 4
|
6
|
-
4, Human Female 1, f, Archetype - Human, Human 1 ♀ | Female 1 | Woman 1 | Lady 1 | ♀ 1
|
7
|
-
5, Human Female 2, f, Archetype - Human, Human 2 ♀ | Female 2 | Woman 2 | Lady 2 | ♀ 2
|
8
|
-
6, Human Female 3, f, Archetype - Human, Human 3 ♀ | Female 3 | Woman 3 | Lady 3 | ♀ 3
|
9
|
-
7, Human Female 4, f, Archetype - Human, Human 4 ♀ | Female 4 | Woman 4 | Lady 4 | ♀ 4
|
10
|
-
8, Zombie, m, Archetype - Zombie, Zombie Male | Zombie ♂
|
11
|
-
9, Zombie Female, f, Archetype - Zombie, Zombie ♀ | Lady Zombie
|
12
|
-
10, Ape, m, Archetype - Ape, Ape Male | Ape ♂
|
13
|
-
11, Ape Female, f, Archetype - Ape, Ape ♀ | Lady Ape
|
14
|
-
12, Alien, m, Archetype - Alien, Alien Male | Alien ♂
|
15
|
-
13, Alien Female, f, Archetype - Alien, Alien ♀ | Lady Alien
|
16
|
-
14, Demon, m, Archetype - Demon, Demon Male | Demon ♂
|
17
|
-
15, Demon Female, f, Archetype - Demon, Demon ♀ | Lady Demon
|
18
|
-
16, Mummy, m, Archetype - Mummy, Mummy Male | Mummy ♂
|
19
|
-
17, Mummy Female, f, Archetype - Mummy, Mummy ♀ | Lady Mummy
|
20
|
-
18, Orc, m, Archetype - Orc, Orc Male | Orc ♂
|
21
|
-
19, Orc Female, f, Archetype - Orc, Orc ♀ | Lady Orc
|
22
|
-
20, Robot, m, Archetype - Robot, Robot Male | Robot ♂
|
23
|
-
21, Robot Female, f, Archetype - Robot, Robot ♀ | Lady Robot
|
24
|
-
22, Skeleton, m, Archetype - Skeleton, Skeleton Male | Skeleton ♂
|
25
|
-
23, Skeleton Female, f, Archetype - Skeleton, Skeleton ♀ | Lady Skeleton
|
26
|
-
24, Vampire, m, Archetype - Vampire, Vampire Male | Vampire ♂
|
27
|
-
25, Vampire Female, f, Archetype - Vampire, Vampire ♀ | Lady Vamp | Lady Vampire
|
28
|
-
26, Zombie (Ape), m, Archetype - Zombie, Zombie (Ape) Male | Zombie (Ape) ♂
|
29
|
-
27, Alien (Ape), m, Archetype - Alien, Alien (Ape) Male | Alien (Ape) ♂
|
30
|
-
28, Alien 0°, m, Archetype - Alien, Alien Male 0° | Alien 0° ♂ | Alien Red | Alien Male Red | Alien Red ♂
|
31
|
-
29, Alien 30°, m, Archetype - Alien, Alien Male 30° | Alien 30° ♂ | Alien Orange | Alien Male Orange | Alien Orange ♂
|
32
|
-
30, Alien 60°, m, Archetype - Alien, Alien Male 60° | Alien 60° ♂ | Alien Yellow | Alien Male Yellow | Alien Yellow ♂
|
33
|
-
31, Alien 90°, m, Archetype - Alien, Alien Male 90° | Alien 90° ♂ | Alien Yellow Green | Alien Male Yellow Green | Alien Yellow Green ♂
|
34
|
-
32, Alien 120°, m, Archetype - Alien, Alien Male 120° | Alien 120° ♂ | Alien Green | Alien Male Green | Alien Green ♂
|
35
|
-
33, Alien 150°, m, Archetype - Alien, Alien Male 150° | Alien 150° ♂ | Alien Cyan Green | Alien Male Cyan Green | Alien Cyan Green ♂
|
36
|
-
34, Alien 180°, m, Archetype - Alien, Alien Male 180° | Alien 180° ♂ | Alien Cyan | Alien Male Cyan | Alien Cyan ♂
|
37
|
-
35, Alien 210°, m, Archetype - Alien, Alien Male 210° | Alien 210° ♂ | Alien Cyan Blue | Alien Male Cyan Blue | Alien Cyan Blue ♂
|
38
|
-
36, Alien 240°, m, Archetype - Alien, Alien Male 240° | Alien 240° ♂ | Alien Blue | Alien Male Blue | Alien Blue ♂
|
39
|
-
37, Alien 270°, m, Archetype - Alien, Alien Male 270° | Alien 270° ♂ | Alien Violet | Alien Male Violet | Alien Violet ♂
|
40
|
-
38, Alien 300°, m, Archetype - Alien, Alien Male 300° | Alien 300° ♂ | Alien Magenta | Alien Male Magenta | Alien Magenta ♂
|
41
|
-
39, Alien 330°, m, Archetype - Alien, Alien Male 330° | Alien 330° ♂ | Alien Red Magenta | Alien Male Red Magenta | Alien Red Magenta ♂
|
42
|
-
40, Alien (Ape) 0°, m, Archetype - Alien, Alien (Ape) Male 0° | Alien (Ape) 0° ♂ | Alien (Ape) Red | Alien (Ape) Male Red | Alien (Ape) Red ♂
|
43
|
-
41, Alien (Ape) 30°, m, Archetype - Alien, Alien (Ape) Male 30° | Alien (Ape) 30° ♂ | Alien (Ape) Orange | Alien (Ape) Male Orange | Alien (Ape) Orange ♂
|
44
|
-
42, Alien (Ape) 60°, m, Archetype - Alien, Alien (Ape) Male 60° | Alien (Ape) 60° ♂ | Alien (Ape) Yellow | Alien (Ape) Male Yellow | Alien (Ape) Yellow ♂
|
45
|
-
43, Alien (Ape) 90°, m, Archetype - Alien, Alien (Ape) Male 90° | Alien (Ape) 90° ♂ | Alien (Ape) Yellow Green | Alien (Ape) Male Yellow Green | Alien (Ape) Yellow Green ♂
|
46
|
-
44, Alien (Ape) 120°, m, Archetype - Alien, Alien (Ape) Male 120° | Alien (Ape) 120° ♂ | Alien (Ape) Green | Alien (Ape) Male Green | Alien (Ape) Green ♂
|
47
|
-
45, Alien (Ape) 150°, m, Archetype - Alien, Alien (Ape) Male 150° | Alien (Ape) 150° ♂ | Alien (Ape) Cyan Green | Alien (Ape) Male Cyan Green | Alien (Ape) Cyan Green ♂
|
48
|
-
46, Alien (Ape) 180°, m, Archetype - Alien, Alien (Ape) Male 180° | Alien (Ape) 180° ♂ | Alien (Ape) Cyan | Alien (Ape) Male Cyan | Alien (Ape) Cyan ♂
|
49
|
-
47, Alien (Ape) 210°, m, Archetype - Alien, Alien (Ape) Male 210° | Alien (Ape) 210° ♂ | Alien (Ape) Cyan Blue | Alien (Ape) Male Cyan Blue | Alien (Ape) Cyan Blue ♂
|
50
|
-
48, Alien (Ape) 240°, m, Archetype - Alien, Alien (Ape) Male 240° | Alien (Ape) 240° ♂ | Alien (Ape) Blue | Alien (Ape) Male Blue | Alien (Ape) Blue ♂
|
51
|
-
49, Alien (Ape) 270°, m, Archetype - Alien, Alien (Ape) Male 270° | Alien (Ape) 270° ♂ | Alien (Ape) Violet | Alien (Ape) Male Violet | Alien (Ape) Violet ♂
|
52
|
-
50, Alien (Ape) 300°, m, Archetype - Alien, Alien (Ape) Male 300° | Alien (Ape) 300° ♂ | Alien (Ape) Magenta | Alien (Ape) Male Magenta | Alien (Ape) Magenta ♂
|
53
|
-
51, Alien (Ape) 330°, m, Archetype - Alien, Alien (Ape) Male 330° | Alien (Ape) 330° ♂ | Alien (Ape) Red Magenta | Alien (Ape) Male Red Magenta | Alien (Ape) Red Magenta ♂
|
54
|
-
52, Alien Female 0°, f, Archetype - Alien, Alien 0° ♀ | Alien Female Red | Alien Red ♀
|
55
|
-
53, Alien Female 30°, f, Archetype - Alien, Alien 30° ♀ | Alien Female Orange | Alien Orange ♀
|
56
|
-
54, Alien Female 60°, f, Archetype - Alien, Alien 60° ♀ | Alien Female Yellow | Alien Yellow ♀
|
57
|
-
55, Alien Female 90°, f, Archetype - Alien, Alien 90° ♀ | Alien Female Yellow Green | Alien Yellow Green ♀
|
58
|
-
56, Alien Female 120°, f, Archetype - Alien, Alien 120° ♀ | Alien Female Green | Alien Green ♀
|
59
|
-
57, Alien Female 150°, f, Archetype - Alien, Alien 150° ♀ | Alien Female Cyan Green | Alien Cyan Green ♀
|
60
|
-
58, Alien Female 180°, f, Archetype - Alien, Alien 180° ♀ | Alien Female Cyan | Alien Cyan ♀
|
61
|
-
59, Alien Female 210°, f, Archetype - Alien, Alien 210° ♀ | Alien Female Cyan Blue | Alien Cyan Blue ♀
|
62
|
-
60, Alien Female 240°, f, Archetype - Alien, Alien 240° ♀ | Alien Female Blue | Alien Blue ♀
|
63
|
-
61, Alien Female 270°, f, Archetype - Alien, Alien 270° ♀ | Alien Female Violet | Alien Violet ♀
|
64
|
-
62, Alien Female 300°, f, Archetype - Alien, Alien 300° ♀ | Alien Female Magenta | Alien Magenta ♀
|
65
|
-
63, Alien Female 330°, f, Archetype - Alien, Alien 330° ♀ | Alien Female Red Magenta | Alien Red Magenta ♀
|
66
|
-
64, 3D Glasses, m, Attribute,
|
67
|
-
65, 3D Glasses, f, Attribute,
|
68
|
-
66, Big Shades, m, Attribute,
|
69
|
-
67, Big Shades, f, Attribute,
|
70
|
-
68, Classic Shades, m, Attribute,
|
71
|
-
69, Classic Shades, f, Attribute,
|
72
|
-
70, Eye Mask, m, Attribute,
|
73
|
-
71, Eye Mask, f, Attribute,
|
74
|
-
72, Eye Patch, m, Attribute,
|
75
|
-
73, Eye Patch, f, Attribute,
|
76
|
-
74, Horned Rim Glasses, m, Attribute,
|
77
|
-
75, Horned Rim Glasses, f, Attribute,
|
78
|
-
76, Nerd Glasses, m, Attribute,
|
79
|
-
77, Nerd Glasses, f, Attribute,
|
80
|
-
78, Regular Shades, m, Attribute,
|
81
|
-
79, Regular Shades, f, Attribute,
|
82
|
-
80, Small Shades, m, Attribute,
|
83
|
-
81, Small Shades, f, Attribute,
|
84
|
-
82, VR, m, Attribute,
|
85
|
-
83, VR, f, Attribute,
|
86
|
-
84, Welding Goggles, f, Attribute,
|
87
|
-
85, Heart Shades, m, Attribute,
|
88
|
-
86, Heart Shades, f, Attribute,
|
89
|
-
87, Laser Eyes, m, Attribute,
|
90
|
-
88, Laser Eyes Gold, m, Attribute,
|
91
|
-
89, Ski Googles, m, Attribute,
|
92
|
-
90, Ski Googles, f, Attribute,
|
93
|
-
91, Tears, m, Attribute,
|
94
|
-
92, Tears, f, Attribute,
|
95
|
-
93, Blue Eye Shadow, f, Attribute,
|
96
|
-
94, Clown Eyes Blue, m, Attribute,
|
97
|
-
95, Clown Eyes Blue, f, Attribute,
|
98
|
-
96, Clown Eyes Green, m, Attribute,
|
99
|
-
97, Clown Eyes Green, f, Attribute,
|
100
|
-
98, Green Eye Shadow, f, Attribute,
|
101
|
-
99, Purple Eye Shadow, f, Attribute,
|
102
|
-
100, Bandana, m, Attribute,
|
103
|
-
101, Bandana, f, Attribute,
|
104
|
-
102, Beanie, m, Attribute,
|
105
|
-
103, Beanie, f, Attribute,
|
106
|
-
104, Big Beard, m, Attribute,
|
107
|
-
105, Black Lipstick, f, Attribute,
|
108
|
-
106, Buck Teeth, m, Attribute,
|
109
|
-
107, Cap Forward, m, Attribute,
|
110
|
-
108, Cap Forward, f, Attribute,
|
111
|
-
109, Chinstrap, m, Attribute,
|
112
|
-
110, Choker, f, Attribute,
|
113
|
-
111, Cigarette, m, Attribute,
|
114
|
-
112, Cigarette, f, Attribute,
|
115
|
-
113, Clown Nose, m, Attribute,
|
116
|
-
114, Clown Nose, f, Attribute,
|
117
|
-
115, Cowboy Hat, m, Attribute,
|
118
|
-
116, Cowboy Hat, f, Attribute,
|
119
|
-
117, Do-rag, m, Attribute,
|
120
|
-
118, Do-rag, f, Attribute,
|
121
|
-
119, Earring, m, Attribute,
|
122
|
-
120, Earring, f, Attribute,
|
123
|
-
121, Fedora, m, Attribute,
|
124
|
-
122, Fedora, f, Attribute,
|
125
|
-
123, Front Beard, m, Attribute,
|
126
|
-
124, Front Beard Dark, m, Attribute,
|
127
|
-
125, Frown, m, Attribute,
|
128
|
-
126, Goat, m, Attribute,
|
129
|
-
127, Gold Chain, m, Attribute,
|
130
|
-
128, Gold Chain, f, Attribute,
|
131
|
-
129, Handlebars, m, Attribute,
|
132
|
-
130, Headband, m, Attribute,
|
133
|
-
131, Headband, f, Attribute,
|
134
|
-
132, Hoodie, m, Attribute,
|
135
|
-
133, Hoodie, f, Attribute,
|
136
|
-
134, Hot Lipstick, f, Attribute,
|
137
|
-
135, Knitted Cap, m, Attribute,
|
138
|
-
136, Knitted Cap, f, Attribute,
|
139
|
-
137, Luxurious Beard, m, Attribute,
|
140
|
-
138, Medical Mask, m, Attribute,
|
141
|
-
139, Medical Mask, f, Attribute,
|
142
|
-
140, Mole, m, Attribute,
|
143
|
-
141, Mole, f, Attribute,
|
144
|
-
142, Mustache, m, Attribute,
|
145
|
-
143, Muttonchops, m, Attribute,
|
146
|
-
144, Normal Beard, m, Attribute,
|
147
|
-
145, Normal Beard Black, m, Attribute,
|
148
|
-
146, Pilot Helmet, f, Attribute,
|
149
|
-
147, Pipe, m, Attribute,
|
150
|
-
148, Pipe, f, Attribute,
|
151
|
-
149, Police Cap, m, Attribute,
|
152
|
-
150, Police Cap, f, Attribute,
|
153
|
-
151, Purple Lipstick, f, Attribute,
|
154
|
-
152, Rosy Cheeks, m, Attribute,
|
155
|
-
153, Rosy Cheeks, f, Attribute,
|
156
|
-
154, Shadow Beard, m, Attribute,
|
157
|
-
155, Silver Chain, m, Attribute,
|
158
|
-
156, Silver Chain, f, Attribute,
|
159
|
-
157, Smile, m, Attribute,
|
160
|
-
158, Spots, m, Attribute,
|
161
|
-
159, Spots, f, Attribute,
|
162
|
-
160, Tassle Hat, f, Attribute,
|
163
|
-
161, Tiara, f, Attribute,
|
164
|
-
162, Top Hat, m, Attribute,
|
165
|
-
163, Top Hat, f, Attribute,
|
166
|
-
164, Vape, m, Attribute,
|
167
|
-
165, Vape, f, Attribute,
|
168
|
-
166, Bear Hood, m, Attribute,
|
169
|
-
167, Bear Hood, f, Attribute,
|
170
|
-
168, Birthday Hat, m, Attribute,
|
171
|
-
169, Birthday Hat, f, Attribute,
|
172
|
-
170, Bow, f, Attribute,
|
173
|
-
171, Cigar, m, Attribute,
|
174
|
-
172, Cigar, f, Attribute,
|
175
|
-
173, Crown, m, Attribute,
|
176
|
-
174, Crown, f, Attribute,
|
177
|
-
175, Flowers, f, Attribute,
|
178
|
-
176, Frog Hood, m, Attribute,
|
179
|
-
177, Frog Hood, f, Attribute,
|
180
|
-
178, Gold Diamond Necklace, m, Attribute,
|
181
|
-
179, Gold Diamond Necklace, f, Attribute,
|
182
|
-
180, Jester Hat, m, Attribute,
|
183
|
-
181, Jester Hat, f, Attribute,
|
184
|
-
182, Pink Lipstick, f, Attribute,
|
185
|
-
183, Red Lipstick, f, Attribute,
|
186
|
-
184, Santa Hat, m, Attribute,
|
187
|
-
185, Santa Hat, f, Attribute,
|
188
|
-
186, Silver Earring, m, Attribute,
|
189
|
-
187, Silver Earring, f, Attribute,
|
190
|
-
188, Sombrero, m, Attribute,
|
191
|
-
189, Sombrero, f, Attribute,
|
192
|
-
190, Sun Hat, m, Attribute,
|
193
|
-
191, Sun Hat, f, Attribute,
|
194
|
-
192, Superhero Tiara, f, Attribute,
|
195
|
-
193, Viking Helmet, m, Attribute,
|
196
|
-
194, Viking Helmet, f, Attribute,
|
197
|
-
195, Winter Hat, m, Attribute,
|
198
|
-
196, Winter Hat, f, Attribute,
|
199
|
-
197, Cap, m, Attribute,
|
200
|
-
198, Cap, f, Attribute,
|
201
|
-
199, Cap 0°, m, Attribute, Cap Red
|
202
|
-
200, Cap 0°, f, Attribute, Cap Red
|
203
|
-
201, Cap 30°, m, Attribute, Cap Orange
|
204
|
-
202, Cap 30°, f, Attribute, Cap Orange
|
205
|
-
203, Cap 60°, m, Attribute, Cap Yellow
|
206
|
-
204, Cap 60°, f, Attribute, Cap Yellow
|
207
|
-
205, Cap 90°, m, Attribute, Cap Yellow Green
|
208
|
-
206, Cap 90°, f, Attribute, Cap Yellow Green
|
209
|
-
207, Cap 120°, m, Attribute, Cap Green
|
210
|
-
208, Cap 120°, f, Attribute, Cap Green
|
211
|
-
209, Cap 150°, m, Attribute, Cap Cyan Green
|
212
|
-
210, Cap 150°, f, Attribute, Cap Cyan Green
|
213
|
-
211, Cap 180°, m, Attribute, Cap Cyan
|
214
|
-
212, Cap 180°, f, Attribute, Cap Cyan
|
215
|
-
213, Cap 210°, m, Attribute, Cap Cyan Blue
|
216
|
-
214, Cap 210°, f, Attribute, Cap Cyan Blue
|
217
|
-
215, Cap 240°, m, Attribute, Cap Blue
|
218
|
-
216, Cap 240°, f, Attribute, Cap Blue
|
219
|
-
217, Cap 270°, m, Attribute, Cap Violet
|
220
|
-
218, Cap 270°, f, Attribute, Cap Violet
|
221
|
-
219, Cap 300°, m, Attribute, Cap Magenta
|
222
|
-
220, Cap 300°, f, Attribute, Cap Magenta
|
223
|
-
221, Cap 330°, m, Attribute, Cap Red Magenta
|
224
|
-
222, Cap 330°, f, Attribute, Cap Red Magenta
|
225
|
-
223, Blonde Short, f, Attribute,
|
226
|
-
224, Crazy Hair, m, Attribute,
|
227
|
-
225, Crazy Hair, f, Attribute,
|
228
|
-
226, Dark Hair, f, Attribute,
|
229
|
-
227, Frumpy Hair, m, Attribute,
|
230
|
-
228, Frumpy Hair, f, Attribute,
|
231
|
-
229, Half Shaved, f, Attribute,
|
232
|
-
230, Messy Hair, m, Attribute,
|
233
|
-
231, Messy Hair, f, Attribute,
|
234
|
-
232, Mohawk, m, Attribute,
|
235
|
-
233, Mohawk, f, Attribute,
|
236
|
-
234, Mohawk Dark, m, Attribute,
|
237
|
-
235, Mohawk Dark, f, Attribute,
|
238
|
-
236, Mohawk Thin, m, Attribute,
|
239
|
-
237, Mohawk Thin, f, Attribute,
|
240
|
-
238, Orange Side, f, Attribute,
|
241
|
-
239, Peak Spike, m, Attribute,
|
242
|
-
240, Pigtails, f, Attribute,
|
243
|
-
241, Pink with Hat, f, Attribute,
|
244
|
-
242, Purple Hair, m, Attribute,
|
245
|
-
243, Purple Hair, f, Attribute,
|
246
|
-
244, Red Mohawk, f, Attribute,
|
247
|
-
245, Shaved Head, m, Attribute,
|
248
|
-
246, Shaved Head, f, Attribute,
|
249
|
-
247, Straight Hair, f, Attribute,
|
250
|
-
248, Straight Hair Blonde, f, Attribute,
|
251
|
-
249, Straight Hair Dark, f, Attribute,
|
252
|
-
250, Stringy Hair, m, Attribute,
|
253
|
-
251, Stringy Hair, f, Attribute,
|
254
|
-
252, Vampire Hair, m, Attribute,
|
255
|
-
253, Wild Blonde, f, Attribute,
|
256
|
-
254, Wild Hair, m, Attribute,
|
257
|
-
255, Wild Hair, f, Attribute,
|
258
|
-
256, Wild White Hair, f, Attribute,
|
259
|
-
257, Black Afro, m, Attribute,
|
260
|
-
258, Black Afro, f, Attribute,
|
261
|
-
259, Brown Afro, m, Attribute,
|
262
|
-
260, Dark Red Afro, m, Attribute,
|
263
|
-
261, Orange Afro, m, Attribute,
|
264
|
-
262, Red Afro, m, Attribute,
|
265
|
-
263, Pink Afro, m, Attribute,
|
266
|
-
264, Purple Afro, m, Attribute,
|
267
|
-
265, Blue Afro, m, Attribute,
|
268
|
-
266, Periwinkle Afro, m, Attribute,
|
269
|
-
267, Light Blue Afro, m, Attribute,
|
270
|
-
268, Light Green Afro, m, Attribute,
|
271
|
-
269, Green Afro, m, Attribute,
|
272
|
-
270, Teal Afro, m, Attribute,
|
273
|
-
271, Blonde Afro, m, Attribute,
|
274
|
-
272, Silver Afro, m, Attribute,
|
275
|
-
273, White Afro, m, Attribute,
|
276
|
-
274, Brown Afro, f, Attribute,
|
277
|
-
275, Dark Red Afro, f, Attribute,
|
278
|
-
276, Orange Afro, f, Attribute,
|
279
|
-
277, Red Afro, f, Attribute,
|
280
|
-
278, Pink Afro, f, Attribute,
|
281
|
-
279, Purple Afro, f, Attribute,
|
282
|
-
280, Blue Afro, f, Attribute,
|
283
|
-
281, Periwinkle Afro, f, Attribute,
|
284
|
-
282, Light Blue Afro, f, Attribute,
|
285
|
-
283, Light Green Afro, f, Attribute,
|
286
|
-
284, Green Afro, f, Attribute,
|
287
|
-
285, Teal Afro, f, Attribute,
|
288
|
-
286, Blonde Afro, f, Attribute,
|
289
|
-
287, Silver Afro, f, Attribute,
|
290
|
-
288, White Afro, f, Attribute,
|
291
|
-
289, Big Hair Black, m, Attribute,
|
292
|
-
290, Big Hair Black, f, Attribute,
|
293
|
-
291, Big Hair Brown, m, Attribute,
|
294
|
-
292, Big Hair Dark Red, m, Attribute,
|
295
|
-
293, Big Hair Orange, m, Attribute,
|
296
|
-
294, Big Hair Red, m, Attribute,
|
297
|
-
295, Big Hair Pink, m, Attribute,
|
298
|
-
296, Big Hair Purple, m, Attribute,
|
299
|
-
297, Big Hair Blue, m, Attribute,
|
300
|
-
298, Big Hair Periwinkle, m, Attribute,
|
301
|
-
299, Big Hair Light Blue, m, Attribute,
|
302
|
-
300, Big Hair Light Green, m, Attribute,
|
303
|
-
301, Big Hair Green, m, Attribute,
|
304
|
-
302, Big Hair Teal, m, Attribute,
|
305
|
-
303, Big Hair Blonde, m, Attribute,
|
306
|
-
304, Big Hair Silver, m, Attribute,
|
307
|
-
305, Big Hair White, m, Attribute,
|
308
|
-
306, Big Hair Brown, f, Attribute,
|
309
|
-
307, Big Hair Dark Red, f, Attribute,
|
310
|
-
308, Big Hair Orange, f, Attribute,
|
311
|
-
309, Big Hair Red, f, Attribute,
|
312
|
-
310, Big Hair Pink, f, Attribute,
|
313
|
-
311, Big Hair Purple, f, Attribute,
|
314
|
-
312, Big Hair Blue, f, Attribute,
|
315
|
-
313, Big Hair Periwinkle, f, Attribute,
|
316
|
-
314, Big Hair Light Blue, f, Attribute,
|
317
|
-
315, Big Hair Light Green, f, Attribute,
|
318
|
-
316, Big Hair Green, f, Attribute,
|
319
|
-
317, Big Hair Teal, f, Attribute,
|
320
|
-
318, Big Hair Blonde, f, Attribute,
|
321
|
-
319, Big Hair Silver, f, Attribute,
|
322
|
-
320, Big Hair White, f, Attribute,
|
323
|
-
321, Black Bob, f, Attribute,
|
324
|
-
322, Brown Bob, f, Attribute,
|
325
|
-
323, Dark Red Bob, f, Attribute,
|
326
|
-
324, Orange Bob, f, Attribute,
|
327
|
-
325, Red Bob, f, Attribute,
|
328
|
-
326, Pink Bob, f, Attribute,
|
329
|
-
327, Purple Bob, f, Attribute,
|
330
|
-
328, Blue Bob, f, Attribute,
|
331
|
-
329, Periwinkle Bob, f, Attribute,
|
332
|
-
330, Light Blue Bob, f, Attribute,
|
333
|
-
331, Light Green Bob, f, Attribute,
|
334
|
-
332, Green Bob, f, Attribute,
|
335
|
-
333, Teal Bob, f, Attribute,
|
336
|
-
334, Blonde Bob, f, Attribute,
|
337
|
-
335, Silver Bob, f, Attribute,
|
338
|
-
336, White Bob, f, Attribute,
|
339
|
-
337, Black Buzz Cut, m, Attribute,
|
340
|
-
338, Black Buzz Cut, f, Attribute,
|
341
|
-
339, Brown Buzz Cut, m, Attribute,
|
342
|
-
340, Dark Red Buzz Cut, m, Attribute,
|
343
|
-
341, Orange Buzz Cut, m, Attribute,
|
344
|
-
342, Red Buzz Cut, m, Attribute,
|
345
|
-
343, Pink Buzz Cut, m, Attribute,
|
346
|
-
344, Purple Buzz Cut, m, Attribute,
|
347
|
-
345, Blue Buzz Cut, m, Attribute,
|
348
|
-
346, Periwinkle Buzz Cut, m, Attribute,
|
349
|
-
347, Light Blue Buzz Cut, m, Attribute,
|
350
|
-
348, Light Green Buzz Cut, m, Attribute,
|
351
|
-
349, Green Buzz Cut, m, Attribute,
|
352
|
-
350, Teal Buzz Cut, m, Attribute,
|
353
|
-
351, Blonde Buzz Cut, m, Attribute,
|
354
|
-
352, Silver Buzz Cut, m, Attribute,
|
355
|
-
353, White Buzz Cut, m, Attribute,
|
356
|
-
354, Brown Buzz Cut, f, Attribute,
|
357
|
-
355, Dark Red Buzz Cut, f, Attribute,
|
358
|
-
356, Orange Buzz Cut, f, Attribute,
|
359
|
-
357, Red Buzz Cut, f, Attribute,
|
360
|
-
358, Pink Buzz Cut, f, Attribute,
|
361
|
-
359, Purple Buzz Cut, f, Attribute,
|
362
|
-
360, Blue Buzz Cut, f, Attribute,
|
363
|
-
361, Periwinkle Buzz Cut, f, Attribute,
|
364
|
-
362, Light Blue Buzz Cut, f, Attribute,
|
365
|
-
363, Light Green Buzz Cut, f, Attribute,
|
366
|
-
364, Green Buzz Cut, f, Attribute,
|
367
|
-
365, Teal Buzz Cut, f, Attribute,
|
368
|
-
366, Blonde Buzz Cut, f, Attribute,
|
369
|
-
367, Silver Buzz Cut, f, Attribute,
|
370
|
-
368, White Buzz Cut, f, Attribute,
|
371
|
-
369, Clown Hair Black, m, Attribute,
|
372
|
-
370, Clown Hair Black, f, Attribute,
|
373
|
-
371, Clown Hair Brown, m, Attribute,
|
374
|
-
372, Clown Hair Dark Red, m, Attribute,
|
375
|
-
373, Clown Hair Orange, m, Attribute,
|
376
|
-
374, Clown Hair Red, m, Attribute,
|
377
|
-
375, Clown Hair Pink, m, Attribute,
|
378
|
-
376, Clown Hair Purple, m, Attribute,
|
379
|
-
377, Clown Hair Blue, m, Attribute,
|
380
|
-
378, Clown Hair Periwinkle, m, Attribute,
|
381
|
-
379, Clown Hair Light Blue, m, Attribute,
|
382
|
-
380, Clown Hair Light Green, m, Attribute,
|
383
|
-
381, Clown Hair Green, m, Attribute,
|
384
|
-
382, Clown Hair Teal, m, Attribute,
|
385
|
-
383, Clown Hair Blonde, m, Attribute,
|
386
|
-
384, Clown Hair Silver, m, Attribute,
|
387
|
-
385, Clown Hair White, m, Attribute,
|
388
|
-
386, Clown Hair Brown, f, Attribute,
|
389
|
-
387, Clown Hair Dark Red, f, Attribute,
|
390
|
-
388, Clown Hair Orange, f, Attribute,
|
391
|
-
389, Clown Hair Red, f, Attribute,
|
392
|
-
390, Clown Hair Pink, f, Attribute,
|
393
|
-
391, Clown Hair Purple, f, Attribute,
|
394
|
-
392, Clown Hair Blue, f, Attribute,
|
395
|
-
393, Clown Hair Periwinkle, f, Attribute,
|
396
|
-
394, Clown Hair Light Blue, f, Attribute,
|
397
|
-
395, Clown Hair Light Green, f, Attribute,
|
398
|
-
396, Clown Hair Green, f, Attribute,
|
399
|
-
397, Clown Hair Teal, f, Attribute,
|
400
|
-
398, Clown Hair Blonde, f, Attribute,
|
401
|
-
399, Clown Hair Silver, f, Attribute,
|
402
|
-
400, Clown Hair White, f, Attribute,
|
data/config/spritesheet.png
DELETED
Binary file
|
@@ -1,223 +0,0 @@
|
|
1
|
-
|
2
|
-
module Cryptopunks
|
3
|
-
|
4
|
-
class Metadata
|
5
|
-
### todo/fix:
|
6
|
-
## move into Punks::Metadata or such
|
7
|
-
class Sprite
|
8
|
-
attr_reader :id, :name, :type, :gender, :more_names
|
9
|
-
|
10
|
-
|
11
|
-
def initialize( id:,
|
12
|
-
name:,
|
13
|
-
type:,
|
14
|
-
gender:,
|
15
|
-
more_names: [] )
|
16
|
-
@id = id # zero-based index eg. 0,1,2,3, etc.
|
17
|
-
@name = name
|
18
|
-
@type = type
|
19
|
-
@gender = gender
|
20
|
-
@more_names = more_names
|
21
|
-
end
|
22
|
-
|
23
|
-
## todo/check - find better names for type attribute/archetypes?
|
24
|
-
## use (alternate name/alias) base or face for archetypes? any others?
|
25
|
-
def attribute?() @type.downcase.start_with?( 'attribute' ); end
|
26
|
-
def archetype?() @type.downcase.start_with?( 'archetype' ); end
|
27
|
-
end # class Metadata::Sprite
|
28
|
-
end # class Metadata
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
class Generator
|
34
|
-
|
35
|
-
######
|
36
|
-
# static helpers - (turn into "true" static self.class methods - why? why not?)
|
37
|
-
#
|
38
|
-
def normalize_key( str )
|
39
|
-
str.downcase.gsub(/[ ()°_-]/, '').strip
|
40
|
-
end
|
41
|
-
|
42
|
-
def normalize_gender( str )
|
43
|
-
## e.g. Female => f
|
44
|
-
## F => f
|
45
|
-
## always return f or m
|
46
|
-
str.downcase[0]
|
47
|
-
end
|
48
|
-
|
49
|
-
def normalize_name( str )
|
50
|
-
## normalize spaces in more names
|
51
|
-
str.strip.gsub( /[ ]{2,}/, ' ' )
|
52
|
-
end
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
def build_attributes_by_name( recs )
|
57
|
-
h = {}
|
58
|
-
recs.each_with_index do |rec|
|
59
|
-
names = [rec.name] + rec.more_names
|
60
|
-
names.each do |name|
|
61
|
-
|
62
|
-
key = normalize_key( name )
|
63
|
-
key << "_(#{rec.gender})" if rec.attribute?
|
64
|
-
|
65
|
-
if h[ key ]
|
66
|
-
puts "!!! ERROR - attribute name is not unique:"
|
67
|
-
pp rec
|
68
|
-
puts "duplicate:"
|
69
|
-
pp h[key]
|
70
|
-
exit 1
|
71
|
-
end
|
72
|
-
h[ key ] = rec
|
73
|
-
end
|
74
|
-
end
|
75
|
-
## pp h
|
76
|
-
h
|
77
|
-
end
|
78
|
-
|
79
|
-
|
80
|
-
def build_recs( recs ) ## build and normalize (meta data) records
|
81
|
-
|
82
|
-
## sort by id
|
83
|
-
recs = recs.sort do |l,r|
|
84
|
-
l['id'].to_i( 10 ) <=> r['id'].to_i( 10 ) # use base10 (decimal)
|
85
|
-
end
|
86
|
-
|
87
|
-
## assert all recs are in order by id (0 to size)
|
88
|
-
recs.each_with_index do |rec, exp_id|
|
89
|
-
id = rec['id'].to_i(10)
|
90
|
-
if id != exp_id
|
91
|
-
puts "!! ERROR - meta data record ids out-of-order - expected id #{exp_id}; got #{id}"
|
92
|
-
exit 1
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
## convert to "wrapped / immutable" kind-of struct
|
97
|
-
recs = recs.map do |rec|
|
98
|
-
id = rec['id'].to_i( 10 )
|
99
|
-
name = normalize_name( rec['name'] )
|
100
|
-
gender = normalize_gender( rec['gender'] )
|
101
|
-
type = rec['type']
|
102
|
-
|
103
|
-
more_names = (rec['more_names'] || '').split( '|' )
|
104
|
-
more_names = more_names.map {|str| normalize_name( str ) }
|
105
|
-
|
106
|
-
Metadata::Sprite.new(
|
107
|
-
id: id,
|
108
|
-
name: name,
|
109
|
-
type: type,
|
110
|
-
gender: gender,
|
111
|
-
more_names: more_names )
|
112
|
-
end
|
113
|
-
recs
|
114
|
-
end # method build_recs
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
def initialize( image_path="./spritesheet.png",
|
120
|
-
meta_path="./spritesheet.csv" )
|
121
|
-
@sheet = Pixelart::ImageComposite.read( image_path )
|
122
|
-
recs = CsvHash.read( meta_path )
|
123
|
-
|
124
|
-
@recs = build_recs( recs )
|
125
|
-
|
126
|
-
## lookup by "case/space-insensitive" name / key
|
127
|
-
@attributes_by_name = build_attributes_by_name( @recs )
|
128
|
-
end
|
129
|
-
|
130
|
-
|
131
|
-
def spritesheet() @sheet; end
|
132
|
-
alias_method :sheet, :spritesheet
|
133
|
-
|
134
|
-
|
135
|
-
def records() @recs; end
|
136
|
-
alias_method :meta, :records
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
def find_meta( q, gender: nil ) ## gender (m/f) required for attributes!!!
|
142
|
-
|
143
|
-
key = normalize_key( q ) ## normalize q(uery) string/symbol
|
144
|
-
key << "_(#{normalize_gender( gender )})" if gender
|
145
|
-
|
146
|
-
rec = @attributes_by_name[ key ]
|
147
|
-
if rec
|
148
|
-
puts " lookup >#{key}< => #{rec.id}: #{rec.name} / #{rec.type} (#{rec.gender})"
|
149
|
-
# pp rec
|
150
|
-
else
|
151
|
-
puts "!! WARN - no lookup found for key >#{key}<"
|
152
|
-
end
|
153
|
-
rec
|
154
|
-
end
|
155
|
-
|
156
|
-
|
157
|
-
def find( q, gender: nil ) ## gender (m/f) required for attributes!!!
|
158
|
-
rec = find_meta( q, gender: gender )
|
159
|
-
|
160
|
-
## return image if record found
|
161
|
-
rec ? @sheet[ rec.id ] : nil
|
162
|
-
end
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
def to_recs( *values )
|
168
|
-
archetype_name = values[0]
|
169
|
-
|
170
|
-
### todo/fix: check for nil/not found!!!!
|
171
|
-
archetype = find_meta( archetype_name )
|
172
|
-
if archetype.nil?
|
173
|
-
puts "!! ERROR - archetype >#{archetype}< not found; sorry"
|
174
|
-
exit 1
|
175
|
-
end
|
176
|
-
|
177
|
-
recs = [archetype]
|
178
|
-
|
179
|
-
attribute_names = values[1..-1]
|
180
|
-
## note: attribute lookup requires gender from archetype!!!!
|
181
|
-
attribute_gender = archetype.gender
|
182
|
-
|
183
|
-
attribute_names.each do |attribute_name|
|
184
|
-
attribute = find_meta( attribute_name, gender: attribute_gender )
|
185
|
-
if attribute.nil?
|
186
|
-
puts "!! ERROR - attribute >#{attribute_name}< for (#{attribute_gender}) not found; sorry"
|
187
|
-
exit 1
|
188
|
-
end
|
189
|
-
recs << attribute
|
190
|
-
end
|
191
|
-
|
192
|
-
recs
|
193
|
-
end
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
def generate_image( *values, background: nil )
|
199
|
-
|
200
|
-
ids = if values[0].is_a?( Integer ) ## assume integer number (indexes)
|
201
|
-
values
|
202
|
-
else ## assume strings (names)
|
203
|
-
to_recs( *values ).map { |rec| rec.id }
|
204
|
-
end
|
205
|
-
|
206
|
-
|
207
|
-
punk = Pixelart::Image.new( 24, 24 )
|
208
|
-
|
209
|
-
if background ## for now assume background is (simply) color
|
210
|
-
punk.compose!( Pixelart::Image.new( 24, 24, background ) )
|
211
|
-
end
|
212
|
-
|
213
|
-
ids.each do |id|
|
214
|
-
punk.compose!( @sheet[ id ] )
|
215
|
-
end
|
216
|
-
|
217
|
-
punk
|
218
|
-
end
|
219
|
-
alias_method :generate, :generate_image
|
220
|
-
|
221
|
-
end # class Generator
|
222
|
-
|
223
|
-
end # module Cryptopunks
|