clairlune-scene 0.28.0

Deterministic, seeded scene generation for the Clairlune ASCII-art wallpaper app
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
//! Archetypes declare the capabilities they offer. Activities declare the
//! capabilities they need. Neither names the other, so a new archetype works with
//! existing activities and vice versa (PLAN.md section 4.7).

/// Terrain capabilities an archetype can offer.
pub const TERRAINS: [&str; 14] = [
    "flat",
    "ledge",
    "cliff",
    "slope",
    "dune",
    "shore",
    "rooftop",
    "cave_floor",
    "water",
    "indoor",
    "ridge",
    "trail",
    "path",
    "dune_trail",
];
/// Surface materials.
pub const SURFACES: [&str; 8] = [
    "rock", "snow", "sand", "grass", "wood", "roof", "water", "ice",
];
/// Ambient weather. Light-source effects such as embers belong to props, not weather.
pub const WEATHERS: [&str; 17] = [
    "none",
    "dust",
    "snow",
    "rain",
    "fireflies",
    "leaves",
    "stars",
    "confetti",
    "petals",
    "fog",
    "blizzard",
    "ash",
    "sparkle",
    "birds",
    "butterflies",
    "seeds",
    "shooting_stars",
];

/// What one archetype offers.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct ArchetypeInfo {
    pub id: &'static str,
    /// Whether this generator version can build it.
    pub implemented: bool,
    pub terrain: &'static [&'static str],
    pub surface: &'static [&'static str],
    pub weather: &'static [&'static str],
    pub platforms: &'static [&'static str],
    /// Open sky overhead (stars, moon). False for enclosed places such as caves.
    pub sky: bool,
}

/// The archetypes (PLAN.md section 4.2, and the interior from
/// docs/activity-system.md). Unimplemented ones carry their
/// intended capabilities so activity files can be written against them now.
pub const ARCHETYPE_INFO: [ArchetypeInfo; 27] = [
    ArchetypeInfo {
        id: "canyon",
        implemented: true,
        terrain: &["ledge", "cliff"],
        surface: &["rock"],
        weather: &["none", "dust", "birds"],
        platforms: &["rock_ledge"],
        sky: true,
    },
    ArchetypeInfo {
        id: "forest",
        implemented: true,
        // `path`: a periodic variant for walks through the wood.
        terrain: &["flat", "ledge", "path"],
        surface: &["grass", "wood"],
        weather: &[
            "none",
            "fireflies",
            "leaves",
            "rain",
            "fog",
            "petals",
            "birds",
            "butterflies",
        ],
        platforms: &["log", "tree_branch"],
        sky: true,
    },
    ArchetypeInfo {
        id: "mountains",
        implemented: true,
        // `ridge`: a periodic variant for journeys along the range.
        terrain: &["ledge", "cliff", "slope", "ridge"],
        surface: &["rock", "snow"],
        weather: &[
            "none",
            "snow",
            "stars",
            "fog",
            "blizzard",
            "birds",
            "shooting_stars",
        ],
        platforms: &["rock_ledge"],
        sky: true,
    },
    ArchetypeInfo {
        id: "shore",
        implemented: true,
        terrain: &["shore", "water", "flat"],
        surface: &["sand", "wood", "water"],
        weather: &["none", "rain", "stars", "fog", "birds", "shooting_stars"],
        platforms: &["pier"],
        sky: true,
    },
    ArchetypeInfo {
        id: "city_rooftops",
        implemented: true,
        terrain: &["rooftop", "flat"],
        surface: &["roof"],
        weather: &[
            "none",
            "rain",
            "stars",
            "confetti",
            "birds",
            "shooting_stars",
        ],
        platforms: &["rooftop_edge"],
        sky: true,
    },
    ArchetypeInfo {
        id: "desert",
        implemented: true,
        // `dune_trail`: a periodic variant for journeys over the dunes.
        terrain: &["dune", "slope", "flat", "dune_trail"],
        surface: &["sand"],
        weather: &["none", "dust", "stars", "birds", "shooting_stars"],
        platforms: &["dune_crest"],
        sky: true,
    },
    ArchetypeInfo {
        id: "snowfield",
        implemented: true,
        // `trail`: a periodic variant for journeys across the snow.
        terrain: &["slope", "flat", "ledge", "trail"],
        surface: &["snow", "ice"],
        weather: &[
            "none",
            "snow",
            "stars",
            "blizzard",
            "sparkle",
            "shooting_stars",
        ],
        platforms: &["ice_shelf"],
        sky: true,
    },
    ArchetypeInfo {
        id: "night_sky",
        implemented: true,
        terrain: &["ledge", "flat"],
        surface: &["rock", "grass"],
        weather: &["none", "stars", "shooting_stars"],
        platforms: &["floating_island", "rock_ledge"],
        sky: true,
    },
    ArchetypeInfo {
        id: "cave",
        implemented: true,
        terrain: &["cave_floor", "ledge"],
        surface: &["rock"],
        weather: &["none", "dust"],
        platforms: &["rock_ledge"],
        sky: false,
    },
    ArchetypeInfo {
        id: "meadow",
        implemented: true,
        terrain: &["flat", "ledge"],
        surface: &["grass"],
        weather: &[
            "none",
            "petals",
            "leaves",
            "fireflies",
            "rain",
            "fog",
            "stars",
            "birds",
            "butterflies",
            "seeds",
            "shooting_stars",
        ],
        platforms: &["grassy_knoll"],
        sky: true,
    },
    ArchetypeInfo {
        id: "lake",
        implemented: true,
        terrain: &["flat", "ledge"],
        surface: &["grass", "rock"],
        weather: &[
            "none",
            "fog",
            "rain",
            "fireflies",
            "snow",
            "stars",
            "birds",
            "butterflies",
            "seeds",
            "shooting_stars",
        ],
        platforms: &["grassy_bank"],
        sky: true,
    },
    ArchetypeInfo {
        id: "volcano",
        implemented: true,
        terrain: &["ledge", "flat"],
        surface: &["rock"],
        weather: &["none", "ash", "stars", "shooting_stars"],
        platforms: &["rock_ledge"],
        sky: true,
    },
    ArchetypeInfo {
        id: "islands",
        implemented: true,
        terrain: &["flat"],
        surface: &["sand"],
        weather: &["none", "rain", "stars", "birds", "shooting_stars"],
        platforms: &["sand_spit"],
        sky: true,
    },
    ArchetypeInfo {
        id: "lunar",
        implemented: true,
        terrain: &["flat", "ledge"],
        surface: &["rock"],
        weather: &["none", "stars", "shooting_stars"],
        platforms: &["crater_rim"],
        sky: true,
    },
    ArchetypeInfo {
        id: "bamboo",
        implemented: true,
        terrain: &["flat"],
        surface: &["grass"],
        weather: &["none", "rain", "fog", "fireflies", "leaves", "butterflies"],
        platforms: &["mossy_bank"],
        sky: false,
    },
    ArchetypeInfo {
        id: "waterfall",
        implemented: true,
        terrain: &["ledge", "flat"],
        surface: &["rock", "grass"],
        weather: &[
            "none",
            "fog",
            "rain",
            "petals",
            "fireflies",
            "stars",
            "birds",
            "butterflies",
            "shooting_stars",
        ],
        platforms: &["rock_ledge"],
        sky: true,
    },
    ArchetypeInfo {
        id: "countryside",
        implemented: true,
        terrain: &["flat", "ledge"],
        surface: &["grass"],
        weather: &[
            "none",
            "rain",
            "fog",
            "leaves",
            "petals",
            "fireflies",
            "snow",
            "stars",
            "birds",
            "butterflies",
            "seeds",
            "shooting_stars",
        ],
        platforms: &["grassy_bank"],
        sky: true,
    },
    ArchetypeInfo {
        id: "ruins",
        implemented: true,
        terrain: &["ledge", "flat"],
        surface: &["rock", "grass"],
        weather: &[
            "none",
            "fog",
            "leaves",
            "dust",
            "fireflies",
            "stars",
            "birds",
            "butterflies",
            "seeds",
            "shooting_stars",
        ],
        platforms: &["rock_ledge"],
        sky: true,
    },
    ArchetypeInfo {
        id: "savanna",
        implemented: true,
        terrain: &["flat", "dune", "ledge"],
        surface: &["sand", "grass"],
        weather: &[
            "none",
            "dust",
            "rain",
            "stars",
            "birds",
            "seeds",
            "shooting_stars",
        ],
        platforms: &["earth_bank"],
        sky: true,
    },
    ArchetypeInfo {
        id: "swamp",
        implemented: true,
        terrain: &["flat", "ledge"],
        surface: &["grass", "wood"],
        weather: &[
            "none",
            "fog",
            "rain",
            "fireflies",
            "stars",
            "birds",
            "butterflies",
            "shooting_stars",
        ],
        platforms: &["mossy_bank"],
        sky: true,
    },
    ArchetypeInfo {
        id: "mushrooms",
        implemented: true,
        terrain: &["flat", "ledge"],
        surface: &["grass"],
        weather: &[
            "none",
            "fireflies",
            "sparkle",
            "fog",
            "stars",
            "shooting_stars",
            "butterflies",
            "seeds",
        ],
        platforms: &["mossy_bank"],
        sky: true,
    },
    ArchetypeInfo {
        id: "crystals",
        implemented: true,
        terrain: &["cave_floor", "ledge"],
        surface: &["rock"],
        weather: &["none", "sparkle", "dust"],
        platforms: &["rock_ledge"],
        sky: false,
    },
    ArchetypeInfo {
        id: "great_tree",
        implemented: true,
        terrain: &["flat", "ledge"],
        surface: &["grass", "wood"],
        weather: &[
            "none",
            "fireflies",
            "leaves",
            "petals",
            "rain",
            "fog",
            "stars",
            "butterflies",
            "birds",
            "seeds",
            "shooting_stars",
        ],
        platforms: &["grassy_bank"],
        sky: true,
    },
    ArchetypeInfo {
        id: "wizard_tower",
        implemented: true,
        terrain: &["ledge", "cliff", "flat"],
        surface: &["rock", "grass"],
        weather: &[
            "none",
            "stars",
            "fog",
            "sparkle",
            "shooting_stars",
            "snow",
            "rain",
            "birds",
        ],
        platforms: &["rock_ledge"],
        sky: true,
    },
    ArchetypeInfo {
        id: "standing_stones",
        implemented: true,
        terrain: &["flat", "ledge"],
        surface: &["grass", "rock"],
        weather: &[
            "none",
            "fog",
            "stars",
            "rain",
            "snow",
            "fireflies",
            "shooting_stars",
            "leaves",
            "birds",
        ],
        platforms: &["grassy_bank"],
        sky: true,
    },
    ArchetypeInfo {
        id: "lantern_lake",
        implemented: true,
        terrain: &["flat", "ledge"],
        surface: &["grass", "wood"],
        weather: &[
            "none",
            "fireflies",
            "stars",
            "fog",
            "petals",
            "shooting_stars",
            "seeds",
        ],
        platforms: &["grassy_bank"],
        sky: true,
    },
    ArchetypeInfo {
        id: "interior",
        implemented: true,
        terrain: &["indoor"],
        surface: &["wood"],
        weather: &["none"],
        platforms: &["floor"],
        sky: false,
    },
];

/// Looks up an archetype by id.
pub fn archetype(id: &str) -> Option<&'static ArchetypeInfo> {
    ARCHETYPE_INFO.iter().find(|a| a.id == id)
}