"Advent Window" by Andrew Plotkin.
[IFID:69D1773A-C1AD-413C-B5AF-6F9931BFF171]
 
The story headline is "An interactive Advent calendar entry".
The release number is 2.
 
[
Copyright 2024 Andrew Plotkin <erkyrath@eblong.com>
<http://eblong.com/zarf/if.html>
 
This source code is provided for personal, educational use only. The story and text of _ Advent Window_ belong to me; you may not use them or create derivative works which contain them. However, you have permission to use the programming techniques of this game in your own works, and you may use the source code excluding game text.
 
If you want to *play* this game, you're in the wrong place. Go to my web site: <http://eblong.com/zarf/zweb/doorsday3/>
 
Obvious warning:  This code contains spoilers! If you haven't played _ Advent Window_, and you read this code, you'll certainly ruin the game for yourself. Play it first. I am releasing this code for the benefit of Inform programmers who are familiar with the game and want to know how I did it.
 
I implemented this game using Inform 7 version 10.1.2. It probably won't compile with earlier releases, and I can't make guarantees about future ones.
]
 
 
Chapter - General Stuff
 
Use American dialect.
Use the serial comma.
 
Release along with an interpreter.
Release along with cover art ("An illustration of an ornate arched window.").
 
To say em -- running on: (- style underline; -).
To say /em -- running on: (- style roman; -).
To say period -- running on: (- print "."; -).
To say para -- running on: (- DivideParagraphPoint(); new_line; -).
 
An object can be ever-seen.
 
To say open-closed (T - thing):
    if T is open:
        say "open";
    else:
        say "closed";
 
When play begins:
    say "The wildest journey begins with a single step. Sometimes that step is straight down into an open trap-door. Commit or stay home![para]Not that 'home' is closer than a distant memory.[para]Astral haze streams up past your face, until your feet crash into...";
 
When play begins:
    now the right hand status line is "[if the location is the Secret Room](way in)[else if the location is indoors](indoors)[else if the location is outdoors](outdoors)[end if]";
 
 
Section - Grammar
 
Rule for printing a parser error when the latest parser error is the can't see any such thing error:
    say "You can't see any such thing";
    if a window is in the location:
        if the location is indoors:
            say " (in here)";
        else if the location is outdoors:
            say " (out here)";
    say ".";
 
Understand "spin [something]" as turning.
 
Check exiting in an indoors room when a portal (called D) is in the location:
    instead try entering D;
Check going outside in an indoors room when a portal (called D) is in the location:
    instead try entering D;
 
Check going inside in an outdoors room when a portal (called D) is in the location:
    instead try entering D;
 
Understand "look out/outside [something]" as searching.
 
Check examining inside:
    if the location is indoors:
        instead say "You [em]are[/em] inside.";
    if the player carries a window (called W):
        instead try searching W;
    let C be the number of windows in the location;
    if C is zero:
        if a portal is in the location:
            instead say "You could just walk through the door.";
        instead say "There is no window here.";
    if C is greater than 1:
        instead say "You have a multiplicity of windows to choose from.";
    instead try searching (a random window in the location);
 
Check examining outside:
    if the location is outdoors:
        instead say "You [em]are[/em] outside.";
    if the player carries a window (called W):
        instead try searching W;
    let C be the number of windows in the location;
    if C is zero:
        if a portal is in the location:
            instead say "You could just walk through the door.";
        instead say "There is no window here.";
    if C is greater than 1:
        instead say "You have a multiplicity of windows to choose from.";
    instead try searching (a random window in the location);
 
 
Section - Directionality
 
Alignment is a kind of value. The alignments are orig, cw, verso, and ccw.
 
To decide what alignment is (L1 - alignment) + (L2 - alignment):
    (- (({L1} + {L2} + 2) % 4 + 1) -).
 
To decide what alignment is (L1 - alignment) - (L2 - alignment):
    (- (({L1} + (-{L2}) + 4) % 4 + 1) -).
 
To decide what alignment is counter (L - alignment):
    if L is:
        -- orig: decide on orig;
        -- verso: decide on verso;
        -- cw: decide on ccw;
        -- ccw: decide on cw;
 
To decide what direction is (D - direction) aligned (L - alignment):
    if L is:
        -- orig:
            decide on D;
        -- ccw:
            if D is:
                -- north: decide on west;
                -- northeast: decide on northwest;
                -- east: decide on north;
                -- southeast: decide on northeast;
                -- south: decide on east;
                -- southwest: decide on southeast;
                -- west: decide on south;
                -- northwest: decide on southwest;
        -- verso:
            if D is:
                -- north: decide on south;
                -- northeast: decide on southwest;
                -- east: decide on west;
                -- southeast: decide on northwest;
                -- south: decide on north;
                -- southwest: decide on northeast;
                -- west: decide on east;
                -- northwest: decide on southeast;
        -- cw:
            if D is:
                -- north: decide on east;
                -- northeast: decide on southeast;
                -- east: decide on south;
                -- southeast: decide on southwest;
                -- south: decide on west;
                -- southwest: decide on northwest;
                -- west: decide on north;
                -- northwest: decide on northeast;
    decide on D.
 
To decide what alignment is align (D1 - direction) to (D2 - direction):
    if D2 is D1 aligned orig:
        decide on orig;
    if D2 is D1 aligned verso:
        decide on verso;
    if D2 is D1 aligned cw:
        decide on cw;
    if D2 is D1 aligned ccw:
        decide on ccw;
    say "(BUG) Cannot align [D1] to [D2].";
    decide on orig.
 
To decide what direction is align-here (D - direction):
    if the location is in1doors:
        decide on D aligned in1doors-alignment;
    if the location is in2doors:
        decide on D aligned in2doors-alignment;
    if the location is outdoors:
        decide on D aligned outdoors-alignment;
    decide on D.
 
To decide what direction is align-in1 (D - direction):
    decide on D aligned in1doors-alignment;
 
To decide what direction is align-in2 (D - direction):
    decide on D aligned in2doors-alignment;
 
To decide what direction is align-out (D - direction):
    decide on D aligned outdoors-alignment;
 
 
Section - Regionality
 
[The game takes place in three coordinate systems: outdoors, inside the start room, and inside the hallway. We will track the rotation of each one. The *offset* is not explicitly tracked; it's computed based on the location of the inner and outer door that connects to the room.
 
We distinguish between "outdoors 1" (the shack area) and "outdoors 2) (the ravine area), but that's only to decide whether you're close enough to hear a door slam. The two outdoors regions have the same coordinate system.]
 
Regionality is a kind of value. The regionalities are nodoors, out1doors, out2doors, in1doors, in2doors.
 
A room has a regionality. A room is usually nodoors.
 
Definition: a room is indoors if the regionality of it is in1doors or the regionality of it is in2doors.
Definition: a room is outdoors if the regionality of it is out1doors or the regionality of it is out2doors.
Definition: a room is 1doors if the regionality of it is in1doors or the regionality of it is out1doors.
Definition: a room is 2doors if the regionality of it is in2doors or the regionality of it is out2doors.
 
To decide whether (R1 - room) region-matches (R2 - room):
    if R1 is 1doors and R2 is 1doors:
        decide yes;
    if R1 is 2doors and R2 is 2doors:
        decide yes;
    decide no.
 
Outdoors-alignment is an alignment that varies.
In1doors-offset is an alignment that varies.
In2doors-offset is an alignment that varies.
 
To decide what alignment is in1doors-alignment:
    decide on outdoors-alignment + in1doors-offset.
To decide what alignment is in2doors-alignment:
    decide on outdoors-alignment + in2doors-offset.
 
[The color shifts in the game text are cued by this I6 variable. Note that the color shifts are *not* handled by Inform code; all we do here is set the current_directionality variable. A JS interpreter modification watches for this variable and adjusts the game display. See: <https://eblong.com/zarf/zweb/doorsday3/doorhook.js>]
 
The current-loc-regionality is a regionality that varies.
The current-loc-regionality variable translates into I6 as "i6_cur_region";
 
Include (-
Global i6_cur_region = 0;
-).
 
When play begins:
    now current-loc-regionality is the regionality of the location.
Every turn:
    now current-loc-regionality is the regionality of the location.
 
 
Section - The Grid
 
[We have to keep track of rooms by their grid location. This requires a bit of vector math.
 
We're going to stuff an (X, Y) location into a simple integer by multiplying the X value by 100. Thus 201 is location (2, 1) and so on. This would of course blow up if the game spanned more than 100 units, but it doesn't.
 
On the other hand, we *do* have to deal with negative coordinates, because we're also going to represent vectors. (-1, 1) means "northwest", for example.]
 
A room has a number called the gridref. The gridref of a room is usually -1.
The verb to grids-at means the gridref property.
 
To decide which arithmetic value is (X - arithmetic value) mod (Y - arithmetic value) (arithmetic operation 4):
    (- ({-arithmetic-operation:X:Y}) -).
 
[Rotate a vector in 90-degree increments.]
To decide what number is align vector (N - number) by (L - alignment):
    let Nx be ( N + 5050 ) / 100 - 50;
    let Ny be ( N + 5050 ) mod 100 - 50;
    if L is:
        -- orig:
            decide on N;
        -- verso:
            decide on 0 - N;
        -- cw:
            decide on ( 100 * Ny ) - Nx;
        -- ccw:
            decide on ( -100 * Ny ) + Nx;
 
[Unit vectors.]
To decide what number is vector dir (D - direction):
    if D is:
        -- north: decide on 1;
        -- south: decide on -1;
        -- east: decide on 100;
        -- west: decide on -100;
    say "(BUG) No vector for [D].";
    decide on 0.
 
To decide what room is loc (G - regionality) at (N - number):
    if G is in1doors:
        decide on a random in1doors room which grids-at N;
    if G is in2doors:
        decide on a random in2doors room which grids-at N;
    if G is out1doors:
        decide on a random out1doors room which grids-at N;
    if G is out2doors:
        decide on a random out2doors room which grids-at N;
    decide on nothing;
 
 
Section - Directional Actions
 
Rule for setting action variables for going when the location is not nodoors (this is the spinny set going variables rule):
    if the noun is a direction:
        let D be the noun;
        if the location is outdoors:
            now the noun is D aligned counter outdoors-alignment;
        else if the location is in1doors:
            now the noun is D aligned counter in1doors-alignment;
        else if the location is in2doors:
            now the noun is D aligned counter in2doors-alignment;
 
 
Chapter - Architectural Components
 
A thing can be dir-describable.
A thing has a direction called the realdir. The realdir of a thing is usually inside.
 
Understand "n", "north" as a thing when the item described is dir-describable and align-here realdir of the item described is north.
Understand "e", "east" as a thing when the item described is dir-describable and align-here realdir of the item described is east.
Understand "s", "south" as a thing when the item described is dir-describable and align-here realdir of the item described is south.
Understand "w", "west" as a thing when the item described is dir-describable and align-here realdir of the item described is west.
 
Section - Walls
 
A wall is a kind of thing. The printed name of a wall is usually "[if dir-describable][align-here realdir] [end if]wall".
A wall is usually scenery. A wall is usually dir-describable.
 
A wall can be mountable or unmountable. A wall is usually mountable.
 
A wall has an object called the mountobj. The mountobj of a wall is usually nothing.
Definition: a wall is mounted rather than unmounted if the mountobj of it is not nothing.
 
To say wall-addendum of (W - wall):
    let O be the mountobj of W;
    if O is a window:
        say ". This wall has a window";
    if O is a portal:
        say ". The door is [if O is open]open[else]closed[end if]";
 
To say rock-wall-addendum of (R - room):
    if a window (called W) is in R:
        say ". A window is set in the rock to the [align-here realdir of W]";
    if a portal (called D) is in R:
        say ". [if D is open]An open[else]A closed[end if] door is set in the rock to the [align-here realdir of D]";
 
The no-wall is a wall. The printed name is "NO WALL".
 
To decide what wall is wall dir (D - direction) in (R - room):
    repeat with V running through walls in R:
        if the realdir of V is D:
            decide on V;
    decide on no-wall.
 
To decide what wall is wall dir (D - direction) at (G - regionality) at (N - number):
    let R be loc G at N;
    if R is nothing:
        decide on no-wall;
    repeat with V running through walls in R:
        if the realdir of V is D:
            decide on V;
    decide on no-wall.
 
Check entering a wall:
    let O be the mountobj of the noun;
    if O is a window:
        instead try entering O;
    if O is a portal:
        instead try entering O;
    follow the unenterable-wall response rules for the noun;
    stop the action.
 
The unenterable-wall response rules are a wall based rulebook.
 
The last unenterable-wall response rule:
    instead say "You can't go that way."
 
The unmountable-wall response rules are a wall based rulebook.
 
The last unmountable-wall response rule for a wall (called W):
    instead say "There's no space on [the W] for a window.";
 
The thru-appearance rules are a room based rulebook.
The thru-from-window is an object that varies.
The thru-from-realdir is a direction that varies.
 
The last thru-appearance rule:
    instead say "You can't make anything out."
 
To say dir-if-mounted (D - direction):
    if thru-from-window is mounted:
        if thru-from-window is shack-window-out:
            say " ([align-in1 D])";
        else if thru-from-window is hall-window-out:
            say " ([align-in2 D])";
        else:
            say " ([align-out D])";
 
 
A shack-wall is a kind of wall.
Understand "pale", "wood", "wall", "polished", "honey" as a shack-wall.
 
The description of a shack-wall is usually "It's lovely wood[wall-addendum of the item described]."
 
An unenterable-wall response rule for a shack-wall:
    instead say "There's a wall in that direction.";
 
Check touching a shack-wall:
    instead say "With pleasure."
 
A shack-face is a kind of wall.
Understand "shack", "bare", "wood", "wooden", "wall" as a shack-face.
 
The description of a shack-face is usually "The shack doesn't look quite as big from the outside, and the wood is weather-streaked and sun-faded[if the item described is unmounted]. It's still a solid piece of work, though[end if][wall-addendum of the item described]."
 
To say shack-face-addendum (W - shack-face):
    let O be the mountobj of W;
    if O is nothing:
        say ", but the side facing you is blank";
    else if O is a portal:
        say "; the door is [if O is open]open[else]closed[end if]";
    else if O is a window:
        say "; there is a window on this side";
 
An unenterable-wall response rule for a shack-face:
    instead say "There is no entrance on this side.";
 
Check touching a shack-face:
    instead say "Smooth wood.";
 
Check opening a shack-face:
    let O be the mountobj of the noun;
    if O is not nothing:
        instead try opening O;
    instead say "There is no door on this side."
 
Check closing a shack-face:
    let O be the mountobj of the noun;
    if O is not nothing:
        instead try closing O;
    instead say "There is no door on this side."
 
 
An obsidian-wall is a kind of wall. The printed name is usually "monolith".
Understand "hulk", "hulking", "obsidian", "block", "monolith", "menhir", "tower", "stone", "black", "face" as an obsidian-wall.
 
An unenterable-wall response rule for an obsidian-wall:
    instead say "You cannot walk into the obsidian block."
 
Check climbing an obsidian-wall:
    instead say "Climbing the black surface is quite impossible."
 
Check touching an obsidian-wall:
    instead say "Rough and yet glassy, in that obsidian sort of way.";
 
 
A rock-wall is a kind of wall. The printed name of a rock-wall is usually "[if dir-describable][align-here realdir] [end if]rock wall".
Understand "rock", "stone", "wall" as a rock-wall.
 
The description of a rock-wall is usually "It's rock[wall-addendum of the item described]."
 
An unenterable-wall response rule for a rock-wall:
    instead say "It's solid rock.";
 
Check climbing a rock-wall:
    instead say "The rock is too steep to climb.";
 
 
A curtain-wall is a kind of wall. The printed name of a curtain-wall is usually "[if dir-describable][align-here realdir] [end if]curtain".
A curtain-wall is usually unmountable.
Understand "gold", "heavy", "weave", "woven", "fabric", "curtain", "curtains", "curtained", "pleat", "pleated", "pleats", "wall" as a curtain-wall.
 
The description of a curtain-wall is usually "Pleated folds of heavy gold fabric[wall-addendum of the item described]."
 
An unmountable-wall response rule for a curtain-wall:
    instead say "The curtains won't hold a window.";
 
An unenterable-wall response rule for a curtain-wall:
    instead say "The curtains are fixed to the walls; you can't walk through them.";
 
Check searching a curtain-wall:
    instead say "It's just a curtain."
 
Check taking a curtain-wall:
    instead say "The curtains are nailed in place."
 
Check pulling a curtain-wall:
    instead say "The curtains are nailed in place."
 
Check climbing a curtain-wall:
    instead say "You haven't reached that point."
 
 
A brick-wall is a kind of wall. The printed name of a brick-wall is usually "[if dir-describable][align-here realdir] [end if]brick wall".
Understand "brick", "raw", "brown", "bare", "unfinished", "stained", "wall" as a brick-wall.
 
The description of a brick-wall is usually "It's time-stained brick[wall-addendum of the item described]."
 
An unenterable-wall response rule for a brick-wall:
    instead say "It's solid brick.";
 
 
A secret-wall is a kind of wall. The printed name of a secret-wall is usually "[if dir-describable][align-here realdir] [end if]bone wall".
A secret-wall is usually unmountable.
Understand "bone", "ivory", "wall", "twisted", "twisting", "sheet", "sheets" as a secret-wall.
 
The description of a secret-wall is usually "Something might have lived here millions of years ago; this is what's left[wall-addendum of the item described]."
 
An unmountable-wall response rule for a secret-wall:
    instead say "The bone doesn't seem compatible with glass.";
 
An unenterable-wall response rule for a secret-wall:
    instead say "The bone has no opening.";
 
Check touching a secret-wall:
    instead say "The bone feels quietly contemplative."
 
 
Section - Windows
 
A window is a kind of thing. The printed name of a window is usually "[if the item described is dir-describable and the item described is mounted][align-here realdir] [end if]window".
Understand "window", "glass", "pane", "pane of", "frame" as a window.
 
A window is usually dir-describable.
A window has a wall called the mountpoint. The mountpoint of a window is usually no-wall.
A window has a window called the counterpane.
 
Definition: a window is mounted rather than unmounted if the mountpoint of it is not no-wall.
 
Rule for writing a paragraph about a window (called W):
    if W is mounted:
        now W is mentioned;
    else:
        say "An unmounted window is lying on the [if the location is indoors]floor[else]ground[end if].";
 
Check examining a window:
    if the noun is mounted:
        say "You peer through the window. ";
    else if the player carries the noun:
        say "You hold up the window and peer through. ";
    else:
        say "You lean over and peer through the window. The scene below hangs at an impossible angle. ";
    let C be the counterpane of the noun;
    let R be the location of C;
    now thru-from-window is the noun;
    now thru-from-realdir is the realdir of C;
    follow the thru-appearance rules for R;
    stop the action.
 
Check searching a window:
    instead try examining the noun;
 
Check entering a window:
    instead say "You can't [if the location is indoors]leave[else]enter[end if] through the window.";
 
Check taking a mounted window:
    let olddir be the realdir of the noun;
    let oldwall be the mountpoint of the noun;
    now the mountpoint of the noun is no-wall;
    now the mountobj of the oldwall is nothing;
    now the realdir of the noun is inside;
    now the player carries the noun;
    say "You lift the window off the [align-here olddir] wall[first time]. The wall behind it is a blank wood surface, which you suppose is only fair[only].";
    perform detachment for the noun;
    stop the action;
 
Check putting a window on a wall (this is the check not already mounted rule):
    if the mountpoint of the noun is the second noun:
        instead say "[The noun] is already on [the second noun].";
    if the second noun is mounted:
        if the mountobj of the second noun is a portal:
            instead say "You can't put a window on a door. That makes no sense.";
        if the mountobj of the second noun is a window:
            instead say "You can't put a window on a window. That makes no sense.";
        instead say "(BUG) [The second noun] is mounted weirdly.";
    if the second noun is unmountable:
        follow the unmountable-wall response rules for the second noun;
        stop the action;
 
Check putting a window on a portal:
    instead say "You can't put a window on a door. That makes no sense.";
 
Check putting a window on a door:
    instead say "You can't put a window on a door. That makes no sense.";
 
The can't put onto what's not a supporter rule does nothing if the noun is a window and the second noun is a wall.
 
Check inserting a window into a wall:
    instead try putting the noun on the second noun.
 
Carry out putting a window on a wall:
    now the noun is in the location of the second noun;
    now the mountpoint of the noun is the second noun;
    now the mountobj of the second noun is the noun;
    now the realdir of the noun is the realdir of the second noun;
    perform attachment for the noun;
    stop;
 
Report putting a window on a wall:
    say "You place the window onto [the second noun][first time]. It remains neatly in place when you let go[only].[para]You peer through. ";
    let C be the counterpane of the noun;
    let R be the location of C;
    now thru-from-window is the noun;
    now thru-from-realdir is the realdir of C;
    follow the thru-appearance rules for R;
    stop.
 
Check opening a window:
    if the noun is mounted:
        instead say "It's just a glass pane mounted in a frame. There's no way to open it.";
    else if the player carries the noun:
        instead say "You're holding the window, frame and all. Opening it is meaningless.";
    else:
        instead say "The window is just lying on the [if the location is indoors]floor[else]ground[end if]. Opening it is meaningless.";
 
Check closing a window:
    instead say "It's not open."
 
Check attacking a window:
    if the noun is mounted:
        say "Disdaining all respect for the sanctity of the Lady of Doors, you put your fist right through the window. It smashes very satisfactorily.[para]What is [if the location is indoors]outside is not the world[else]on the other side is not a room, or even another world[end if], but howling, empty Void";
    else if the player carries the noun:
        say "You bring the glass down on your knee. It smashes very satisfactorily.[para]You're not sure how the howling Void can be on the other side when you are holding the frame in your hands. But it is";
    else:
        say "You stomp the glass. It smashes very satisfactorily.[para]Apparently the space under the window is the howling Void";
    say ". You and everything are dragged through and out and beyond.";
    end the story finally;
    stop the action.
 
Section - Portals
 
A portal is a kind of thing. A portal is usually scenery. Understand "door" as a portal.
A portal is usually dir-describable.
A portal can be open or closed. A portal is usually closed.
A portal can be openable or unopenable. A portal is usually openable.
A portal has a wall called the mountpoint. The mountpoint of a portal is usually no-wall.
A portal has a portal called the counterport.
 
Definition: a portal is mounted rather than unmounted if the mountpoint of it is not no-wall.
 
Definition: a portal is you-coregional:
    if it is unmounted:
        decide no;
    let R1 be the location of it;
    let R2 be the location of the player;
    if R1 region-matches R2:
        decide yes;
    decide no.
 
The no-portal is a closed portal. The printed name is "NO PORTAL".
 
Check entering a portal:
    if the noun is closed:
        say "(first opening [the noun])[command clarification break]";
        try opening the noun;
        if the noun is closed:
            stop the action;
    let CD be the counterport of the noun;
    if CD is unmounted:
        instead say "(BUG) [The CD] is unmounted.";
    if the location is indoors:
        say "You step outside[first time] into damp, chilly daylight[only].";
    else:
        say "You step inside.";
    move the player to the location of CD;
    stop the action.
 
Check opening an open portal:
    instead say "It's already open.";
 
Check closing a closed portal:
    instead say "It's already closed.";
 
Check opening a portal when the counterport of the noun is unmounted:
    instead say "The door won't budge."
 
Carry out opening a portal:
    let CD be the counterport of the noun;
    now the noun is open;
    now CD is open;
 
Report opening a portal:
    instead say "You [if the location is indoors]pull[else]push[end if] open the door.";
 
Carry out closing a portal:
    let CD be the counterport of the noun;
    now the noun is closed;
    now CD is closed;
 
Report closing a portal:
    instead say "You [if the location is indoors]push[else]pull[end if] the door closed.";
 
Check pushing a portal:
    if the location is indoors:
        if the noun is closed:
            instead say "Wrong way.";
        instead try closing the noun;
    else:
        instead try opening the noun.
 
Check pulling a portal:
    if the location is outdoors:
        if the noun is closed:
            instead say "Wrong way.";
        instead try closing the noun;
    else:
        instead try opening the noun.
 
Check taking a portal:
    instead say "A door isn't something you can pick up[one of]. (Not around here, anyhow.)[or].[stopping]";
 
Check locking a portal with:
    instead say "The door has no keyhole.";
Check unlocking a portal with:
    instead say "The door has no keyhole.";
 
Section - Sacred Geometry
 
To detach (D - portal):
    if D is mounted:
        let V be the mountpoint of D;
        now the mountpoint of D is no-wall;
        now the mountobj of V is nothing;
        now the realdir of D is inside;
        now D is off-stage;
 
To attach (D - portal) to (V - wall):
    if V is mounted:
        say "(BUG) [V] is already mounted.";
        stop;
    move D to the location of V;
    now the realdir of D is the realdir of V;
    now the mountpoint of D is V;
    now the mountobj of V is D;
 
 
To perform detachment for (W - window):
    if there is an open portal in the location:
        say "[line break]As the window comes free, the door slams shut.";
    else if there is an open you-coregional portal:
        say "[line break]You hear a door slam nearby.";
    now all portals are closed;
    if W is shack-window-in or W is shack-window-out:
        detach shack-door-out;
        adjust astral portal;
    if W is hall-window-in or W is hall-window-out:
        detach tall-door-out;
        detach wide-door-out;
        adjust statues and plants;
 
To perform attachment for (W - window):
    if the location of W is outdoors:
        let W be the counterpane of W;
    let CW be the counterpane of W;
    let L be align (realdir of W) to (realdir of CW);
    now L is L + verso;
    if the location is out1doors:
        [now in1doors-alignment is (outdoors-alignment + L);]
        now in1doors-offset is L;
    else if the location is out2doors:
        [now in2doors-alignment is (outdoors-alignment + L);]
        now in2doors-offset is L;
    else if location is in1doors:
        [now outdoors-alignment is (in1doors-alignment - L);]
        let newout be (in1doors-alignment - L);
        let newdiff be newout - outdoors-alignment;
        now outdoors-alignment is outdoors-alignment + newdiff;
        now in1doors-offset is in1doors-offset - newdiff;
    else if location is in2doors:
        [now outdoors-alignment is (in2doors-alignment - L);]
        let newout be (in2doors-alignment - L);
        let newdiff be newout - outdoors-alignment;
        now outdoors-alignment is outdoors-alignment + newdiff;
        now in2doors-offset is in2doors-offset - newdiff;
    if W is shack-window-in:
        calculate attachment for shack-door-out from shack-window-in in out1doors;
        adjust astral portal;
    if W is hall-window-in:
        calculate attachment for tall-door-out from hall-window-in in out2doors;
        calculate attachment for wide-door-out from hall-window-in in out2doors;
    if W is hall-window-in or W is hall-window-out:
        adjust statues and plants;
 
To calculate attachment for (D - portal) from (W - window) in (outreg - regionality):
    let CW be the counterpane of W;  [CW is out]
    let CD be the counterport of D;  [CD is in]
    let inalign be orig;
    if outreg is:
        -- out1doors:
            now inalign is in1doors-alignment;
        -- out2doors:
            now inalign is in2doors-alignment;
        -- otherwise:
            say "(BUG) bad outreg [outreg].";
    let vecstart be vector dir (realdir of W);
    let vecoff be (gridref of location of CD) - (gridref of location of W);
    let vecend be vector dir (realdir of CD);
    let vec be (vecend + vecoff - vecstart);
    let vec be align vector vec by counter (outdoors-alignment - inalign);
    let doorref be (gridref of location of CW) + vec;
    let indir be the opposite of the realdir of CD;
    let doordir be indir aligned counter (outdoors-alignment - inalign);
    let V be wall dir doordir at outreg at doorref;
    if V is not no-wall:
        attach D to V;
 
To adjust astral portal:
    let M be the mountpoint of shack-window-out;
    if M is side-block or M is front-block:
        if astral-portal is not in the Shack:
            now astral-portal is in the Shack;
    else:
        if astral-portal is in the Shack:
            now astral-portal is off-stage;
 
To adjust statues and plants:
    now the out-statue is off-stage;
    now the out-plant is off-stage;
    now the angle-plant is off-stage;
    now the angle-statue is off-stage;
    if hall-window-in is mounted and hall-window-out is mounted:
        let M-in be the mountpoint of hall-window-in;
        let M-out be the mountpoint of hall-window-out;
        if M-out is rwall-106-e:
            if M-in is far-brick:
                now the angle-statue is in the Rocky Angle;
            else if M-in is near-brick:
                now the angle-plant is in the Rocky Angle;
        else if M-out is rwall-306-w:
            if M-in is far-brick:
                now the out-statue is on the pedestal;
            else if M-in is near-brick:
                now the out-plant is on the pedestal;
 
 
Chapter - Locations
 
Section - Intro Indoors
 
The Shack is an in1doors room. The printed name is "[if Shack is not ever-seen]Where?[else]Shack[end if]".
The gridref is 202.
The description is "[shack-desc]."
 
To say shack-desc:
    if Shack is not ever-seen:
        if not expanding text for comparison purposes:
            now the Shack is ever-seen;
        say "Well, at least it's not a dusty library this time.[para]You're standing in a... shack? It has the layout of a shack. Small, square, a single room with the front door [align-here north] and a window on the [align-here west] wall.[para]This is no woodsman's shabby hovel, though. The walls are pale wood, gleaming to a shine. The joists are carved and the lintels are downright baroque. There's not a speck of cobweb in any corner.[para]On the low hand, the place is quite empty";
        stop;
    say "You are in a small elegant shack";
    if the astral-portal is not in the Shack:
        say ", richly carved but quite empty";
    else:
        say ". The ceiling seems higher than you remember; the joists above disappear into darkness";
    say ". The door [if shack-door-in is open]stands open[else]is[end if] to the [align-here north]";
    if the shack-window-in is mounted:
        say ", and there is a window on the [align-here realdir of shack-window-in] wall";
    if the shack-window-in is not in the Shack:
        say ", but there is no window now";
 
A thru-appearance rule for the Shack:
    say "You see the interior of the shack";
    if the astral-portal is in the Shack:
        say ", although it looks strangely altered";
    if thru-from-realdir is:
        -- south:
            say ". The door is opposite you[dir-if-mounted north]";
        -- west:
            say ". The door is to your left[dir-if-mounted north]";
        -- east:
            say ". The door is to your right[dir-if-mounted north]";
        -- north:
            say ". (BUG) Looking from north";
    if the astral-portal is in the Shack:
        say ".[para]A whirling astral portal is visible in the center of the shack";
    instead say "."
 
 
Check going north in the Shack:
    instead try entering the shack-wall-n.
Check going west in the Shack:
    instead try entering the shack-wall-w.
Check going east in the Shack:
    instead try entering the shack-wall-e.
Check going south in the Shack:
    instead try entering the shack-wall-s.
 
Check going inside in the Shack when the astral-portal is in the Shack:
    instead try entering the astral-portal.
 
The woodwork is scenery in the Shack.
Understand "joist", "joists", "lintel", "lintels", "carved", "carving", "carvings", "shack", "trim" as the woodwork.
Understand "darkness", "obsidian" as the woodwork when the astral-portal is in the Shack.
 
The description is "[woodwork-desc]."
 
To say woodwork-desc:
    if the astral-portal is in the Shack:
        say "The joists seem remote. They glint like obsidian now";
    else:
        say "[first time]The trim is a darker wood, almost mauve. [only]";
        say "It really is lovely work[one of][or]. You wish you lived here[or]. You wish... well, you wish you were home. But the woodwork is still nice[or][stopping]";
 
Check touching the woodwork:
    instead say "With pleasure."
 
Check searching the woodwork:
    instead say "[one of]No hidden catches or secret panels. That's a pity[or]It's decorative, but that's all[stopping]."
 
The shack-wall-n is a shack-wall in the Shack. The realdir is north. The shack-wall-n is unmountable.
The shack-wall-w is a shack-wall in the Shack. The realdir is west.
The shack-wall-e is a shack-wall in the Shack. The realdir is east.
The shack-wall-s is a shack-wall in the Shack. The realdir is south.
 
Understand "sh-1-wall" as shack-wall-n.
Understand "sh-2-wall" as shack-wall-e.
Understand "sh-3-wall" as shack-wall-w.
Understand "sh-4-wall" as shack-wall-s.
 
The shack-door-in is a portal in the Shack. The printed name is "front door".
Understand "front", "sdoor-in" as the shack-door-in.
The realdir is north.
The counterport is the shack-door-out.
The mountpoint of the shack-door-in is the shack-wall-n.
The mountobj of the shack-wall-n is the shack-door-in.
 
The description of the shack-door-in is "The front door is a square-panelled arrangement of honey-brown wood. It is [if shack-door-in is open]open[else]closed[end if]."
 
The shack-window-in is a window in the Shack.
Understand "swin-in" as the shack-window-in.
The counterpane is the shack-window-out.
The mountpoint is shack-wall-w.
The realdir is west.
The mountobj of shack-wall-w is the shack-window-in.
 
The astral-portal is fixed in place. The printed name is "portal".
Understand "portal", "astral", "silvery", "haze", "whirling", "whirlpool", "funnel" as the astral-portal.
The initial appearance is "A funnel of astral haze whirls in the center of the room[first time]. There's your portal[only]."
 
The description is "It's clearly a portal, although with no arch or frame this time. Just a whirlpool of silvery haze."
 
Check entering the astral-portal:
    say "[em]And have you seen enough of doors?[/em][line break][em]A mirrored glance across the hall[/em][line break][em]A window on my mind and yours[/em][line break][em]Reflects for any time at all.[/em][para][em]To hear the call reflected back[/em][line break][em]To catch the time under a glass[/em][line break][em]Between the mirror and the crack[/em][line break][em]We'll find a final door to pass.[/em][para]";
    say "Commit or go home[if the player carries a window]! You clutch your souvenir window firmly under your arm; maybe it will do you some good where you're going. And maybe not.[para][else]! [end if]You plunge into the portal and pass from this place.";
    if all signums are ever-seen:
        end the story finally saying "Homeward";
    else:
        end the story finally saying "Onward";
 
Check touching the astral-portal:
    instead say "No fingers, now. Commit!"
 
Check taking the astral-portal:
    instead try touching the astral-portal.
Check pushing the astral-portal:
    instead try touching the astral-portal.
Check pulling the astral-portal:
    instead try touching the astral-portal.
 
Check turning the astral-portal:
    instead say "It spins by itself."
 
 
Section - Intro Outdoors
 
The Side Yard is an out1doors room.
The gridref is 102.
The description is "You are standing in a muddy yard next to a small shack. The shack's [side-yard-addendum] is to the [align-here east]; the yard continues around it to the [align-here southeast]. To the [align-here north], the yard is choked by brush.[para]The [align-here west] side of the yard is a hulking block of obsidian[obsidian-addendum]."
 
To say side-yard-addendum:
    let O be the mountobj of side-shack;
    if O is nothing:
        say "bare wooden wall";
    else if O is a portal:
        say "[if O is open]open[else]closed[end if] door";
    else if O is a window:
        say "window";
 
To say obsidian-addendum:
    let O be the mountobj of side-block;
    if O is a portal:
        say ". There's [if O is open]an open[else]a closed[end if] door on this side";
    else if O is a window:
        say ". There's a window on this side";
    if wayfound:
        say ". A path is visible to one side, running [align-here northwest] around the monolith";
 
A thru-appearance rule for the Side Yard:
    say "You see a muddy yard";
    if thru-from-realdir is east:
        say " with a rough obsidian monolith on the far side[dir-if-mounted west]";
    if thru-from-realdir is west:
        say " with a shack on the far side[dir-if-mounted east]";
    if the gate-key is in the side Yard:
        say ". A key is lying in the grass";
    instead say ".";
 
Check going south in the Side Yard:
    say "You walk around the shack to the [align-here south]."
Check going southeast in the Side Yard:
    say "You walk around the shack to the [align-here south]."
 
Check going west in the Side Yard:
    instead try entering the side-block.
 
Check going northwest in the Side Yard:
    if not wayfound:
        instead say "Dense brush surrounds the monolith; you can't go around it.";
    say "You edge onto the path around the monolith."
 
Check going southwest in the Side Yard:
    instead say "Dense brush surrounds the monolith; you can't go around it.";
 
Check going north in the Side Yard:
    instead say "The brush is impenetrable.";
 
Check going northeast in the Side Yard:
    instead say "The brush is impenetrable.";
 
Check going east in the Side Yard:
    instead try entering the side-shack.
 
The side-shack is a shack-face in the Side Yard. The realdir is east.
 
The shack-window-out is a window in the Side Yard.
Understand "swin-out" as the shack-window-out.
The counterpane is the shack-window-in.
The realdir is east.
The mountpoint of shack-window-out is the side-shack.
The mountobj of the side-shack is the shack-window-out.
 
The side-block is an obsidian-wall in the Side Yard. The realdir of side-block is west.
 
The description is "You can only see one face of the obsidian monolith; the rest is buried in the brush[if the side-block is unmounted]. It looms over the yard like a black... monolith[else][obsidian-addendum][end if]."
 
The gate-key is a thing in the Side Yard. The printed name is "iron key".
Understand "long", "iron", "key" as the gate-key.
The initial appearance is "A long-hafted iron key is lying in the mud."
 
The description is "The key has a long shaft and an ornate curlicued bow[first time]. Quite the sort of thing you can imagine being used around these parts[only]."
 
 
The Back Yard is an out1doors room.
The gridref is 201.
The description is "This is a wide grassy space, fenced around the [align-here south] and [align-here east] sides. A small shack stands to the [align-here north][shack-face-addendum back-shack]. The yard continues around to the [align-here northwest]."
 
A thru-appearance rule for the Back Yard:
    say "You see a grassy fenced-in yard";
    if the gate-key is in the Back Yard:
        say ". A key is lying in the grass";
    instead say ".";
 
The Back Yard is southeast of the Side Yard.
West of the Back Yard is south of the Side Yard.
 
Check going west in the Back Yard:
    say "You walk around the shack to the [align-here west]."
Check going northwest in the Back Yard:
    say "You walk around the shack to the [align-here west]."
 
Check going north in the Back Yard:
    instead try entering the back-shack.
 
Check going south in the Back Yard:
    instead say "You can't get past the fence."
Check going east in the Back Yard:
    instead say "You can't get past the fence."
Check going southeast in the Back Yard:
    instead say "You can't get past the fence."
Check going southwest in the Back Yard:
    instead say "You can't get past the fence."
Check going northeast in the Back Yard:
    instead say "You can't get past the fence."
 
The back-shack is a shack-face in the Back Yard. The realdir is north.
 
The back-fence is scenery in the Back Yard.
Understand "fence", "fencing", "twisted", "metal", "high", "wire" as the back-fence.
 
The description is "The fence is an affair of twisted metal wire strung through the brush. Not elegant, but effective. The fence runs from the shack around the [align-here south] and [align-here east] sides of the yard."
 
Check climbing the back-fence:
    instead say "Climbing the wire would be painful, as would falling off it[first time]. You decide not to[only]."
 
 
The Outcrop is an out1doors room.
The gridref is 302.
 
The description is "This is a narrow promontory which overlooks a rocky ravine. There is no way down. A shack stands to the [align-here west][shack-face-addendum oside-shack]."
 
A thru-appearance rule for the Outcrop:
    say "You see a rocky outcrop with a ravine beyond";
    if the gate-key is in the Outcrop:
        say ". A key is lying on the ground";
    instead say ".";
 
Check going west in the Outcrop:
    instead try entering the oside-shack.
 
Check going down in the Outcrop:
    instead try entering the ravine.
 
Check going north in the Outcrop:
    instead try entering the ravine.
Check going northeast in the Outcrop:
    instead try entering the ravine.
Check going east in the Outcrop:
    instead try entering the ravine.
Check going southeast in the Outcrop:
    instead try entering the ravine.
Check going south in the Outcrop:
    instead try entering the ravine.
Check going northwest in the Outcrop:
    instead say "There's no space to walk around the shack.";
Check going southwest in the Outcrop:
    instead say "There's no space to walk around the shack.";
 
The oside-shack is a shack-face in the Outcrop. The realdir is west.
 
The ravine is scenery in the Outcrop.
Understand "chasm", "rocky", "rock", "rocks" as the ravine.
 
Check entering the ravine:
    instead say "The ravine is too steep to scramble down."
 
Check climbing the ravine:
    instead try entering the ravine.
 
 
The Front Lane is an out1doors room.
The gridref is 203.
The description is "[front-lane-desc].";
 
To say front-lane-desc:
    say "A small shack stands amid trees under a louring grey sky. The shack is to the [align-here south]";
    let O be the mountobj of front-shack;
    if O is nothing:
        say ", although the side facing you is bare";
    else if O is a portal:
        say "; the door is [if O is open]open[else]closed[end if]";
    else if O is a window:
        say "; a window faces you";
    say ". A rutted lane runs [align-here north]. The lane is fenced to either side with iron bars, and [if front-gate is closed]is blocked by a heavy iron gate[else]runs through an open iron gate[end if] to the [align-here north]";
 
Check going south in the Front Lane:
    instead try entering the front-shack.
 
Check going east in the Front Lane:
    instead say "The iron fence prevents you."
Check going northeast in the Front Lane:
    instead say "The iron fence prevents you."
Check going southeast in the Front Lane:
    instead say "The iron fence prevents you."
Check going west in the Front Lane:
    instead say "The iron fence prevents you."
Check going northwest in the Front Lane:
    instead say "The iron fence prevents you."
Check going southwest in the Front Lane:
    instead say "The iron fence prevents you."
 
The front-shack is a shack-face in the Front Lane. The realdir is south.
 
The shack-door-out is a portal in the Front Lane. The printed name is "front door".
Understand "front", "sdoor-out" as the shack-door-out.
The realdir is south.
The counterport is the shack-door-in.
The mountobj of the front-shack is the shack-door-out.
The mountpoint of the shack-door-out is the front-shack.
 
The description of the shack-door-out is "The door is a square-panelled arrangement of honey-brown wood. It is [if shack-door-out is open]open[else]closed[end if]."
 
The front-fence is scenery in the Front Lane. The printed name is "iron fence".
Understand "fence", "fencing", "iron", "bar", "bars", "crossbar", "crossbars", "point", "pointy" as the front-fence.
 
The description is "The fencing to the [align-here east] and [align-here west] is of high pointy iron bars and crossbars[first time]. You're not getting past[only]."
 
Check climbing the front-fence:
    instead say "Someone worked hard to make that even harder."
 
The front-gate is a closed openable locked scenery door. The printed name is "iron gate".
Understand "iron", "heavy", "gate" as the front-gate.
 
The front-gate is north of the Front Lane and south of the Country Road.
 
The description of the front-gate is "The iron gate is decorative but definitely functional. It is standing [open-closed front-gate]."
 
Check opening the locked front-gate:
    if the player carries the gate-key:
        try unlocking the front-gate with the gate-key;
        if the front-gate is unlocked:
            continue the action;
    if the gate-key is handled:
        instead say "You're not holding the key.";
    instead say "[one of]You rattle the gate, but it's locked[or]The gate is still locked[stopping]."
 
After opening the front-gate:
    if the gate-note is on-stage:
        now the gate-note is off-stage;
        say "The bit of paper flutters away, unnoticed and unneeded.";
    continue the action;
 
Check unlocking the locked front-gate with the gate-key:
    now the front-gate is unlocked;
    instead say "The key turns with a satisfying sla-schick!";
 
Check locking the unlocked front-gate with the gate-key:
    instead say "Oh, good grief, who relocks a gate?"
 
The gate-note is in the Front Lane. The printed name is "note".
Understand "paper", "crumpled", "note" as the gate-note.
The initial appearance is "A crumpled note is wedged between the gate bars.";
 
Check taking the gate-note:
    now the gate-note is off-stage;
    instead say "You pull the note free and flatten it. The paper reads: 'TAKE A WINDOW AND PUT IT ELSEWHERE.'[para]Huh. A stray breeze pulls the note from your fingers; it flutters away past the fence.";
 
Check examining the gate-note:
    instead try taking the gate-note.
 
 
Section - Ravine Outdoors
 
The Country Road is an out2doors room.
The gridref is 204.
 
The description is "This lane cuts through a scrubby pine wood. The gate to the [align-here south] is [open-closed front-gate]. To the [align-here north], the road crumbles down the side of a rough ravine[if the Ravine Bottom is not visited]. You could make it down, but it'll be a scramble[end if]."
 
Check going north from the Country Road:
    if the player carries a window:
        instead say "That pane of glass would never make it down intact, I'm afraid.";
    say "You half-slide down into the ravine.";
    continue the action;
 
Check going down in the Country Road:
    instead try going (north aligned outdoors-alignment);
 
Check going up in the Country Road:
    instead say "The trees aren't climbable."
 
Check going nowhere in the Country Road:
    instead say "The woods look like an unpleasant brushy scramble."
 
The road-ravine is scenery in the Country Road. The printed name is "ravine".
Understand "rough", "ravine", "chasm", "edge" as the road-ravine.
 
The description is "The ravine is a sharp drop running [align-here east] and [align-here west] through the forest. But the edge is somewhat broken down here; you could scramble down to the [align-here north]."
 
Check entering the road-ravine:
    instead try going (north aligned outdoors-alignment);
Check climbing the road-ravine:
    instead try going (north aligned outdoors-alignment);
 
 
The Ravine Bottom is an out2doors room.
The Ravine Bottom is north of the Country Road.
The gridref is 205.
 
The description is "This is a wide spot at the bottom of the ravine. A towering wall of rock stands to the [align-here north][ravbottom-addendum]. The ravine is choked with brush to the [align-here west], but you could move around the boulder to the [align-here northeast] and [align-here northwest]. To the [align-here south] is a rough scramble up to the road."
 
To say ravbottom-addendum:
    if rwall-205 is mounted:
        let O be the mountobj of rwall-205;
        if O is a window:
            say "; a window is set into it";
        if O is a portal:
            say "; [if O is open]an open[else]a closed[end if] door is set into it"
 
A thru-appearance rule for the Ravine Bottom:
    say "You see the rocky bottom of the ravine";
    instead say ".";
 
Check going south from the Ravine Bottom:
    if the player carries a window:
        instead say "That pane of glass would never make it up intact, I'm afraid.";
    say "You make your laborious way up out of the ravine.";
    continue the action;
 
Check going up in the Ravine Bottom:
    instead try going (south aligned outdoors-alignment);
Check going outside in the Ravine Bottom:
    instead try going (south aligned outdoors-alignment);
Check exiting in the Ravine Bottom:
    instead try going (south aligned outdoors-alignment);
 
Check going north in the Ravine Bottom:
    instead try entering the rwall-205.
 
Check going west in the Ravine Bottom:
    instead say "You can't push through the brush."
Check going southwest in the Ravine Bottom:
    instead say "You can't push through the brush."
 
Check going east in the Ravine Bottom:
    instead say "The only navigable paths are [align-here northeast] and [align-here northwest]."
Check going southeast in the Ravine Bottom:
    instead try going (east aligned outdoors-alignment);
 
The rwall-205 is a rock-wall in the Ravine Bottom. The realdir is north.
Understand "boulder", "towering" as the rwall-205.
 
The bottom-ravine is scenery in the Ravine Bottom. The printed name is "ravine".
Understand "rough", "ravine", "chasm", "edge" as the bottom-ravine.
 
The description is "Just an antediluvian stream bed. Postdiluvian? Long since dried up, anyway."
 
Check entering the bottom-ravine:
    instead say "You're already in the ravine.";
 
Check climbing the bottom-ravine:
    instead try going (south aligned outdoors-alignment);
 
The bottom-brush is scenery in the Ravine Bottom. The printed name is "brush".
Understand "brush", "mass", "mass of", "bramble", "brambles" as the bottom-brush.
 
The description is "Brambles piled on brambles."
 
Check entering the bottom-brush:
    instead try going (west aligned outdoors-alignment);
Check climbing the bottom-brush:
    instead try going (west aligned outdoors-alignment);
 
 
The Blind Canyon is an out2doors room.
The gridref is 106.
The Blind Canyon is northwest of the Ravine Bottom.
 
The description is "[blind-canyon-desc]."
 
To say blind-canyon-desc:
    say "The ravine ends here with stone walls to the [align-here north], [align-here west], and [align-here east][rock-wall-addendum of Blind Canyon]";
    if not wayfound:
        say ". A mass of brush blocks your way [align-here south], but";
    else:
        say ". A path runs through a mass of brush to the [align-here south], or";
    say " you could edge around to the [align-here southeast]";
 
A thru-appearance rule for the Blind Canyon:
    say "You see the blind end of the ravine";
    if thru-from-realdir is:
        -- north:
            say ". A mass of brush is opposite you[dir-if-mounted south]";
        -- east:
            say ". A mass of brush is to your left[dir-if-mounted south]";
    say ". Directly in front of you is a pedestal";
    [pedestal should be empty when a window looks out on it, but just in case...]
    if the out-plant is on the pedestal:
        say " with a shrub";
    if the out-statue is on the pedestal:
        say " with a statue";
    instead say ".";
 
Check going south from the Blind Canyon:
    if not wayfound:
        if the hidden-path is in the Blind Canyon:
            instead say "You can no longer find any trace of the path.";
        instead say "The brush is impenetrable.";
    say "You push your way into the brush-tangled path.";
 
Check going southwest in the Blind Canyon:
    instead say "The brush is impenetrable."
 
Check going north in the Blind Canyon:
    instead try entering the rwall-106-n.
Check going east in the Blind Canyon:
    instead try entering the rwall-106-e.
Check going west in the Blind Canyon:
    instead try entering the rwall-106-w.
 
The rwall-106-n is a rock-wall in the Blind Canyon. The realdir is north.
The rwall-106-e is a rock-wall in the Blind Canyon. The realdir is east.
The rwall-106-w is an unmountable rock-wall in the Blind Canyon. The realdir is west.
 
Understand "rwall-bw" as the rwall-106-w.
Understand "rwall-bn" as the rwall-106-n.
Understand "rwall-be" as the rwall-106-e.
 
Understand "crack", "cracks", "cracked", "worn" as the rwall-106-w.
The description of rwall-106-w is "[The rwall-106-w] is more heavily cracked and worn."
 
An unmountable-wall response rule for the rwall-106-w:
    instead say "[The rwall-106-w] is too cracked and riven to hold a window."
 
The blind-brush is scenery in the Blind Canyon. The printed name is "brush".
Understand "brush", "mass", "mass of", "bramble", "brambles" as the blind-brush.
 
The description is "Brambles piled on brambles[if wayfound]. But there's a path running [align-here south] through them[end if]."
 
After examining the blind-brush:
    if the out-statue is on the pedestal:
        invoke wayfinding;
 
Check entering the blind-brush:
    instead try going (south aligned outdoors-alignment);
Check climbing the blind-brush:
    instead try going (south aligned outdoors-alignment);
 
To invoke wayfinding:
    if the hidden-path is not in the Blind Canyon:
        now the hidden-path is in the Blind Canyon;
        say "Following the statue's line of sight, you realize that a narrow path cuts [align-here south] through the brush!"
 
To decide whether wayfound:
    if the hidden-path is in the Blind Canyon and the out-statue is on the pedestal:
        decide yes;
    decide no.
 
The hidden-path is scenery. The printed name is "hidden path".
Understand "hidden", "narrow", "path" as the hidden-path.
 
The description is "A path winds [align-here south] into the mass of brush[first time]. You're surprised you didn't notice it before[only]."
 
Instead of doing anything to the hidden-path when not wayfound:
    instead say "You can no longer see any trace of the path.";
 
Check entering the hidden-path:
    instead try going (south aligned outdoors-alignment);
 
The hall-window-out is a window in the Blind Canyon.
Understand "hwin-out" as the hall-window-out.
The counterpane is the hall-window-in.
The mountpoint is rwall-106-n.
The realdir is north.
The mountobj of rwall-106-n is the hall-window-out.
 
The pedestal is a fixed in place supporter in the Blind Canyon.
Understand "stone", "circle", "circular", "flat", "grey", "greyish" as the pedestal.
 
Definition: the pedestal is empty if nothing is on it.
 
Rule for writing a paragraph about the pedestal:
    say "A stone pedestal sits here between the ravine walls. It's circular and [if the pedestal is not ever-seen]perfectly[else]pretty[end if] flat";
    if the out-plant is on the pedestal:
        now the out-plant is mentioned;
        say ". A vigorous bush is sprouting from the pedestal[one of]. (Now that definitely wasn't there before[period])[or][period][stopping]";
        if the spoon is part of the out-plant:
            say "[para]A white spoon is tangled in the shrub's branches[period]";
    else if the out-statue is on the pedestal:
        now the out-statue is mentioned;
        say ".[para]A marble statue of a Wayfinder stands on the pedestal[one of]. (Now that definitely wasn't there before[period])[or][period][stopping]";
    else:
        say ", but empty[period]";
    say line break;
    stop;
 
The description of the pedestal is "It's the same greyish stone as all the other rocks around here. But this one was clearly carved by human hands[if the pedestal is empty]. The pedestal is empty[end if]."
 
Check taking the pedestal:
    instead say "[if the pedestal is empty]Even empty, the[else]The[end if] pedestal is too heavy to move."
 
Check pushing the pedestal:
    instead try taking the pedestal.
Check pulling the pedestal:
    instead try taking the pedestal.
Check turning the pedestal:
    instead try taking the pedestal.
 
Check entering the pedestal:
    if the pedestal is empty:
        instead say "You step onto the pedestal. Then you step off of it. Nothing much happens.";
    else:
        instead say "It would be awkward now.";
 
Check putting a window on the pedestal:
    instead say "The pedestal isn't big enough to mount a window on."
 
Check inserting something into the pedestal:
    instead try putting the noun on the pedestal.
 
Carry out putting something on the pedestal:
    move the noun to the location;
    stop the action.
 
Report putting something on the pedestal:
    now the pedestal is ever-seen;
    instead say "[The noun] slowly slides off the pedestal and tumbles to the ground[first time]. Hm. Maybe the pedestal isn't so flat after all[only]."
 
 
The out-plant is fixed in place. The printed name is "vigorous bush".
Understand "plant", "bush", "shrub", "vigorous", "branch", "branches" as the out-plant.
 
The description is "It's just a plant, living its best life here in the ravine[if the spoon is part of the out-plant]. A spoon is hanging in the shrub's branches[end if]."
 
Check taking the out-plant:
    instead say "The plant seems firmly rooted in the pedestal. However improbable that may be.";
Check pulling the out-plant:
    instead try taking the out-plant;
 
Check taking the spoon when the spoon is part of the out-plant:
    now the spoon is in the location;
    continue the action;
 
Check putting the spoon on the out-plant:
    instead say "You don't need to put that back.";
Check inserting the spoon into the out-plant:
    instead say "You don't need to put that back.";
 
The out-statue is fixed in place. The printed name is "statue".
Understand "statue", "goddess", "god", "meddo", "lukios", "marble", "wayfinder", "hat" as the out-statue.
 
The description is "The statue is a finely detailed representation of one of the Wayfinder goddesses of the City. The attributal pose looks natural on her: peering intently to the [align-here south] with a hand shading her eyes and her hat tucked under her arm."
 
After examining the out-statue:
    invoke wayfinding;
 
Check taking the out-statue:
    instead say "The statue and pedestal are too heavy to move."
 
Check pushing the out-statue:
    instead say "The statue is affixed to the pedestal.";
 
Check pulling the out-statue:
    instead try pushing the out-statue.
Check turning the out-statue:
    instead try pushing the out-statue.
 
Check touching the out-statue:
    instead say "It feels like marble, because that's what it is."
 
 
The Rocky Angle is an out2doors room.
The gridref is 306.
The Rocky Angle is northeast of the Ravine Bottom.
 
The description is "This is a niche in the ravine, with rocky walls [align-here west] and [align-here north][rock-wall-addendum of Rocky Angle]. A path runs [align-here southwest]. To the [align-here east], the canyon descends further into a swamp of broken boulders; you will go no further."
 
A thru-appearance rule for the Rocky Angle:
    say "You see the niche in the ravine";
    [again, should not see these]
    if the angle-plant is in the Rocky Angle:
        say ". There is a small shrub in front of you";
    if the angle-statue is in the Rocky Angle:
        say ". There is a marble pillar in front of you";
    instead say ".";
 
Check going north in the Rocky Angle:
    instead try entering the rwall-306-n.
Check going west in the Rocky Angle:
    instead try entering the rwall-306-w.
 
Check going east in the Rocky Angle:
    instead say "You cannot proceed along the ravine."
Check going northeast in the Rocky Angle:
    instead say "You cannot proceed along the ravine."
Check going southeast in the Rocky Angle:
    instead say "You cannot proceed along the ravine."
 
Check going down in the Rocky Angle:
    instead say "You cannot proceed down the ravine."
 
Check going south in the Rocky Angle:
    instead say "There is no way up the ravine here.."
Check going up in the Rocky Angle:
    instead say "There is no way up the ravine here.."
 
The rwall-306-n is an unmountable rock-wall in the Rocky Angle. The realdir is north.
The rwall-306-w is a rock-wall in the Rocky Angle. The realdir is west.
 
Understand "rwall-aw" as the rwall-306-w.
Understand "rwall-an" as the rwall-306-n.
 
Understand "crack", "cracks", "cracked", "worn" as the rwall-306-n.
The description of rwall-306-n is "[The rwall-306-n] is more heavily cracked and worn."
 
An unmountable-wall response rule for the rwall-306-n:
    instead say "[The rwall-306-n] is too cracked and riven to hold a window."
 
The broken-boulders are plural-named scenery in the Rocky Angle. The printed name is "broken boulders".
Understand "broken", "boulder", "boulders", "swamp" as the broken-boulders.
 
Check entering the broken-boulders:
    instead say "You cannot proceed down the ravine."
Check climbing the broken-boulders:
    instead say "You cannot proceed down the ravine."
 
 
The angle-plant is fixed in place. The printed name is "scraggly shrub".
Understand "short", "sad", "scraggly", "shrub", "bush", "plant" as the angle-plant.
 
The initial appearance is "A short scraggly bush pokes up between the rocks here[one of]. Was that here before?[or].[stopping]";
 
The description is "It's just a plant, eking out a life here in the ravine."
 
Check taking the angle-plant:
    instead say "It's not holding on very well, but you'd still rather not uproot it."
Check pulling the angle-plant:
    instead try taking the angle-plant.
 
 
The angle-statue is fixed in place. The printed name is "worn pillar".
Understand "figure", "form", "worn", "pillar", "marble", "shaped", "odd", "oddly", "oddly-shaped" as the angle-statue.
 
The initial appearance is "An oddly-shaped pillar of worn marble stands nearby[one of]. Was that here before?[or].[stopping]";
 
The description is "The pillar is about your height, and it has a vaguely human form. From some angles, anyway. But if it was shaped by human hands, the task was long since abandoned."
 
Check touching the angle-statue:
    instead say "It feels like marble that's been standing out in the weather for a few centuries."
 
Check taking the angle-statue:
    instead say "You can't move the marble pillar.";
 
Check pulling the angle-statue:
    instead try taking the angle-statue.
Check pushing the angle-statue:
    instead try taking the angle-statue.
Check turning the angle-statue:
    instead try taking the angle-statue.
 
Check climbing the angle-statue:
    instead say "It's not tall enough to climb anywhere."
 
 
Section - Ravine Indoors
 
The Hallway-Near is an in2doors room. The printed name is "Hallway at Statue".
The gridref is 107.
 
The description is "[hallway-near-desc]."
 
To say hallway-near-desc:
    say "This hallway runs [align-here north] between walls curtained in heavy gold weave. To the [align-here south]";
    if near-brick is mounted:
        say ", the hall ends at a wall of brown brick, upon which is a window";
    else:
        say ", the hall ends at a wall of bare brown brick";
    say ". A wide door stands [open-closed wide-door-in] to the [align-here east]";
 
A thru-appearance rule for the Hallway-Near:
    say "You are looking down a curtained hallway, which stretches away";
    if thru-from-window is mounted:
        say " to the [align-in2 north]";
    else:
        say " from you";
    say ". To your right[dir-if-mounted east] is a wide door";
    say ". A statue stands at this end of the hall";
    instead say ".";
 
Check going south in the Hallway-Near:
    instead try entering the near-brick.
Check going east in the Hallway-Near:
    instead try entering the curtain-wall-n-e.
Check going west in the Hallway-Near:
    instead try entering the curtain-wall-n-w.
 
The near-brick is a brick-wall in the Hallway-Near. The realdir is south.
 
The curtain-wall-n-e is a curtain-wall in the Hallway-Near. The realdir is east.
The curtain-wall-n-w is a curtain-wall in the Hallway-Near. The realdir is west.
 
The hall-window-in is a window in the Hallway-Near.
Understand "hwin-in" as the hall-window-in.
The counterpane is the hall-window-out.
The mountpoint is near-brick.
The realdir is south.
The mountobj of near-brick is the hall-window-in.
 
The wide-door-in is a portal in the Hallway-Near. The printed name is "wide door".
Understand "wide", "plain", "wood", "wooden", "wdoor-in" as the wide-door-in.
The realdir is east.
The counterport is the wide-door-out.
The mountpoint of the wide-door-in is the curtain-wall-n-e.
The mountobj of the curtain-wall-n-e is the wide-door-in.
 
The description of the wide-door-in is "It's a plain wooden door, rather wide. It is [open-closed wide-door-in]."
 
The wide-door-out is a portal. The printed name is "wide door".
Understand "wide", "plain", "wood", "wooden", "wdoor-out" as the wide-door-out.
The counterport is the wide-door-in.
 
The description of the wide-door-out is "It's a plain wooden door, rather wide. It is [open-closed wide-door-out]."
 
The statue-in is fixed in place in the Hallway-Near. The printed name is "statue".
Understand "statue", "goddess", "god", "meddo", "lukios", "marble", "wayfinder" as the statue-in.
 
Rule for writing a paragraph about the statue-in:
    say "A life-sized statue stands in one corner, blindly staring across at the door."
 
The description is "It's a rather abstract representation of Meddo, or perhaps Lukios -- one of the wayfinding goddesses of the City pantheons. You can tell by the hat."
 
Check taking the statue-in:
    instead say "The statue is far too heavy to move."
 
Check pushing the statue-in:
    instead say "The statue is too heavy to move.";
 
Check pulling the statue-in:
    instead try pushing the statue-in.
Check turning the statue-in:
    instead try pushing the statue-in.
 
Check touching the statue-in:
    instead say "It feels like marble, because that's what it is."
 
The statue-hat is part of the statue-in. The printed name is "hat".
Understand "hat", "wayfinder", "pheasant", "plume", "plumes", "feather", "feathers", "marble" as the statue-hat.
 
The description is "The wayfinder's hat is an elongated headdress lined with flocced pheasant plumes. [first time](Say that six times.) [only]The feathers symbolize something, although the cults don't agree on what and you can't remember anyhow. This marble rendition is stylized but immediately recognizable."
 
Check taking the statue-hat:
    instead say "The hat is admirable, but it's part of the statue."
 
Check pushing the statue-hat:
    instead say "The hat is fixed in place.";
 
Check pulling the statue-hat:
    instead try pushing the statue-hat.
Check turning the statue-hat:
    instead try pushing the statue-hat.
 
Check touching the statue-hat:
    instead say "It feels like marble, because that's what it is."
 
 
The Hallway-Far is an in2doors room. The printed name is "Hallway at Plant".
The gridref is 108.
 
The description is "[hallway-far-desc]."
 
To say hallway-far-desc:
    say "The curtain-lined hallway runs [align-here south] from here. To the [align-here north]";
    if far-brick is mounted:
        say ", it ends at a wall of brown brick, upon which is a window";
    else:
        say ", it ends at a wall of bare brown brick";
    say ". A tall door stands [open-closed tall-door-in] to the [align-here west]";
 
A thru-appearance rule for the Hallway-Far:
    say "You are looking down a curtained hallway, which stretches away";
    if thru-from-window is mounted:
        say " to the [align-in2 south]";
    else:
        say " from you";
    say ". To your right[dir-if-mounted west] is a tall door";
    say ". There's a potted plant at this end of the hall";
    instead say ".";
 
The Hallway-Far is north of Hallway-Near.
 
Check going north in the Hallway-Far:
    instead try entering the far-brick.
Check going east in the Hallway-Far:
    instead try entering the curtain-wall-f-e.
Check going west in the Hallway-Far:
    instead try entering the curtain-wall-f-w.
 
The far-brick is a brick-wall in the Hallway-Far. The realdir is north.
 
The curtain-wall-f-e is a curtain-wall in the Hallway-Far. The realdir is east.
The curtain-wall-f-w is a curtain-wall in the Hallway-Far. The realdir is west.
 
The tall-door-in is a portal in the Hallway-Far. The printed name is "tall door".
Understand "tall", "plain", "wood", "wooden", "tdoor-in" as the tall-door-in.
The realdir is west.
The counterport is the tall-door-out.
The mountpoint of the tall-door-in is the curtain-wall-f-w.
The mountobj of the curtain-wall-f-w is the tall-door-in.
 
The description of the tall-door-in is "It's a tall plain wooden door. It is [open-closed tall-door-in]."
 
The tall-door-out is a portal. The printed name is "tall door".
Understand "tall", "plain", "wood", "wooden", "tdoor-out" as the tall-door-out.
The counterport is the tall-door-in.
 
The description of the tall-door-out is "It's a tall plain wooden door. It is [open-closed tall-door-out]."
 
The hall-plant is fixed in place in the Hallway-Far. The printed name is "plant".
Understand "plant", "shrub", "etiolated", "planter", "pot", "potted", "tall", "stalky", "stalk" as the hall-plant.
 
Rule for writing a paragraph about the hall-plant:
    say "A planter in one corner supports an etiolated shrub."
 
The description is "The pot is about waist-high, with a tall stalky plant growing from it[if far-brick is unmounted]. The plant doesn't look like it's gotten much love recently[else]. The plant seems to quietly appreciate the light falling from the window[end if]."
 
Check taking the hall-plant:
    instead say "Don't abuse the poor plant."
 
Check pushing the hall-plant:
    instead say "The potted plant is too heavy to move."
 
Check pulling the hall-plant:
    instead try pushing the hall-plant.
Check turning the hall-plant:
    instead try pushing the hall-plant.
 
 
Section - Return Outdoors
 
 
The Secret Room is an out2doors room. The printed name is "Secret Cell".
The gridref is 107.
 
The description is "This narrow space is enclosed by twisting sheets of bone[first time]. You cannot imagine how such a place could have been formed, or what it's doing here, or why[only][secret-addendum]."
 
To say secret-addendum:
    if a portal (called D) is in the Secret Room:
        say ". The only exit is the [open-closed D] door to the [align-here realdir of D]";
    else:
        say ". There is no way out";
 
Check examining inside in the Secret Room:
    instead say "You [em]are[/em] inside."
 
Check examining outside in the Secret Room:
    instead say "You could just walk through the door."
 
Check going outside in the Secret Room:
    if a portal (called D) is in the Secret Room:
        instead try entering D;
Check exiting in the Secret Room:
    if a portal (called D) is in the Secret Room:
        instead try entering D;
 
Check going north in the Secret Room:
    instead try entering the secret-wall-n.
Check going east in the Secret Room:
    instead try entering the secret-wall-e.
Check going south in the Secret Room:
    instead try entering the secret-wall-s.
Check going west in the Secret Room:
    instead try entering the secret-wall-w.
 
The secret-wall-n is a secret-wall in the Secret Room. The realdir is north.
The secret-wall-e is a secret-wall in the Secret Room. The realdir is east.
The secret-wall-s is a secret-wall in the Secret Room. The realdir is south.
The secret-wall-w is a secret-wall in the Secret Room. The realdir is west.
 
 
The Tangled Path is an out2doors room.
The gridref is 105.
The Tangled Path is south of the Blind Canyon.
The Tangled Path is northeast of the Clearing.
 
The description is "A narrow path wends through the brush. You can go [align-here southwest], where the path climbs steeply uphill, or return to the [align-here north]."
 
Check going up in the Tangled Path:
    instead try going (southwest aligned outdoors-alignment);
Check going down in the Tangled Path:
    instead try going (north aligned outdoors-alignment);
 
Check going north in the Tangled Path:
    say "You emerge onto the ravine floor."
 
Check going southwest in the Tangled Path:
    if the player carries a window:
        instead say "That pane of glass would never make it up intact, I'm afraid.";
    say "You climb the slope and emerge into a small clearing."
 
Check going nowhere in the Tangled Path:
    instead say "The forest is too dense to leave the path.";
 
The mid-brush is scenery in the Tangled Path. The printed name is "brush".
Understand "brush", "bramble", "brambles", "tangled" as the mid-brush.
 
The description is "Brambled piled on brambles, all around you."
 
Check entering the mid-brush:
    instead say "You're already in the middle of this mess."
 
 
The Clearing is an out1doors room.
The gridref is 3.
 
The description is "This is a small clearing in the deep forest. Faint trails run [align-here northeast] and [align-here southeast] into the brush.[para]To the [align-here south] stands a hulking wall of obsidian[clear-obsid-addendum]."
 
To say clear-obsid-addendum:
    let M be the mountobj of the front-block;
    if M is a window:
        say " with a window on it";
    if M is a portal:
        say " with [if M is open]an open[else]a closed[end if] door";
 
A thru-appearance rule for the Clearing:
    instead say "You see a forest clearing.";
 
The Side Yard is southeast of the Clearing.
 
Check going south in the Clearing:
    instead try entering the front-block.
Check going down in the Clearing:
    instead try going (northeast aligned outdoors-alignment);
 
Check going northeast in the Clearing:
    if the player carries a window:
        instead say "That pane of glass would never make it down intact, I'm afraid.";
    say "You descend into the brush."
 
Check going southeast in the Clearing:
    say "You push past the monolith and emerge into a familiar yard."
 
The front-block is an obsidian-wall in the Clearing. The realdir of front-block is south.
Understand "wall" as the front-block.
 
The description is "The obsidian block looms out of the brush like... still like a black monolith, really[obsidian-addendum-2]."
 
To say obsidian-addendum-2:
    let O be the mountobj of front-block;
    if O is a portal:
        say ". There's [if O is open]an open[else]a closed[end if] door on this side";
    else if O is a window:
        say ". There's a window on this side";
 
 
Chapter - Signifiers
 
A signum is a kind of thing.
Understand "white" as a signum.
 
A signum has a number called the lifespan. The lifespan of a signum is usually 4.
 
Every turn:
    repeat with S running through ever-seen signums:
        if the lifespan of S is not zero:
            decrement the lifespan of S;
            if the lifespan of S is zero:
                if the player is carrying S:
                    say "[The S] silently dissolves into dust and sifts away between your fingers.";
                else if S is in the location:
                    say "[The S] silently dissolves into dust.";
                now S is off-stage;
 
 
The teacup is a signum in the Front Lane.
Understand "tea", "cup" as the teacup.
The initial appearance is "A white teacup is lying on the doorstep."
 
The comb is a signum in the Outcrop.
The initial appearance is "You notice a white comb amid the rocks."
 
The thimble is a signum in the Back Yard.
Understand "tiny" as the thimble.
The initial appearance is "A tiny white thimble is lying in the grass."
 
The coin is a signum in the Country Road.
The initial appearance is "A white coin of some sort peeks from a rut in the road."
 
The spindle is a signum in the Rocky Angle.
Understand "hand" as the spindle.
The initial appearance is "A white hand spindle is lying discarded amid the rocks."
 
Check turning the spindle:
    instead say "Good thought, but you never learned how. Plus you have no wool."
 
The spoon is a signum.
The spoon is part of the out-plant.
 
The button is a signum in the Clearing.
Understand "round" as the button.
The initial appearance is "A small round button lies here."
 
Check pushing the button:
    instead say "Not that kind of button."
 
The ring is a signum in the Secret Room. The lifespan is zero.
The initial appearance is "A white ring sits in the middle of the floor."
 
Check wearing the ring:
    instead say "It's not your size."
 
The signifier rules are a signum based rulebook.
 
Check examining a signum:
    instead say "It's [whitestuff], or maybe [whitestuff]."
 
To say whitestuff:
    say "[one of]alabaster[or]ivory[or]bone[or]plaster[or]chalk[or]marble[or]moonstone[or]salt[or]plastic[at random]";
 
Report taking a not ever-seen signum:
    say "You pick up [the noun]. Memory sparks between your fingers...[para]";
    now the noun is ever-seen;
    follow the signifier rules for the noun;
    say line break;
    stop the action.
 
Signifier rule for the teacup:
    instead say "[em]'But why are [/em]you[em] leaving?' I asked.[para]'Six hundred reasons, maybe,' you said. 'Six hundred doors.'[para]'That's poetry, not a janiographic survey,' I said. 'Bellamy never even visited the City.'[para]'I bet she's the reason [/em]you[em] did, though.'[/em]";
 
Signifier rule for the comb:
    instead say "[em]'[/em]I[em] came back, is all I'm saying.'[para]'But did you leave in order to come back?' you asked. 'Or did you leave first?'[para]'I could have told you I was leaving forever...' I began, and then wondered if that were true.[para]You smiled. 'I wouldn't have believed you, anyhow.'[/em]"
 
Signifier rule for the thimble:
    instead say "[em]'It's lonely out there,' I said. 'I mean... maybe you're lonely here.'[para]'Always a little,' you replied. 'Never entirely. You know that. But I keep wondering: maybe [']out there['] is lonely without [/em]me?[em] That's all.'[/em]"
 
Signifier rule for the coin:
    instead say "[em]'Well, that's not [/em]all[em] it is,' you went on.[para]'You want to see a thing or two. I get it.' I grinned. 'I've been there.'[para]'I want to see the places you [/em]haven't[em] been!' you said. 'There must be a few left!' And then you stopped and thought about that admission.[/em]"
 
Signifier rule for the spindle:
    instead say "[em]'I am not,' I said seriously, 'the one dragging you through the doors.'[para]'No, of course not,' you said. 'I'm quite capable of dragging myself. Or chasing myself. Whichever.'[para]'Just be careful that when you arrive, you haven't already gotten there first.'[para]You snickered, picturing this.[/em]"
 
Signifier rule for the button:
    instead say "[em]I opened my hands. 'Just think about what happens when you [']weary of the doors and time['].'[para]'That's two problems, though,' you said. 'What if I run out of time and the doors are still there? Bellamy didn't talk about that one.'[/em]";
 
Signifier rule for the spoon:
    instead say "[em]'Say you come back,' I began, and waved off your protest. 'Say. What would you think if you found me packing to leave?'[para]'To leave? Or to come after me?'[para]'I meant...' But which [/em]had[em] I meant?[/em]"
 
Signifier rule for the ring:
    instead say "[em]'Look,' you said. 'I am going. The door is right there. I have to be a person who can go through it.'[para]'And then?' I asked.[para]'Then we will both be people who have gone.'[para]'...Can't be a person who's gone until you come back.'[para]'Is that a dare?'[para]'It can be.'[/em]"
 
The last signifier rule:
    instead say "(BUG) Not defined.";
 
 
Chapter - Debug - not for release
 
Zap-status is an action out of world.
Understand "status" as zap-status.
 
Carry out zap-status:
    say "In1doors is [in1doors-alignment].";
    say "In2doors is [in2doors-alignment].";
    say "Outdoors is [outdoors-alignment].";
    say line break;
    if shack-window-in is mounted:
        say "The swin-in has realdir [realdir of shack-window-in] (apparent [realdir of shack-window-in aligned in1doors-alignment]).";
    else:
        say "The swin-in is unmounted.";
    if shack-window-out is mounted:
        say "The swin-out has realdir [realdir of shack-window-out] (apparent [realdir of shack-window-out aligned outdoors-alignment]).";
    else:
        say "The swin-out is unmounted.";
    if shack-door-in is mounted:
        say "The sdoor-in has realdir [realdir of shack-door-in] (apparent [realdir of shack-door-in aligned in1doors-alignment]).";
    else:
        say "The sdoor-in is unmounted.";
    if shack-door-out is mounted:
        say "The sdoor-out has realdir [realdir of shack-door-out] (apparent [realdir of shack-door-out aligned outdoors-alignment]).";
    else:
        say "The sdoor-out is unmounted.";
    say line break;
    if hall-window-in is mounted:
        say "The hwin-in has realdir [realdir of hall-window-in] (apparent [realdir of hall-window-in aligned in2doors-alignment]).";
    else:
        say "The hwin-in is unmounted.";
    if hall-window-out is mounted:
        say "The hwin-out has realdir [realdir of hall-window-out] (apparent [realdir of hall-window-out aligned outdoors-alignment]).";
    else:
        say "The hwin-out is unmounted.";
    say line break;
    if tall-door-in is mounted:
        say "The tdoor-in has realdir [realdir of tall-door-in] (apparent [realdir of tall-door-in aligned in2doors-alignment]).";
    else:
        say "The tdoor-in is unmounted.";
    if tall-door-out is mounted:
        say "The tdoor-out has realdir [realdir of tall-door-out] (apparent [realdir of tall-door-out aligned outdoors-alignment]).";
    else:
        say "The tdoor-out is unmounted.";
    if wide-door-in is mounted:
        say "The wdoor-in has realdir [realdir of wide-door-in] (apparent [realdir of wide-door-in aligned in2doors-alignment]).";
    else:
        say "The wdoor-in is unmounted.";
    if wide-door-out is mounted:
        say "The wdoor-out has realdir [realdir of wide-door-out] (apparent [realdir of wide-door-out aligned outdoors-alignment]).";
    else:
        say "The wdoor-out is unmounted.";
    if the angle-statue is on-stage:
        say "[line break]The angle-statue is placed.";
    if the angle-plant is on-stage:
        say "[line break]The angle-plant is placed.";
    if the out-statue is on-stage:
        say "[line break]The out-statue is placed.";
    if the out-plant is on-stage:
        say "[line break]The out-plant is placed.";
 
 
Zap-set-bothalignment is an action out of world applying to one alignment.
Understand "zap both/all [alignment]" as zap-set-bothalignment.
 
Carry out zap-set-bothalignment:
    now outdoors-alignment is the alignment understood;
    now in1doors-offset is orig;
    now in2doors-offset is orig;
    say "Indoors, outdoors is [alignment understood].";
 
 
Zap-statue is an action out of world.
Understand "zap statue" as zap-statue.
 
Carry out zap-statue:
    now the hall-window-in is in the Hallway-Far;
    now the mountpoint of hall-window-in is far-brick;
    now the realdir of hall-window-in is the realdir of far-brick;
    now the mountobj of far-brick is hall-window-in;
    now the mountobj of near-brick is nothing;
    now the hall-window-out is in the Rocky Angle;
    now the mountpoint of hall-window-out is rwall-306-w;
    now the realdir of hall-window-out is the realdir of rwall-306-w;
    now the mountobj of rwall-306-w is hall-window-out;
    now the mountobj of rwall-106-e is nothing;
    perform attachment for hall-window-out;
    now outdoors-alignment is verso;
    now in1doors-offset is orig;
    now in2doors-offset is cw;
    say "(DONE.)"
 
 
Gonear-gridref is an action out of world applying to one number.
Understand "goto [number]" as gonear-gridref.
 
Carry out gonear-gridref:
    let R be loc in1doors at the number understood;
    if R is not nothing:
        move the player to R;
        stop;
    let R be loc in2doors at the number understood;
    if R is not nothing:
        move the player to R;
        stop;
    now R is loc out1doors at the number understood;
    if R is not nothing:
        move the player to R;
        stop;
    now R is loc out2doors at the number understood;
    if R is not nothing:
        move the player to R;
        stop;
    say "No such room as [number understood].";
 
 
To consistency-check-window (W - window):
    if W is mounted:
        let V be the mountpoint of W;
        if the realdir of W is inside:
            say "(CHECK) [W] has no realdir.";
        if V is unmounted:
            say "(CHECK) [V] is unmounted.";
        if the realdir of W is not the realdir of V:
            say "(CHECK) [W], [V] realdir mismatch.";
    else:
        if the realdir of W is not inside:
            say "(CHECK) [W] has realdir [realdir of W].";
 
To consistency-check-door (D - portal):
    if D is mounted:
        let V be the mountpoint of D;
        if the realdir of D is inside:
            say "(CHECK) [D] has no realdir.";
        if D is off-stage:
            say "(CHECK) [D] is off-stage.";
        if V is unmounted:
            say "(CHECK) [V] is unmounted.";
        if the realdir of D is not the realdir of V:
            say "(CHECK) [D], [V] realdir mismatch.";
    else:
        if the realdir of D is not inside:
            say "(CHECK) [D] has realdir [realdir of D].";
        if D is on-stage:
            say "(CHECK) [D] is on-stage.";
 
To consistency-check-wall (V - wall):
    if V is mounted:
        let W be the mountobj of V;
        if W is unmounted:
            say "(CHECK) [W] is unmounted.";
 
Zap-checking is an action out of world.
Understand "zap check" as zap-checking.
Understand "zcheck" as zap-checking.
 
Carry out zap-checking:
    say "(CHECKING...)";
    consistency-check-window shack-window-in;
    consistency-check-window shack-window-out;
    repeat with V running through walls:
        consistency-check-wall V;
    repeat with D running through portals:
        consistency-check-door D;
 
 
[The vector math in this game isn't complicated, but Inform isn't exactly set up for that sort of thing! So I wrote a bunch of regresssion tests.]
 
Understand "zap math" as a mistake ("[zap-math]").
 
To say zap-math:
    say "1: 201 rotated is [align vector 201 by orig], [align vector 201 by cw], [align vector 201 by verso], [align vector 201 by ccw].";
    say "2: 98 rotated is [align vector 98 by orig], [align vector 98 by cw], [align vector 98 by verso], [align vector 98 by ccw].";
    say "3: -201 rotated is [align vector -201 by orig], [align vector -201 by cw], [align vector -201 by verso], [align vector -201 by ccw].";
    say "4: -98 rotated is [align vector -98 by orig], [align vector -98 by cw], [align vector -98 by verso], [align vector -98 by ccw].";
    say line break;
    say "1: orig+orig = [ orig + orig ].";
    say "2: orig+cw = [ orig + cw ].";
    say "3: cw+orig = [ cw + orig ].";
    say "4: cw+cw = [ cw + cw ].";
    say "5: orig+verso = [ orig + verso ].";
    say "6: verso+cw = [ verso + cw ].";
    say "7: cw+verso = [ cw + verso ].";
    say "8: verso+verso = [ verso + verso ].";
    say "9: ccw+verso = [ ccw + verso ].";
    say "10: ccw+ccw = [ ccw + ccw ].";
    say "11: verso+ccw = [ verso + ccw ].";
    say "12: cw+ccw = [ cw + ccw ].";
    say "13: ccw+cw = [ ccw + cw ].";
    say line break;
    say "1: orig-orig = [ orig - orig ].";
    say "2: orig-cw = [ orig - cw ].";
    say "3: cw-orig = [ cw - orig ].";
    say "4: cw-cw = [ cw - cw ].";
    say "5: orig-verso = [ orig - verso ].";
    say "6: verso-cw = [ verso - cw ].";
    say "7: cw-verso = [ cw - verso ].";
    say "8: verso-verso = [ verso - verso ].";
    say "9: ccw-verso = [ ccw - verso ].";
    say "10: ccw-ccw = [ ccw - ccw ].";
    say "11: verso-ccw = [ verso - ccw ].";
    say "12: cw-ccw = [ cw - ccw ].";
    say "13: ccw-cw = [ ccw - cw ].";