lighting
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user