T3:DarkRoom

From IFWiki

A DarkRoom is a room without any light of its own.

This class exists as a convienence for authors. If an author doesn't want to use or can't use DarkRoom for some reason, he or she could instead add the line

brightness = 0

to any room object that ought to be dark.

Summary

Definition (travel.t)

  • class DarkRoom: Room

Template: use the Room template (en_us.h):

  • 'name' 'destName'? "desc"?;

Subclasses: none.

Related classes:

  • LightSource (objects.t) — something that provides light.

Modified properties:

  • brightness — Set to 0, meaning the room has no ambient light whatsoever.

Example

This example is adapted from Dungeon a.k.a. Zork.

cellar : DarkRoom 'Cellar'
   "You are in a dark and damp cellar with a narrow passageway leading east, and a crawlway
    to the south. To the west is the bottom of a steep metal ramp which is unclimbable. "
   up = trapdoor
   west = cellarRamp
   east = narrowPassageway
   south = crawlway
;

Links