Blue Lacuna — 48 of 467

Aaron A. Reed

Release 4

Section - Going by Landmark

A room can be landmarked or unlandmarked. A room is usually unlandmarked.

A room has some text called the landmark name. The landmark name of a room is usually "null".

The last landmark turn is a number that varies. The last landmark turn is 0. [ This number stores the turn count on which we last discovered a new landmark, useful for the drama manager.]

Understand "landmark" or "landmarks" as landmark-listing. Landmark-listing is an action applying to nothing.

we-are-landmark-going is a truth state that varies.

First report going to an unvisited landmarked room: say "(new [d]landmark[x] discovered)[command clarification break]"; now last landmark turn is turn count; continue the action.

After reading a command:

if the player's command matches "go" or the player's command matches "walk", replace the player's command with "landmark";

if the player's command matches "lie down" or the player's command matches "lay down" or the player's command matches "go to sleep", replace the player's command with "sleep".

Definition: a room is unadjacent if it is not the location and it is not adjacent to the location.

Landmark-going is an action applying to one thing.

Check landmark-going:

if noun is location, say "You're already here." instead;

if noun is adjacent to location, head to noun instead.

To decide whether ready to landmark-go:

if ( noun is regionally in Homeworld and player is not regionally in Homeworld ) or ( noun is regionally in Lacuna and player is not regionally in Lacuna ) or ( noun is regionally in Rebelworld and player is not regionally in Rebelworld ) or ( noun is regionally in Treeworld and player is not regionally in Treeworld ) begin;

say "That's in a whole other world[if noun is regionally in Homeworld]... one you can never return to[end if].";

decide no;

end if;

if the holder of the player is not a room, try exiting;

if location is not noun begin;

say "You head towards ";

if the prose name of noun is "NULL", say "[the noun].";

otherwise say "[the prose name of noun].";

end if;

truncate travelogue to 0 entries;

decide yes.

Travelogue is a list of objects that varies.

To clean up landmark-go, silently:

if we-are-landmark-going is false, stop; [ If this has been set by hand, it's assumed we've done all this already.]

now we-are-landmark-going is false;

remove location from travelogue, if present;

if not silently:

if location is not noun, say "(Before you arrive, you were distracted";

if the number of entries in travelogue is at least 1:

if location is noun, say "On your way, you pass through ";

otherwise say ", after passing through ";

let ctr be 1;

repeat with loc running through travelogue:

say prose name of loc;

if ctr is ( number of entries in travelogue - 1 ) :

say " and ";

otherwise if ctr < number of entries in travelogue:

say ", ";

increase ctr by 1;

say "[if location is not noun].)[otherwise if the number of entries in travelogue is at least 1].[end if]";

say "[line break][bold type][location][roman type][line break][description of location][line break]". [ We do it this way so we don't spend a turn looking, which would prevent us from immediately reacting to something that stopped us.]

Carry out landmark-going:

if ready to landmark-go begin;

now we-are-landmark-going is true;

while location is not noun and we-are-landmark-going is true begin;

let aim be the best route from the location to noun, using doors;

let target be the room aim from location;

if aim is not a direction or target is not a room begin;

say "You can't seem to progress any farther ([aim]).";

stop;

end if;

try silently going aim;

if location is not target begin;

clean up landmark-go;

stop;

otherwise;

add location to travelogue;

end if;

follow the turn sequence rules; [ Why? well, for Progue to move. ]

end while;

clean up landmark-go;

end if.