I am trying to write a routine that makes objects “glow” a little bit in darkness. Here’s what I have so far. It will allow the player to examine “glowing” objects which give off enough light to be visible, but not enough to illuminate the whole location. Containers aren’t implemented yet. If the orb is put in an open box, for example, it will not show up in the dark.
"What Gloweth Must Be Seen" by Steve Westwood Part 1 - Set-Up Rule for printing the description of a dark room: say "Your eyes can barely make anything out." instead. After printing the description of a dark room: repeat with glorb running through things in location: if glorb is a glowing thing: place glorb in scope; if the initial appearance of glorb is not "": say "[line break][initial appearance of glorb][paragraph break]" After deciding the scope of the player while in darkness: repeat with glorb running through things in location: if glorb is a glowing thing, place glorb in scope; Visibility rule when examining something: if the location is a dark room: if the thing is a glowing thing, there is sufficient light; Part 2 - Rooms and Objects The Lit Place is a room with printed name "The Lit Room". The description of the Lit Place is "Sunlight filters through the windows that make up the walls and reflects off the white panelling of the frames." The player is in the Lit Place. Before going to the Lit Place when the location of the orb is the Lit Place: say "You think about being blinded again, and decide not to go into the Lit Room after all."; After going to the Lit Place when the location of the orb is the Lit Place: if the orb is carried by the player: now the dark place is lit; move the orb to the Lit Place; say "As you enter the room while carrying the orb, a blinding flash sears your retina. Instinctively, you close your eyes and cover them with your hands, dropping the orb. You stumble back through the door to the east."; try the player going east; The Dark Place is a dark room with printed name "The Dark Room". The description of the Dark Place is "There are no windows in this room. The walls are cedar, giving the room a very rustic atmosphere. Low benches line the walls.[if the location of the orb is the Lit Room][paragraph break]Light filters in from the Lit Room, illuminating this room very well.[end if]". The Dark Place is east of the Lit Place. The benches are a supporter in the Dark Place. The benches are enterable. The benches are plural-named. Understand "bench" as the benches. A thing can be glowing or plain. A thing is usually plain. The orb is a glowing thing in the Dark Place. "There is an orb here, glowing gently." The description of the orb is "This orb is made out of crystal and glows in the dim light.". Understand "glowing" and "crystal" as the orb.
Any suggestions on how to accomodate containers? So that if a glowing orb is in a small glass case which is itself in an open cardboard box, that the case and the box can be seen as well as the orb? But that if the case with the orb is removed from the box, the box is no longer put into scope?