[code]Chapter - Exiting and Entering
Section - Transitive Exiting
Getting out of is an action applying to one thing. Understand “exit [something]” as getting out of.
Understand “out/off/down/up” as “[out]”. Understand “of/from” as “[from]”. Understand “[out]” and “[out] [from]” and “[from]” as “[out of]”.
Understand “exit [out of] [something]” as getting out of. Understand “get [out of] [something]” as getting out of. Understand “go [out of] [something]” as getting out of.
Check getting out of when the noun does not enclose the player:
say “You’re not [if the noun is a supporter]on[otherwise]in[end if] [the noun] right now.”
Check getting out of:
Let the outer enclosure be the noun;
while the outer enclosure encloses the player:
let the inner enclosure be the holder of the player;
If the inner enclosure is not the outer enclosure:
say “(First exiting [the inner enclosure])[command clarification break]”;
silently try exiting;
otherwise:
try exiting;
if the inner enclosure is the holder of the player:
stop the action;
Section - Going Outside
Check going nowhere when the noun is outside:
Try exiting instead.
Section - The Way Out
A room has an object called the way out.
Definition: A room is exitable if the way out of it is a direction.
Definition: A direction (called way) is viable:
Decide on whether or not the room to the way is a room.
Definition: A direction (called way) is outward:
If way is the way out of the location, yes;
If way is inward, no;
decide on whether or not way is viable.
Check exiting when the holder of the player is an exitable room:
Try going the way out of the location instead.
Check exiting when the holder of the player is a not exitable room:
If the number of outward directions is 1:
let the way be a random outward direction;
say “(leaving to [the way])[command clarification break]”;
try going the way instead.
Section - The Way In
Definition: A direction (called way) is inward:
Let destination be the room to the way;
if destination is not a room, no;
decide on whether or not the way out of destination is the way from destination.
To decide what object is the way in:
If the number of inward directions is 1, decide on a random inward direction;
decide on nothing.
Check going nowhere when the noun is inside and the way in is a direction:
Try going the way in instead.
Section - Intransitive Entering
for supplying a missing noun when entering (this is the enter the location rule):
Now the noun is the location.
The enter the location rule is listed after the find what to enter rule in the for supplying a missing noun rulebook.
Check entering the location:
Try going inside instead.
Check going nowhere when the noun is inside:
say “There’s no obvious way to go inside from here.” instead.
[/code]
You could probably simplify that by removing the “way out/way in” stuff. As it stands, it requires you to state explicitly what the way out of every room is.