"Advent Mirror" by Andrew Plotkin.
[IFID:116BD184-28AF-4DEA-A90E-63476327215B]
The story headline is "An interactive Advent calendar entry".
The release number is 2.
[
Copyright 2022 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 Mirror_ 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/doorsday2/>
Obvious warning: This code contains spoilers! If you haven't played _ Advent Mirror_, 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 9.3 (6M62). It probably won't work 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.
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; -).
Understand the command "shatter" as "break";
First-time-banner is initially true.
Rule for printing the banner text when first-time-banner is true:
now first-time-banner is false;
do nothing.
Winding is an action applying to one thing.
Understand "wind [something]" as winding.
Carry out winding:
instead say "You can't wind that."
To decide whether loc-carpeted:
if the location is the Library-R or the location is the Library-V:
decide yes.
Chapter - Directionality
No-room is a room.
A room has an object called the counterpart.
The counterpart of a room is usually no-room.
A room has a text called the view-image.
Directionality is a kind of value. The directionalities are neutral, recto, and verso.
A room has a directionality. A room is usually neutral.
To decide if (X - object) dir-matches (Y - object):
if the directionality of X is the directionality of Y:
decide yes.
To decide if (X - object) dir-matches (R - directionality):
if the directionality of X is R:
decide yes.
[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/doorsday2/doorhook.js>]
Include (-
Global current_directionality;
-) after "Definitions.i6t".
Current-directionality is a directionality that varies.
The current-directionality variable translates into I6 as "current_directionality".
Every turn:
now current-directionality is the directionality of the location.
World-NS is a directionality that varies.
World-EW is a directionality that varies.
To decide if the world is inverted:
if the location is neutral:
decide no;
if world-NS is not world-EW:
decide yes.
To invert NS:
if world-NS is verso:
now world-NS is recto;
else:
now world-NS is verso;
To invert EW:
if world-EW is verso:
now world-EW is recto;
else:
now world-EW is verso;
After printing the name of a verso room:
say " (verso)";
To decide what direction is loc (D - direction):
if world-NS is verso:
if D is north:
now D is south;
else if D is south:
now D is north;
if world-EW is verso:
if D is west:
now D is east;
else if D is east:
now D is west;
decide on D;
The last-move-turn is initially -1.
To decide if not-just-moved:
if turn count is not last-move-turn:
decide yes.
First setting action variables for going (this is the preliminary direction tweak rule):
now the last-move-turn is the turn count;
if the location is not neutral and the noun is a direction:
let D be the noun;
now the noun is loc D;
Chapter - Mirrors and Frames
The mirror is a thing.
Understand "tall", "glass" as the mirror.
The mirror can be ever-taken.
The mirror can be ever-entered.
Rule for writing a paragraph about the mirror when the mirror is not in a frame:
say "The mirror is lying face-up on the [if loc-carpeted]carpet[else]floor[end if]."
Check examining the mirror:
if the mirror is face-up:
instead say "The mirror reflects the ceiling.";
say "The mirror reflects you";
if the player carries the mirror:
say ", albeit at an odd angle";
let R be the counterpart of the location;
if R is no-room:
instead say ".";
say ". But the room behind you doesn't look right";
let T be the view-image of R;
if T is not "":
say ". In the reflection, [T]";
instead say ".";
Check searching the mirror:
instead try examining the mirror.
Check entering the mirror:
if the player carries the mirror:
instead say "The mirror feels like normal solid glass in your hands.";
if the mirror is face-up:
say "You take a step forward and drop through the mirror. The world seems to slide through itself.[para]Naturally, on the other side, everything is upside down";
if the location is Library-R:
say ".[para]You plummet feet-first towards the closed trap-door in the ceiling below. The boards splinter as you crash through them";
else:
say ".[para]You plummet feet-first towards the open trap-door in the ceiling below";
say ". The opening swallows you and you pass from this place.";
end the story finally saying "Onward";
stop the action;
if the mirror is not in a frame (called F):
instead say "(BUG) Mirror not in frame.";
let R be the counterpart of the location;
if R is no-room:
instead say "(BUG) [The location] has no counterpart.";
if the mirror is not ever-entered:
say "Will that work? You stretch out your hand to the mirror, and it... doesn't seem to reach anything.[para]Okay then. You take a careful step through the glass surface, or the glass lack-of-surface. The world seems to slide through itself.";
else:
say "You [one of]step through the mirror[or]step again through the mirror[or]step through the mirror again[or]step through the mirror once again[at random].";
now the mirror is ever-entered;
transfer mirror;
if the player does not carry the gold-key:
invert key;
if the basedir of F is north or the basedir of F is south:
invert NS;
if the basedir of F is east or the basedir of F is west:
invert EW;
now the player is in R;
stop the action;
Check attacking the mirror:
if the mirror is face-up or the mirror is in a frame:
instead say "You put your foot through the mirror, and... it just goes through the mirror without touching the surface.";
if the player carries the mirror:
say "You release the mirror and it crashes to the ground";
if the location is Library-R:
say ". Unfortunately, the carpet is rock-hard with mud";
else:
say "You put your foot through the mirror";
say ". The glass shatters, and the world shatters with it.[para]This time there's nothing behind the frame.";
end the story saying "You broke it";
Report taking the mirror:
if loc-carpeted:
instead say "You lift the mirror from the carpet.";
else if the mirror is not ever-taken:
now the mirror is ever-taken;
instead say "You lift the mirror carefully from its frame. The glass is heavy but not too heavy to carry. Just be careful about dropping it.";
else:
instead say "You lift the mirror carefully from the frame.";
Check pulling the mirror when the mirror is in a frame:
instead try taking the mirror.
Check dropping the mirror when the player carries the mirror:
if the location is Library-V:
continue the action;
instead try attacking the mirror.
Report dropping the mirror when the location is Library-V:
instead say "The mirror settles gently onto the carpet."
Check touching the mirror:
if the player carries the mirror:
instead say "It feels like glass.";
else if the mirror is face-up:
instead say "Your fingers pass through the mirror's surface.";
else if the mirror is not ever-entered:
instead say "Your fingers don't seem to stop at the mirror's surface. What?";
else:
instead say "Your fingers pass imperceptibly through the mirror's surface.";
To transfer mirror:
if the mirror is in a frame (called F):
now the mirror is in the counterpart of F;
else if the mirror is face-up:
let R be the holder of the mirror;
now the mirror is in the counterpart of R;
Definition: the mirror is face-up if the holder of the mirror is Library-R or the holder of the mirror is Library-V.
The ball is a thing. The printed name is "reflective ball".
The ball can be ever-taken.
The ball can be just-broken.
Understand "sphere", "reflective", "polished", "ornament", "glass", "fragile" as the ball.
Rule for writing a paragraph about the ball:
say "A perfectly reflective sphere is resting [if loc-carpeted]on the carpet[else]in the center of the room[end if]."
Every turn when the ball is just-broken:
now the ball is not just-broken;
if the player carries the ball:
say "You find the glass sphere in your hand again, intact[first time]. You [em]definitely[/em] just dropped it... this is only getting odder[only]";
else:
now the ball is in the location;
say "The glass sphere is once again lying by your feet, intact[first time]. You [em]definitely[/em] just crushed it... this is only getting odder[only]";
say ".";
Check examining the ball:
say "It's a polished glass sphere, somewhat larger than a grapefruit. The surface reflects the room around you";
let R be the counterpart of the location;
if R is no-room:
instead say ".";
say ". But even through the spherical distortion, the reflection looks wrong";
let T be the view-image of R;
if T is not "":
say ": [T]";
instead say ".";
Check searching the ball:
instead try examining the ball.
Report taking the ball:
if the ball is not ever-taken:
now the ball is ever-taken;
instead say "You pick up the sphere. It feels very light and fragile... Great, not another one.";
else:
instead say "You pick up the fragile sphere again.";
Check dropping the ball when the player carries the ball:
if the location is Library-V:
continue the action;
instead try attacking the ball.
Report dropping the ball when the location is Library-V:
instead say "The ball drops lightly onto the fluffy carpet."
Check attacking the ball:
if the player carries the ball:
say "You release the ball; it crashes to the ground";
else:
say "You stomp on the ball";
say ". The glass shatters. The world... turns inside out.";
let R be the counterpart of the location;
if R is no-room:
instead say "(BUG) [The location] has no counterpart.";
transfer mirror;
now the ball is just-broken;
invert NS;
invert EW;
now the player is in R;
stop the action;
Check touching the ball:
instead say "It feels like curved glass."
Check entering the ball:
instead say "It's solid to the touch; it doesn't seem to work like the other mirror."
A frame is a kind of container.
A frame is usually fixed in place.
A frame has an object called the counterpart.
The printed name of a frame is usually "frame".
A frame has a direction called the basedir.
Definition: a frame is empty rather than non-empty if the mirror is not in it.
Understand "heavy", "iron", "oval", "wrought", "frame", "clip", "clips" as a frame.
Understand "empty" as an empty frame.
Understand "n", "north" as a frame when loc the basedir of the item described is north.
Understand "s", "south" as a frame when loc the basedir of the item described is south.
Understand "e", "east" as a frame when loc the basedir of the item described is east.
Understand "w", "west" as a frame when loc the basedir of the item described is west.
Check examining an empty frame (called F):
instead say "It's an oval frame of wrought iron, bolted to the [loc basedir of F] wall. You can see the clips that hold the mirror in place but the mirror itself has been removed."
Check examining a non-empty frame (called F):
say "It's an oval mirror frame bolted to the [loc basedir of F] wall";
if the mirror is not handled:
say ".[para]Upon inspection, it looks like the mirror can be pulled out of the frame";
else:
say ". The mirror is set in place";
instead say ".";
Rule for writing a paragraph about a frame (called F):
if the mirror is in F:
now the mirror is mentioned;
say "On the [loc basedir of F] wall, a tall mirror hangs in an iron frame.";
else:
say "On the [loc basedir of F] wall hangs an empty iron frame.";
Check taking a frame:
instead say "The frame is immovably fixed to the wall."
Check pulling a frame:
instead try taking the noun.
Check pushing a frame:
instead try taking the noun.
Check putting the mirror on a frame (called F):
instead try inserting the mirror into F.
Check inserting something into a frame when the noun is not the mirror:
instead say "It's a mirror-frame. You can only put mirrors in there."
Report inserting the mirror into a frame (called F):
instead say "You set the mirror into the [loc basedir of F] frame."
Check entering an empty frame:
instead say "It's just an empty frame with a wall behind it. There's nowhere to go."
Check entering a non-empty frame:
instead try entering the mirror.
Check attacking a frame:
instead say "Mirrors are fragile, but this frame looks unbreakable."
Chapter - Doors and Bad Doors
To say doorloc (D - door):
let R be the direction of D from the location;
say loc R;
Understand "n", "north" as a door when loc the direction of the item described from location is north.
Understand "s", "south" as a door when loc the direction of the item described from location is south.
Understand "e", "east" as a door when loc the direction of the item described from location is east.
Understand "w", "west" as a door when loc the direction of the item described from location is west.
Check inserting a mirror into a door:
instead say "You see no way to attach the mirror to that."
Check putting a mirror on a door:
instead say "You see no way to attach the mirror to that."
The gold-key is a thing. The printed name is "gold key".
The gold-key is in the Closet-V.
The gold-key has a directionality. The gold-key is verso.
Understand "gold", "golden", "key", "bow", "elegant", "r" as the gold-key.
The description is "It's a long-barreled gold key. The bow forms a monogram: [if the gold-key is recto]an elegantly swooping[else]a reversed[end if] capital 'R'."
Rule for writing a paragraph about the gold-key:
say "An elegant gold key is lying here!"
To invert key:
if the gold-key is recto:
now the gold-key is verso;
else:
now the gold-key is recto;
A locking-door is a kind of door.
A locking-door is usually closed. A locking-door is usually scenery.
A locking-door is usually locked.
Understand "door", "keyhole" as a locking-door.
To say locking-desc-addendum:
say ".[para]The [item described]'s keyhole is decorated with [if the world is inverted]a mirror-reversed[else]a swooping[end if] capital 'R'";
Check locking a locking-door with something:
if the second noun is not the gold-key:
instead say "That's not a key.";
if the noun is locked:
instead say "[The noun] is already locked.";
instead say "You don't see any reason to re-lock the door.";
Check unlocking a locking-door with something:
if the second noun is not the gold-key:
instead say "That's not a key.";
if the noun is unlocked:
instead say "[The noun] is already unlocked.";
if the world is inverted:
if the gold-key is recto:
instead say "The key doesn't seem to fit the lock.";
else:
if the gold-key is verso:
instead say "The key doesn't seem to fit the lock.";
now the noun is unlocked;
instead say "The key turns easily and [the noun] is unlocked.";
A bolting-door is a kind of door.
A bolting-door is usually closed. A bolting-door is usually scenery.
A bolting-door is usually locked.
A bolting-door has a room called the open-side. The open-side of a bolting-door is usually no-room.
Understand "door" as a bolting-door.
Check an actor going through a locked bolting-door (called D) (this is the easy unbolting rule):
if the open-side of D is the location:
now D is unlocked;
say "(first unbolting [the D])[command clarification break]";
Check opening a locked bolting-door:
if the open-side of the noun is not the location:
instead say "The door appears to be bolted from the other side.";
now the noun is unlocked;
now the noun is open;
instead say "[The noun] is locked with a simple bolt on this side. You unbolt and open it.";
Check locking a bolting-door with something:
if the noun is locked:
instead say "[The noun] is already locked.";
instead say "You don't see any reason to re-lock the door.";
Check unlocking a bolting-door with something:
if the noun is locked and the open-side of the noun is the location:
now the noun is unlocked;
instead say "[The noun] is locked with a simple bolt on this side. You unbolt it.";
if the noun is unlocked:
instead say "[The noun] is already unlocked.";
instead say "There's no keyhole.";
A brick-door is a kind of door.
The printed name of a brick-door is usually "bricked archway".
A brick-door is usually closed. A brick-door is usually scenery.
Understand "brick", "bricks", "bricked", "bricked-up", "arch", "archway" as a brick-door.
Check examining a brick-door:
let R be the direction of the noun from the location;
instead say "The passage [loc R] has been bricked up."
Check opening a brick-door:
instead say "The bricks insensately refuse to open."
Check closing a brick-door:
instead say "The archway has been thoroughly closed up already."
Check going when the door gone through is a brick-door (called D):
instead try entering D.
Check entering a brick-door:
let R be the direction of the noun from the location;
instead say "The [loc R] archway is bricked up."
Check unlocking a brick-door with:
instead say "You can't unlock bricks."
Check attacking a brick-door:
instead say "If violence is the answer to this one, you're going to need a really [em]big[/em] sledge hammer."
Chapter - Beginning
When play begins:
now world-NS is recto;
now world-EW is recto;
say "You had no idea where the portal would take you. That's life in the City of Doors. One more step as always.[para]The astral haze funnels into a knot and ejects you into..[period]";
The Windscor is a room. The player is in Windscor.
The description of Windscor is "[one of]...A[or]You stand in a[stopping] dim, bitter landscape of scored rock.[para]Wind hisses past you, an unending scrape of cold sand. By the worn guttered stone underfoot, it might have blown forever."
Check going up in the Windscor:
instead say "You can't fly."
Check going down in the Windscor:
instead say "The rock is obdurate to the wind, much less your scrabbling."
Check going in the Windscor:
instead say "You can't see far, but you're sure there's nothing for miles[one of][or][or]. Hundreds of miles[or][stopping].";
The windrock is scenery in the Windscor. The printed name is "rock".
Understand "rock", "stone", "stony", "bedrock", "scored", "worn", "rude", "bare", "ground" as the windrock.
The description is "The bedrock is bare to the burning wind."
Check touching the windrock:
instead say "The rock doesn't care."
Check rubbing the windrock:
instead say "The rock doesn't care."
Check attacking the windrock:
instead say "The rock doesn't care."
The wind-sand is scenery in the Windscor. The printed name is "sand".
Understand "wind", "sand", "cold", "burning", "unceasing" as the wind-sand.
The description is "There's nothing to say about the wind-blown sand."
Instead of doing anything except examining to the wind-sand:
instead say "The wind ignores you."
The vase is in the Windscor.
Understand "pure", "white", "porcelain", "fragile", "ming" as the vase.
Rule for writing a paragraph about the vase:
say "At your feet, obtrusive in this wilderness: a large unadorned porcelain vase. It rests on a wisp of yellow silk which whips and flutters in the unceasing wind.";
Check examining the vase:
say "The vase is pure white porcelain. It's miraculously intact, if somewhat hazed, after who knows how long in the blowing sand";
if the vase is not carried by the player:
say ".[para]The vase rests on a flapping rag of silk. No doubt someone placed it so to protect its base from the rude rock beneath[first time]. Why they did it [em]here[/em] you'll never know[only]";
else:
say ".[para]In your arms, the vase is lighter and more fragile than it first looked. It would probably shatter if it touched the stony ground";
instead say ".";
Check taking the vase:
now the silk-rag is off-stage.
Report taking the vase:
instead say "You lift the vase. The silk rag, freed, whips away in the wind and is lost.[para]Well. Good luck putting that down again safely."
Check dropping the vase when the player carries the vase:
instead try attacking the vase.
Check attacking the vase:
if the player carries the vase:
say "You release the vase. It crashes to the stony ground";
else:
say "You give the vase a swift kick";
say ". The porcelain shatters, except it doesn't.[para]The world shatters.[para]Stone, sky, wind-blown sand: they all fall away, dim shards disappearing into darkness. Everything is quiet now -- the quiet of a dusty library.[para]";
now the vase is off-stage;
say banner text;
now the player is in the Library-R;
stop the action.
The silk-rag is scenery in the Windscor.
Understand "rag", "wisp", "yellow", "silk", "oriental" as the silk-rag.
The description is "The silk is pinned to the ground beneath the vase. It struggles in the wind to be free."
Check taking the silk-rag:
instead say "That would upset the vase, which would surely destroy it."
Check pulling the silk-rag:
instead try taking the silk-rag.
Check pushing the silk-rag:
instead try taking the silk-rag.
Check touching the silk-rag:
instead say "You let the silk brush your fingers. It's improbably delicate."
Check rubbing the silk-rag:
instead try touching the silk-rag.
Check attacking the silk-rag:
instead say "You're not sure how."
Chapter - Rooms
The Library-R is a room. The printed name is "Library".
The Library-R is recto.
The counterpart of the Library-V is the Library-R.
The counterpart of the Library-R is the Library-V.
The description of Library-R is "[first time]You've seen abandoned libraries. Sometimes you think half the City is done up in fusty, decaying leather. [only]This is an abandoned library, all right, and you don't care for the owner. The shelves are pinched and stingy and they're all exactly the same size.[para]Not that it matters. The place has been cleaned out and then, somewhence, flooded. The floor is caked with dried mud; the carpet is petrified.[para]There's an open archway to the [loc north]. A heavy oak door to the [loc west] is [if the oak-door-R is closed]closed[else]open[end if]. And there's an open trap-door in the ceiling above you."
The view-image of Library-R is "the floor is filthy and mud-caked".
Check going up in Library-R:
instead say "The trap door is out of reach overhead."
Check going down in Library-R when the holder of the mirror is Library-R:
instead try entering the mirror.
Check jumping in the Library-R:
instead say "You can't jump anywhere near high enough to reach the trap door."
The oak-door-R is a locking-door. The printed name is "oak door".
Understand "oak", "heavy", "plain", "worn" as the oak-door-R.
The oak-door-R is west of the Library-R and east of the Clock-Room-R.
The description is "The oak door to the [doorloc oak-door-R] is plain and worn but still elegant. It's [if the oak-door-R is closed]closed[else]standing open[end if][locking-desc-addendum]."
The trap-door-R is scenery in Library-R. The printed name is "trap door".
Understand "trap", "door", "trap-door", "trapdoor", "ceiling" as the trap-door-R.
The description is "The trap door is far out of reach."
Instead of doing anything except examining to the trap-door-R:
instead say "The trap door is out of reach overhead."
The lib-shelves-R are plural-named scenery in the Library-R. The printed name is "shelves".
Understand "shelf", "shelves", "bookshelf", "bookshelves" as the lib-shelves-R.
The description of the lib-shelves-R is "You won't be doing much browsing here. The shelves are empty and slowly decaying."
Check searching the lib-shelves-R:
instead try examining the lib-shelves-R.
Check climbing the lib-shelves-R:
instead say "You wouldn't dare climb them unless you were a termite (and that's why not)."
The carpet-R is scenery in the Library-R. The printed name is "muddy carpet".
Understand "carpet", "area", "rug", "mud", "muddy", "petrified", "rucked", "clay" as the carpet-R.
The description is "This might once have been a nice area rug. Then it was soaked with mud and dried and flooded again and dried and maybe there were mice. Now it's rucked clay, as hard as the wood underneath."
Check putting something on the carpet-R:
instead try dropping the noun.
Check pulling the carpet-R:
instead say "Anything underneath the carpet is permanently entombed[first time]. Anyhow, the trap-door is in the ceiling[only]."
Check pushing the carpet-R:
instead try pulling the carpet-R.
Check searching the carpet-R:
instead try pulling the carpet-R.
Check looking under the carpet-R:
instead try pulling the carpet-R.
Check taking the carpet-R:
instead try pulling the carpet-R.
Check touching the carpet-R:
instead say "It's rock-hard with mud."
The Library-V is a room. The printed name is "Library".
The Library-V is verso.
The description of Library-V is "This might be a library, someday, when the shelves are finished out. Right now they're bare beams from floor to ceiling.[para]Speaking of the floor and the ceiling, you're standing on a plush soft mop of a carpet. And there's a closed trap-door directly over your head. The oak door to the [loc west] is [if the oak-door-V is closed]closed[else]open[end if]; the archway to the [loc north] is entirely bricked up."
The view-image of Library-V is "the floor is covered by a clean, soft-looking carpet".
Check going up in Library-V:
instead say "The trap door is closed and, in any case, out of reach."
Check going down in Library-V when the holder of the mirror is Library-V:
instead try entering the mirror.
Check jumping in the Library-V:
instead say "You can't jump anywhere near high enough to reach the trap door. The carpet is nice to land on, though."
The oak-door-V is a locking-door. The printed name is "oak door".
Understand "oak", "heavy", "new", "fresh", "trimmed", "freshly" as the oak-door-V.
The oak-door-V is west of the Library-V and east of the Clock-Room-V.
The description is "The oak door to the [doorloc oak-door-V] looks new and freshly trimmed. It's [if the oak-door-V is closed]closed[else]standing open[end if][locking-desc-addendum]."
The lib-brick-V is a brick-door. The lib-brick-V is south of Tea-Room-V and north of Library-V.
The lib-shelves-V are plural-named scenery in the Library-V. The printed name is "beams".
Understand "shelf", "shelves", "bookshelf", "bookshelves", "beam", "beams" as the lib-shelves-V.
The description of the lib-shelves-V is "They're just bare wooden beams, no shelves installed."
Check climbing the lib-shelves-V:
instead say "There's not enough there to climb.";
The trap-door-V is scenery in Library-V. The printed name is "trap door".
Understand "trap", "door", "trap-door", "trapdoor", "ceiling" as the trap-door-V.
The description is "The trap door is far out of reach."
Instead of doing anything except examining to the trap-door-V:
instead say "The trap door is closed and, in any case, out of reach."
The carpet-V is scenery in the Library-V. The printed name is "fluffy carpet".
Understand "plush", "soft", "fluffy", "mop", "huge", "white", "rug", "carpet" as the carpet-V.
The description is "A huge, soft, fluffy white carpet covers most of the floor."
Check putting something on the carpet-V:
instead try dropping the noun.
Check pulling the carpet-V:
instead say "The carpet appears to be fastened to the floorboards."
Check pushing the carpet-V:
instead try pulling the carpet-V.
Check searching the carpet-V:
instead try pulling the carpet-V.
Check looking under the carpet-V:
instead try pulling the carpet-V.
Check taking the carpet-V:
instead try pulling the carpet-V.
Check touching the carpet-V:
instead say "It's delightfully soft."
The Tea-Room-R is a room. The printed name is "Tea Room".
The Tea-Room-R is recto.
The counterpart of the Tea-Room-V is the Tea-Room-R.
The counterpart of the Tea-Room-R is the Tea-Room-V.
The Tea-Room-R is north of Library-R.
The description of Tea-Room-R is "This must have been a tea salon. It's not the broken crockery so much as the swags of rotting floral wallpaper and the baroque table where the samovar once sat.[para]An archway opens to the [loc south]. To the [loc west] is [if the marquet-door-R is closed]a closed[else]an open[end if] door of marqueted wood."
The view-image of Tea-Room-R is "you see a large table and rotting wallpaper".
The marquet-door-R is a locking-door. The printed name is "inlaid door".
Understand "marquet", "marquetry", "marqueted", "inlay", "inlaid", "wood", "pattern", "patterns" as the marquet-door-R.
The marquet-door-R is west of Tea-Room-R and east of Trophy-Room-R.
The description is "The [doorloc marquet-door-R] door is inlaid with angular geometric patterns in a dozen colors of polished wood. It's lovely. It's [if the marquet-door-R is closed]also closed[else]standing open[end if][locking-desc-addendum]."
Check touching the marquet-door-R:
instead say "The inlaid patterns are satisfying to run your fingers over."
The tea-frame-R is a frame in Tea-Room-R. The basedir is north.
The counterpart of the tea-frame-R is the tea-frame-V.
The counterpart of the tea-frame-V is the tea-frame-R.
The mirror is in the tea-frame-R.
Check going north in the Tea-Room-R:
instead try entering the tea-frame-R.
The tea-table is scenery in Tea-Room-R.
Understand "baroque", "table" as the tea-table.
The description is "The table must once have been imposingly tasteless. Now it's just coming apart at the joints."
Check climbing the tea-table:
instead say "The table is long past its supporting-anything days. Least of all a person's weight."
Check entering the tea-table:
instead try climbing the tea-table.
Check putting something on the tea-table:
instead say "The table is long past its supporting-anything days."
Check inserting something into the tea-table:
instead say "The table is long past its supporting-anything days."
Check pushing the tea-table:
instead say "Even in ruin, the table is too heavy to move."
Check pulling the tea-table:
instead try pushing the tea-table.
Check taking the tea-table:
instead try pushing the tea-table.
The crockery-R is scenery in Tea-Room-R. The printed name is "crockery".
Understand "crockery", "broken", "teacup", "teacups", "cup", "cups", "mug", "mugs" as the crockery-R.
The description is "Less than you might expect, really. Just a few broken teacups in the corners, hinting at what this place was once like."
Check taking the crockery-R:
instead say "The broken crockery isn't worth your time."
The tea-wallpaper-R is scenery in Tea-Room-R. The printed name is "wallpaper".
Understand "wallpaper", "swag", "swags", "rotting", "rotten", "floral" as the tea-wallpaper-R.
The description is "You have no interest in spending your time here with your nose to the wallpaper."
Check taking the tea-wallpaper-R:
instead say "Good heavens, leave it alone."
Check pulling the tea-wallpaper-R:
instead try taking the tea-wallpaper-R.
The Tea-Room-V is a room. The printed name is "Tea Room".
The Tea-Room-V is verso.
The description of Tea-Room-V is "This room is bare, with crates stacked in the corners, as if workers had just been called away. They left dented tea-mugs everywhere.[para]There's a doorway open to the [loc west] -- no door yet installed. The archway to the [loc south], in contrast, is bricked up."
The view-image of Tea-Room-V is "the walls are bare and crates are stacked everywhere".
The tea-frame-V is a frame in Tea-Room-V. The basedir is north.
Check going north in the Tea-Room-V:
instead try entering the tea-frame-V.
The tea-crates-V are plural-named scenery in Tea-Room-V. The printed name is "crates".
Understand "crates", "crate" as the tea-crates-V.
The description is "The crates probably hold somebody's life's-work in tchotkes and knick-knacks, but that's no concern of yours."
Check opening the tea-crates-V:
instead say "You have no way to open the crates."
Check pulling the tea-crates-V:
instead say "They're too heavy to move."
Check pushing the tea-crates-V:
instead try pulling the tea-crates-V.
The crockery-V is scenery in Tea-Room-V. The printed name is "crockery".
Understand "crockery", "mug", "mugs", "cup", "cups", "teacup", "teacups", "teamug", "teamugs", "tea-mug", "tea-mugs", "dented", "tin" as the crockery-V.
The description is "Dented tin mugs lie scattered around the room. Someone was interrupted at their tea break."
Check taking the crockery-V:
instead say "The crockery isn't worth your time."
The Trophy-Room-R is a room. The printed name is "Trophy Room".
The Trophy-Room-R is recto.
The counterpart of the Trophy-Room-V is the Trophy-Room-R.
The counterpart of the Trophy-Room-R is the Trophy-Room-V.
The description of Trophy-Room-R is "Plaques and tablets line the walls, each bearing witness to the outline of an animal head which is no longer present.[para]A heavy marqueted door to the [loc east] is [if the marquet-door-R is closed]closed[else]open[end if]. There's also an open archway to the [loc north] and a bricked-up one to the [loc south]."
The view-image of Trophy-Room-R is "the walls are covered with empty plaques".
The trophy-frame-R is a frame in Trophy-Room-R. The basedir is west.
The counterpart of the trophy-frame-R is the trophy-frame-V.
The counterpart of the trophy-frame-V is the trophy-frame-R.
Check going west in the Trophy-Room-R:
instead try entering the trophy-frame-R.
Rule for writing a paragraph about trophy-frame-R when the mirror is not in trophy-frame-R:
say "On the [loc west] wall hangs an empty iron frame -- a frame for a mirror, that is, not for a taxidermy."
The trophy-brick-R is a brick-door. The trophy-brick-R is south of Trophy-Room-R and north of the Clock-Room-R.
The plaques-R are plural-named scenery in Trophy-Room-R. The printed name is "plaques".
Understand "plaque", "plaques", "tablet", "tablets", "mounting" as the plaques-R.
The description is "This room once boasted a very large number of dead things. Now they are gone, leaving only their mounting-plaques. It's not less creepy."
Check taking the plaques-R:
instead say "The plaques are all fixed in place."
The Trophy-Room-V is a room. The printed name is "Trophy Room".
The Trophy-Room-V is verso.
The Trophy-Room-V is west of Tea-Room-V.
The description of Trophy-Room-V is "The plaster of the walls is cracked and bowed, as if... something... had hurled its bulk around the room in a frenzied rage. But whatever-it-was has left no other trace.[para][trophy-V-doors]. There's also an open doorway to the [loc east]."
The view-image of Trophy-Room-V is "the walls are bare and cracked".
To say trophy-V-doors:
if the maple-door-V is closed and the birch-door-V is closed:
say "A rich maple-panelled door to the [loc south] and a lighter birch door to the [loc north] are both closed";
else if the maple-door-V is open and the birch-door-V is open:
say "A rich maple-panelled door to the [loc south] and a lighter birch door to the [loc north] are both open";
else:
say "A rich maple-panelled door to the [loc south] is [if the maple-door-V is closed]closed[else]open[end if]; a lighter birch door to the [loc north] is [if the birch-door-V is closed]closed[else]open[end if]";
Every turn when the location is Trophy-Room-V and not-just-moved:
if a random chance of 1 in 9 succeeds:
say "Bits of plaster trickle from the ceiling."
The maple-door-V is a locking-door. The printed name is "maple door".
Understand "maple", "panel", "panelled", "paneled", "maple-panel", "burl", "burled" as the maple-door-V.
The maple-door-V is north of the Clock-Room-V and south of Trophy-Room-V.
The description is "The [doorloc maple-door-V] door is two tall panels of lovely burled maple. It is [if the maple-door-V is closed]closed[else]standing open[end if][locking-desc-addendum]."
The trophy-frame-V is a frame in Trophy-Room-V. The basedir is west.
Check going west in the Trophy-Room-V:
instead try entering the trophy-frame-V.
The plaster-V is scenery in the Trophy-Room-V. The printed name is "cracked plaster".
Understand "cracked", "crack", "cracks", "bowed", "plaster", "wall", "walls" as the plaster-V.
The description of the plaster-V is "You don't know what damaged the walls and you hope not to find out."
Check attacking the plaster-V:
instead say "You can't damage the plaster further."
Check pushing the plaster-V:
instead try attacking the plaster-V.
The Closet-R is a room. The printed name is "Closet".
The Closet-R is recto.
The counterpart of the Closet-V is the Closet-R.
The counterpart of the Closet-R is the Closet-V.
The Closet-R is north of the Trophy-Room-R.
The description of the Closet-R is "This is an afterthought of a room, bare and barely wide enough to stretch your arms. It would be uncomfortable even for a closet, but you can't think of anything else it could be. The exit is to the [loc south]."
Every turn when (the location is Closet-R or the location is Closet-V) and not-just-moved:
if a random chance of 1 in 9 succeeds:
say "[one of]Something moves behind a wall[or]You hear something skitter[or]You hear some small thing moving somewhere[at random]."
The closet-frame-R is a frame in Closet-R. The basedir is north.
The counterpart of the closet-frame-R is the closet-frame-V.
The counterpart of the closet-frame-V is the closet-frame-R.
Check going north in the Closet-R:
instead try entering the closet-frame-R.
The Closet-V is a room. The printed name is "Closet".
The Closet-V is verso.
The description of the Closet-V is "Disappointingly, this closet is exactly the same as the one on the other side. Except that the [loc south] exit is [if the birch-door-V is closed]blocked by a closed birch door[else]through an open birch door[end if]."
The closet-frame-V is a frame in Closet-V. The basedir is north.
Check going north in the Closet-V:
instead try entering the closet-frame-V.
The birch-door-V is a bolting-door. The printed name is "birch door".
The open-side is the Closet-V.
Understand "birch", "light", "lighter" as the birch-door-V.
The birch-door-V is south of the Closet-V and north of Trophy-Room-V.
The description is "It's a plain birch door, [if the birch-door-V is closed]closed[else]open[end if], to the [doorloc birch-door-V]."
The Clock-Room-R is a room. The printed name is "Clock Chamber".
The Clock-Room-R is recto.
The counterpart of the Clock-Room-V is the Clock-Room-R.
The counterpart of the Clock-Room-R is Clock-Room-V.
The description of the Clock-Room-R is "A dusty old tall-case clock dominates the center of this room. [clock-R-doors]. There's also a bricked-up opening to the [loc north]."
The view-image of Clock-Room-R is "the clock is a tall case-clock".
To say clock-R-doors:
if the oak-door-R is closed and the plywood-door-R is closed:
say "A heavy oak door to the [loc east] and a lighter plywood door to the [loc south] are both closed";
else if the oak-door-R is open and the plywood-door-R is open:
say "A heavy oak door to the [loc east] and a lighter plywood door to the [loc south] are both open";
else:
say "A heavy oak door to the [loc east] is [if the oak-door-R is closed]closed[else]open[end if]; a lighter plywood door to the [loc south] is [if the plywood-door-R is closed]closed[else]open[end if]";
The clock-frame-R is a frame in Clock-Room-R. The basedir is west.
The counterpart of the clock-frame-R is the clock-frame-V.
The counterpart of the clock-frame-V is the clock-frame-R.
Check going west in the Clock-Room-R:
instead try entering the clock-frame-R.
The plywood-door-R is a bolting-door. The printed name is "plywood door".
The open-side is the Kitchen-R.
Understand "plywood", "light", "lighter", "rough", "panel" as the plywood-door-R.
The plywood-door-R is north of the Kitchen-R and south of the Clock-Room-R.
The description is "The door to the [doorloc plywood-door-R] doesn't match the standards of this place. It's just a rough plywood panel, now [if the plywood-door-R is closed]closed[else]open[end if]."
Check attacking the plywood-door-R:
instead say "The plywood door may be cheap but it's not flimsy."
The clock-R is scenery in the Clock-Room-R. The printed name is "clock".
The clock-R can be ever-heard.
Understand "clock", "dusty", "old", "tall", "case", "tall-case", "works", "face", "instrument" as the clock-R.
The description is "The decades have left this once-majestic instrument to ruin. The case is cracked and the works have long since ceased to move. The clock face shows twenty minutes after two o'clock, and will forever."
Check listening to the clock-R:
instead say "The clock is silent[if the clock-R is ever-heard] now[end if]."
Check winding the clock-R:
instead say "The clockwork is a wreck."
Every turn when the location is Clock-Room-R and not-just-moved:
if a random chance of 1 in 7 succeeds:
if the clock-R is not ever-heard:
now the clock-R is ever-heard;
say "You jerk around as the clock emits an echoing, off-kilter [em]tick[/em].[para]You glare at the clock suspiciously. But it betrays no further hint of life.";
else:
say "[one of]The clock ticks again[or]The clock emits a dying wheeze[or]The clock rattles[or]A desultory vibration comes from the clock[or]You hear a faint [em]thud[/em] from within the clock[at random].";
The Clock-Room-V is a room. The printed name is "Clock Chamber".
The Clock-Room-V is verso.
The Clock-Room-V is north of the Kitchen-V.
The description of the Clock-Room-V is "This room is empty except for an absurd gilt shelf-clock sitting in a corner. [clock-V-doors]. There's also a narrow opening to the [loc south]."
The view-image of Clock-Room-V is "the clock is a smaller gilt affair".
To say clock-V-doors:
if the oak-door-V is closed and the maple-door-V is closed:
say "An oak door to the [loc east] and a maple door to the [loc north] are both closed";
else if the oak-door-V is open and the maple-door-V is open:
say "An oak door to the [loc east] and a maple door to the [loc north] are both open";
else:
say "An oak door to the [loc east] is [if the oak-door-V is closed]closed[else]open[end if]; a maple door to the [loc north] is [if the maple-door-V is closed]closed[else]open[end if]";
The clock-frame-V is a frame in Clock-Room-V. The basedir is west.
Check going west in the Clock-Room-V:
instead try entering the clock-frame-V.
The clock-V is scenery in the Clock-Room-V. The printed name is "clock".
Understand "shelf", "clock", "shelf-clock", "absurd", "ornate", "gilt" as the clock-V.
The description is "The shelf-clock is not in fact on a shelf; someone just left it sitting in the corner. The case is molded with gilt cherubs, or owls, or... you're not sure what they are, but they're in execrable taste.[para]The face is, of course, backwards. You're pretty sure it reads twenty minutes after two o'clock."
Check taking the clock-V:
instead say "The clock isn't a tall-case, but it's still too heavy to lug around."
Check listening to the clock-V:
instead say "The clock isn't ticking."
Check winding the clock-V:
instead say "You can't find a keyhole."
The Kitchen-R is a room. The printed name is "Kitchen".
The Kitchen-R is recto.
The counterpart of the Kitchen-V is the Kitchen-R.
The counterpart of the Kitchen-R is the Kitchen-V.
The description of the Kitchen-R is "This is the carcass of a kitchen. The fireplace in the corner has crumbled; the floor tiles are cracked and knocked askew.[para]There's an open doorway to the [loc east] and [if the plywood-door-R is closed]a closed[else]an open[end if] plywood door to the [loc north]."
The view-image of the Kitchen-R is "the fireplace is a crumbled ruin".
The fireplace-R is scenery in the Kitchen-R. The printed name is "fireplace".
Understand "enormous", "crumbling", "crumbled", "fireplace", "chimney", "rubble" as the fireplace-R.
The description is "Now that you look, the chimney seems to have fallen in on the fireplace. You didn't think that was possible."
Check entering the fireplace-R:
instead say "The fireplace is half-filled with rubble."
The kitchen-tiles-R are plural-named scenery in the Kitchen-R. The printed name is "cracked tiles".
Understand "cracked", "askew", "tile", "tiles", "floor" as the kitchen-tiles-R.
The description is "This place must have seen a lot of cooking. Possibly with big iron pots and clumsy chefs."
Check taking the kitchen-tiles-R:
instead say "Leave the tiles alone."
Check pushing the kitchen-tiles-R:
instead try taking the kitchen-tiles-R.
Check pulling the kitchen-tiles-R:
instead try taking the kitchen-tiles-R.
The Kitchen-V is a room. The printed name is "Kitchen".
The Kitchen-V is verso.
The description of the Kitchen-V is "This will probably be a kitchen someday. Right now it's just stacks of tiles and dressed stone, and a squared-off corner for the fireplace.[para]You see a narrow opening to the [loc north] and [if the cork-door-V is closed]a closed[else]an open[end if] corkwood door to the [loc east]."
The view-image of the Kitchen-V is "the fireplace hasn't yet been built".
The kitchen-tiles-V are plural-named scenery in the Kitchen-V. The printed name is "tiles".
Understand "tile", "tiles", "masonry", "stone", "stones", "dressed" as the kitchen-tiles-V.
The description is "Stones and tiles are stacked everywhere."
Check taking the kitchen-tiles-V:
instead say "Leave the tiles alone."
Check pushing the kitchen-tiles-V:
instead try taking the kitchen-tiles-V.
Check pulling the kitchen-tiles-V:
instead try taking the kitchen-tiles-V.
The fireplace-V is scenery in the Kitchen-V. The printed name is "fireplace".
Understand "fireplace", "corner" as the fireplace-V.
The description is "There is no fireplace yet."
Check entering the fireplace-V:
instead say "It's just an empty corner of the room right now."
The Wine-Nook-R is a room. The printed name is "Wine Nook".
The Wine-Nook-R is recto.
The counterpart of the Wine-Nook-V is the Wine-Nook-R.
The counterpart of the Wine-Nook-R is the Wine-Nook-V.
The Wine-Nook-R is east of the Kitchen-R.
The description of Wine-Nook-R is "This chamber reeks of mold and rotted grapes. Broken glass crunches stickily underfoot -- the smashed wreckage of a vast fortune in wine. The only exit is an open doorway to the [loc west]."
The view-image of the Wine-Nook-R is "smashed bottles lie everywhere".
The bottles-R are plural-named scenery in Wine-Nook-R. The printed name is "broken bottles".
Understand "broken", "smashed", "glass", "bottle", "bottles", "sticky", "wreckage", "wine", "dried", "puddle", "puddles" as the bottles-R.
The description is "Someone destroyed the contents of this wine horde with impressive thoroughness. Broken glass and long-dried puddles of wine cover the floor."
Check searching the bottles-R:
instead say "Not a single bottle remains intact."
Check taking the bottles-R:
instead say "You'd slice up your hands and probably die of noble rot."
Check touching the bottles-R:
instead try taking the bottles-R.
Check tasting the bottles-R:
instead say "You'd slice up your tongue and probably die of noble rot."
The Wine-Nook-V is a room. The printed name is "Wine Nook".
The Wine-Nook-V is verso.
The Wine-Nook-V can be ever-entered.
The description of Wine-Nook-V is "Someone plans to store a vast amount of wine here. Empty bottle-racks and niches cover the walls. The only exit is a corkwood door to the [loc west][Wine-Nook-doors]."
The view-image of the Wine-Nook-V is "the walls are covered with empty wine-racks".
To say Wine-Nook-doors:
if Wine-Nook-V is ever-entered:
say ", which is [if the cork-door-V is closed]closed[else]open[end if]";
Every turn when the location is Wine-Nook-V and Wine-Nook-V is not ever-entered:
now Wine-Nook-V is ever-entered;
now the cork-door-V is closed;
now the cork-door-V is locked;
say "You hear a faint [em]thump[/em] behind you.[para]You turn to find that the door has been slammed shut! Or as slammed as a corkwood door can be, which is not very slammed. But definitely shut. Bolted, too, you quickly discover.[para]Great.";
The ball is in Wine-Nook-V.
The cork-door-V is a bolting-door. The printed name is "cork door".
The open-side is the Kitchen-V.
The cork-door-V is unlocked.
Understand "cork", "corkwood", "padded" as the cork-door-V.
The cork-door-V is west of the Wine-Nook-V and east of Kitchen-V.
The description is "The [doorloc cork-door-V] door is padded with corkwood. For silence, no doubt, but why? It [if the cork-door-V is closed]is closed[else]stands open[end if]."
Check touching the cork-door-V:
instead say "The cork is pleasantly soft and dry."
Check listening to the cork-door-V:
instead say "You can hear nothing through the cork[first time]. But then the house has been quiet all along[only]."
The racks-V are plural-named scenery in the Wine-Nook-V. The printed name is "wine racks".
Understand "rack", "racks", "niche", "niches", "wine", "bottle", "bottles", "bottle-racks" as the racks-V.
The description is "All the wine racks are empty[first time]. Inevitable, and yet still disappointing[only]."
Chapter - Debugging - not for release
[When play begins:
move the player to Library-R, without printing a room description.]
The wand is a thing.
Zap-dooring is an action out of world.
Understand "zap-door" or "zap-doors" or "zap door" or "zap doors" as zap-dooring.
Carry out zap-dooring:
now all doors are unlocked;
say "All doors unlocked."
Zap-flipping is an action out of world.
Understand "zap-flip" or "zap flip" as zap-flipping.
Carry out zap-flipping:
let R be the counterpart of the location;
if R is no-room:
say "(No counterpart.)";
else:
say "(Flipping sides.)";
transfer mirror;
if the player does not carry the gold-key:
invert key;
now the player is in R;
Zap-dir-inverting is an action out of world applying to one thing.
Understand "zap [direction]" as zap-dir-inverting.
Carry out zap-dir-inverting:
if the noun is east or the noun is west:
invert EW;
else if the noun is north or the noun is south:
invert NS;
else:
say "That's not an invertible axis.";
say "NS is [world-NS]; EW is [world-EW].";
Understand "zap show" or "zap-show" as a mistake ("NS is [world-NS]; EW is [world-EW]; world is [if world is inverted]inverted[else]normal[end if]; key is [if gold-key is recto]normal[else]inverted[end if].").
Zap-verifying is an action out of world.
Understand "zap-verify" or "zap verify" as zap-verifying.
Carry out zap-verifying:
repeat with R running through rooms:
let R2 be the counterpart of R;
if R2 is not no-room:
if the counterpart of R2 is not R:
say "BUG: [R] does not pair with [R2].";
if R is recto and R2 is recto:
say "BUG: [R] and [R2] are both recto.";
if R is verso and R2 is verso:
say "BUG: [R] and [R2] are both verso.";
repeat with F running through frames:
let F2 be the counterpart of F;
if the counterpart of F2 is not F:
say "BUG: [F] does not pair with [F2].";
if the basedir of F is not the basedir of F2:
say "BUG: dir [F] does not pair with dir [F2].";
let R be the location of F;
let R2 be the location of F2;
if the counterpart of R2 is not R:
say "BUG: loc [F] does not pair with loc [F2].";
say "Parity verified.";