//! 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 serde::{Deserialize, Serialize}; use super::{Culture, pick}; use crate::seed::Rng; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] 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, /// Whether a scholar has told you its true name. pub identified: bool, } impl Artifact { /// What you call it: its true name once you know it. pub fn name(&self) -> &str { if self.identified { &self.true_name } else { &self.unidentified } } } pub fn artifact(rng: &mut Rng) -> Artifact { let look = format!("{} {} {}", pick(QUALITIES, rng), pick(COLOURS, rng), pick(SHAPES, rng)); let unidentified = super::a(&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, identified: false } } 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", ];