Manual:DIL Manual/illum

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:11, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

illum

Field (integer, read-only; units: all).

u.illum : integer

The part of a unit's bright that comes from what is inside it: the light that shines out of an open transparent container (a glass lantern with a candle in it). It is 0 for units that aren't transparent (UNIT_FL_TRANS in flags) or are closed.

u.bright - u.illum is the unit's own brightness.

Notes

  • It can't be assigned (vmc: "Illegal lvalue").
  • Setting or clearing UNIT_FL_TRANS through .flags in DIL doesn't recount the light; the wizard set command does.
  • On null it fails.

Example

dilbegin shine_report(item : unitptr);
code
{
   if (item.illum > 0)
      act("Light shines out of $2n.", A_ALWAYS, self, item, null, TO_CHAR);
   if (item.bright - item.illum > 0)
      act("$2n itself is shining.", A_ALWAYS, self, item, null, TO_CHAR);
   return;
}
dilend

Tells whether a container shines because of what is in it, or by itself.

See also