This commit is contained in:
2026-07-11 14:47:08 -05:00
parent 6dccf5fc23
commit 03185c9c68
17 changed files with 408 additions and 105 deletions
+6
View File
@@ -51,6 +51,11 @@ pub struct ObjectDef {
/// remove itself via `die()`). Set when a grab archetype (e.g. a gem) is
/// expanded into an object. Defaults to `false`.
pub grab: bool,
/// Light radius in cells that this object emits on a `dark` board (0 = no
/// light). The emitted *color* is this object's own glyph foreground color,
/// so a red glyph casts red light. See [`crate::fov`] for the lighting model.
/// Scripts can change it at runtime via `set_light(n)`. Defaults to `0`.
pub light: u32,
/// Compile-key of the Rhai script that drives this object: a name in
/// [`World::scripts`](crate::world::World::scripts) for a hand-authored object,
/// or a synthetic `BUILTIN_*` name set when a script-backed archetype is
@@ -102,6 +107,7 @@ impl ObjectDef {
opaque: true,
pushable: false,
grab: false,
light: 0,
script_name: None,
builtin_script: None,
tags: HashSet::new(),