@benosjs/pixel 0.0.0-stage → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +62 -2
- package/dist/js/index.development.js +2419 -0
- package/dist/js/index.development.js.map +1 -0
- package/dist/js/index.production.js +2119 -0
- package/dist/js/png.development.js +60 -0
- package/dist/js/png.development.js.map +1 -0
- package/dist/js/png.production.js +46 -0
- package/dist/types/ai.d.ts +37 -0
- package/dist/types/ai.d.ts.map +1 -0
- package/dist/types/character.d.ts +61 -0
- package/dist/types/character.d.ts.map +1 -0
- package/dist/types/color.d.ts +14 -0
- package/dist/types/color.d.ts.map +1 -0
- package/dist/types/draw.d.ts +27 -0
- package/dist/types/draw.d.ts.map +1 -0
- package/dist/types/font.d.ts +5 -0
- package/dist/types/font.d.ts.map +1 -0
- package/dist/types/format.d.ts +22 -0
- package/dist/types/format.d.ts.map +1 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/library/decor.d.ts +2 -0
- package/dist/types/library/decor.d.ts.map +1 -0
- package/dist/types/library/furniture.d.ts +2 -0
- package/dist/types/library/furniture.d.ts.map +1 -0
- package/dist/types/library/index.d.ts +9 -0
- package/dist/types/library/index.d.ts.map +1 -0
- package/dist/types/library/make.d.ts +6 -0
- package/dist/types/library/make.d.ts.map +1 -0
- package/dist/types/library/more.d.ts +2 -0
- package/dist/types/library/more.d.ts.map +1 -0
- package/dist/types/library/people.d.ts +2 -0
- package/dist/types/library/people.d.ts.map +1 -0
- package/dist/types/library/structure.d.ts +2 -0
- package/dist/types/library/structure.d.ts.map +1 -0
- package/dist/types/library/tech.d.ts +2 -0
- package/dist/types/library/tech.d.ts.map +1 -0
- package/dist/types/must.d.ts +6 -0
- package/dist/types/must.d.ts.map +1 -0
- package/dist/types/palette.d.ts +8 -0
- package/dist/types/palette.d.ts.map +1 -0
- package/dist/types/pixelate.d.ts +36 -0
- package/dist/types/pixelate.d.ts.map +1 -0
- package/dist/types/png.d.ts +4 -0
- package/dist/types/png.d.ts.map +1 -0
- package/dist/types/procedural.d.ts +91 -0
- package/dist/types/procedural.d.ts.map +1 -0
- package/dist/types/recolor.d.ts +14 -0
- package/dist/types/recolor.d.ts.map +1 -0
- package/dist/types/render.d.ts +13 -0
- package/dist/types/render.d.ts.map +1 -0
- package/dist/types/sheet.d.ts +19 -0
- package/dist/types/sheet.d.ts.map +1 -0
- package/package.json +39 -3
|
@@ -0,0 +1,2119 @@
|
|
|
1
|
+
var go = ".", P = (e) => e.rows[0]?.length ?? 0, A = (e) => e.rows.length;
|
|
2
|
+
function yo(e) {
|
|
3
|
+
const t = [];
|
|
4
|
+
/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.id) || t.push(`id "${e.id}" is not lowercase-with-hyphens`), e.name.trim() || t.push("name is empty"), e.rows.length === 0 && t.push("has no rows");
|
|
5
|
+
const o = P(e);
|
|
6
|
+
e.rows.forEach((r, a) => {
|
|
7
|
+
r.length !== o && t.push(`row ${a} is ${r.length} wide, expected ${o}`);
|
|
8
|
+
for (const c of r) c !== "." && !(c in e.palette) && t.push(`row ${a} uses '${c}', which is not in the palette`);
|
|
9
|
+
});
|
|
10
|
+
for (const [r, a] of Object.entries(e.palette))
|
|
11
|
+
(r.length !== 1 || r === ".") && t.push(`palette key '${r}' must be one character other than '.'`), /^#[0-9a-f]{6}$/.test(a) || t.push(`palette colour "${a}" is not lowercase #rrggbb`);
|
|
12
|
+
const n = new Set(e.rows.join(""));
|
|
13
|
+
for (const r of Object.keys(e.palette)) n.has(r) || t.push(`palette entry '${r}' is never used`);
|
|
14
|
+
return e.rows.every((r) => /^\.*$/.test(r)) && t.push("is completely transparent"), t;
|
|
15
|
+
}
|
|
16
|
+
function w(e) {
|
|
17
|
+
if (e === void 0) throw new Error("Internal error: a value that must exist is missing");
|
|
18
|
+
return e;
|
|
19
|
+
}
|
|
20
|
+
var h = class {
|
|
21
|
+
width;
|
|
22
|
+
height;
|
|
23
|
+
grid;
|
|
24
|
+
constructor(e, t) {
|
|
25
|
+
this.width = e, this.height = t, this.grid = Array.from({ length: t }, () => Array(e).fill("."));
|
|
26
|
+
}
|
|
27
|
+
get(e, t) {
|
|
28
|
+
return this.grid[t]?.[e] ?? ".";
|
|
29
|
+
}
|
|
30
|
+
px(e, t, o) {
|
|
31
|
+
return e >= 0 && t >= 0 && e < this.width && t < this.height && (w(this.grid[t])[e] = o), this;
|
|
32
|
+
}
|
|
33
|
+
dots(e, t) {
|
|
34
|
+
for (const [o, n] of t) this.px(o, n, e);
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
rect(e, t, o, n, r) {
|
|
38
|
+
for (let a = 0; a < n; a++) for (let c = 0; c < o; c++) this.px(e + c, t + a, r);
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
frame(e, t, o, n, r) {
|
|
42
|
+
return this.hline(e, t, o, r).hline(e, t + n - 1, o, r).vline(e, t, n, r).vline(e + o - 1, t, n, r);
|
|
43
|
+
}
|
|
44
|
+
hline(e, t, o, n) {
|
|
45
|
+
return this.rect(e, t, o, 1, n);
|
|
46
|
+
}
|
|
47
|
+
vline(e, t, o, n) {
|
|
48
|
+
return this.rect(e, t, 1, o, n);
|
|
49
|
+
}
|
|
50
|
+
disc(e, t, o, n) {
|
|
51
|
+
for (let r = 0; r < this.height; r++) for (let a = 0; a < this.width; a++) (a + 0.5 - e) ** 2 + (r + 0.5 - t) ** 2 <= o ** 2 && this.px(a, r, n);
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
stamp(e, t, o) {
|
|
55
|
+
return o.forEach((n, r) => {
|
|
56
|
+
[...n].forEach((a, c) => {
|
|
57
|
+
a !== "." && this.px(e + c, t + r, a);
|
|
58
|
+
});
|
|
59
|
+
}), this;
|
|
60
|
+
}
|
|
61
|
+
outline(e = "o") {
|
|
62
|
+
const t = [];
|
|
63
|
+
for (let o = 0; o < this.height; o++) for (let n = 0; n < this.width; n++)
|
|
64
|
+
this.get(n, o) === "." && [
|
|
65
|
+
this.get(n - 1, o),
|
|
66
|
+
this.get(n + 1, o),
|
|
67
|
+
this.get(n, o - 1),
|
|
68
|
+
this.get(n, o + 1)
|
|
69
|
+
].some((r) => r !== ".") && t.push([n, o]);
|
|
70
|
+
return this.dots(e, t);
|
|
71
|
+
}
|
|
72
|
+
rows() {
|
|
73
|
+
return this.grid.map((e) => e.join(""));
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
function j(e) {
|
|
77
|
+
return [
|
|
78
|
+
parseInt(e.slice(1, 3), 16),
|
|
79
|
+
parseInt(e.slice(3, 5), 16),
|
|
80
|
+
parseInt(e.slice(5, 7), 16)
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
function E([e, t, o]) {
|
|
84
|
+
const n = (r) => Math.max(0, Math.min(255, Math.round(r))).toString(16).padStart(2, "0");
|
|
85
|
+
return `#${n(e)}${n(t)}${n(o)}`;
|
|
86
|
+
}
|
|
87
|
+
function Ce(e) {
|
|
88
|
+
const [t, o, n] = j(e), r = t / 255, a = o / 255, c = n / 255, l = Math.max(r, a, c), u = Math.min(r, a, c), s = (l + u) / 2;
|
|
89
|
+
if (l === u) return [
|
|
90
|
+
0,
|
|
91
|
+
0,
|
|
92
|
+
s
|
|
93
|
+
];
|
|
94
|
+
const i = l - u, d = i / (1 - Math.abs(2 * s - 1));
|
|
95
|
+
return [
|
|
96
|
+
(l === r ? ((a - c) / i + 6) % 6 : l === a ? (c - r) / i + 2 : (r - a) / i + 4) * 60,
|
|
97
|
+
d,
|
|
98
|
+
s
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
function y(e, t, o) {
|
|
102
|
+
const n = (1 - Math.abs(2 * o - 1)) * t, r = (e % 360 + 360) % 360 / 60, a = n * (1 - Math.abs(r % 2 - 1)), [c, l, u] = r < 1 ? [
|
|
103
|
+
n,
|
|
104
|
+
a,
|
|
105
|
+
0
|
|
106
|
+
] : r < 2 ? [
|
|
107
|
+
a,
|
|
108
|
+
n,
|
|
109
|
+
0
|
|
110
|
+
] : r < 3 ? [
|
|
111
|
+
0,
|
|
112
|
+
n,
|
|
113
|
+
a
|
|
114
|
+
] : r < 4 ? [
|
|
115
|
+
0,
|
|
116
|
+
a,
|
|
117
|
+
n
|
|
118
|
+
] : r < 5 ? [
|
|
119
|
+
a,
|
|
120
|
+
0,
|
|
121
|
+
n
|
|
122
|
+
] : [
|
|
123
|
+
n,
|
|
124
|
+
0,
|
|
125
|
+
a
|
|
126
|
+
], s = o - n / 2;
|
|
127
|
+
return E([
|
|
128
|
+
(c + s) * 255,
|
|
129
|
+
(l + s) * 255,
|
|
130
|
+
(u + s) * 255
|
|
131
|
+
]);
|
|
132
|
+
}
|
|
133
|
+
function ne(e) {
|
|
134
|
+
const [t, o, n] = j(e);
|
|
135
|
+
return (0.299 * t + 0.587 * o + 0.114 * n) / 255;
|
|
136
|
+
}
|
|
137
|
+
function K(e, t) {
|
|
138
|
+
return E(j(e).map((o) => o * t));
|
|
139
|
+
}
|
|
140
|
+
function He(e, t, o) {
|
|
141
|
+
const n = j(e), r = j(t), a = (c, l) => c + (l - c) * o;
|
|
142
|
+
return E([
|
|
143
|
+
a(n[0], r[0]),
|
|
144
|
+
a(n[1], r[1]),
|
|
145
|
+
a(n[2], r[2])
|
|
146
|
+
]);
|
|
147
|
+
}
|
|
148
|
+
var ae = {
|
|
149
|
+
o: "#2b2233",
|
|
150
|
+
x: "#262b3d",
|
|
151
|
+
k: "#663931",
|
|
152
|
+
d: "#8f563b",
|
|
153
|
+
w: "#b97a45",
|
|
154
|
+
W: "#d9a066",
|
|
155
|
+
s: "#eec39a",
|
|
156
|
+
M: "#3b3f52",
|
|
157
|
+
m: "#5a6078",
|
|
158
|
+
K: "#7f8a99",
|
|
159
|
+
q: "#9badb7",
|
|
160
|
+
p: "#b8c4d6",
|
|
161
|
+
l: "#dfe6f0",
|
|
162
|
+
P: "#f4f4f4",
|
|
163
|
+
1: "#ffffff",
|
|
164
|
+
S: "#1f2f4a",
|
|
165
|
+
J: "#22324f",
|
|
166
|
+
j: "#306082",
|
|
167
|
+
h: "#3f3f74",
|
|
168
|
+
H: "#5b6ee1",
|
|
169
|
+
C: "#639bff",
|
|
170
|
+
c: "#5fcde4",
|
|
171
|
+
L: "#cbdbfc",
|
|
172
|
+
F: "#4b692f",
|
|
173
|
+
f: "#37946e",
|
|
174
|
+
G: "#6abe30",
|
|
175
|
+
g: "#99e550",
|
|
176
|
+
y: "#fbf236",
|
|
177
|
+
Y: "#e8b930",
|
|
178
|
+
O: "#df7126",
|
|
179
|
+
b: "#d95763",
|
|
180
|
+
R: "#ac3232",
|
|
181
|
+
t: "#e4dccf",
|
|
182
|
+
T: "#cfc5b4",
|
|
183
|
+
u: "#a89f8f"
|
|
184
|
+
};
|
|
185
|
+
function $(e, t = ae) {
|
|
186
|
+
const o = {};
|
|
187
|
+
for (const n of new Set(e.join(""))) {
|
|
188
|
+
if (n === ".") continue;
|
|
189
|
+
const r = t[n];
|
|
190
|
+
if (r === void 0) throw new Error(`No colour for '${n}'`);
|
|
191
|
+
o[n] = r;
|
|
192
|
+
}
|
|
193
|
+
return o;
|
|
194
|
+
}
|
|
195
|
+
var ce = 16, je = 24, I = ".".repeat(ce);
|
|
196
|
+
function S(e, t) {
|
|
197
|
+
return t.forEach((o, n) => {
|
|
198
|
+
if (o.length !== ce) throw new Error(`Layer row ${e + n} "${o}" is ${o.length} wide`);
|
|
199
|
+
}), [
|
|
200
|
+
...Array(e).fill(I),
|
|
201
|
+
...t,
|
|
202
|
+
...Array(je - e - t.length).fill(I)
|
|
203
|
+
];
|
|
204
|
+
}
|
|
205
|
+
var Pe = S(1, [
|
|
206
|
+
".....oooooo.....",
|
|
207
|
+
"....osssssso....",
|
|
208
|
+
"...osssssssso...",
|
|
209
|
+
"...osssssssso...",
|
|
210
|
+
"...osssssssso...",
|
|
211
|
+
"...osesssseso...",
|
|
212
|
+
"...osssssssso...",
|
|
213
|
+
"....ossSSsso....",
|
|
214
|
+
".....oooooo....."
|
|
215
|
+
]), Ee = S(22, ["...obbboobbbo...", "...oooo..oooo..."]), ie = [
|
|
216
|
+
{
|
|
217
|
+
id: "short",
|
|
218
|
+
name: "Short",
|
|
219
|
+
rows: S(1, [
|
|
220
|
+
".....oooooo.....",
|
|
221
|
+
"....ohhhhhho....",
|
|
222
|
+
"...ohhhhhhhho...",
|
|
223
|
+
"...ohhhhhhhho...",
|
|
224
|
+
"...oh......ho..."
|
|
225
|
+
])
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: "fringe",
|
|
229
|
+
name: "Fringe",
|
|
230
|
+
rows: S(1, [
|
|
231
|
+
".....oooooo.....",
|
|
232
|
+
"....ohhhhhho....",
|
|
233
|
+
"...ohhhhhhhho...",
|
|
234
|
+
"...ohhhhhhhho...",
|
|
235
|
+
"...ohhhhhhhho..."
|
|
236
|
+
])
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
id: "long",
|
|
240
|
+
name: "Long",
|
|
241
|
+
rows: S(1, [
|
|
242
|
+
".....oooooo.....",
|
|
243
|
+
"....ohhhhhho....",
|
|
244
|
+
"...ohhhhhhhho...",
|
|
245
|
+
"...ohhhhhhhho...",
|
|
246
|
+
"..ohh......hho..",
|
|
247
|
+
"..oh........ho..",
|
|
248
|
+
"..oh........ho..",
|
|
249
|
+
"..oh........ho..",
|
|
250
|
+
"..ohh......hho..",
|
|
251
|
+
"...oo......oo..."
|
|
252
|
+
])
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
id: "curly",
|
|
256
|
+
name: "Curly",
|
|
257
|
+
rows: S(0, [
|
|
258
|
+
".....oooooo.....",
|
|
259
|
+
"...oohhhhhhoo...",
|
|
260
|
+
"..ohhhhhhhhhho..",
|
|
261
|
+
"..ohhhhhhhhhho..",
|
|
262
|
+
"..ohhhhhhhhhho..",
|
|
263
|
+
"..ohh......hho..",
|
|
264
|
+
"..oo........oo.."
|
|
265
|
+
])
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
id: "bald",
|
|
269
|
+
name: "Bald",
|
|
270
|
+
rows: S(0, [])
|
|
271
|
+
}
|
|
272
|
+
], se = [
|
|
273
|
+
{
|
|
274
|
+
id: "hoodie",
|
|
275
|
+
name: "Hoodie",
|
|
276
|
+
rows: S(10, [
|
|
277
|
+
"...otttttttto...",
|
|
278
|
+
"..otttttttttto..",
|
|
279
|
+
"..otTttttttTto..",
|
|
280
|
+
"..otTttwwttTto..",
|
|
281
|
+
"..osTttttttTso..",
|
|
282
|
+
"..ooTttttttToo.."
|
|
283
|
+
])
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
id: "t-shirt",
|
|
287
|
+
name: "T-shirt",
|
|
288
|
+
rows: S(10, [
|
|
289
|
+
"...otttttttto...",
|
|
290
|
+
"..otttttttttto..",
|
|
291
|
+
"..otTttwwttTto..",
|
|
292
|
+
"..osTttttttTso..",
|
|
293
|
+
"..osTttttttTso..",
|
|
294
|
+
"..ooTttttttToo.."
|
|
295
|
+
])
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
id: "shirt-and-tie",
|
|
299
|
+
name: "Shirt and tie",
|
|
300
|
+
rows: S(10, [
|
|
301
|
+
"...otttwwttto...",
|
|
302
|
+
"..ottttwwtttto..",
|
|
303
|
+
"..otTttwwttTto..",
|
|
304
|
+
"..otTttwwttTto..",
|
|
305
|
+
"..osTttttttTso..",
|
|
306
|
+
"..ooTttttttToo.."
|
|
307
|
+
])
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
id: "blazer",
|
|
311
|
+
name: "Blazer",
|
|
312
|
+
rows: S(10, [
|
|
313
|
+
"...oTtwwwwtTo...",
|
|
314
|
+
"..ottTtwwtTtto..",
|
|
315
|
+
"..otTtTwwTtTto..",
|
|
316
|
+
"..otTttTTttTto..",
|
|
317
|
+
"..osTttttttTso..",
|
|
318
|
+
"..ooTttttttToo.."
|
|
319
|
+
])
|
|
320
|
+
}
|
|
321
|
+
], le = [{
|
|
322
|
+
id: "trousers",
|
|
323
|
+
name: "Trousers",
|
|
324
|
+
rows: S(16, [
|
|
325
|
+
"....ojjjjjjo....",
|
|
326
|
+
"....ojjjjjjo....",
|
|
327
|
+
"....ojjJJjjo....",
|
|
328
|
+
"....ojjoojjo....",
|
|
329
|
+
"....ojjoojjo....",
|
|
330
|
+
"....oJJooJJo...."
|
|
331
|
+
])
|
|
332
|
+
}, {
|
|
333
|
+
id: "shorts",
|
|
334
|
+
name: "Shorts",
|
|
335
|
+
rows: S(16, [
|
|
336
|
+
"....ojjjjjjo....",
|
|
337
|
+
"....ojjjjjjo....",
|
|
338
|
+
"....oJJooJJo....",
|
|
339
|
+
"....ossoosso....",
|
|
340
|
+
"....ossoosso....",
|
|
341
|
+
"....oSSooSSo...."
|
|
342
|
+
])
|
|
343
|
+
}], he = [
|
|
344
|
+
{
|
|
345
|
+
id: "none",
|
|
346
|
+
name: "None",
|
|
347
|
+
rows: S(0, [])
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
id: "glasses",
|
|
351
|
+
name: "Glasses",
|
|
352
|
+
rows: S(6, ["....a.a..a.a...."])
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
id: "headphones",
|
|
356
|
+
name: "Headphones",
|
|
357
|
+
rows: S(1, [
|
|
358
|
+
".....aaaaaa.....",
|
|
359
|
+
"....a......a....",
|
|
360
|
+
"...a........a...",
|
|
361
|
+
"...a........a...",
|
|
362
|
+
"..oao......oao..",
|
|
363
|
+
"..oAo......oAo..",
|
|
364
|
+
"..oao......oao.."
|
|
365
|
+
])
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
id: "cap",
|
|
369
|
+
name: "Cap",
|
|
370
|
+
rows: S(1, [
|
|
371
|
+
".....oooooo.....",
|
|
372
|
+
"....occcccco....",
|
|
373
|
+
"...occcccccco...",
|
|
374
|
+
"..oocccccccco...",
|
|
375
|
+
".oCCCCCCCCCCo...",
|
|
376
|
+
"..oooooooooo...."
|
|
377
|
+
])
|
|
378
|
+
}
|
|
379
|
+
], fe = [
|
|
380
|
+
{
|
|
381
|
+
name: "Light",
|
|
382
|
+
colour: "#f6d3b3"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
name: "Fair",
|
|
386
|
+
colour: "#eec39a"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
name: "Tan",
|
|
390
|
+
colour: "#d9a066"
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
name: "Brown",
|
|
394
|
+
colour: "#b97a45"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
name: "Deep",
|
|
398
|
+
colour: "#8f563b"
|
|
399
|
+
}
|
|
400
|
+
], ue = [
|
|
401
|
+
{
|
|
402
|
+
name: "Dark brown",
|
|
403
|
+
colour: "#45283c"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
name: "Brown",
|
|
407
|
+
colour: "#8f563b"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
name: "Blonde",
|
|
411
|
+
colour: "#e8b930"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
name: "Ginger",
|
|
415
|
+
colour: "#c2522d"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
name: "Grey",
|
|
419
|
+
colour: "#9badb7"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
name: "Blue",
|
|
423
|
+
colour: "#5b6ee1"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: "Pink",
|
|
427
|
+
colour: "#d77bba"
|
|
428
|
+
}
|
|
429
|
+
], de = [
|
|
430
|
+
{
|
|
431
|
+
name: "Blue",
|
|
432
|
+
colour: "#5b6ee1"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
name: "Red",
|
|
436
|
+
colour: "#d95763"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
name: "Green",
|
|
440
|
+
colour: "#37946e"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
name: "Gold",
|
|
444
|
+
colour: "#e8b930"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
name: "Purple",
|
|
448
|
+
colour: "#76428a"
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
name: "Grey",
|
|
452
|
+
colour: "#7f8a99"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
name: "White",
|
|
456
|
+
colour: "#f4f4f4"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
name: "Charcoal",
|
|
460
|
+
colour: "#3b3f52"
|
|
461
|
+
}
|
|
462
|
+
], we = [
|
|
463
|
+
{
|
|
464
|
+
name: "Denim",
|
|
465
|
+
colour: "#306082"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
name: "Charcoal",
|
|
469
|
+
colour: "#3b3f52"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
name: "Khaki",
|
|
473
|
+
colour: "#b9a36a"
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
name: "Brown",
|
|
477
|
+
colour: "#663931"
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
name: "Grey",
|
|
481
|
+
colour: "#7f8a99"
|
|
482
|
+
}
|
|
483
|
+
], be = [
|
|
484
|
+
{
|
|
485
|
+
name: "Brown",
|
|
486
|
+
colour: "#8f563b"
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
name: "Black",
|
|
490
|
+
colour: "#262b3d"
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
name: "White",
|
|
494
|
+
colour: "#dfe6f0"
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
name: "Red",
|
|
498
|
+
colour: "#d95763"
|
|
499
|
+
}
|
|
500
|
+
], pe = [
|
|
501
|
+
{
|
|
502
|
+
name: "White",
|
|
503
|
+
colour: "#f4f4f4"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
name: "Red",
|
|
507
|
+
colour: "#d95763"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
name: "Yellow",
|
|
511
|
+
colour: "#fbf236"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
name: "Cyan",
|
|
515
|
+
colour: "#5fcde4"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
name: "Lime",
|
|
519
|
+
colour: "#99e550"
|
|
520
|
+
}
|
|
521
|
+
], vo = {
|
|
522
|
+
skin: w(fe[1]).colour,
|
|
523
|
+
hairStyle: "short",
|
|
524
|
+
hairColour: w(ue[0]).colour,
|
|
525
|
+
top: "hoodie",
|
|
526
|
+
topColour: w(de[0]).colour,
|
|
527
|
+
bottom: "trousers",
|
|
528
|
+
bottomColour: w(we[0]).colour,
|
|
529
|
+
shoeColour: w(be[0]).colour,
|
|
530
|
+
accessory: "none",
|
|
531
|
+
accent: w(pe[0]).colour
|
|
532
|
+
};
|
|
533
|
+
function R(e, t) {
|
|
534
|
+
const o = e.find((n) => n.id === t);
|
|
535
|
+
if (!o) throw new Error(`Unknown part "${t}"`);
|
|
536
|
+
return o;
|
|
537
|
+
}
|
|
538
|
+
function Ke(e) {
|
|
539
|
+
return w(e[0]).map((t, o) => [...t].map((n, r) => e.reduce((a, c) => {
|
|
540
|
+
const l = w(c[o])[r] ?? ".";
|
|
541
|
+
return l === "." ? a : l;
|
|
542
|
+
}, ".")).join(""));
|
|
543
|
+
}
|
|
544
|
+
function me(e) {
|
|
545
|
+
const t = Ke([
|
|
546
|
+
Pe,
|
|
547
|
+
R(le, e.bottom).rows,
|
|
548
|
+
Ee,
|
|
549
|
+
R(se, e.top).rows,
|
|
550
|
+
R(ie, e.hairStyle).rows,
|
|
551
|
+
R(he, e.accessory).rows
|
|
552
|
+
]), o = {
|
|
553
|
+
o: "#2b2233",
|
|
554
|
+
e: "#222034",
|
|
555
|
+
s: e.skin,
|
|
556
|
+
S: K(e.skin, 0.82),
|
|
557
|
+
h: e.hairColour,
|
|
558
|
+
t: e.topColour,
|
|
559
|
+
T: K(e.topColour, 0.72),
|
|
560
|
+
w: e.accent,
|
|
561
|
+
j: e.bottomColour,
|
|
562
|
+
J: K(e.bottomColour, 0.72),
|
|
563
|
+
b: e.shoeColour,
|
|
564
|
+
a: "#3b3f52",
|
|
565
|
+
A: e.accent,
|
|
566
|
+
c: e.accent,
|
|
567
|
+
C: K(e.accent, 0.75)
|
|
568
|
+
};
|
|
569
|
+
return {
|
|
570
|
+
id: "character",
|
|
571
|
+
name: "Character",
|
|
572
|
+
tags: ["character", "generated"],
|
|
573
|
+
rows: t,
|
|
574
|
+
palette: $(t, o)
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
function Mo(e = Math.random) {
|
|
578
|
+
const t = (o) => w(o[Math.floor(e() * o.length)]);
|
|
579
|
+
return {
|
|
580
|
+
skin: t(fe).colour,
|
|
581
|
+
hairStyle: t(ie).id,
|
|
582
|
+
hairColour: t(ue).colour,
|
|
583
|
+
top: t(se).id,
|
|
584
|
+
topColour: t(de).colour,
|
|
585
|
+
bottom: t(le).id,
|
|
586
|
+
bottomColour: t(we).colour,
|
|
587
|
+
shoeColour: t(be).colour,
|
|
588
|
+
accessory: t(he).id,
|
|
589
|
+
accent: t(pe).colour
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
function F(e) {
|
|
593
|
+
const o = [I, ...e.slice(0, 16)], n = w(e[16]), r = w(o[16]).split("").map((a, c) => a === "." ? n[c] ?? "." : a).join("");
|
|
594
|
+
return [
|
|
595
|
+
...o.slice(0, 16),
|
|
596
|
+
r,
|
|
597
|
+
...e.slice(17)
|
|
598
|
+
];
|
|
599
|
+
}
|
|
600
|
+
function Z(e, t) {
|
|
601
|
+
const [o, n] = t === "left" ? [3, 8] : [8, 13];
|
|
602
|
+
return e.map((r, a) => {
|
|
603
|
+
if (a < 18) return r;
|
|
604
|
+
const c = (e[a + 1] ?? I).slice(o, n);
|
|
605
|
+
return a === 18 ? r : r.slice(0, o) + c + r.slice(n);
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
function Re(e) {
|
|
609
|
+
return [
|
|
610
|
+
Z(e, "left"),
|
|
611
|
+
F(e),
|
|
612
|
+
Z(e, "right"),
|
|
613
|
+
F(e)
|
|
614
|
+
];
|
|
615
|
+
}
|
|
616
|
+
function Oe(e) {
|
|
617
|
+
return [e, F(e)];
|
|
618
|
+
}
|
|
619
|
+
function Q(e) {
|
|
620
|
+
const t = {
|
|
621
|
+
palette: e.palette,
|
|
622
|
+
tags: [...e.tags.filter((o) => o !== "generated"), "animation"]
|
|
623
|
+
};
|
|
624
|
+
return [{
|
|
625
|
+
...t,
|
|
626
|
+
id: `${e.id}-walk`,
|
|
627
|
+
name: `${e.name}, walking`,
|
|
628
|
+
frames: Re(e.rows),
|
|
629
|
+
frameMs: 160
|
|
630
|
+
}, {
|
|
631
|
+
...t,
|
|
632
|
+
id: `${e.id}-idle`,
|
|
633
|
+
name: `${e.name}, idle`,
|
|
634
|
+
frames: Oe(e.rows),
|
|
635
|
+
frameMs: 520
|
|
636
|
+
}];
|
|
637
|
+
}
|
|
638
|
+
function So(e) {
|
|
639
|
+
const t = w(e.frames[0]).map((o, n) => e.frames.map((r) => w(r[n])).join(""));
|
|
640
|
+
return {
|
|
641
|
+
id: e.id,
|
|
642
|
+
name: e.name,
|
|
643
|
+
tags: e.tags,
|
|
644
|
+
palette: e.palette,
|
|
645
|
+
rows: t
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
function ko(e, t) {
|
|
649
|
+
return {
|
|
650
|
+
id: e.id,
|
|
651
|
+
name: e.name,
|
|
652
|
+
tags: e.tags,
|
|
653
|
+
palette: e.palette,
|
|
654
|
+
rows: w(e.frames[t % e.frames.length])
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
function f(e, t, o, n, r) {
|
|
658
|
+
return {
|
|
659
|
+
id: e,
|
|
660
|
+
name: t,
|
|
661
|
+
tags: o,
|
|
662
|
+
rows: n,
|
|
663
|
+
palette: r ? $(n, r) : $(n)
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
function L(e, t) {
|
|
667
|
+
return t.forEach((o, n) => {
|
|
668
|
+
if (o.length !== e) throw new Error(`Row ${n} "${o}" is ${o.length} wide, expected ${e}`);
|
|
669
|
+
}), t;
|
|
670
|
+
}
|
|
671
|
+
var Ae = new h(16, 16).rect(4, 5, 7, 8, "b").hline(5, 5, 5, "k").vline(10, 6, 7, "R").hline(4, 12, 7, "R").vline(5, 7, 2, "P").dots("b", [
|
|
672
|
+
[11, 7],
|
|
673
|
+
[12, 7],
|
|
674
|
+
[12, 8],
|
|
675
|
+
[12, 9],
|
|
676
|
+
[12, 10],
|
|
677
|
+
[11, 10]
|
|
678
|
+
]).outline().dots("p", [
|
|
679
|
+
[6, 2],
|
|
680
|
+
[7, 1],
|
|
681
|
+
[9, 2],
|
|
682
|
+
[10, 1]
|
|
683
|
+
]).rows(), $e = new h(16, 32).disc(8, 10, 4.6, "f").disc(4.5, 14, 3.4, "f").disc(11.5, 14, 3.4, "f").disc(8, 16, 4.2, "f").disc(8, 9, 4.6, "G").disc(4.5, 13, 3.4, "G").disc(11.5, 13, 3.4, "G").disc(8, 15, 4.2, "G").disc(7, 7.5, 2.4, "g").disc(4, 12, 1.6, "g").disc(11, 12, 1.6, "g").dots("g", [
|
|
684
|
+
[7, 14],
|
|
685
|
+
[8, 15],
|
|
686
|
+
[9, 13]
|
|
687
|
+
]).rect(7, 20, 2, 2, "k").rect(3, 22, 10, 2, "w").hline(3, 22, 10, "W").rect(4, 24, 8, 6, "w").vline(11, 24, 6, "d").hline(4, 29, 8, "d").outline().rows(), Ie = new h(16, 16).dots("P", [
|
|
688
|
+
[6, 2],
|
|
689
|
+
[5, 3],
|
|
690
|
+
[6, 3],
|
|
691
|
+
[7, 3],
|
|
692
|
+
[5, 4],
|
|
693
|
+
[6, 4],
|
|
694
|
+
[7, 4],
|
|
695
|
+
[9, 3],
|
|
696
|
+
[10, 3],
|
|
697
|
+
[9, 4],
|
|
698
|
+
[10, 4]
|
|
699
|
+
]).px(6, 3, "p").rect(3, 5, 10, 2, "q").hline(3, 5, 10, "p").rect(4, 7, 8, 7, "K").vline(6, 8, 5, "m").vline(9, 8, 5, "m").outline().rows(), Ge = new h(16, 16).disc(7.5, 7.5, 6.5, "H").disc(7.5, 7.5, 5.3, "P").dots("K", [
|
|
700
|
+
[7, 3],
|
|
701
|
+
[7, 11],
|
|
702
|
+
[3, 7],
|
|
703
|
+
[11, 7]
|
|
704
|
+
]).vline(7, 4, 4, "M").hline(8, 7, 3, "M").px(7, 7, "b").outline().rows(), Le = new h(16, 16).hline(9, 2, 4, "b").hline(8, 3, 6, "b").hline(8, 4, 7, "b").dots("R", [
|
|
705
|
+
[13, 3],
|
|
706
|
+
[14, 4],
|
|
707
|
+
[13, 4]
|
|
708
|
+
]).hline(9, 5, 5, "y").dots("m", [[7, 4], [6, 5]]).vline(6, 6, 6, "m").hline(4, 12, 6, "m").hline(3, 13, 8, "M").outline().rows(), Be = L(16, [
|
|
709
|
+
"................",
|
|
710
|
+
"......yyyy......",
|
|
711
|
+
".....yyyyyy.....",
|
|
712
|
+
".....yyxyyy.....",
|
|
713
|
+
"...OOyyyyyy.....",
|
|
714
|
+
"....Oyyyyyy.....",
|
|
715
|
+
".....yyyyy...y..",
|
|
716
|
+
"...yyyyyyyyyyy..",
|
|
717
|
+
"..yyyyyyyyyyyy..",
|
|
718
|
+
"..yyyYYYYyyyyy..",
|
|
719
|
+
"..yyyyYYYyyyy...",
|
|
720
|
+
"...yyyyyyyyy....",
|
|
721
|
+
"....yyyyyyy....."
|
|
722
|
+
]), Ye = new h(16, 16).stamp(0, 1, Be).outline().rows(), De = new h(32, 32).rect(2, 3, 28, 19, "p").rect(3, 4, 26, 17, "1").hline(5, 6, 8, "H").hline(5, 8, 11, "H").hline(5, 10, 6, "H").frame(19, 6, 8, 5, "b").hline(21, 8, 4, "b").vline(6, 13, 6, "M").hline(6, 18, 11, "M").rect(8, 16, 2, 2, "c").rect(11, 14, 2, 4, "G").rect(14, 15, 2, 3, "Y").rect(20, 13, 4, 4, "y").rect(24, 15, 4, 4, "g").rect(8, 22, 16, 1, "K").hline(10, 21, 2, "b").hline(13, 21, 2, "H").vline(6, 23, 7, "m").vline(25, 23, 7, "m").hline(4, 30, 5, "m").hline(23, 30, 5, "m").outline().rows(), _e = [
|
|
723
|
+
f("coffee-mug", "Coffee mug", ["decor", "kitchen"], Ae),
|
|
724
|
+
f("potted-plant", "Potted plant", ["decor"], $e),
|
|
725
|
+
f("trash-bin", "Trash bin", ["decor"], Ie),
|
|
726
|
+
f("wall-clock", "Wall clock", ["decor"], Ge),
|
|
727
|
+
f("desk-lamp", "Desk lamp", ["decor"], Le),
|
|
728
|
+
f("rubber-duck", "Rubber duck", ["decor"], Ye),
|
|
729
|
+
f("whiteboard", "Whiteboard", ["decor", "furniture"], De)
|
|
730
|
+
], Fe = L(32, [
|
|
731
|
+
"................................",
|
|
732
|
+
"................................",
|
|
733
|
+
".........oooooooooooooo.........",
|
|
734
|
+
".........oMMMMMMMMMMMMo.........",
|
|
735
|
+
".........oMSSSSSSSSSSMo.........",
|
|
736
|
+
".........oMScccSSggSSMo.........",
|
|
737
|
+
".........oMSSyyyyySSSMo.........",
|
|
738
|
+
".........oMSccSSccccSMo.........",
|
|
739
|
+
".........oMSSggggSSSSMo.........",
|
|
740
|
+
".........oMSSSSSSSSSSMo.........",
|
|
741
|
+
".........oMMMMMMMMMMMMo.........",
|
|
742
|
+
".........oooooooooooooo.........",
|
|
743
|
+
".............ommmmo.............",
|
|
744
|
+
".oooooooooooooMMMMooooooooooooo.",
|
|
745
|
+
".oWPPPPPWWWWWWWWWWWWWWWbbbWWWWo.",
|
|
746
|
+
".oWPppPPWWWWWWWWWWWWWWWbPbbWWWo.",
|
|
747
|
+
".oWPPPPPWWKKKKKKKKKKKKWWbbbWWWo.",
|
|
748
|
+
".oWPppPPWWKpKpKpKpKpKKWWdddWWWo.",
|
|
749
|
+
".oWPPPPPWWKKKKKKKKKKKKWWWWWWWWo.",
|
|
750
|
+
".oWdddddWWddddddddddddWWWWWWWWo.",
|
|
751
|
+
".oWWWWWWWWWWWWWWWWWWWWWWWWWWWWo.",
|
|
752
|
+
".owwwwwwwwwwwwwwwwwwwwwwwwwwwwo.",
|
|
753
|
+
".oddddddddddddddddddddddddddddo.",
|
|
754
|
+
".odwwwwwwwwwwwwwwwwdwwwwwwwwwdo.",
|
|
755
|
+
".odwwwwwwwoooooooooooowwKKwwwdo.",
|
|
756
|
+
".odwwwwwwwoHHHHHHHHHHowwwwwwwdo.",
|
|
757
|
+
".odddddddoHHHHHHHHHHHHodddddddo.",
|
|
758
|
+
".oooooooooHhHHHHHHHHhHooooooooo.",
|
|
759
|
+
"..kk.....oHhHHHHHHHHhHo.....kk..",
|
|
760
|
+
"..kk.....ohhhhhhhhhhhho.....kk..",
|
|
761
|
+
".........oooooooooooooo.........",
|
|
762
|
+
"............oo....oo............"
|
|
763
|
+
]), Je = new h(16, 16).rect(4, 1, 8, 6, "H").hline(4, 1, 8, "C").vline(11, 2, 5, "h").rect(7, 7, 2, 1, "m").rect(3, 8, 10, 3, "H").hline(3, 10, 10, "h").rect(7, 11, 2, 2, "m").hline(4, 13, 8, "M").dots("M", [
|
|
764
|
+
[4, 14],
|
|
765
|
+
[7, 14],
|
|
766
|
+
[8, 14],
|
|
767
|
+
[11, 14]
|
|
768
|
+
]).outline().rows(), Ue = new h(32, 24).rect(4, 5, 24, 9, "H").hline(4, 5, 24, "C").vline(16, 6, 8, "h").rect(2, 10, 4, 10, "H").hline(2, 10, 4, "C").rect(26, 10, 4, 10, "H").hline(26, 10, 4, "C").vline(5, 11, 9, "h").vline(26, 11, 9, "h").rect(6, 14, 20, 4, "C").vline(16, 14, 4, "H").hline(6, 17, 20, "H").rect(6, 18, 20, 2, "h").rect(3, 20, 2, 2, "k").rect(27, 20, 2, 2, "k").outline().rows();
|
|
769
|
+
function Ne() {
|
|
770
|
+
const e = new h(32, 32).rect(2, 2, 28, 28, "w").hline(2, 2, 28, "W").vline(29, 3, 27, "d");
|
|
771
|
+
for (const t of [
|
|
772
|
+
{
|
|
773
|
+
bottom: 10,
|
|
774
|
+
books: [
|
|
775
|
+
[
|
|
776
|
+
2,
|
|
777
|
+
6,
|
|
778
|
+
"b"
|
|
779
|
+
],
|
|
780
|
+
[
|
|
781
|
+
2,
|
|
782
|
+
5,
|
|
783
|
+
"H"
|
|
784
|
+
],
|
|
785
|
+
[
|
|
786
|
+
3,
|
|
787
|
+
6,
|
|
788
|
+
"G"
|
|
789
|
+
],
|
|
790
|
+
[
|
|
791
|
+
2,
|
|
792
|
+
4,
|
|
793
|
+
"y"
|
|
794
|
+
],
|
|
795
|
+
[
|
|
796
|
+
2,
|
|
797
|
+
6,
|
|
798
|
+
"C"
|
|
799
|
+
],
|
|
800
|
+
[
|
|
801
|
+
1,
|
|
802
|
+
5,
|
|
803
|
+
"P"
|
|
804
|
+
],
|
|
805
|
+
[
|
|
806
|
+
3,
|
|
807
|
+
6,
|
|
808
|
+
"R"
|
|
809
|
+
],
|
|
810
|
+
[
|
|
811
|
+
2,
|
|
812
|
+
5,
|
|
813
|
+
"f"
|
|
814
|
+
],
|
|
815
|
+
[
|
|
816
|
+
2,
|
|
817
|
+
6,
|
|
818
|
+
"O"
|
|
819
|
+
],
|
|
820
|
+
[
|
|
821
|
+
2,
|
|
822
|
+
4,
|
|
823
|
+
"H"
|
|
824
|
+
],
|
|
825
|
+
1,
|
|
826
|
+
[
|
|
827
|
+
2,
|
|
828
|
+
6,
|
|
829
|
+
"b"
|
|
830
|
+
]
|
|
831
|
+
]
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
bottom: 19,
|
|
835
|
+
books: [
|
|
836
|
+
[
|
|
837
|
+
3,
|
|
838
|
+
6,
|
|
839
|
+
"H"
|
|
840
|
+
],
|
|
841
|
+
[
|
|
842
|
+
2,
|
|
843
|
+
6,
|
|
844
|
+
"Y"
|
|
845
|
+
],
|
|
846
|
+
[
|
|
847
|
+
2,
|
|
848
|
+
5,
|
|
849
|
+
"b"
|
|
850
|
+
],
|
|
851
|
+
[
|
|
852
|
+
2,
|
|
853
|
+
6,
|
|
854
|
+
"f"
|
|
855
|
+
],
|
|
856
|
+
3,
|
|
857
|
+
[
|
|
858
|
+
2,
|
|
859
|
+
5,
|
|
860
|
+
"C"
|
|
861
|
+
],
|
|
862
|
+
[
|
|
863
|
+
3,
|
|
864
|
+
6,
|
|
865
|
+
"m"
|
|
866
|
+
],
|
|
867
|
+
[
|
|
868
|
+
2,
|
|
869
|
+
4,
|
|
870
|
+
"G"
|
|
871
|
+
],
|
|
872
|
+
[
|
|
873
|
+
2,
|
|
874
|
+
6,
|
|
875
|
+
"b"
|
|
876
|
+
],
|
|
877
|
+
[
|
|
878
|
+
1,
|
|
879
|
+
5,
|
|
880
|
+
"P"
|
|
881
|
+
],
|
|
882
|
+
[
|
|
883
|
+
2,
|
|
884
|
+
6,
|
|
885
|
+
"O"
|
|
886
|
+
]
|
|
887
|
+
]
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
bottom: 28,
|
|
891
|
+
books: [
|
|
892
|
+
[
|
|
893
|
+
2,
|
|
894
|
+
5,
|
|
895
|
+
"G"
|
|
896
|
+
],
|
|
897
|
+
[
|
|
898
|
+
2,
|
|
899
|
+
6,
|
|
900
|
+
"R"
|
|
901
|
+
],
|
|
902
|
+
[
|
|
903
|
+
3,
|
|
904
|
+
6,
|
|
905
|
+
"C"
|
|
906
|
+
],
|
|
907
|
+
[
|
|
908
|
+
2,
|
|
909
|
+
5,
|
|
910
|
+
"y"
|
|
911
|
+
],
|
|
912
|
+
[
|
|
913
|
+
2,
|
|
914
|
+
6,
|
|
915
|
+
"H"
|
|
916
|
+
],
|
|
917
|
+
[
|
|
918
|
+
2,
|
|
919
|
+
6,
|
|
920
|
+
"b"
|
|
921
|
+
],
|
|
922
|
+
[
|
|
923
|
+
3,
|
|
924
|
+
5,
|
|
925
|
+
"f"
|
|
926
|
+
],
|
|
927
|
+
[
|
|
928
|
+
2,
|
|
929
|
+
6,
|
|
930
|
+
"P"
|
|
931
|
+
],
|
|
932
|
+
[
|
|
933
|
+
2,
|
|
934
|
+
4,
|
|
935
|
+
"O"
|
|
936
|
+
],
|
|
937
|
+
[
|
|
938
|
+
2,
|
|
939
|
+
6,
|
|
940
|
+
"j"
|
|
941
|
+
],
|
|
942
|
+
[
|
|
943
|
+
2,
|
|
944
|
+
5,
|
|
945
|
+
"Y"
|
|
946
|
+
]
|
|
947
|
+
]
|
|
948
|
+
}
|
|
949
|
+
]) {
|
|
950
|
+
e.rect(4, t.bottom - 6, 24, 7, "k");
|
|
951
|
+
let o = 4;
|
|
952
|
+
for (const n of t.books) {
|
|
953
|
+
if (typeof n == "number") {
|
|
954
|
+
o += n;
|
|
955
|
+
continue;
|
|
956
|
+
}
|
|
957
|
+
const [r, a, c] = n, l = t.bottom - a + 1;
|
|
958
|
+
e.rect(o, l, r, a, c), r >= 2 && a >= 5 && e.hline(o, l + 1, r, "l"), o += r;
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
return e.outline().rows();
|
|
962
|
+
}
|
|
963
|
+
var qe = (() => {
|
|
964
|
+
const e = new h(16, 32).rect(2, 3, 12, 27, "q").rect(2, 3, 12, 2, "p");
|
|
965
|
+
for (const t of [
|
|
966
|
+
6,
|
|
967
|
+
14,
|
|
968
|
+
22
|
|
969
|
+
]) e.rect(3, t, 10, 7, "p").frame(3, t, 10, 7, "K").rect(6, t + 1, 4, 2, "P").hline(6, t + 4, 4, "M");
|
|
970
|
+
return e.vline(13, 5, 25, "K").outline().rows();
|
|
971
|
+
})(), ze = [
|
|
972
|
+
f("coding-desk", "Coding desk", ["furniture", "tech"], Fe),
|
|
973
|
+
f("office-chair", "Office chair", ["furniture"], Je),
|
|
974
|
+
f("sofa", "Sofa", ["furniture"], Ue),
|
|
975
|
+
f("bookshelf", "Bookshelf", ["furniture"], Ne()),
|
|
976
|
+
f("filing-cabinet", "Filing cabinet", ["furniture"], qe)
|
|
977
|
+
], Xe = L(16, [
|
|
978
|
+
"................",
|
|
979
|
+
".....oooooo.....",
|
|
980
|
+
"....ohhhhhho....",
|
|
981
|
+
"...ohhhhhhhho...",
|
|
982
|
+
"...ohhhhhhhho...",
|
|
983
|
+
"...ohssssssho...",
|
|
984
|
+
"...osesssseso...",
|
|
985
|
+
"...osssssssso...",
|
|
986
|
+
"....ossSSsso....",
|
|
987
|
+
".....oooooo.....",
|
|
988
|
+
"...otttttttto...",
|
|
989
|
+
"..otttttttttto..",
|
|
990
|
+
"..otTttttttTto..",
|
|
991
|
+
"..otTttwwttTto..",
|
|
992
|
+
"..osTttttttTso..",
|
|
993
|
+
"..ooTttttttToo..",
|
|
994
|
+
"....ojjjjjjo....",
|
|
995
|
+
"....ojjjjjjo....",
|
|
996
|
+
"....ojjJJjjo....",
|
|
997
|
+
"....ojjoojjo....",
|
|
998
|
+
"....ojjoojjo....",
|
|
999
|
+
"....oJJooJJo....",
|
|
1000
|
+
"...obbboobbbo...",
|
|
1001
|
+
"...oooo..oooo..."
|
|
1002
|
+
]), Ve = [f("developer", "Developer", ["character"], Xe, {
|
|
1003
|
+
o: "#2b2233",
|
|
1004
|
+
h: "#45283c",
|
|
1005
|
+
s: "#eec39a",
|
|
1006
|
+
S: "#d9a066",
|
|
1007
|
+
e: "#222034",
|
|
1008
|
+
t: "#5b6ee1",
|
|
1009
|
+
T: "#3f3f74",
|
|
1010
|
+
w: "#f4f4f4",
|
|
1011
|
+
j: "#306082",
|
|
1012
|
+
J: "#22324f",
|
|
1013
|
+
b: "#8f563b"
|
|
1014
|
+
})], Ze = new h(32, 32).rect(10, 2, 12, 9, "M").rect(11, 3, 10, 7, "S").hline(12, 4, 4, "c").hline(13, 6, 6, "g").hline(12, 8, 3, "y").rect(15, 11, 2, 2, "m").rect(24, 11, 2, 2, "b").rect(5, 12, 4, 1, "P").rect(2, 13, 28, 3, "W").hline(2, 15, 28, "w").rect(4, 16, 2, 13, "m").rect(26, 16, 2, 13, "m").rect(6, 18, 20, 1, "M").rect(2, 29, 6, 1, "M").rect(24, 29, 6, 1, "M").outline().rows(), Qe = new h(32, 24).rect(5, 7, 22, 1, "W").rect(3, 8, 26, 6, "W").hline(3, 13, 26, "w").rect(5, 14, 22, 1, "w").rect(8, 9, 4, 2, "p").hline(8, 11, 4, "K").rect(17, 9, 3, 3, "P").px(18, 10, "p").rect(23, 9, 2, 2, "b").rect(8, 15, 2, 6, "k").rect(22, 15, 2, 6, "k").outline().rows(), et = new h(16, 16).disc(8, 11, 5.6, "R").disc(8, 10, 5.3, "b").disc(8, 7, 3.6, "b").dots("P", [[6, 6], [5, 7]]).hline(5, 11, 6, "R").outline().rows(), tt = new h(16, 32).rect(7, 2, 2, 2, "W").rect(7, 4, 2, 24, "w").dots("w", [
|
|
1015
|
+
[5, 6],
|
|
1016
|
+
[4, 5],
|
|
1017
|
+
[10, 6],
|
|
1018
|
+
[11, 5],
|
|
1019
|
+
[6, 6],
|
|
1020
|
+
[9, 6]
|
|
1021
|
+
]).rect(9, 7, 4, 11, "H").vline(12, 7, 11, "h").hline(9, 7, 4, "C").rect(3, 7, 3, 8, "b").vline(3, 7, 8, "R").rect(4, 28, 8, 2, "k").outline().rows(), ot = (() => {
|
|
1022
|
+
const e = new h(16, 32).rect(2, 2, 12, 28, "H").hline(2, 2, 12, "C");
|
|
1023
|
+
for (const t of [3, 16]) e.frame(3, t, 10, 13, "h").hline(5, t + 2, 6, "h").hline(5, t + 4, 6, "h").rect(10, t + 7, 1, 3, "p");
|
|
1024
|
+
return e.rect(3, 30, 2, 1, "M").rect(11, 30, 2, 1, "M").outline().rows();
|
|
1025
|
+
})(), rt = new h(32, 24).rect(20, 1, 8, 5, "M").rect(21, 2, 6, 3, "S").hline(22, 3, 3, "c").disc(6, 3.5, 2.2, "G").px(5, 3, "g").rect(5, 5, 2, 1, "w").rect(1, 6, 30, 2, "W").rect(2, 8, 28, 13, "w").frame(4, 10, 24, 9, "d").rect(14, 12, 4, 4, "O").rect(15, 13, 2, 2, "y").hline(2, 20, 28, "d").outline().rows(), nt = new h(16, 16).rect(4, 4, 8, 2, "b").hline(4, 5, 8, "R").vline(5, 6, 8, "m").vline(10, 6, 8, "m").hline(6, 10, 4, "m").outline().rows(), at = (() => {
|
|
1026
|
+
const e = new h(32, 16).rect(2, 4, 28, 9, "b").frame(3, 5, 26, 7, "y");
|
|
1027
|
+
for (let t = 7; t <= 24; t += 4) e.dots("y", [
|
|
1028
|
+
[t, 8],
|
|
1029
|
+
[t + 1, 7],
|
|
1030
|
+
[t + 1, 9],
|
|
1031
|
+
[t + 2, 8]
|
|
1032
|
+
]);
|
|
1033
|
+
for (let t = 3; t <= 28; t += 2) e.px(t, 3, "s").px(t, 13, "s");
|
|
1034
|
+
return e.outline().rows();
|
|
1035
|
+
})(), ct = new h(32, 24).rect(21, 7, 2, 2, "P").rect(15, 5, 2, 5, "P").hline(14, 5, 4, "K").rect(2, 10, 28, 3, "f").hline(2, 10, 28, "G").hline(2, 12, 28, "F").rect(5, 13, 2, 8, "M").rect(25, 13, 2, 8, "M").hline(7, 16, 18, "M").outline().rows(), it = new h(16, 16).rect(2, 4, 12, 2, "s").rect(2, 6, 12, 8, "W").rect(7, 4, 2, 5, "p").vline(13, 6, 8, "w").hline(2, 13, 12, "w").rect(4, 9, 3, 3, "P").px(5, 10, "b").outline().rows(), st = new h(32, 24).rect(2, 2, 28, 17, "M").rect(3, 3, 26, 15, "S").hline(6, 5, 10, "p").rect(6, 12, 3, 5, "c").rect(11, 9, 3, 8, "g").rect(16, 11, 3, 6, "y").rect(21, 7, 3, 10, "b").rect(14, 19, 4, 2, "m").rect(10, 21, 12, 1, "M").outline().rows(), lt = (() => {
|
|
1036
|
+
const e = new h(16, 24).rect(4, 2, 8, 20, "M").rect(5, 3, 6, 18, "m").hline(6, 5, 4, "M").px(8, 8, "c").px(6, 10, "g");
|
|
1037
|
+
for (const t of [
|
|
1038
|
+
13,
|
|
1039
|
+
15,
|
|
1040
|
+
17
|
|
1041
|
+
]) e.hline(6, t, 4, "M");
|
|
1042
|
+
return e.outline().rows();
|
|
1043
|
+
})(), ht = new h(16, 16).rect(3, 2, 10, 12, "M").rect(4, 3, 8, 10, "C").rect(5, 4, 2, 2, "y").rect(9, 4, 2, 2, "b").rect(5, 7, 2, 2, "g").rect(9, 7, 2, 2, "1").hline(6, 11, 4, "L").outline().rows(), ft = new h(16, 16).rect(5, 2, 6, 12, "M").rect(6, 3, 4, 9, "S").hline(6, 4, 3, "c").hline(7, 6, 3, "g").hline(6, 8, 2, "c").hline(7, 10, 3, "g").hline(7, 13, 2, "m").outline().rows(), ut = (() => {
|
|
1044
|
+
const e = new h(16, 16);
|
|
1045
|
+
for (let t = 0; t < 9; t++) for (let o = 0; o < 16; o++) {
|
|
1046
|
+
const n = Math.hypot(o + 0.5 - 8, t + 0.5 - 8.5);
|
|
1047
|
+
n <= 6.2 && n > 4.6 && e.px(o, t, "M");
|
|
1048
|
+
}
|
|
1049
|
+
return e.rect(2, 8, 3, 5, "b").rect(11, 8, 3, 5, "b").vline(4, 9, 3, "R").vline(11, 9, 3, "R").outline().rows();
|
|
1050
|
+
})(), dt = new h(16, 16).vline(3, 3, 6, "M").vline(12, 3, 6, "M").rect(2, 9, 12, 4, "P").hline(2, 12, 12, "p").dots("g", [[4, 10], [6, 10]]).px(8, 10, "y").dots("M", [[3, 13], [12, 13]]).outline().rows(), wt = new h(16, 16).rect(2, 6, 12, 5, "m").rect(2, 10, 3, 3, "m").rect(11, 10, 3, 3, "m").dots("M", [
|
|
1051
|
+
[4, 7],
|
|
1052
|
+
[3, 8],
|
|
1053
|
+
[4, 8],
|
|
1054
|
+
[5, 8],
|
|
1055
|
+
[4, 9],
|
|
1056
|
+
[7, 8],
|
|
1057
|
+
[8, 8]
|
|
1058
|
+
]).px(11, 7, "b").px(12, 8, "g").px(10, 8, "y").px(11, 9, "c").outline().rows(), bt = new h(16, 16).vline(8, 1, 3, "K").rect(6, 4, 5, 9, "P").rect(5, 6, 7, 5, "P").vline(8, 4, 3, "p").px(8, 5, "K").hline(5, 7, 7, "p").hline(6, 12, 5, "p").outline().rows(), pt = new h(16, 32).rect(2, 3, 12, 27, "h").rect(3, 4, 10, 3, "y").hline(5, 5, 6, "b").rect(3, 8, 10, 8, "S").dots("g", [
|
|
1059
|
+
[6, 10],
|
|
1060
|
+
[9, 10],
|
|
1061
|
+
[7, 11],
|
|
1062
|
+
[8, 11],
|
|
1063
|
+
[6, 12],
|
|
1064
|
+
[9, 12]
|
|
1065
|
+
]).dots("c", [[7, 14], [8, 14]]).px(8, 13, "y").rect(2, 17, 12, 3, "m").px(5, 16, "b").px(5, 17, "M").px(9, 18, "b").px(11, 18, "y").vline(4, 21, 8, "H").vline(11, 21, 8, "H").rect(7, 23, 2, 3, "M").outline().rows(), mt = new h(16, 32).rect(2, 2, 12, 27, "l").hline(2, 2, 12, "1").hline(2, 11, 12, "q").rect(4, 5, 1, 4, "K").rect(4, 14, 1, 6, "K").vline(13, 3, 26, "p").px(9, 15, "b").px(11, 17, "c").rect(8, 19, 3, 3, "y").rect(3, 29, 2, 1, "M").rect(11, 29, 2, 1, "M").outline().rows(), gt = new h(16, 16).rect(1, 4, 14, 9, "p").hline(1, 4, 14, "l").rect(2, 5, 9, 7, "S").hline(4, 10, 5, "K").rect(5, 8, 3, 2, "y").rect(12, 5, 2, 2, "g").dots("M", [
|
|
1066
|
+
[12, 8],
|
|
1067
|
+
[13, 8],
|
|
1068
|
+
[12, 10],
|
|
1069
|
+
[13, 10],
|
|
1070
|
+
[2, 13],
|
|
1071
|
+
[13, 13]
|
|
1072
|
+
]).outline().rows(), yt = (() => {
|
|
1073
|
+
const e = new h(16, 32).rect(2, 2, 12, 28, "b").rect(3, 3, 10, 3, "R").hline(4, 4, 8, "y").rect(3, 7, 7, 14, "S");
|
|
1074
|
+
return [
|
|
1075
|
+
[
|
|
1076
|
+
"c",
|
|
1077
|
+
"g",
|
|
1078
|
+
"y"
|
|
1079
|
+
],
|
|
1080
|
+
[
|
|
1081
|
+
"y",
|
|
1082
|
+
"O",
|
|
1083
|
+
"c"
|
|
1084
|
+
],
|
|
1085
|
+
[
|
|
1086
|
+
"g",
|
|
1087
|
+
"c",
|
|
1088
|
+
"O"
|
|
1089
|
+
]
|
|
1090
|
+
].forEach((t, o) => {
|
|
1091
|
+
t.forEach((n, r) => e.rect(4 + r * 2, 8 + o * 4, 1, 2, n)), e.hline(3, 10 + o * 4, 7, "M");
|
|
1092
|
+
}), e.rect(11, 8, 2, 4, "p").hline(11, 14, 2, "M").rect(3, 23, 10, 3, "M").vline(13, 6, 24, "R").rect(3, 30, 2, 1, "x").rect(11, 30, 2, 1, "x").outline().rows();
|
|
1093
|
+
})(), vt = new h(16, 16).rect(2, 2, 12, 6, "w").frame(3, 3, 10, 4, "d").rect(1, 8, 14, 5, "W").rect(3, 9, 10, 3, "Y").hline(3, 11, 10, "w").dots("b", [
|
|
1094
|
+
[5, 10],
|
|
1095
|
+
[8, 9],
|
|
1096
|
+
[10, 10]
|
|
1097
|
+
]).outline().rows(), Mt = new h(16, 16).disc(8, 8.5, 5.6, "w").disc(8, 7.5, 5.2, "b").disc(8, 8, 1.7, ".").dots("y", [
|
|
1098
|
+
[5, 6],
|
|
1099
|
+
[10, 9],
|
|
1100
|
+
[8, 4]
|
|
1101
|
+
]).dots("c", [[10, 5], [5, 9]]).dots("1", [
|
|
1102
|
+
[7, 11],
|
|
1103
|
+
[11, 7],
|
|
1104
|
+
[4, 7]
|
|
1105
|
+
]).outline().rows(), St = new h(16, 16).rect(5, 3, 6, 11, "G").hline(5, 3, 6, "p").hline(5, 13, 6, "q").vline(10, 4, 9, "F").dots("y", [
|
|
1106
|
+
[8, 5],
|
|
1107
|
+
[7, 6],
|
|
1108
|
+
[7, 7],
|
|
1109
|
+
[8, 7],
|
|
1110
|
+
[8, 8],
|
|
1111
|
+
[8, 9],
|
|
1112
|
+
[7, 10]
|
|
1113
|
+
]).outline().rows(), kt = new h(16, 16).px(8, 2, "b").rect(7, 3, 3, 9, "G").vline(8, 4, 7, "g").rect(4, 6, 2, 3, "G").px(6, 8, "G").rect(11, 5, 2, 3, "G").px(10, 7, "G").rect(5, 12, 7, 3, "w").hline(5, 12, 7, "W").outline().rows(), Wt = new h(16, 16).rect(2, 2, 12, 12, "w").rect(3, 3, 10, 10, "C").rect(10, 4, 2, 2, "y").hline(7, 7, 2, "f").hline(6, 8, 4, "f").hline(5, 9, 6, "f").hline(4, 10, 8, "f").px(7, 7, "1").rect(3, 11, 10, 2, "G").outline().rows(), xt = new h(16, 16).rect(5, 2, 6, 5, "y").hline(6, 7, 4, "y").dots("Y", [
|
|
1114
|
+
[4, 3],
|
|
1115
|
+
[3, 3],
|
|
1116
|
+
[3, 4],
|
|
1117
|
+
[3, 5],
|
|
1118
|
+
[4, 5],
|
|
1119
|
+
[11, 3],
|
|
1120
|
+
[12, 3],
|
|
1121
|
+
[12, 4],
|
|
1122
|
+
[12, 5],
|
|
1123
|
+
[11, 5]
|
|
1124
|
+
]).vline(6, 3, 3, "1").vline(10, 2, 5, "Y").rect(7, 8, 2, 2, "Y").rect(5, 10, 6, 1, "Y").rect(4, 11, 8, 3, "k").hline(6, 12, 4, "y").outline().rows(), Tt = new h(16, 16).rect(2, 3, 7, 7, "y").hline(3, 5, 4, "Y").hline(3, 7, 3, "Y").rect(7, 5, 7, 7, "g").hline(8, 7, 4, "G").hline(8, 9, 3, "G").rect(4, 8, 7, 6, "c").hline(5, 10, 4, "j").hline(5, 12, 3, "j").outline().rows(), Ct = (() => {
|
|
1125
|
+
const e = new h(16, 16).rect(2, 3, 12, 11, "P").rect(2, 3, 12, 3, "b").dots("M", [[5, 2], [10, 2]]);
|
|
1126
|
+
for (const t of [
|
|
1127
|
+
7,
|
|
1128
|
+
9,
|
|
1129
|
+
11
|
|
1130
|
+
]) for (const o of [
|
|
1131
|
+
4,
|
|
1132
|
+
6,
|
|
1133
|
+
8,
|
|
1134
|
+
10
|
|
1135
|
+
]) e.px(o, t, "q");
|
|
1136
|
+
return e.rect(8, 9, 2, 2, "b").hline(2, 13, 12, "p").outline().rows();
|
|
1137
|
+
})(), Ht = new h(16, 24).hline(6, 3, 5, "M").px(6, 4, "M").rect(7, 5, 2, 2, "M").dots("M", [
|
|
1138
|
+
[11, 4],
|
|
1139
|
+
[12, 5],
|
|
1140
|
+
[12, 6],
|
|
1141
|
+
[12, 7],
|
|
1142
|
+
[12, 8],
|
|
1143
|
+
[12, 9]
|
|
1144
|
+
]).rect(5, 7, 6, 14, "b").vline(10, 7, 14, "R").vline(6, 8, 3, "P").rect(6, 12, 4, 4, "P").hline(7, 13, 2, "b").hline(5, 20, 6, "R").outline().rows(), jt = new h(16, 16).rect(3, 4, 9, 3, "G").vline(11, 4, 3, "P").hline(3, 5, 2, "l").rect(4, 7, 9, 3, "H").vline(12, 7, 3, "P").hline(4, 8, 2, "l").rect(3, 10, 10, 3, "b").vline(12, 10, 3, "P").hline(3, 11, 2, "l").outline().rows(), Pt = new h(32, 32).rect(2, 2, 28, 28, "q").rect(13, 3, 6, 2, "S").dots("g", [[15, 3], [16, 4]]).rect(5, 6, 22, 24, "p").vline(6, 7, 22, "l").vline(17, 7, 22, "l").rect(15, 6, 2, 24, "K").rect(28, 15, 1, 2, "y").hline(2, 29, 28, "K").outline().rows(), Et = new h(16, 16).rect(0, 0, 16, 16, "l").dots("P", [
|
|
1145
|
+
[2, 2],
|
|
1146
|
+
[10, 3],
|
|
1147
|
+
[4, 11],
|
|
1148
|
+
[12, 12]
|
|
1149
|
+
]).hline(0, 7, 16, "p").hline(0, 15, 16, "p").vline(7, 0, 16, "p").vline(15, 0, 16, "p").rows(), Kt = (() => {
|
|
1150
|
+
const e = new h(16, 16).rect(0, 0, 16, 16, "b");
|
|
1151
|
+
e.rect(8, 0, 7, 3, "R").rect(4, 4, 7, 3, "R").rect(0, 8, 7, 3, "R").rect(12, 12, 3, 3, "R").rect(0, 12, 3, 3, "R");
|
|
1152
|
+
for (const t of [
|
|
1153
|
+
3,
|
|
1154
|
+
7,
|
|
1155
|
+
11,
|
|
1156
|
+
15
|
|
1157
|
+
]) e.hline(0, t, 16, "T");
|
|
1158
|
+
return [
|
|
1159
|
+
[7, 15],
|
|
1160
|
+
[3, 11],
|
|
1161
|
+
[7, 15],
|
|
1162
|
+
[3, 11]
|
|
1163
|
+
].forEach((t, o) => t.forEach((n) => e.vline(n, o * 4, 3, "T"))), e.rows();
|
|
1164
|
+
})(), Rt = [
|
|
1165
|
+
f("standing-desk", "Standing desk", ["furniture", "tech"], Ze),
|
|
1166
|
+
f("meeting-table", "Meeting table", ["furniture"], Qe),
|
|
1167
|
+
f("reception-desk", "Reception desk", ["furniture"], rt),
|
|
1168
|
+
f("bean-bag", "Bean bag", ["furniture"], et),
|
|
1169
|
+
f("stool", "Stool", ["furniture"], nt),
|
|
1170
|
+
f("locker", "Locker", ["furniture"], ot),
|
|
1171
|
+
f("coat-rack", "Coat rack", ["furniture", "decor"], tt),
|
|
1172
|
+
f("ping-pong-table", "Ping-pong table", ["furniture", "fun"], ct),
|
|
1173
|
+
f("rug", "Rug", ["decor"], at),
|
|
1174
|
+
f("cardboard-box", "Cardboard box", ["decor"], it),
|
|
1175
|
+
f("tv-screen", "Wall screen", ["tech"], st),
|
|
1176
|
+
f("desktop-tower", "Desktop tower", ["tech"], lt),
|
|
1177
|
+
f("tablet", "Tablet", ["tech"], ht),
|
|
1178
|
+
f("phone", "Phone", ["tech"], ft),
|
|
1179
|
+
f("headphones", "Headphones", ["tech"], ut),
|
|
1180
|
+
f("router", "Router", ["tech"], dt),
|
|
1181
|
+
f("mouse", "Mouse", ["tech"], bt),
|
|
1182
|
+
f("game-controller", "Game controller", ["tech", "fun"], wt),
|
|
1183
|
+
f("arcade-cabinet", "Arcade cabinet", ["tech", "fun"], pt),
|
|
1184
|
+
f("fridge", "Fridge", ["kitchen"], mt),
|
|
1185
|
+
f("microwave", "Microwave", ["kitchen"], gt),
|
|
1186
|
+
f("vending-machine", "Vending machine", ["kitchen"], yt),
|
|
1187
|
+
f("pizza-box", "Pizza box", ["kitchen", "fun"], vt),
|
|
1188
|
+
f("donut", "Donut", ["kitchen"], Mt),
|
|
1189
|
+
f("energy-drink", "Energy drink", ["kitchen"], St),
|
|
1190
|
+
f("cactus", "Cactus", ["decor"], kt),
|
|
1191
|
+
f("picture-frame", "Picture frame", ["decor"], Wt),
|
|
1192
|
+
f("trophy", "Trophy", ["decor"], xt),
|
|
1193
|
+
f("sticky-notes", "Sticky notes", ["decor"], Tt),
|
|
1194
|
+
f("calendar", "Calendar", ["decor"], Ct),
|
|
1195
|
+
f("fire-extinguisher", "Fire extinguisher", ["decor", "structure"], Ht),
|
|
1196
|
+
f("book-stack", "Stack of books", ["decor"], jt),
|
|
1197
|
+
f("elevator", "Elevator", ["structure"], Pt),
|
|
1198
|
+
f("tiled-floor-tile", "Tiled floor tile", ["tile"], Et),
|
|
1199
|
+
f("brick-wall-tile", "Brick wall tile", ["tile", "structure"], Kt)
|
|
1200
|
+
], Ot = new h(32, 32).rect(2, 2, 28, 26, "P").rect(4, 4, 24, 22, "C").rect(4, 12, 24, 14, "L").rect(6, 6, 5, 2, "1").rect(7, 5, 3, 1, "1").rect(20, 9, 5, 2, "1").rect(21, 8, 3, 1, "1").rect(5, 19, 4, 7, "j").rect(9, 16, 5, 10, "h").rect(17, 20, 4, 6, "h").rect(21, 17, 4, 9, "j").rect(25, 21, 3, 5, "h").dots("y", [
|
|
1201
|
+
[10, 18],
|
|
1202
|
+
[12, 20],
|
|
1203
|
+
[22, 19],
|
|
1204
|
+
[23, 22],
|
|
1205
|
+
[6, 21],
|
|
1206
|
+
[18, 22]
|
|
1207
|
+
]).rect(15, 4, 2, 22, "P").rect(4, 14, 24, 2, "P").hline(2, 27, 28, "p").rect(1, 28, 30, 2, "p").hline(1, 28, 30, "l").outline().rows(), At = new h(16, 32).rect(1, 1, 14, 30, "k").rect(2, 2, 12, 29, "w").rect(4, 4, 8, 10, "W").frame(4, 4, 8, 10, "d").rect(4, 17, 8, 11, "W").frame(4, 17, 8, 11, "d").px(11, 15, "y").px(11, 16, "Y").outline().rows(), $t = L(16, [
|
|
1208
|
+
"aaaaaaaabaaaaaaa",
|
|
1209
|
+
"aacaaaaabaaaaaaa",
|
|
1210
|
+
"aaaaaaaabaaaacaa",
|
|
1211
|
+
"aaaaaaaabaaaaaaa",
|
|
1212
|
+
"aaaaacaabaaaaaaa",
|
|
1213
|
+
"aaaaaaaabaaaaaaa",
|
|
1214
|
+
"aaaaaaaabaacaaaa",
|
|
1215
|
+
"bbbbbbbbbbbbbbbb",
|
|
1216
|
+
"baaaaaaaaaaaaaaa",
|
|
1217
|
+
"baaaaaacaaaaaaaa",
|
|
1218
|
+
"baaaaaaaaaaaaaca",
|
|
1219
|
+
"baacaaaaaaaaaaaa",
|
|
1220
|
+
"baaaaaaaaaacaaaa",
|
|
1221
|
+
"baaaaaaaaaaaaaaa",
|
|
1222
|
+
"baaaaacaaaaaaaaa",
|
|
1223
|
+
"bbbbbbbbbbbbbbbb"
|
|
1224
|
+
]), It = new h(16, 16).rect(0, 0, 16, 16, "W").dots("s", [
|
|
1225
|
+
[1, 1],
|
|
1226
|
+
[9, 1],
|
|
1227
|
+
[13, 5],
|
|
1228
|
+
[4, 5],
|
|
1229
|
+
[7, 9],
|
|
1230
|
+
[12, 9],
|
|
1231
|
+
[2, 13],
|
|
1232
|
+
[13, 13]
|
|
1233
|
+
]).hline(0, 3, 16, "w").hline(0, 7, 16, "w").hline(0, 11, 16, "w").hline(0, 15, 16, "w").vline(5, 0, 3, "w").vline(11, 4, 3, "w").vline(3, 8, 3, "w").vline(9, 12, 3, "w").rows(), Gt = new h(16, 16).rect(0, 0, 16, 16, "t").dots("T", [
|
|
1234
|
+
[3, 2],
|
|
1235
|
+
[11, 5],
|
|
1236
|
+
[6, 8],
|
|
1237
|
+
[13, 9]
|
|
1238
|
+
]).hline(0, 11, 16, "T").rect(0, 12, 16, 4, "m").hline(0, 12, 16, "K").hline(0, 15, 16, "M").rows(), Lt = [
|
|
1239
|
+
f("window", "Window", ["structure"], Ot),
|
|
1240
|
+
f("door", "Door", ["structure"], At),
|
|
1241
|
+
f("carpet-tile", "Carpet tile", ["tile"], $t, {
|
|
1242
|
+
a: "#4b5672",
|
|
1243
|
+
b: "#465069",
|
|
1244
|
+
c: "#525e7c"
|
|
1245
|
+
}),
|
|
1246
|
+
f("wood-floor-tile", "Wood floor tile", ["tile"], It),
|
|
1247
|
+
f("wall-tile", "Wall tile", ["tile", "structure"], Gt)
|
|
1248
|
+
], Bt = new h(16, 16).rect(1, 1, 14, 10, "M").rect(2, 2, 12, 8, "S").hline(3, 3, 4, "c").hline(8, 3, 3, "g").hline(4, 5, 6, "y").hline(3, 7, 3, "c").hline(7, 7, 5, "g").px(12, 10, "g").rect(7, 11, 2, 2, "m").rect(4, 13, 8, 1, "M").outline().rows(), Yt = new h(16, 16).rect(3, 2, 10, 7, "p").rect(4, 3, 8, 5, "S").hline(5, 4, 3, "c").px(9, 4, "y").hline(5, 6, 5, "g").hline(3, 9, 10, "K").rect(2, 10, 12, 1, "q").rect(1, 11, 14, 1, "p").hline(6, 11, 4, "q").rect(1, 12, 14, 1, "K").outline().rows(), Dt = new h(16, 16).rect(1, 4, 14, 8, "p").dots("K", [
|
|
1249
|
+
2,
|
|
1250
|
+
4,
|
|
1251
|
+
6,
|
|
1252
|
+
8,
|
|
1253
|
+
10,
|
|
1254
|
+
12
|
|
1255
|
+
].map((e) => [e, 5])).dots("K", [
|
|
1256
|
+
3,
|
|
1257
|
+
5,
|
|
1258
|
+
7,
|
|
1259
|
+
9,
|
|
1260
|
+
11,
|
|
1261
|
+
13
|
|
1262
|
+
].map((e) => [e, 7])).dots("K", [
|
|
1263
|
+
[2, 9],
|
|
1264
|
+
[4, 9],
|
|
1265
|
+
[12, 9]
|
|
1266
|
+
]).hline(6, 9, 5, "K").hline(1, 11, 14, "q").outline().rows(), _t = new h(16, 16).rect(5, 1, 6, 4, "P").hline(6, 2, 4, "p").rect(2, 5, 12, 6, "p").hline(2, 5, 12, "l").px(12, 7, "g").px(10, 7, "K").hline(4, 8, 8, "M").rect(2, 11, 12, 2, "q").rect(4, 9, 8, 5, "P").hline(5, 10, 5, "q").hline(5, 12, 4, "q").outline().rows(), Ft = (() => {
|
|
1267
|
+
const e = new h(16, 32).rect(2, 2, 12, 28, "M").hline(2, 2, 12, "m"), t = [
|
|
1268
|
+
"g",
|
|
1269
|
+
"y",
|
|
1270
|
+
"g",
|
|
1271
|
+
"b",
|
|
1272
|
+
"g",
|
|
1273
|
+
"g"
|
|
1274
|
+
];
|
|
1275
|
+
return [
|
|
1276
|
+
4,
|
|
1277
|
+
8,
|
|
1278
|
+
12,
|
|
1279
|
+
16,
|
|
1280
|
+
20,
|
|
1281
|
+
24
|
|
1282
|
+
].forEach((o, n) => {
|
|
1283
|
+
e.rect(3, o, 10, 3, "m").px(4, o + 1, "g").px(6, o + 1, w(t[n])).hline(8, o + 1, 4, "M");
|
|
1284
|
+
}), e.rect(3, 30, 2, 1, "x").rect(11, 30, 2, 1, "x").outline().rows();
|
|
1285
|
+
})(), Jt = new h(16, 24).rect(2, 2, 12, 19, "m").rect(2, 2, 12, 3, "M").rect(4, 6, 5, 3, "S").hline(5, 7, 2, "g").px(11, 6, "b").px(11, 8, "g").rect(4, 11, 8, 8, "M").rect(7, 11, 2, 2, "K").rect(6, 15, 4, 4, "P").hline(6, 15, 4, "k").vline(10, 16, 2, "P").rect(3, 19, 10, 1, "K").rect(2, 20, 12, 2, "M").outline().rows(), Ut = new h(16, 32).rect(6, 1, 4, 1, "C").rect(5, 2, 6, 9, "c").rect(5, 2, 6, 2, "L").vline(6, 4, 6, "1").vline(10, 4, 7, "C").rect(6, 11, 4, 1, "H").rect(3, 12, 10, 17, "P").hline(3, 12, 10, "1").vline(12, 13, 16, "p").rect(5, 15, 6, 5, "p").px(6, 17, "H").px(9, 17, "b").rect(5, 21, 6, 1, "K").rect(5, 22, 6, 1, "q").rect(3, 29, 2, 1, "m").rect(11, 29, 2, 1, "m").outline().rows(), Nt = [
|
|
1286
|
+
f("monitor", "Monitor", ["tech"], Bt),
|
|
1287
|
+
f("laptop", "Laptop", ["tech"], Yt),
|
|
1288
|
+
f("keyboard", "Keyboard", ["tech"], Dt),
|
|
1289
|
+
f("printer", "Printer", ["tech"], _t),
|
|
1290
|
+
f("server-rack", "Server rack", ["tech"], Ft),
|
|
1291
|
+
f("coffee-machine", "Coffee machine", ["tech", "kitchen"], Jt),
|
|
1292
|
+
f("water-cooler", "Water cooler", ["kitchen"], Ut)
|
|
1293
|
+
], ge = {
|
|
1294
|
+
...me({
|
|
1295
|
+
skin: "#d9a066",
|
|
1296
|
+
hairStyle: "long",
|
|
1297
|
+
hairColour: "#d77bba",
|
|
1298
|
+
top: "t-shirt",
|
|
1299
|
+
topColour: "#3b3f52",
|
|
1300
|
+
bottom: "trousers",
|
|
1301
|
+
bottomColour: "#7f8a99",
|
|
1302
|
+
shoeColour: "#dfe6f0",
|
|
1303
|
+
accessory: "glasses",
|
|
1304
|
+
accent: "#5fcde4"
|
|
1305
|
+
}),
|
|
1306
|
+
id: "designer",
|
|
1307
|
+
name: "Designer",
|
|
1308
|
+
tags: ["character"]
|
|
1309
|
+
}, ye = {
|
|
1310
|
+
...me({
|
|
1311
|
+
skin: "#b97a45",
|
|
1312
|
+
hairStyle: "short",
|
|
1313
|
+
hairColour: "#9badb7",
|
|
1314
|
+
top: "shirt-and-tie",
|
|
1315
|
+
topColour: "#f4f4f4",
|
|
1316
|
+
bottom: "trousers",
|
|
1317
|
+
bottomColour: "#3b3f52",
|
|
1318
|
+
shoeColour: "#262b3d",
|
|
1319
|
+
accessory: "none",
|
|
1320
|
+
accent: "#d95763"
|
|
1321
|
+
}),
|
|
1322
|
+
id: "manager",
|
|
1323
|
+
name: "Manager",
|
|
1324
|
+
tags: ["character"]
|
|
1325
|
+
}, qt = [
|
|
1326
|
+
...ze,
|
|
1327
|
+
...Nt,
|
|
1328
|
+
..._e,
|
|
1329
|
+
...Lt,
|
|
1330
|
+
...Ve,
|
|
1331
|
+
...Rt,
|
|
1332
|
+
ge,
|
|
1333
|
+
ye
|
|
1334
|
+
], zt = [...Q(ge), ...Q(ye)];
|
|
1335
|
+
function Wo(e) {
|
|
1336
|
+
return qt.find((t) => t.id === e);
|
|
1337
|
+
}
|
|
1338
|
+
function xo(e) {
|
|
1339
|
+
return zt.find((t) => t.id === e);
|
|
1340
|
+
}
|
|
1341
|
+
function ve(e, t) {
|
|
1342
|
+
return {
|
|
1343
|
+
width: e,
|
|
1344
|
+
height: t,
|
|
1345
|
+
data: new Uint8ClampedArray(e * t * 4)
|
|
1346
|
+
};
|
|
1347
|
+
}
|
|
1348
|
+
function Xt(e) {
|
|
1349
|
+
return [
|
|
1350
|
+
parseInt(e.slice(1, 3), 16),
|
|
1351
|
+
parseInt(e.slice(3, 5), 16),
|
|
1352
|
+
parseInt(e.slice(5, 7), 16)
|
|
1353
|
+
];
|
|
1354
|
+
}
|
|
1355
|
+
function Me(e, t, o = 0, n = 0, r = 1) {
|
|
1356
|
+
const a = new Map(Object.entries(t.palette).map(([c, l]) => [c, Xt(l)]));
|
|
1357
|
+
t.rows.forEach((c, l) => {
|
|
1358
|
+
[...c].forEach((u, s) => {
|
|
1359
|
+
if (u === ".") return;
|
|
1360
|
+
const i = a.get(u);
|
|
1361
|
+
if (!i) throw new Error(`${t.id}: no palette entry for '${u}'`);
|
|
1362
|
+
for (let d = 0; d < r; d++) for (let m = 0; m < r; m++) {
|
|
1363
|
+
const g = o + s * r + m, v = n + l * r + d;
|
|
1364
|
+
g < 0 || v < 0 || g >= e.width || v >= e.height || e.data.set([...i, 255], (v * e.width + g) * 4);
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
});
|
|
1368
|
+
}
|
|
1369
|
+
function To(e, t = 1) {
|
|
1370
|
+
if (!Number.isInteger(t) || t < 1) throw new Error(`Scale must be a whole number of 1 or more, got ${t}`);
|
|
1371
|
+
const o = ve(P(e) * t, A(e) * t);
|
|
1372
|
+
return Me(o, e, 0, 0, t), o;
|
|
1373
|
+
}
|
|
1374
|
+
function Co(e, t = 128, o = 1) {
|
|
1375
|
+
const n = [...e].sort((i, d) => A(d) - A(i) || P(d) - P(i) || i.id.localeCompare(d.id)), r = {};
|
|
1376
|
+
let a = 0, c = 0, l = 0, u = 0;
|
|
1377
|
+
for (const i of n) {
|
|
1378
|
+
const d = P(i), m = A(i);
|
|
1379
|
+
a > 0 && a + d > t && (a = 0, c += l + o, l = 0), r[i.id] = {
|
|
1380
|
+
x: a,
|
|
1381
|
+
y: c,
|
|
1382
|
+
width: d,
|
|
1383
|
+
height: m
|
|
1384
|
+
}, a += d + o, l = Math.max(l, m), u = Math.max(u, a - o);
|
|
1385
|
+
}
|
|
1386
|
+
const s = ve(u, c + l);
|
|
1387
|
+
for (const i of n) Me(s, i, w(r[i.id]).x, w(r[i.id]).y);
|
|
1388
|
+
return {
|
|
1389
|
+
bitmap: s,
|
|
1390
|
+
frames: r
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
function Ho(e, t) {
|
|
1394
|
+
const o = { ...e.palette };
|
|
1395
|
+
for (const [n, r] of Object.entries(t)) n in o && (o[n] = r.toLowerCase());
|
|
1396
|
+
return {
|
|
1397
|
+
...e,
|
|
1398
|
+
palette: o
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1401
|
+
function Vt(e, t) {
|
|
1402
|
+
return {
|
|
1403
|
+
...e,
|
|
1404
|
+
palette: Object.fromEntries(Object.entries(e.palette).map(([o, n]) => [o, t(n)]))
|
|
1405
|
+
};
|
|
1406
|
+
}
|
|
1407
|
+
function jo(e, t) {
|
|
1408
|
+
return t % 360 === 0 ? e : Vt(e, (o) => {
|
|
1409
|
+
const [n, r, a] = Ce(o);
|
|
1410
|
+
return y(n + t, r, a);
|
|
1411
|
+
});
|
|
1412
|
+
}
|
|
1413
|
+
var _ = (e) => (t) => w(e[Math.min(e.length - 1, Math.floor(ne(t) * e.length))]), Po = [
|
|
1414
|
+
{
|
|
1415
|
+
id: "greyscale",
|
|
1416
|
+
name: "Greyscale",
|
|
1417
|
+
apply: (e) => {
|
|
1418
|
+
const t = ne(e) * 255;
|
|
1419
|
+
return E([
|
|
1420
|
+
t,
|
|
1421
|
+
t,
|
|
1422
|
+
t
|
|
1423
|
+
]);
|
|
1424
|
+
}
|
|
1425
|
+
},
|
|
1426
|
+
{
|
|
1427
|
+
id: "handheld",
|
|
1428
|
+
name: "Handheld",
|
|
1429
|
+
apply: _([
|
|
1430
|
+
"#0f380f",
|
|
1431
|
+
"#306230",
|
|
1432
|
+
"#8bac0f",
|
|
1433
|
+
"#9bbc0f"
|
|
1434
|
+
])
|
|
1435
|
+
},
|
|
1436
|
+
{
|
|
1437
|
+
id: "night",
|
|
1438
|
+
name: "Night",
|
|
1439
|
+
apply: (e) => He(e, "#1a1c3a", 0.45)
|
|
1440
|
+
},
|
|
1441
|
+
{
|
|
1442
|
+
id: "sunset",
|
|
1443
|
+
name: "Sunset",
|
|
1444
|
+
apply: _([
|
|
1445
|
+
"#2d1b3d",
|
|
1446
|
+
"#7a2e4d",
|
|
1447
|
+
"#c8553d",
|
|
1448
|
+
"#f28f3b",
|
|
1449
|
+
"#ffd07b",
|
|
1450
|
+
"#fff4d6"
|
|
1451
|
+
])
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
id: "blueprint",
|
|
1455
|
+
name: "Blueprint",
|
|
1456
|
+
apply: _([
|
|
1457
|
+
"#0b2a5b",
|
|
1458
|
+
"#1d4e9e",
|
|
1459
|
+
"#5b9bea",
|
|
1460
|
+
"#d6e8ff"
|
|
1461
|
+
])
|
|
1462
|
+
}
|
|
1463
|
+
], Zt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", Eo = 62, Ko = [
|
|
1464
|
+
{
|
|
1465
|
+
id: "house",
|
|
1466
|
+
name: "House palette",
|
|
1467
|
+
colours: [...new Set(Object.values(ae))]
|
|
1468
|
+
},
|
|
1469
|
+
{
|
|
1470
|
+
id: "handheld",
|
|
1471
|
+
name: "Handheld green",
|
|
1472
|
+
colours: [
|
|
1473
|
+
"#0f380f",
|
|
1474
|
+
"#306230",
|
|
1475
|
+
"#8bac0f",
|
|
1476
|
+
"#9bbc0f"
|
|
1477
|
+
]
|
|
1478
|
+
},
|
|
1479
|
+
{
|
|
1480
|
+
id: "grey",
|
|
1481
|
+
name: "Four greys",
|
|
1482
|
+
colours: [
|
|
1483
|
+
"#1a1a1a",
|
|
1484
|
+
"#6b6b6b",
|
|
1485
|
+
"#b5b5b5",
|
|
1486
|
+
"#f4f4f4"
|
|
1487
|
+
]
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
id: "ink",
|
|
1491
|
+
name: "Black and white",
|
|
1492
|
+
colours: ["#1d1b26", "#faf8f3"]
|
|
1493
|
+
}
|
|
1494
|
+
];
|
|
1495
|
+
function Qt(e, t, o) {
|
|
1496
|
+
const n = o / Math.max(e, t);
|
|
1497
|
+
return [Math.max(1, Math.round(e * n)), Math.max(1, Math.round(t * n))];
|
|
1498
|
+
}
|
|
1499
|
+
function eo(e, t, o) {
|
|
1500
|
+
const n = [];
|
|
1501
|
+
for (let r = 0; r < o; r++) {
|
|
1502
|
+
const a = Math.floor(r * e.height / o), c = Math.max(a + 1, Math.floor((r + 1) * e.height / o));
|
|
1503
|
+
for (let l = 0; l < t; l++) {
|
|
1504
|
+
const u = Math.floor(l * e.width / t), s = Math.max(u + 1, Math.floor((l + 1) * e.width / t));
|
|
1505
|
+
let i = 0, d = 0, m = 0, g = 0;
|
|
1506
|
+
for (let k = a; k < c; k++) for (let p = u; p < s; p++) {
|
|
1507
|
+
const M = (k * e.width + p) * 4, W = w(e.data[M + 3]);
|
|
1508
|
+
i += w(e.data[M]) * W, d += w(e.data[M + 1]) * W, m += w(e.data[M + 2]) * W, g += W;
|
|
1509
|
+
}
|
|
1510
|
+
const v = (c - a) * (s - u);
|
|
1511
|
+
n.push(g / v < 128 ? null : [
|
|
1512
|
+
i / g,
|
|
1513
|
+
d / g,
|
|
1514
|
+
m / g
|
|
1515
|
+
]);
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
return n;
|
|
1519
|
+
}
|
|
1520
|
+
function to(e, t) {
|
|
1521
|
+
if (e.length === 0) return [];
|
|
1522
|
+
let o = [e];
|
|
1523
|
+
for (; o.length < t; ) {
|
|
1524
|
+
let r = -1, a = 0, c = 0;
|
|
1525
|
+
if (o.forEach((d, m) => {
|
|
1526
|
+
for (const g of [
|
|
1527
|
+
0,
|
|
1528
|
+
1,
|
|
1529
|
+
2
|
|
1530
|
+
]) {
|
|
1531
|
+
let v = 255, k = 0;
|
|
1532
|
+
for (const p of d)
|
|
1533
|
+
p[g] < v && (v = p[g]), p[g] > k && (k = p[g]);
|
|
1534
|
+
k - v > c && (c = k - v, r = m, a = g);
|
|
1535
|
+
}
|
|
1536
|
+
}), r < 0) break;
|
|
1537
|
+
const l = a, u = [...w(o[r])].sort((d, m) => d[l] - m[l]), s = (d) => w(u[d])[l];
|
|
1538
|
+
let i = Math.floor(u.length / 2);
|
|
1539
|
+
for (; i < u.length - 1 && s(i) === s(i - 1); ) i++;
|
|
1540
|
+
if (s(i) === s(i - 1))
|
|
1541
|
+
for (i = Math.floor(u.length / 2); i > 1 && s(i) === s(i - 1); ) i--;
|
|
1542
|
+
o = [
|
|
1543
|
+
...o.slice(0, r),
|
|
1544
|
+
u.slice(0, i),
|
|
1545
|
+
u.slice(i),
|
|
1546
|
+
...o.slice(r + 1)
|
|
1547
|
+
];
|
|
1548
|
+
}
|
|
1549
|
+
const n = o.map((r) => {
|
|
1550
|
+
const a = r.reduce((c, l) => [
|
|
1551
|
+
c[0] + l[0],
|
|
1552
|
+
c[1] + l[1],
|
|
1553
|
+
c[2] + l[2]
|
|
1554
|
+
], [
|
|
1555
|
+
0,
|
|
1556
|
+
0,
|
|
1557
|
+
0
|
|
1558
|
+
]);
|
|
1559
|
+
return E([
|
|
1560
|
+
a[0] / r.length,
|
|
1561
|
+
a[1] / r.length,
|
|
1562
|
+
a[2] / r.length
|
|
1563
|
+
]);
|
|
1564
|
+
});
|
|
1565
|
+
return [...new Set(n)];
|
|
1566
|
+
}
|
|
1567
|
+
function oo(e, t) {
|
|
1568
|
+
let o = 0, n = 1 / 0;
|
|
1569
|
+
return t.forEach((r, a) => {
|
|
1570
|
+
const c = 3 * (e[0] - r[0]) ** 2 + 4 * (e[1] - r[1]) ** 2 + 2 * (e[2] - r[2]) ** 2;
|
|
1571
|
+
c < n && (n = c, o = a);
|
|
1572
|
+
}), o;
|
|
1573
|
+
}
|
|
1574
|
+
var ro = [
|
|
1575
|
+
0,
|
|
1576
|
+
8,
|
|
1577
|
+
2,
|
|
1578
|
+
10,
|
|
1579
|
+
12,
|
|
1580
|
+
4,
|
|
1581
|
+
14,
|
|
1582
|
+
6,
|
|
1583
|
+
3,
|
|
1584
|
+
11,
|
|
1585
|
+
1,
|
|
1586
|
+
9,
|
|
1587
|
+
15,
|
|
1588
|
+
7,
|
|
1589
|
+
13,
|
|
1590
|
+
5
|
|
1591
|
+
].map((e) => e / 16 - 0.5 + 1 / 32);
|
|
1592
|
+
function Ro(e, t) {
|
|
1593
|
+
const [o, n] = Qt(e.width, e.height, t.size), r = eo(e, o, n), a = r.filter((p) => p !== null), c = typeof t.palette == "number" ? to(a, Math.min(t.palette, 62)) : t.palette, l = [...new Set(c.map((p) => p.toLowerCase()))].slice(0, 62);
|
|
1594
|
+
l.length === 0 && l.push("#000000");
|
|
1595
|
+
const u = l.map(j), s = t.dither ?? "none", i = 255 / Math.max(2, Math.cbrt(l.length) * 1.5), d = r.map((p) => p ? [...p] : null), m = [];
|
|
1596
|
+
for (let p = 0; p < n; p++) for (let M = 0; M < o; M++) {
|
|
1597
|
+
const W = d[p * o + M];
|
|
1598
|
+
if (!W) {
|
|
1599
|
+
m.push(null);
|
|
1600
|
+
continue;
|
|
1601
|
+
}
|
|
1602
|
+
const B = s === "ordered" ? w(ro[p % 4 * 4 + M % 4]) * i : 0, q = oo([
|
|
1603
|
+
W[0] + B,
|
|
1604
|
+
W[1] + B,
|
|
1605
|
+
W[2] + B
|
|
1606
|
+
], u);
|
|
1607
|
+
if (m.push(q), s === "diffusion") {
|
|
1608
|
+
const Y = w(u[q]), ke = [
|
|
1609
|
+
W[0] - Y[0],
|
|
1610
|
+
W[1] - Y[1],
|
|
1611
|
+
W[2] - Y[2]
|
|
1612
|
+
];
|
|
1613
|
+
for (const [We, xe, Te] of [
|
|
1614
|
+
[
|
|
1615
|
+
1,
|
|
1616
|
+
0,
|
|
1617
|
+
7 / 16
|
|
1618
|
+
],
|
|
1619
|
+
[
|
|
1620
|
+
-1,
|
|
1621
|
+
1,
|
|
1622
|
+
3 / 16
|
|
1623
|
+
],
|
|
1624
|
+
[
|
|
1625
|
+
0,
|
|
1626
|
+
1,
|
|
1627
|
+
5 / 16
|
|
1628
|
+
],
|
|
1629
|
+
[
|
|
1630
|
+
1,
|
|
1631
|
+
1,
|
|
1632
|
+
1 / 16
|
|
1633
|
+
]
|
|
1634
|
+
]) {
|
|
1635
|
+
const D = M + We, z = p + xe;
|
|
1636
|
+
if (D < 0 || D >= o || z >= n) continue;
|
|
1637
|
+
const X = d[z * o + D];
|
|
1638
|
+
if (X) for (const V of [
|
|
1639
|
+
0,
|
|
1640
|
+
1,
|
|
1641
|
+
2
|
|
1642
|
+
]) X[V] += ke[V] * Te;
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
const g = [...new Set(m.filter((p) => p !== null))].sort((p, M) => p - M), v = new Map(g.map((p, M) => [p, w(Zt[M])])), k = Array.from({ length: n }, (p, M) => m.slice(M * o, (M + 1) * o).map((W) => W === null ? "." : w(v.get(W))).join(""));
|
|
1647
|
+
return {
|
|
1648
|
+
id: "pixel-art",
|
|
1649
|
+
name: "Pixel art",
|
|
1650
|
+
tags: ["generated"],
|
|
1651
|
+
palette: Object.fromEntries(g.map((p) => [w(v.get(p)), w(l[p])])),
|
|
1652
|
+
rows: k
|
|
1653
|
+
};
|
|
1654
|
+
}
|
|
1655
|
+
function U(e) {
|
|
1656
|
+
let t = e >>> 0;
|
|
1657
|
+
return () => {
|
|
1658
|
+
t = t + 1831565813 >>> 0;
|
|
1659
|
+
let o = t;
|
|
1660
|
+
return o = Math.imul(o ^ o >>> 15, o | 1), o ^= o + Math.imul(o ^ o >>> 7, o | 61), ((o ^ o >>> 14) >>> 0) / 4294967296;
|
|
1661
|
+
};
|
|
1662
|
+
}
|
|
1663
|
+
var N = (e, t) => (Math.imul(e >>> 0, 2654435761) ^ Math.imul(t + 1, 40503)) >>> 0, b = 16, H = "#2b2233", T = (e, t) => w(t[Math.floor(e() * t.length)]), J = (e, t, o) => t + e() * (o - t), x = (e, t, o) => t + Math.floor(e() * (o - t + 1));
|
|
1664
|
+
function G(e, t, o, n, r) {
|
|
1665
|
+
return {
|
|
1666
|
+
id: e,
|
|
1667
|
+
name: t,
|
|
1668
|
+
tags: [...o, "generated"],
|
|
1669
|
+
rows: n,
|
|
1670
|
+
palette: $(n, r)
|
|
1671
|
+
};
|
|
1672
|
+
}
|
|
1673
|
+
var ee = () => Array.from({ length: b }, () => Array(b).fill(!1)), C = (e, t, o) => e[o]?.[t] ?? !1;
|
|
1674
|
+
function O(e, t, o, n) {
|
|
1675
|
+
const r = e[o];
|
|
1676
|
+
r && t >= 0 && t < b && (r[t] = n);
|
|
1677
|
+
}
|
|
1678
|
+
function no(e) {
|
|
1679
|
+
const t = ee();
|
|
1680
|
+
for (let s = 1; s <= 14; s++) for (let i = 1; i <= 7; i++) {
|
|
1681
|
+
const d = (i - 1) / 6, m = 1 - ((s - 7.5) / 7) ** 2;
|
|
1682
|
+
O(t, i, s, e() < 0.12 + 0.6 * d * m + 0.15 * m);
|
|
1683
|
+
}
|
|
1684
|
+
const o = (s, i) => i < 1 || i > 14 || s < 1 ? !1 : C(t, Math.min(s, 15 - s), i), n = t.map((s, i) => s.map((d, m) => {
|
|
1685
|
+
if (i < 1 || i > 14 || m < 1 || m > 7) return !1;
|
|
1686
|
+
let g = 0;
|
|
1687
|
+
for (let v = -1; v <= 1; v++) for (let k = -1; k <= 1; k++) (k || v) && o(m + k, i + v) && g++;
|
|
1688
|
+
return g >= 5 || d && g >= 2;
|
|
1689
|
+
})), r = x(e, 5, 7);
|
|
1690
|
+
for (let s = r - 1; s <= r + 1; s++) for (let i = 4; i <= 7; i++) O(n, i, s, !0);
|
|
1691
|
+
for (let s = 0; s < b; s++) for (let i = 8; i < b; i++) O(n, i, s, C(n, 15 - i, s));
|
|
1692
|
+
const a = ee(), c = [[7, r]];
|
|
1693
|
+
let l = 0;
|
|
1694
|
+
for (; c.length; ) {
|
|
1695
|
+
const s = c.pop();
|
|
1696
|
+
if (!s) break;
|
|
1697
|
+
const [i, d] = s;
|
|
1698
|
+
i < 0 || d < 0 || i >= b || d >= b || C(a, i, d) || !C(n, i, d) || (O(a, i, d, !0), l++, c.push([i + 1, d], [i - 1, d], [i, d + 1], [i, d - 1]));
|
|
1699
|
+
}
|
|
1700
|
+
if (l < 44) return null;
|
|
1701
|
+
const u = new h(b, b);
|
|
1702
|
+
for (let s = 0; s < b; s++) for (let i = 0; i < b; i++) {
|
|
1703
|
+
if (!C(a, i, s)) continue;
|
|
1704
|
+
const d = !C(a, i, s + 1), m = !C(a, i, s - 1);
|
|
1705
|
+
u.px(i, s, d ? "s" : m && s < 8 ? "h" : "b");
|
|
1706
|
+
}
|
|
1707
|
+
return u.dots("w", [[5, r], [10, r]]).dots("p", [[6, r], [9, r]]), e() < 0.5 && a[r + 2]?.[7] && u.dots("p", [[7, r + 2], [8, r + 2]]), u.outline().rows();
|
|
1708
|
+
}
|
|
1709
|
+
function Oo(e) {
|
|
1710
|
+
for (let t = 0; t < 50; t++) {
|
|
1711
|
+
const o = U(N(e, 100 + t)), n = no(o);
|
|
1712
|
+
if (!n) continue;
|
|
1713
|
+
const r = o() * 360, a = J(o, 0.45, 0.75);
|
|
1714
|
+
return G("creature", "Creature", ["creature"], n, {
|
|
1715
|
+
o: H,
|
|
1716
|
+
b: y(r, a, 0.55),
|
|
1717
|
+
s: y(r - 20, a, 0.38),
|
|
1718
|
+
h: y(r + 20, a, 0.72),
|
|
1719
|
+
w: "#ffffff",
|
|
1720
|
+
p: "#222034"
|
|
1721
|
+
});
|
|
1722
|
+
}
|
|
1723
|
+
return G("creature", "Creature", ["creature"], new h(b, b).disc(8, 8, 5, "b").outline().rows(), {
|
|
1724
|
+
o: H,
|
|
1725
|
+
b: "#5b6ee1"
|
|
1726
|
+
});
|
|
1727
|
+
}
|
|
1728
|
+
var Se = (e, t, o) => [
|
|
1729
|
+
e.get(t - 1, o),
|
|
1730
|
+
e.get(t + 1, o),
|
|
1731
|
+
e.get(t, o - 1),
|
|
1732
|
+
e.get(t, o + 1)
|
|
1733
|
+
].includes(".");
|
|
1734
|
+
function ao(e) {
|
|
1735
|
+
const t = new h(b, b), o = T(e, [
|
|
1736
|
+
"round",
|
|
1737
|
+
"square",
|
|
1738
|
+
"flask"
|
|
1739
|
+
]);
|
|
1740
|
+
if (o === "round" && t.disc(8, 10, 4.6, "g"), o === "square" && t.rect(4, 6, 8, 9, "g"), o === "flask") for (let c = 6; c <= 14; c++) t.hline(7 - Math.floor((c - 6) / 2), c, 2 + Math.floor((c - 6) / 2) * 2, "g");
|
|
1741
|
+
const n = x(e, 8, 10), r = [];
|
|
1742
|
+
for (let c = n; c < b; c++) for (let l = 0; l < b; l++) t.get(l, c) === "g" && !Se(t, l, c) && r.push([l, c]);
|
|
1743
|
+
t.dots("l", r), t.dots("d", r.filter(([c, l]) => t.get(c, l + 1) !== "l")), t.dots("t", r.filter(([, c]) => c === n)), t.rect(7, 3, 2, 4, "g").rect(6, 3, 4, 1, "g").rect(7, 1, 2, 2, "c").px(6, 9, "1");
|
|
1744
|
+
const a = e() * 360;
|
|
1745
|
+
return {
|
|
1746
|
+
rows: t.outline().rows(),
|
|
1747
|
+
colours: {
|
|
1748
|
+
o: H,
|
|
1749
|
+
g: "#dfe6f0",
|
|
1750
|
+
c: "#b97a45",
|
|
1751
|
+
1: "#ffffff",
|
|
1752
|
+
l: y(a, 0.7, 0.55),
|
|
1753
|
+
d: y(a, 0.7, 0.4),
|
|
1754
|
+
t: y(a, 0.8, 0.75)
|
|
1755
|
+
}
|
|
1756
|
+
};
|
|
1757
|
+
}
|
|
1758
|
+
function co(e) {
|
|
1759
|
+
const t = new h(b, b), o = T(e, [
|
|
1760
|
+
"diamond",
|
|
1761
|
+
"cut",
|
|
1762
|
+
"round"
|
|
1763
|
+
]);
|
|
1764
|
+
for (let r = 0; r < b; r++) for (let a = 0; a < b; a++) {
|
|
1765
|
+
const c = Math.abs(a + 0.5 - 8), l = Math.abs(r + 0.5 - 8);
|
|
1766
|
+
if (!(o === "diamond" ? c + l <= 6.5 : o === "cut" ? c <= 5 && l <= 6 && c + l <= 8.5 : c * c + l * l <= 5.6 * 5.6)) continue;
|
|
1767
|
+
const u = a + r - 15;
|
|
1768
|
+
t.px(a, r, u < -4 ? "h" : u > 3 ? "s" : "b");
|
|
1769
|
+
}
|
|
1770
|
+
t.px(6, 5, "1").px(5, 6, "1");
|
|
1771
|
+
const n = e() * 360;
|
|
1772
|
+
return {
|
|
1773
|
+
rows: t.outline().rows(),
|
|
1774
|
+
colours: {
|
|
1775
|
+
o: H,
|
|
1776
|
+
1: "#ffffff",
|
|
1777
|
+
h: y(n, 0.75, 0.75),
|
|
1778
|
+
b: y(n, 0.75, 0.55),
|
|
1779
|
+
s: y(n - 15, 0.75, 0.38)
|
|
1780
|
+
}
|
|
1781
|
+
};
|
|
1782
|
+
}
|
|
1783
|
+
function io(e) {
|
|
1784
|
+
const t = new h(b, b), o = x(e, 7, 9);
|
|
1785
|
+
for (let s = 0; s < o; s++) t.px(13 - s, 2 + s, "h").px(12 - s, 2 + s, "b").px(13 - s, 3 + s, "b");
|
|
1786
|
+
t.px(13, 2, "h");
|
|
1787
|
+
const n = 12 - o, r = 2 + o, a = x(e, 1, 2);
|
|
1788
|
+
for (let s = -a; s <= a; s++) t.px(n + s, r + s, "g").px(n + s + 1, r + s, "g");
|
|
1789
|
+
for (let s = 1; s <= 2; s++) t.px(n - s, r + s, "k");
|
|
1790
|
+
t.px(n - 3, r + 3, "g");
|
|
1791
|
+
const c = e() < 0.45, l = e() * 360, u = T(e, [
|
|
1792
|
+
["#fbf236", "#e8b930"],
|
|
1793
|
+
["#dfe6f0", "#9badb7"],
|
|
1794
|
+
["#d9a066", "#b97a45"]
|
|
1795
|
+
]);
|
|
1796
|
+
return {
|
|
1797
|
+
rows: t.outline().rows(),
|
|
1798
|
+
colours: {
|
|
1799
|
+
o: H,
|
|
1800
|
+
h: c ? y(l, 0.6, 0.85) : "#ffffff",
|
|
1801
|
+
b: c ? y(l, 0.6, 0.65) : "#b8c4d6",
|
|
1802
|
+
g: u[1],
|
|
1803
|
+
k: T(e, [
|
|
1804
|
+
"#663931",
|
|
1805
|
+
"#ac3232",
|
|
1806
|
+
"#3f3f74",
|
|
1807
|
+
"#37946e"
|
|
1808
|
+
])
|
|
1809
|
+
}
|
|
1810
|
+
};
|
|
1811
|
+
}
|
|
1812
|
+
function so(e) {
|
|
1813
|
+
const t = new h(b, b);
|
|
1814
|
+
[
|
|
1815
|
+
5,
|
|
1816
|
+
5,
|
|
1817
|
+
5,
|
|
1818
|
+
5,
|
|
1819
|
+
5,
|
|
1820
|
+
5,
|
|
1821
|
+
5,
|
|
1822
|
+
4,
|
|
1823
|
+
4,
|
|
1824
|
+
3,
|
|
1825
|
+
2,
|
|
1826
|
+
1
|
|
1827
|
+
].forEach((a, c) => t.hline(8 - a, 2 + c, a * 2, "a"));
|
|
1828
|
+
const o = T(e, [
|
|
1829
|
+
"stripe",
|
|
1830
|
+
"cross",
|
|
1831
|
+
"halves",
|
|
1832
|
+
"dot",
|
|
1833
|
+
"chevron",
|
|
1834
|
+
"band"
|
|
1835
|
+
]);
|
|
1836
|
+
for (let a = 0; a < b; a++) for (let c = 0; c < b; c++) {
|
|
1837
|
+
if (t.get(c, a) !== "a") continue;
|
|
1838
|
+
const l = Math.min(c, 15 - c);
|
|
1839
|
+
(o === "stripe" ? l === 7 : o === "cross" ? l === 7 || a === 6 || a === 7 : o === "halves" ? c >= 8 : o === "dot" ? (c + 0.5 - 8) ** 2 + (a + 0.5 - 7) ** 2 <= 5 : o === "chevron" ? a - (7 - l) === 4 || a - (7 - l) === 5 : a >= 6 && a <= 8) && t.px(c, a, "e");
|
|
1840
|
+
}
|
|
1841
|
+
const n = [];
|
|
1842
|
+
for (let a = 0; a < b; a++) for (let c = 0; c < b; c++) t.get(c, a) !== "." && Se(t, c, a) && n.push([c, a]);
|
|
1843
|
+
t.dots("m", n);
|
|
1844
|
+
const r = e() * 360;
|
|
1845
|
+
return {
|
|
1846
|
+
rows: t.outline().rows(),
|
|
1847
|
+
colours: {
|
|
1848
|
+
o: H,
|
|
1849
|
+
m: "#9badb7",
|
|
1850
|
+
a: y(r, 0.6, 0.5),
|
|
1851
|
+
e: T(e, [
|
|
1852
|
+
"#f4f4f4",
|
|
1853
|
+
"#fbf236",
|
|
1854
|
+
y(r + 180, 0.6, 0.6)
|
|
1855
|
+
])
|
|
1856
|
+
}
|
|
1857
|
+
};
|
|
1858
|
+
}
|
|
1859
|
+
function lo(e) {
|
|
1860
|
+
const t = new h(b, b);
|
|
1861
|
+
e() < 0.5 ? t.disc(4.5, 8, 3.1, "g") : t.rect(2, 5, 5, 6, "g"), t.rect(7, 7, 7, 2, "g").hline(7, 8, 7, "s");
|
|
1862
|
+
const o = x(e, 2, 3);
|
|
1863
|
+
for (let c = 0; c < o; c++) t.vline(13 - c * 2, 9, x(e, 1, 2), "s");
|
|
1864
|
+
const n = e() * 360, r = e() < 0.5 ? T(e, [
|
|
1865
|
+
["#fbf236", "#e8b930"],
|
|
1866
|
+
["#dfe6f0", "#9badb7"],
|
|
1867
|
+
["#d9a066", "#b97a45"]
|
|
1868
|
+
]) : [y(n, 0.7, 0.65), y(n, 0.7, 0.45)], a = t.outline().rows();
|
|
1869
|
+
return {
|
|
1870
|
+
rows: new h(b, b).stamp(0, 0, a).rect(4, 7, 1, 2, "o").rows(),
|
|
1871
|
+
colours: {
|
|
1872
|
+
o: H,
|
|
1873
|
+
g: r[0],
|
|
1874
|
+
s: r[1]
|
|
1875
|
+
}
|
|
1876
|
+
};
|
|
1877
|
+
}
|
|
1878
|
+
var ho = {
|
|
1879
|
+
potion: ao,
|
|
1880
|
+
gem: co,
|
|
1881
|
+
sword: io,
|
|
1882
|
+
shield: so,
|
|
1883
|
+
key: lo
|
|
1884
|
+
}, te = [
|
|
1885
|
+
{
|
|
1886
|
+
id: "potion",
|
|
1887
|
+
name: "Potion"
|
|
1888
|
+
},
|
|
1889
|
+
{
|
|
1890
|
+
id: "gem",
|
|
1891
|
+
name: "Gem"
|
|
1892
|
+
},
|
|
1893
|
+
{
|
|
1894
|
+
id: "sword",
|
|
1895
|
+
name: "Sword"
|
|
1896
|
+
},
|
|
1897
|
+
{
|
|
1898
|
+
id: "shield",
|
|
1899
|
+
name: "Shield"
|
|
1900
|
+
},
|
|
1901
|
+
{
|
|
1902
|
+
id: "key",
|
|
1903
|
+
name: "Key"
|
|
1904
|
+
}
|
|
1905
|
+
];
|
|
1906
|
+
function Ao(e, t) {
|
|
1907
|
+
const o = te.findIndex((r) => r.id === t);
|
|
1908
|
+
if (o < 0) throw new Error(`Unknown item kind "${t}"`);
|
|
1909
|
+
const n = ho[t](U(N(e, 200 + o)));
|
|
1910
|
+
return G(t, w(te[o]).name, ["item"], n.rows, n.colours);
|
|
1911
|
+
}
|
|
1912
|
+
var fo = (e) => {
|
|
1913
|
+
const t = Array.from({ length: 8 }, () => T(e, [
|
|
1914
|
+
"a",
|
|
1915
|
+
"a",
|
|
1916
|
+
"b",
|
|
1917
|
+
"c"
|
|
1918
|
+
]));
|
|
1919
|
+
return (o, n) => {
|
|
1920
|
+
const r = Math.floor(n / 4), a = (o + r % 2 * 4) % 16;
|
|
1921
|
+
return n % 4 === 3 || a % 8 === 7 ? "m" : w(t[r * 2 + Math.floor(a / 8)]);
|
|
1922
|
+
};
|
|
1923
|
+
}, uo = (e) => {
|
|
1924
|
+
const t = Array.from({ length: 4 }, () => x(e, 0, 15)), o = Array.from({ length: 4 }, () => T(e, [
|
|
1925
|
+
"a",
|
|
1926
|
+
"a",
|
|
1927
|
+
"c"
|
|
1928
|
+
])), n = /* @__PURE__ */ new Set();
|
|
1929
|
+
for (let r = 0; r < 6; r++) {
|
|
1930
|
+
const a = x(e, 0, 15), c = x(e, 0, 3) * 4 + x(e, 0, 2), l = x(e, 2, 4);
|
|
1931
|
+
for (let u = 0; u < l; u++) n.add(`${(a + u) % 16},${c}`);
|
|
1932
|
+
}
|
|
1933
|
+
return (r, a) => {
|
|
1934
|
+
const c = Math.floor(a / 4);
|
|
1935
|
+
return a % 4 === 3 || r === t[c] ? "m" : n.has(`${r},${a}`) ? "b" : w(o[c]);
|
|
1936
|
+
};
|
|
1937
|
+
}, wo = (e) => {
|
|
1938
|
+
const t = new Set(Array.from({ length: 12 }, () => `${x(e, 0, 15)},${x(e, 0, 15)}`));
|
|
1939
|
+
return (o, n) => {
|
|
1940
|
+
const r = (Math.floor(o / 8) + Math.floor(n / 8)) % 2 === 1;
|
|
1941
|
+
return t.has(`${o},${n}`) ? r ? "m" : "b" : r ? "c" : "a";
|
|
1942
|
+
};
|
|
1943
|
+
}, bo = (e) => {
|
|
1944
|
+
const t = Array.from({ length: 7 }, () => [
|
|
1945
|
+
e() * 16,
|
|
1946
|
+
e() * 16,
|
|
1947
|
+
T(e, [
|
|
1948
|
+
"a",
|
|
1949
|
+
"a",
|
|
1950
|
+
"b",
|
|
1951
|
+
"c"
|
|
1952
|
+
])
|
|
1953
|
+
]), o = (n, r) => {
|
|
1954
|
+
let a = 0, c = 1 / 0;
|
|
1955
|
+
return t.forEach(([l, u], s) => {
|
|
1956
|
+
const i = Math.min(Math.abs(n - l), 16 - Math.abs(n - l)), d = Math.min(Math.abs(r - u), 16 - Math.abs(r - u));
|
|
1957
|
+
i * i + d * d < c && (c = i * i + d * d, a = s);
|
|
1958
|
+
}), a;
|
|
1959
|
+
};
|
|
1960
|
+
return (n, r) => {
|
|
1961
|
+
const a = o(n + 0.5, r + 0.5);
|
|
1962
|
+
return a !== o((n + 1) % 16 + 0.5, r + 0.5) || a !== o(n + 0.5, (r + 1) % 16 + 0.5) ? "m" : w(t[a])[2];
|
|
1963
|
+
};
|
|
1964
|
+
}, po = (e) => {
|
|
1965
|
+
const t = /* @__PURE__ */ new Map();
|
|
1966
|
+
for (let o = 0; o < 44; o++) t.set(`${x(e, 0, 15)},${x(e, 0, 15)}`, T(e, [
|
|
1967
|
+
"b",
|
|
1968
|
+
"c",
|
|
1969
|
+
"c"
|
|
1970
|
+
]));
|
|
1971
|
+
return (o, n) => t.get(`${o},${n}`) ?? "a";
|
|
1972
|
+
}, mo = {
|
|
1973
|
+
bricks: fo,
|
|
1974
|
+
planks: uo,
|
|
1975
|
+
checker: wo,
|
|
1976
|
+
cobbles: bo,
|
|
1977
|
+
speckle: po
|
|
1978
|
+
}, oe = [
|
|
1979
|
+
{
|
|
1980
|
+
id: "bricks",
|
|
1981
|
+
name: "Bricks"
|
|
1982
|
+
},
|
|
1983
|
+
{
|
|
1984
|
+
id: "planks",
|
|
1985
|
+
name: "Planks"
|
|
1986
|
+
},
|
|
1987
|
+
{
|
|
1988
|
+
id: "checker",
|
|
1989
|
+
name: "Checker"
|
|
1990
|
+
},
|
|
1991
|
+
{
|
|
1992
|
+
id: "cobbles",
|
|
1993
|
+
name: "Cobbles"
|
|
1994
|
+
},
|
|
1995
|
+
{
|
|
1996
|
+
id: "speckle",
|
|
1997
|
+
name: "Speckle"
|
|
1998
|
+
}
|
|
1999
|
+
];
|
|
2000
|
+
function $o(e, t) {
|
|
2001
|
+
const o = oe.findIndex((s) => s.id === t);
|
|
2002
|
+
if (o < 0) throw new Error(`Unknown tile style "${t}"`);
|
|
2003
|
+
const n = U(N(e, 300 + o)), r = mo[t](n), a = Array.from({ length: b }, (s, i) => Array.from({ length: b }, (d, m) => r(m, i)).join("")), c = n() * 360, l = J(n, 0.15, 0.5), u = J(n, 0.4, 0.62);
|
|
2004
|
+
return G(`${t}-tile`, `${w(oe[o]).name} tile`, ["tile"], a, {
|
|
2005
|
+
a: y(c, l, u),
|
|
2006
|
+
b: y(c, l, u + 0.07),
|
|
2007
|
+
c: y(c, l, u - 0.07),
|
|
2008
|
+
m: y(c, l * 0.8, u - 0.2)
|
|
2009
|
+
});
|
|
2010
|
+
}
|
|
2011
|
+
function Io(e, t, o) {
|
|
2012
|
+
const n = Array.from({ length: o }, () => e.rows.map((r) => r.repeat(t))).flat();
|
|
2013
|
+
return {
|
|
2014
|
+
...e,
|
|
2015
|
+
rows: n
|
|
2016
|
+
};
|
|
2017
|
+
}
|
|
2018
|
+
var re = {
|
|
2019
|
+
A: ".###. #...# #...# ##### #...# #...# #...#",
|
|
2020
|
+
B: "####. #...# #...# ####. #...# #...# ####.",
|
|
2021
|
+
C: ".#### #.... #.... #.... #.... #.... .####",
|
|
2022
|
+
D: "####. #...# #...# #...# #...# #...# ####.",
|
|
2023
|
+
E: "##### #.... #.... ####. #.... #.... #####",
|
|
2024
|
+
F: "##### #.... #.... ####. #.... #.... #....",
|
|
2025
|
+
G: ".#### #.... #.... #.### #...# #...# .####",
|
|
2026
|
+
H: "#...# #...# #...# ##### #...# #...# #...#",
|
|
2027
|
+
I: "##### ..#.. ..#.. ..#.. ..#.. ..#.. #####",
|
|
2028
|
+
J: "..### ...#. ...#. ...#. ...#. #..#. .##..",
|
|
2029
|
+
K: "#...# #..#. #.#.. ##... #.#.. #..#. #...#",
|
|
2030
|
+
L: "#.... #.... #.... #.... #.... #.... #####",
|
|
2031
|
+
M: "#...# ##.## #.#.# #.#.# #...# #...# #...#",
|
|
2032
|
+
N: "#...# ##..# #.#.# #..## #...# #...# #...#",
|
|
2033
|
+
O: ".###. #...# #...# #...# #...# #...# .###.",
|
|
2034
|
+
P: "####. #...# #...# ####. #.... #.... #....",
|
|
2035
|
+
Q: ".###. #...# #...# #...# #.#.# #..#. .##.#",
|
|
2036
|
+
R: "####. #...# #...# ####. #.#.. #..#. #...#",
|
|
2037
|
+
S: ".#### #.... #.... .###. ....# ....# ####.",
|
|
2038
|
+
T: "##### ..#.. ..#.. ..#.. ..#.. ..#.. ..#..",
|
|
2039
|
+
U: "#...# #...# #...# #...# #...# #...# .###.",
|
|
2040
|
+
V: "#...# #...# #...# #...# #...# .#.#. ..#..",
|
|
2041
|
+
W: "#...# #...# #...# #.#.# #.#.# ##.## #...#",
|
|
2042
|
+
X: "#...# #...# .#.#. ..#.. .#.#. #...# #...#",
|
|
2043
|
+
Y: "#...# #...# .#.#. ..#.. ..#.. ..#.. ..#..",
|
|
2044
|
+
Z: "##### ....# ...#. ..#.. .#... #.... #####",
|
|
2045
|
+
" ": "..... ..... ..... ..... ..... ..... ....."
|
|
2046
|
+
}, Go = 7;
|
|
2047
|
+
function Lo(e, t) {
|
|
2048
|
+
const o = [...e.toUpperCase()].map((r) => w(re[r] ?? re[" "]).split(" ")), n = Array.from({ length: 7 }, (r, a) => o.map((c) => w(c[a]).replaceAll("#", "x")).join("."));
|
|
2049
|
+
return {
|
|
2050
|
+
id: "text",
|
|
2051
|
+
name: e,
|
|
2052
|
+
tags: ["text"],
|
|
2053
|
+
palette: { x: t },
|
|
2054
|
+
rows: n
|
|
2055
|
+
};
|
|
2056
|
+
}
|
|
2057
|
+
export {
|
|
2058
|
+
pe as ACCENT_COLOURS,
|
|
2059
|
+
he as ACCESSORIES,
|
|
2060
|
+
le as BOTTOMS,
|
|
2061
|
+
we as BOTTOM_COLOURS,
|
|
2062
|
+
vo as DEFAULT_CHARACTER,
|
|
2063
|
+
h as Draw,
|
|
2064
|
+
Ko as FIXED_PALETTES,
|
|
2065
|
+
Go as FONT_HEIGHT,
|
|
2066
|
+
ue as HAIR_COLOURS,
|
|
2067
|
+
ie as HAIR_STYLES,
|
|
2068
|
+
ae as HOUSE_PALETTE,
|
|
2069
|
+
te as ITEM_KINDS,
|
|
2070
|
+
Eo as MAX_COLOURS,
|
|
2071
|
+
Po as RECOLOUR_PRESETS,
|
|
2072
|
+
be as SHOE_COLOURS,
|
|
2073
|
+
fe as SKIN_TONES,
|
|
2074
|
+
qt as SPRITES,
|
|
2075
|
+
zt as SPRITE_ANIMATIONS,
|
|
2076
|
+
oe as TILE_STYLES,
|
|
2077
|
+
se as TOPS,
|
|
2078
|
+
de as TOP_COLOURS,
|
|
2079
|
+
go as TRANSPARENT,
|
|
2080
|
+
Q as animateCharacter,
|
|
2081
|
+
ko as animationFrame,
|
|
2082
|
+
So as animationStrip,
|
|
2083
|
+
ne as brightness,
|
|
2084
|
+
me as buildCharacter,
|
|
2085
|
+
ve as createBitmap,
|
|
2086
|
+
U as createRandom,
|
|
2087
|
+
K as darken,
|
|
2088
|
+
Me as drawSprite,
|
|
2089
|
+
xo as findAnimation,
|
|
2090
|
+
to as findPalette,
|
|
2091
|
+
Wo as findSprite,
|
|
2092
|
+
Qt as fitSize,
|
|
2093
|
+
y as fromHsl,
|
|
2094
|
+
Oo as generateCreature,
|
|
2095
|
+
Ao as generateItem,
|
|
2096
|
+
$o as generateTile,
|
|
2097
|
+
Oe as idleFrames,
|
|
2098
|
+
Vt as mapPalette,
|
|
2099
|
+
He as mix,
|
|
2100
|
+
oo as nearest,
|
|
2101
|
+
Co as packSheet,
|
|
2102
|
+
$ as paletteFor,
|
|
2103
|
+
Ro as pixelate,
|
|
2104
|
+
Mo as randomCharacter,
|
|
2105
|
+
Ho as recolour,
|
|
2106
|
+
To as renderSprite,
|
|
2107
|
+
Io as repeatSprite,
|
|
2108
|
+
jo as shiftHue,
|
|
2109
|
+
eo as shrink,
|
|
2110
|
+
A as spriteHeight,
|
|
2111
|
+
P as spriteWidth,
|
|
2112
|
+
Ke as stack,
|
|
2113
|
+
Lo as textSprite,
|
|
2114
|
+
E as toHex,
|
|
2115
|
+
Ce as toHsl,
|
|
2116
|
+
j as toRgb,
|
|
2117
|
+
yo as validateSprite,
|
|
2118
|
+
Re as walkFrames
|
|
2119
|
+
};
|