summaryrefslogtreecommitdiff
path: root/src/names/artifact.rs
blob: af24b3dc46e8702a3c774c6f88a18f31cf28ff45 (plain)
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
//! Artifact names: what a thing looks like when you find it, and what it's
//! called once a scholar has told you what it is.

use rand::RngExt;

use super::{Culture, pick};
use crate::seed::Rng;

#[derive(Clone, Debug)]
pub struct Artifact {
    /// What you see when you find it: "a humming ochre lattice".
    pub unidentified: String,
    /// Its true name: "the Lacquered Orrery of Teshemond".
    pub true_name: String,
}

pub fn artifact(rng: &mut Rng) -> Artifact {
    let look = format!("{} {} {}", pick(QUALITIES, rng), pick(COLOURS, rng), pick(SHAPES, rng));
    let article = if look.starts_with(['a', 'e', 'i', 'o', 'u']) { "an" } else { "a" };
    let unidentified = format!("{article} {look}");

    let object = pick(OBJECTS, rng);
    let culture = Culture::ALL[rng.random_range(..Culture::ALL.len())];
    let true_name = match rng.random_range(0..5) {
        0 => format!("the {} {object} of {}", pick(MATERIALS, rng), culture.word(rng)),
        1 => format!("the {object} of {}", culture.place(rng)),
        2 => format!("{}'s {object}", culture.word(rng)),
        3 => format!("the {} {object}", pick(EPITHETS, rng)),
        _ => format!("the {object} {}", pick(CLAUSES, rng)),
    };
    Artifact { unidentified, true_name }
}

const QUALITIES: &[&str] = &[
    "humming", "warm", "weightless", "faintly singing", "ice-cold", "flickering", "whispering",
    "slowly turning", "perfectly still", "pulsing", "dust-caked", "oddly heavy", "tarnished",
    "ticking", "breathing",
];

const COLOURS: &[&str] = &[
    "ochre", "verdigris", "bone-white", "umber", "cerulean", "oxblood", "iridescent", "smoke-grey",
    "jet-black", "saffron", "rust-red", "pearlescent", "cobalt",
];

const SHAPES: &[&str] = &[
    "lattice", "spindle", "disc", "knot", "sphere", "prism", "coil", "shard", "ring", "cube",
    "cylinder", "helix", "lens", "rod", "tessera",
];

const MATERIALS: &[&str] = &[
    "Saltglass", "Black-Iron", "Lacquered", "Bone", "Star-Ivory", "Verdigris", "Voidsteel",
    "Smoked-Glass", "Amber", "Obsidian", "Gilt", "Quicksilver",
];

const OBJECTS: &[&str] = &[
    "Orrery", "Reliquary", "Astrolabe", "Censer", "Lattice", "Mask", "Crown", "Key", "Sigil",
    "Codex", "Lens", "Spindle", "Compass", "Chalice", "Engine", "Bell", "Heart", "Mirror", "Loom",
];

const EPITHETS: &[&str] = &[
    "Weeping", "Ninth", "Hollow", "Unspoken", "Last", "Sleeping", "Burning", "Patient", "Seventh",
    "Silent", "Drowned", "Unfinished", "Forgotten", "Inverted",
];

const CLAUSES: &[&str] = &[
    "That Remembers", "That Was Promised", "Which Does Not Turn", "That Sings at Dusk",
    "That Counts the Dead", "That Opens Inward", "That Waits", "of Unmaking", "of Seven Silences",
    "Beneath the Sun",
];