Volume 0 - Mechanics
Part Doors
Door-directionality relates a door (called the door-in-question) to a direction (called the direction-in-question) when the room-or-door direction-in-question from the location is the door-in-question. The verb to lead toward means the door-directionality relation. The verb to lead through means the reversed door-directionality relation.
Understand "[something related by door-directionality]" as a door. [Understand "east door" for disambiguation purposes]
An internal-door is a kind of door. The matching key of an internal-door is usually no-key. The printed name of an internal-door is usually "door". Understand "door" or "door to" or "door to the" as an internal-door. An internal-door is usually closed, openable, unlocked, lockable, not scenery, and not proper-named.
After printing the name of an internal-door:
let the way be a random direction that leads through the item described;
say " to [the way]".
[A first-door is an internal-door. It is south of Alpha and north of Beta. A second-door is an internal-door. It is west of Alpha and east of Delta.
A ladder is an enterable portable supporter in Alpha. A box is an open container in Beta.]
Liminality relates a door (called X) to a room (called Y) when the front side of X is Y or the back side of X is Y. The verb to be a threshold of implies the liminality relation. The verb to be liminal to implies the liminality relation.
To decide whether a door connects (X - a room) and (Y - a room):
repeat with D running through doors liminal to X:
if the other side of D from X is Y, yes;
no.
Proximity relates a room (called X) to a room (called Y) when a door connects X and Y. The verb to be near implies the proximity relation. Definition: a room is nearby if it is near the location.
[After looking: say "Adjacent rooms are [the list of rooms near the location]."; continue the action.]
To describe (the portal - an internal-door) with (caps - a truth state) capitalization and (same - a truth state) similarity:
say "[if caps is true]A[else]a[end if]";
if the portal is jammed:
say "[if same is true]nother[end if]";
else if the portal is open:
say "n[if same is true]other[end if] open";
otherwise:
say "[if same is true]nother[end if] closed";
say " door leads ";
let the way be a random direction that leads through the portal;
say "[way]";
let the destination be the room way from the location;
if the destination is visited, say " to [the destination]";
if the portal is jammed, say " (though it looks like something is blocking it)".
Rule for writing a paragraph about an internal-door:
if there should be darkness:
say "Faint, grayish rectangles of light stand out in the dark. ";
let L be the list of internal-doors liminal to the location;
let P1 be entry 1 in L;
let P2 be entry 2 in L;
let same be whether or not (P1 is open and P2 is open) or (P1 is closed and P2 is closed) or P2 is jammed;
describe P1 with true capitalization and false similarity;
now P1 is mentioned;
say ", and ";
describe P2 with false capitalization and same similarity;
now P2 is mentioned;
if the location is the Entrance, say ". The main door of the mansion looms to the south";
say ".".