Cragne Manor room SPO4: Backwater Public Library (Carl Muckenhoupt)

This file is part of the Cragne Manor source code collection. Posted with the author's permission. All rights reserved.


"Cragne Manor SPO4 Test"
 
Chapter 1 - Do Not Change Any Of This
 
Include Cragne Suite by Ryan Veeder.
Include Object Response Tests by Juhana Leinonen.
 
 
[Don't mess with other people's rooms!]
 
SPO is a region.
 
SPO4 is a room in SPO. SPO4 is east of SPO2.
 
Part 1 - SPO4 Public Library
 
[The player's goal in this room is to gain access to the grimoire in the display case.
To do this, you need to do three things:
    Show the librarian Peter's library card;
    Return all the library books Peter has checked out;
    Indicate interest in the grimoire by either pointing at it or trying various actions with the case.
These can be done in any order. If I had been smarter about things, there would be one centralized piece of code that handles all the checks, but instead the logic is repeated under various verb handlers. Oh well. Not changing it now.]
 
Test SPO4 with "purloin all library books / put all library books on counter / get jacket / give card to librarian / point at case / get grimoire / read grimoire".
 
Chapter 1 - The Room
 
Section 1 - Basics
 
Printed name of SPO4 is "Backwater Public Library (Carl Muckenhoupt)".
 
Description of SPO4 is "This is unusually spacious for a small-town library. You think you remember something about it being a national historical site? That would explain the decor, at least. It's half rustic colonial, half modern budget-strapped public service, with a meager collection of creaky shelves standing in the middle of an old plank floor. A small display case stands prominently near the entrance, and some weird chairs are scattered around for the comfort of the patrons, none of whom are here at the moment. The sole exit is back to the west."
 
Instead of going nowhere from SPO4, say "The only exit is to the west."
 
Commentary of SPO4 is "The library is the endpoint of one of Cragne Manor's major puzzle tracks, so its main puzzle was laid out in advance by the project's organizers. Beyond that, the specifics of the room largely flow from my laziness. I didn't want to bother implementing dialogue, so I made a librarian who insists on silence. That's a pretty unrealistic stereotype in my experience, so I decided the librarian isn't real. That reminded me of the mute man from Lovecraft's [italic type]The Festival[roman type], so it's possible to find a minor call-out to that here. I'm not entirely sure what she really is. Possibly some kind of octopus. Definitely not a librarian, anyway.[paragraph break]And what sort of library does a fake librarian tend? Not a good one. I've tried to make an extreme contrast to the temple-of-knowledge atmosphere of the university library in [italic type]Anchorhead[roman type], and I'm a little worried that actual librarians will take offense at the result. Even the grimoire, the one useful book in the entire place, is the work of a crackpot.[paragraph break]The title of the grimoire, [italic type]De Vermibus Laceris[roman type], literally 'of cut worms', is based on the name 'Verlac' from Anchorhead, by way of [italic type]De Vermis Mysteriis[roman type] from Cthulhu Mythos lore. Thanks to Emily Short for help with the Latin.[paragraph break]Yes, there really was a major earthquake in New Hampshire, estimated magnitude 6.5-7.0, the same year that the Massachusetts Bay Colony got its first printing press. This is the sort of coincidence that isn't even really a coincidence; it's just two completely unrelated facts, and I'm engaging in a sort of sleight of hand when I imply a connection.[paragraph break]Room tested by Chris Conley, Michael Fessler, Jeremy Freese, Josh Giesbrecht, Lucian, Daniel Ravipinto, Ivan Roth, Andrew Schultz, Sean M. Shore, @ToffleToft, and Greg Travis."
 
The baf-room is scenery in SPO4. Printed name of baf-room is "library". Understand "room/backwater/public/library/old/plank/floor/exit/creaky/floorboards/rustic/colonial/decor" as baf-room.
Instead of examining baf-room, try looking.
Instead of searching baf-room, try looking.
 
[To disambiguate "library" when library books are present:]
Does the player mean examining baf-room: it is very likely.
Does the player mean searching baf-room: it is very likely.
 
The baf-sign is scenery in SPO4. Printed name of baf-sign is "sign". Understand "sign" as baf-sign.
Description of baf-sign is "QUIET PLEASE".
The baf-counter is an enterable scenery supporter in SPO4. Printed name of baf-counter is "counter". Understand "counter/desk/circulation/simple/slab/wood/veneer/wood-veneer" as baf-counter.
Description of baf-counter is "Just a simple wood-veneer slab with a large version of the library insignia painted on. There's a sign mounted on it, and a small cart stands to one side."
Instead of entering baf-counter when baf-librarian is in SPO4, say "The librarian shoos you away indignantly."
Instead of climbing baf-counter, try entering baf-counter.
Instead of looking under baf-counter:
    if baf-librarian is in SPO4:
        say "The librarian shoos you away and points toward the bookshelves.";
    otherwise:
        say "You see no sign of the librarian's equipment."
Understand "look behind [something]" as looking under when the location is SPO4.
 
A baf-cart is scenery supporter in SPO4. Printed name of baf-cart is "cart". Understand "cart" as baf-cart.
Description of baf-cart is "A rusty-wheeled little convenience with bright floral contact paper wrapped around its carrying surfaces."
Instead of pushing or pulling or turning baf-cart, say "The cart doesn't budge. The wheels are rusted solid. You start to question its practicality."
Instead of pushing baf-cart to, try pushing baf-cart.
 
Instead of examining the player when the location is SPO4:
    say "Disheveled. Exhausted. [if the player is wearing baf-wig and the player is wearing baf-dress and the player is wearing baf-mask]Disguised as a librarian. [end if]Not crying yet. Glad to be in from the cold, if only for a little while."
 
Instead of rubbing the player when the location is SPO4:
    say "It would be nice to get cleaned up, but this is not the place."
 
Instead of smelling SPO4:
    say "There's a musty odor in the room. Mildew, maybe? Some kind of fungal bloom? Not a good thing in a library."
 
instead of listening to SPO4:
    say "Absolute silence, apart from the creak of the floorboards under your feet. Even the howling wind outside seems reluctant to raise its voice here."
 
Instead of buying a book when the location is SPO4, say "It's a public library. You can read the books here for free."
 
Instead of sleeping when the location is SPO4:
    say "[one of]In your current state, sneaking a nap [if the player is not on baf-chairs]on one of those chairs [end if]seems like a good idea. You drift off...[paragraph break]...and wake up maybe an hour later, still tired and now with a crick in your neck.[or]No thanks. Not again.[stopping]".
 
Instead of jumping when the location is SPO4:
    say "The floor creaks and squeaks as you bounce up and down.";
    if baf-librarian is in SPO4:
        try baf getting shushed for the player.
 
A library book can be baf-returned or baf-unreturned. A library book is usually baf-unreturned.
 
Section 2 - Bookshelves
 
The baf-shelves is an ambiguously plural scenery book in SPO4. Printed name of baf-shelves is "bookshelf". Understand "shelf/shelves/bookshelf/bookshelves/bookcase/bookcases/stack/stacks/book/books/from/creaky" as baf-shelves.
Description of baf-shelves is "The books don't seem to be in any particular order. You can browse if you like, but good luck finding anything specific."
 
Instead of reading baf-shelves:
    say "[one of]You randomly pull out[or]You take from the shelf[or]You blindly pick out[or]You come across[or]Browsing, you discover[or]Something catches your eye, but it turns out to be[or]Your hand comes to rest on[or]You find[or]A cursory search turns up[at random] [baf book description]. [one of]Disappointed,[or]It doesn't seem at all relevant to your situation, so[or]You don't see how this is going to help you find Peter, so[or]You don't have time for this, so[or]With an increasing sense of futility,[or]Sighing inwardly,[or]Wondering why anyone thought it belonged here,[or]With a shake of your head,[at random] [one of]you put it back[or]you reshelve it[or]you place it back on the shelf[or]you put it back where it was[or]you return it to its place[at random]."
 
Instead of taking or searching baf-shelves, try reading baf-shelves.
Instead of consulting baf-shelves about, try reading baf-shelves.
Instead of reading baf-room, try reading baf-shelves.
 
Understand "browse [something]" as reading when the location is SPO4.
Baf browsing is an action applying to nothing. Understand "browse" as baf browsing when the location is SPO4.
Carry out baf browsing:
    Try reading baf-shelves.
 
[Keep track of the most recent books we've seen so we don't repeat too soon.]
Baf booklog is a list of numbers that varies.
 
To say baf book description:
    Let n be a random number between 1 and the number of rows in table of baf library disappointments;
    while n is listed in baf booklog:
        now n is a random number between 1 and the number of rows in table of baf library disappointments;
    truncate baf booklog to the last 5 entries;
    add n to baf booklog;
    choose row n in table of baf library disappointments;
    say "[description entry]".
 
Table of baf library disappointments
Description
"a well-chewed picture book for children"
"an obsolete computer manual"
"a collection of type-in BASIC program listings"
"a decades-old high school yearbook"
"the middle volume of a best-selling fantasy trilogy"
"the novelization of a forgotten Hollywood summer blockbuster"
"a tie-in novel for a long-canceled sci-fi show"
"a trashy paperback romance"
"a B-list celebrity's memoir"
"the manifesto of a political fringe group"
"a treatise on 18th-century agricultural techniques"
"a painfully earnest self-help book"
"a badly-damaged collection of old newspaper funnies"
"a self-published volume of mawkish poetry"
"a dense and incomprehensible book of philosophy"
"an unconvincing polemic from a utopian community"
"the autobiography of an obscure political functionary"
"an amazingly comprehensive taxonomy of knots"
"a terrible joke book"
"a crackpot's attempt at disproving well-established scientific principles"
"a slim microwave cookbook"
"an already-solved book of crossword puzzles"
"a bound collection of tabloid front pages"
"a fad diet book"
"a parody of some other book you've never heard of"
"the complete rules to an excessively complicated tabletop war game"
"an illustrated Children's Bible"
"a phrasebook for translating a language you don't know into another language you don't know"
 
Instead of smelling baf-shelves, say "The musty smell is definitely more intense over here. Oh dear."
 
Instead of climbing or entering baf-shelves:
    say "You clamber up the shelf like it's a creaky, rickety ladder. Then, with a groan, it falls backward onto you.";
    end the story saying "You have been crushed."
Instead of pushing or pulling or turning or taking baf-shelves:
    say "Grabbing the shelf awkwardly, you give it a mighty heave. It rocks briefly, then teeters back onto you.";
    end the story saying "You have been crushed."
Instead of pushing baf-shelves to, try pushing baf-shelves.
 
Instead of putting a book on baf-shelves:
    say "Best leave the reshelving to the library staff. Otherwise they won't know it's been returned."
Instead of inserting something into baf-shelves, try putting the noun on baf-shelves.
 
Section 3 - Obtaining the Library Card
 
[Peter left his library card in his jacket on one of the chairs in the library.]
 
[Separating "library card" out in the grammar so that "library" by itself doesn't match]
The baf-card is a thing. Printed name of baf-card is "library card". Understand "card" or "library card" or "peter's/cardboard/id/number/little/metal/dealy" as baf-card.
Description of baf-card is "A battered beige rectangle with rounded corners, printed with the library insignia, and bearing the words:[paragraph break][fixed letter spacing]PETER CRAGNE[line break]CRAGNE MANOR[variable letter spacing][line break][bold type]is entitled to borrow books from[line break]BACKWATER PUBLIC LIBRARY[line break]Backwater, Vermont[line break]and is responsible for all books taken on this card[line break]Expires [roman type][fixed letter spacing]APRIL 1998[line break]No 19078[variable letter spacing][paragraph break]A little metal dealy clips through the cardboard, with a mirror-reversed version of the ID number stamped into it.[one of] They really haven't upgraded their systems in a while.[or][stopping]".
 
The baf-chairs is an enterable scenery supporter in SPO4. It is ambiguously plural. Printed name of baf-chairs is "chair". Understand "chair/chairs/set/seats/weird/wooden/sculpture/sculptures/orange/vinyl/cushion/cushions/collection" as baf-chairs.
Description of baf-chairs is "A collection of tired-looking wooden sculptures with orange vinyl cushions on them."
Instead of climbing baf-chairs, try entering baf-chairs.
Instead of pushing or pulling or turning baf-chairs:
    if the player is enclosed by baf-chairs:
        say "It's difficult to move the chairs while you're sitting in one.";
    otherwise:
        say "You rearrange the chairs. [one of]That looks a little better, but you're still not satisfied.[or]No, it's even worse now.[or]Gah! The entire effect is ruined![or]Now they're back to the way they were originally.[cycling]".
Instead of pushing baf-chairs to, try pushing baf-chairs.
Does the player mean entering baf-chairs:
    it is very likely.
After entering baf-chairs, say "You hear a slow hiss as the cushion partially deflates under your weight."
 
The baf-jacket is a wearable container on baf-chairs. Printed name of baf-jacket is "fleece jacket". Understand "jacket/coat/peter's/fleece/comfy/old/elbow" as baf-jacket.
After printing the name of baf-jacket: omit contents in listing.
Initial appearance of baf-jacket is "[A baf-jacket] is draped over the back of one of the chairs.".
Description of baf-jacket is "[one of]Hey, isn't this Peter's jacket?[paragraph break]Yeah, it totally is! It's got that worn-off section on the elbow from your bike trip together. I guess he must have been in the library recently and left it there. Only... how could anyone forget their jacket in this weather?[or]Peter's comfy old fleece jacket.[stopping]".
 
Baf-card is in baf-jacket.
 
Instead of touching baf-jacket, say "The fleece is old, but it's still got some spring to it."
Instead of smelling baf-jacket, say "It smells like old sweat, crushed grass, and snow. Some people would say that snow doesn't have a smell, but that's what it smells like all the same."
 
Before examining baf-jacket:
    now the printed name of baf-jacket is "Peter's jacket";
    now baf-jacket is proper-named;
    continue the action.
 
After taking baf-jacket:
    if baf-card is handled:
        continue the action;
    otherwise:
        now the player has baf-card;
        say "A card flutters to the ground as you pick the jacket up. Almost involuntarily, you stoop and pick it up too.";
 
Section 4 - The Book List
 
[I was thinking of making this preserve the book list as it was when you first get the note, but it struck me that a dynamically-shrinking list would be useful to the player, and is well within the parameters of cosmic horror.
 
Also, I was thinking of getting the same player-helping aspect by making it preserve the whole book list and making the player automatically cross them out or put X's by them as you go. But that would have been more work, and would have produced annoying cases like "what if you return a book while the book list is in another room".
 
As an added bonus, a mysteriously-changing list will provide a built-in excuse for any books whose printed names change over the course of play.]
 
A library book has some text called the official title. The official title of a library book is usually "[the printed name]".
 
The baf-note is a thing. Printed name of baf-note is "book list". Understand "note" or "list" or "book list" or "library note" as baf-note.
Description of baf-note is "[fixed letter spacing]ATTENTION PETER CRAGNE[paragraph break][if baf-status is good]This is to notify you that you are once again in GOOD STANDING with the Backwater Public Library, and may avail yourself of all the library's services, including book removal.[otherwise]This is your notification that your status with the Backwater Public Library is DELINQUENT due to NON-RETURNAL.[line break]You are NOT PERMITTED to check out books or to access special library materials until your status is cleared.[line break][line break]To clear your status, you must return ALL books you currently have checked out:[line break][baf books remaining][end if][roman type][variable letter spacing]".
To say baf books remaining:
    repeat with B running through baf-unreturned library books:
        say "[line break][fixed letter spacing]    [italic type][official title of B]".
 
[The purpose of this bit: We want to print special messages when the player notices the contents of the list changing, to let the player know that it's deliberate. So we keep track of how long the list was the last time the player looked at it, so we can see if it's different now. The special value -1 means that there is no previous length, either because this is the first time we've looked at the note, or because the list was cleared the last time we looked at it.]
The baf-note has a number called book-count. The book-count of baf-note is -1.
After examining baf-note:
    if baf-status is good:
        if the book-count of baf-note is not -1:
            say "That's definitely not what it said before. Something weird is going on, but at least it's an improvement.";
        now the book-count of baf-note is -1;
    otherwise:
        let count be the number of baf-unreturned library books;
        if count is less than the book-count of baf-note:
            say "[one of]...Huh, you could have sworn that the list was longer before.[or]There! It changed again! Weird.[or]By now, you're used to seeing the list shrink dynamically.[or][stopping]";
        now the book-count of baf-note is count.
 
Section 5 - The Grimoire
 
The baf-case is a locked transparent scenery container in SPO4. Printed name of baf-case is "display case". Understand "display/case/small/stand/glass" as baf-case.
Instead of attacking or cutting baf-case:
    say "A hollow 'SMAT!' sound echoes around the room, but the case isn't even scratched.";
    if baf-librarian is in SPO4:
        try baf getting shushed for the player.
 
The baf-plaque is in baf-case. It is fixed in place. Printed name of baf-plaque is "plaque". Understand "plaque" as baf-plaque.
Description of baf-plaque is "DE VERMIBUS LACERIS[paragraph break]In 1630, the eccentric scholar and polymath Henry Danton Gules came to America to study the superstitions of the Abenaki people, who he was convinced held 'the secrets of the earth'. He spent much of the next eight years living among them, learning their language and folklore. Or so he claimed; his accounts of his experiences range from the highly exaggerated to the outright fabricated.[paragraph break][italic type]'The native storytellers have shown me wondrous things. Under the mountains are caverns without limit, where great beasts roam, and feed upon the buried dead...'[roman type][line break](Letter from Gules to a colleague)[paragraph break]During this time, he wrote two books, under the pseudonym 'Azban' (a trickster figure from Abenaki legend). One, now lost, was a text on a language that he called 'Adamic', which he claimed was the original language spoken before the fall of the Tower of Babel. The other, displayed here, is [italic type]De Vermibus Laceris[roman type], which he described as 'completing the known principles of ritual magic by reuniting them with the forgotten wisdom of the ancients'. Most of the book is written in a mix of Latin and English, but some of the more theoretical passages, including several entire chapters, are in Adamic, and have not been translated.[paragraph break]In order to publish these books, Gules helped to finance the first printing press in New England in 1638. However, he never saw them printed, due to his disappearance in the great New Hampshire earthquake later that year. The few copies that had been made were declared 'blasphemous' by Massachusetts Bay Colony governor John Winthrop, who ordered them destroyed. It was believed that no copies survived until 1986, when the volume displayed here was discovered concealed in a wall of the Backwater Public Library during renovations. "
 
The baf-grimoire is a book in baf-case. Printed name of baf-grimoire is "big black book". Understand "grimoire/massive/tome/big/black/de/vermibus/laceris/leather/ragged/badly/decayed/badly-decayed/page/pages" as baf-grimoire.
Description of baf-grimoire is "A massive tome, with ragged pages bound in badly-decayed black leather[if baf-grimoire is in baf-case], laid open on a stand.[otherwise]. You can just make out the words 'DE VERMIBUS LACERIS' embossed on the cover, and 'Azban' underneath that in smaller type."
Passage of baf-grimoire is "[if baf-grimoire is in baf-case][jj grimoire in the case][otherwise][jj grimoire free]".
 
To baf identify the grimoire:
    now the printed name of baf-grimoire is "De Vermibus Laceris";
    now baf-grimoire is proper-named.
 
After examining baf-grimoire when baf-grimoire is not in baf-case:
    baf identify the grimoire.
 
After examining baf-plaque:
    baf identify the grimoire.
 
Instead of reading baf-grimoire when baf-grimoire is in baf-case and baf-case is closed:
    say [passage of the noun][line break];
 
After inserting baf-grimoire into baf-case:
    say "It automatically falls open as you place it back on the stand."
 
Instead of turning baf-grimoire:
    say "You don't have to turn the pages explicitly. Just reading it will turn the pages as necessary[if baf-grimoire is in baf-case], once you get it out of the display case[end if]."
 
Instead of putting something on baf-case, try inserting the noun into baf-case instead.
 
Instead of rubbing or touching baf-grimoire, say "The centuries-old leather crumbles a little more at your touch."
 
Chapter 2 - The Librarian
 
Section 1 - Basics
 
To decide if baf-status is good:
    if baf-librarian is finished receiving books, decide on true;
    decide on false.
 
The baf-librarian is a woman in SPO4. Printed name of baf-librarian is "librarian". Understand "librarian/woman/dress/hair/grey/gray/slate-grey/slate-gray/slate/finger/fingers/hand/hands" as baf-librarian.
"A librarian stands behind a counter."
Description of baf-librarian is "An old woman with severe features, primly dressed, with slate-gray hair tied up in a bun. She's almost a caricature, and seems as antique as the building."
Baf-librarian can be waiting for card or waiting for books. Baf-librarian is waiting for card.
Baf-librarian can be knowing your intent. Baf-librarian is not knowing your intent.
Baf-librarian can be finished receiving books. Baf-librarian is not finished receiving books.
 
Instead of smelling baf-librarian, say "A gingerly sniff reveals an unexpected unpleasant smell, like expired turmeric, partly masked by flowery perfume."
Instead of listening to baf-librarian, say "She's absolutely silent. You can't even hear her breathing."
 
Section 2 - Barks
 
[The "mentioned" flag should help us skip the random messages about the librarian when she's already the focus of your attention for the turn, although it doesn't work as consistently as I had hoped.]
 
Every turn while the location is SPO4 and baf-librarian is in SPO4:
    repeat with b running through baf-returned library books:
        if the player has b:
            now b is in baf-cart;
            say "You put [b] back on the cart.";
        otherwise:
            if b is not enclosed by baf-cart:
                now b is in baf-cart;
                now baf-librarian is mentioned;
                say "The librarian huffily puts [b] back on the cart.";
    if baf-librarian is not mentioned and the noun is not baf-librarian and the second noun is not baf-librarian:
        if baf-case is locked and baf-librarian is not waiting for card and baf-status is good:
            [Emergency help for players who have returned all the books but haven't worked out that they need to indicate interest in the grimoire. Do this *frequently*.]
            say "[one of]The librarian waits for you to show some indication of what you want.[or]The librarian fetches [baf book description] from the shelves and points at it, looking for a reaction.[or]The librarian points at the chairs and shrugs expectantly[or]The librarian seems to want you to do something.[or]The librarian points at the shelves in general, as if to indicate the vast choice of reading matter available to you.[or]You get the impression that the librarian is eager to serve you, but doesn't know how.[at random]";
        otherwise:
            if a random chance of 1 in 3 succeeds:
                say "[one of]The librarian sorts some books[or]The librarian fusses about behind the counter[or]The librarian stamps something[or]The librarian disappears between the shelves for a bit, then returns[or]The librarian looks at you[or]The librarian catches your eye and points at the bookshelves[or]The librarian nods at you curtly[at random]. [one of][line break][or]There's something odd about the way she moves. You can't quite put your finger on it.[or][line break][or]There's something eerie about how quietly she moves about the library. You can hardly take a step without a floorboard creaking. It's like she weighs nothing.[or][line break][or]It really seems like she doesn't blink enough. Or at all.[or][line break][or][line break][or]You hadn't noticed before, but she doesn't ever seem to move her fingers. Her left hand is permanently in a pointing position, three fingers curled back. Her right is like a puppet's. She's probably a stroke survivor or something. You try not to stare.[or][line break][stopping]".
 
Section 3 - Pointing
 
Baf pointing is an action applying to one visible thing.
Understand "point at/to/toward [something]" as baf pointing when the location is SPO4.
Understand "gesture at/to/toward [something]" as baf pointing when the location is SPO4.
Understand "wave at/to/toward [something]" as baf pointing when the location is SPO4.
Understand "indicate [something]" as baf pointing when the location is SPO4.
Carry out baf pointing:
    say "This accomplishes nothing."
Before baf pointing when baf-librarian is in SPO4:
    now baf-librarian is mentioned;
    continue the action.
 
Instead of baf pointing when baf-librarian is in SPO4:
    say "[one of]The librarian looks at [if the noun is the player]you[otherwise][the noun], then looks back at you[end if] in incomprehension[or]The librarian is unimpressed[or]The librarian folds her arms[or]The librarian pointedly ignores [regarding the noun][them][at random]."
 
Instead of baf pointing baf-librarian when baf-librarian is in SPO4:
    say "[one of]She steps back as if startled.[or]She nods back at you.[or]You have her attention.[at random]"
 
Instead of baf pointing a book when baf-librarian is in SPO4:
    say "The librarian peers at [regarding the noun][them], then shakes her head."
 
Instead of baf pointing baf-grimoire when baf-librarian is in SPO4:
    if baf-grimoire is in baf-case:
        try baf pointing baf-case instead;
    otherwise:
        say "The librarian nods and waves her hands in front of her."
 
Instead of baf pointing baf-plaque when baf-librarian is in SPO4:
    try baf pointing baf-case instead.
 
Instead of baf pointing a library book when baf-librarian is in SPO4:
    say "The librarian nods and holds out her hand."
 
Instead of baf pointing baf-shelves when baf-librarian is in SPO4:
    say "The librarian nods and waves you towards the shelves."
 
Instead of baf pointing baf-case when baf-librarian is in SPO4:
    if baf-case is unlocked:
        say "The librarian glances up briefly, then shrugs and goes back to what she was doing.";
    otherwise:
        if baf-librarian is waiting for card:
            if baf-librarian is knowing your intent:
                say "The librarian holds out her hand again, expectantly.";
            otherwise:
                say "The librarian looks at the case, then looks back at you, then shrugs and holds out a hand, palm up, as if to receive something.";
        otherwise:
            if baf-status is good:
                say "The librarian nods in understanding. She comes out from behind the counter and unlocks the display case for you.";
                now baf-case is unlocked;
                now baf-case is open;
            otherwise:
                if baf-librarian is knowing your intent:
                    say "The librarian points at ";
                otherwise:
                    say "The librarian looks at the case, then looks back at you, then shrugs and points at ";
                if baf-note is in SPO4 or baf-note is held by the player:
                    say "the book list she gave you earlier. Then she waves you away.";
                otherwise:
                    say "you and then at the circulation desk, and then waves you away.";
    now baf-librarian is knowing your intent.
 
Instead of baf pointing something lit when baf-librarian is in SPO4:
    say "[regarding the noun]The librarian gazes into [their] light without blinking."
 
Section 4 - Shushing
 
[A special fake action to apply when the player tries talking in the presence of the librarian.]
Baf getting shushed for is an action applying to one thing. [The noun is the being you were addressing when shushed.]
Carry out baf getting shushed for:
    now baf-librarian is mentioned;
    say "[one of]With whip-like speed, [if the noun is baf-librarian]she[otherwise]the librarian[end if] raises a finger to her lips and shushes you vigorously, then points at a sign on the counter.[paragraph break]You glance around. There's no one around who you could possibly be disturbing[or][if the noun is baf-librarian]She[otherwise]The librarian[end if] shushes you again and taps on the sign with a fingernail, then points at you and then at the bookshelves in the middle of the room[or][if the noun is baf-librarian]She[otherwise]The librarian[end if] shushes you again, sharply. It's a little strange how she doesn't purse her lips when she does that. She basically just holds a finger to her mouth and blows around it[or][if the noun is baf-librarian]She[otherwise]The librarian[end if] shushes you[stopping]."
 
Instead of conversing when the location is SPO4 and baf-librarian is in SPO4, try baf getting shushed for the noun.
Instead of saying hello to when the location is SPO4 and baf-librarian is in SPO4 and the greeting type is explicit, try baf getting shushed for the noun.
Instead of saying goodbye to when the location is SPO4 and baf-librarian is in SPO4 and the farewell type is explicit, try baf getting shushed for the noun.
Instead of hailing when the location is SPO4 and baf-librarian is in SPO4, try baf getting shushed for the player.
Instead of leavetaking when the location is SPO4 and baf-librarian is in SPO4, try baf getting shushed for the player.
Instead of asking somebody to try doing something when the location is SPO4 and baf-librarian is in SPO4, try baf getting shushed for the person asked.
 
[Turnabout is fair play]
Baf shushing is an action applying to one thing. Understand "shush [something]" as baf shushing when the location is SPO4.
Carry out baf shushing:
    say "[The noun] doesn't react."
Instead of baf shushing baf-librarian:
    say "[one of]She immediately shushes you back, longer and more energetically. Good lord she's got a good set of lungs[or]You're not challenging her to another shush fight. There's only so much humiliation you can take[stopping]."
 
 
Section 5 - Giving
 
Instead of giving something to baf-librarian, say "She refuses [regarding the noun][them] with a gesture."
Instead of giving baf-card to baf-librarian when baf-librarian is waiting for card:
    now baf-librarian is waiting for books;
    say "She takes the card from you and fusses with some machinery behind the counter. ";
    if baf-status is good:
        say "You hear a beep. The librarian nods with satisfaction, then ";
        if baf-librarian is knowing your intent:
            say "gives you back the card, comes out from behind the counter, and unlocks the display case for you.";
            now baf-case is unlocked;
            now baf-case is open;
        otherwise:
            say "gives you back the card and regards you inquisitively.";
    otherwise:
        now the player has baf-note;
         say "You hear the buzz of a dot-matrix printer, and then she gives you back the card along with a note."
 
Instead of giving baf-card to baf-librarian when baf-librarian is waiting for books:
    if baf-case is unlocked:
        say "She shrugs.";
    otherwise if baf-note is held by the player:
        say "She nods brusquely and gestures at the note she gave you earlier.";
    otherwise:
        say "Having already accepted the card, she just nods and stands waiting for you to indicate what you want."
 
Instead of giving a book to baf-librarian, say "She gently takes it, glances at it, and hands it back."
 
Baf book returning is an action applying to one thing.
Carry out baf book returning:
    now the noun is in baf-cart;
    now the noun is baf-returned;
    if the all the library books are baf-returned:
        now baf-librarian is finished receiving books;
        now the printed name of baf-note is "library note";
        say "Klonk-klonk. The librarian puts it on the cart, then ";
        if baf-librarian is waiting for card:
            say "turns back to you expectantly.";
        otherwise if baf-librarian is knowing your intent:
            say "comes out from behind the counter and unlocks the display case for you.";
            now baf-case is unlocked;
            now baf-case is open;
        otherwise: [You've given her the card but haven't pointed at the display case]
            say "points at various features of the library, waves her hands, and shrugs.";
    otherwise:
        say "[one of]She does something with it behind the counter that makes 'klonk-klonk' noise, then puts it on a cart for later reshelving.[or]Klonk-klonk. On the cart it goes.[or]Klonk-klonk.[stopping]".
 
Instead of giving a held library book to baf-librarian, try baf book returning the noun.
Understand "return [something preferably held] to [someone]" as giving it to when the location is SPO4.
Instead of showing something to baf-librarian, try giving the noun to baf-librarian.
Instead of throwing something at baf-librarian, try giving the noun to baf-librarian.
Instead of waving something when the location is SPO4 and baf-librarian is in SPO4:
    say "The librarian notices you waving [them]. ";
    try giving the noun to baf-librarian.
After putting a book on baf-counter while baf-librarian is in SPO4:
    say "[regarding the noun]The librarian picks [them] up, examines [them], and hands [them] back to you."
After putting a library book on baf-counter while baf-librarian is in SPO4:
    say "The librarian picks it up. ";
    try baf book returning the noun.
 
After putting something on baf-cart while baf-librarian is in SPO4:
    say "[regarding the noun]The librarian indignantly picks [the noun] off the cart and returns [them] to you."
After putting a library book on baf-cart while baf-librarian is in SPO4:
    say "The librarian indignantly picks [the noun] off the cart, then notices the library insignia. ";
    try baf book returning the noun.
 
Section 6 - Other Verbs
 
Instead of attacking or cutting or burning baf-librarian:
    say "You try. She moves incredibly fast for someone of her apparent age, flash-stepping up to you, grabbing your wrists, and squeezing hard. Looking down, you notice that she isn't using her hands. Her arms are wrapped around yours like a pair of snakes. You wonder if you're hallucinating as you pass out from the pain...";
    end the story saying "You have died".
 
Instead of kissing or touching or rubbing or squeezing or tasting baf-librarian:
    say "Just considering it makes the hairs on the back of your neck stand up. Some uncanny queasy feeling keeps you from getting that close to her."
 
Instead of waving hands when the location is SPO4 and baf-librarian is in SPO4, say "You attract the librarian's attention."
Understand "shrug" as waving hands when the location is SPO4.
Understand "nod" as waving hands when the location is SPO4.
Understand "nod at/to [something]" as baf pointing when the location is SPO4.
 
[Some actions will let the librarian notice your interest in the case when she's paying attention to you after you return the books and show her the card.]
Baf librarian notices interest is an action applying to nothing.
Carry out baf librarian notices interest:
    if baf-case is locked and baf-status is good and baf-librarian is not waiting for card:
        now baf-librarian is knowing your intent;
        now baf-case is unlocked;
        now baf-case is open;
        now baf-librarian is mentioned;
        say "The librarian notices your interest in the display case. She pauses for a moment to consider, then shrugs, comes over, and unlocks it for you."
 
[Have to do these as an "instead" instead of an "after" when the action fails.]
Instead of opening baf-case while baf-case is locked:
    say "It seems to be locked.";
    try baf librarian notices interest.
Instead of unlocking baf-case with something while baf-case is locked:
    say "That doesn't seem to fit the lock.";
    try baf librarian notices interest.
 
After touching baf-case, try baf librarian notices interest.
After rubbing baf-case, try baf librarian notices interest.
After reading baf-grimoire, try baf librarian notices interest.
After looking under baf-case, try baf librarian notices interest.
 
[There's a mention of the librarian "tapping" the sign. Just in case:]
Understand "tap [something]" as touching when the location is SPO4.
 
Section 7 - Aftermath
 
The baf-dress is a wearable. Printed name of baf-dress is "librarian's dress". Understand "dress/librarian's/librarian/sleeves/collar" as baf-dress.
Initial appearance of baf-dress is "The librarian's dress is lying in a deflated heap on the floor. A trail of slime connects it to a vent in the wall."
Description of baf-dress is "It's a plain dark floor-length thing with long sleeves and a high collar, like something an antagonistic Victorian governess would wear."
The baf-mask is a wearable. Printed name of baf-mask is "wax mask". Understand "mask/wax/librarian's/librarian/face" as baf-mask.
Description of baf-mask is "A perfect replica of the librarian's face, molded in wax."
The baf-wig is a wearable. Printed name of baf-wig is "gray wig". Understand "wig/grey/gray/librarian's/librarian/bun/acrylic/hair" as baf-wig.
Description of baf-wig is "Gray acrylic hair bound up in a tight bun."
 
Instead of smelling baf-wig, say "It smells faintly of turmeric."
Instead of smelling baf-dress, say "It smells faintly of turmeric."
Instead of smelling baf-mask, say "It smells faintly of turmeric."
 
The baf-vent is scenery in SPO4. Printed name of baf-vent is "vent". Understand "vent" as baf-vent.
To say baf nested text vent hack: [Necessary because I7 is squeamish about nested "if" clauses in strings]
    say " A trail of slime connects it to the [if baf-dress is handled]spot on the floor where you found the dress.[otherwise]dress lying on the floor."
Description of baf-vent is "Just an ordinary heating vent, a few inches across, high on the back wall.[if baf-librarian is not in SPO4][baf nested text vent hack]".
Instead of smelling baf-vent when baf-librarian is not in SPO4, say "The air in the vent smells strongly of rotted turmeric."
Instead of opening or closing baf-vent, say "There's no vent cover."
 
The baf-slime is scenery. Printed name of baf-slime is "trail of slime". Understand "trail/of/slime/glistening/substance" as baf-slime.
Description of baf-slime is "A thin layer of some glistening substance, a few inches across, stretching from [if baf-dress is handled]the spot where you found [end if]the librarian's dress on the floor to a small vent on the wall."
Instead of smelling baf-slime, say "It smells faintly of turmeric."
Instead of touching or rubbing baf-slime, say "All you manage to do is spread it around a little. Now your fingers are slightly sticky and tingle a little."
 
 
After going from SPO4 when baf-librarian is in SPO4 and baf-case is unlocked:
    remove baf-librarian from play;
    move baf-dress to SPO4;
    move baf-mask to SPO4;
    move baf-wig to SPO4;
    move baf-slime to SPO4;
    continue the action.
 
Chapter 3 - The Insignia
 
To say library insignia:
    say "the insignia of the Backwater Public Library[one of], two back-to-back crescent moons joined by an eye looking down at an open book[or][stopping]".
To say Library insignia:
    let the result be "[library insignia]" in sentence case;
    say the result.
To say library insignia sentence:
    say "A sticker on the spine bears [library insignia]"
 
The baf-insignia is fixed in place. Printed name of baf-insignia is "library insignia".  Understand "backwater/-- public/-- library/-- insignia" as baf-insignia. Understand "insignia of/-- the/-- backwater/-- public/-- library/--" as baf-insignia. Understand "moon/moons/crescent/eye" as baf-insignia.
Description of baf-insignia is "Two back-to-back crescent moons joined by an eye looking down at an open book."
After deciding the scope of the player:
    if the player is carrying baf-card, place baf-insignia in scope;
    otherwise:
        if the player is in SPO4, place baf-insignia in scope;
        otherwise:
            if the player is carrying a library book, place baf-insignia in scope;
            otherwise:
                if a library book is in the location, place baf-insignia in scope.
 
Does the player mean doing something with baf-insignia: it is very unlikely.
 
Before doing something other than examining with baf-insignia:
    say "You can't really do anything with the insignia separately from what it's on." instead.
 
Chapter 4 - Easter Eggs
 
[If you have to cut down on stuff, this is a good candidate for deletion.]
 
Baf magic word is a kind of value. The baf magic words are xyzzy, azban, and vaadignephod.
Baf magic wording is an action applying to a baf magic word.
Understand "[baf magic word]" as baf magic wording when the location is SPO4.
Understand "say [baf magic word]" as baf magic wording when the location is SPO4.
Carry out baf magic wording:
    if baf-librarian is in SPO4:
        try baf getting shushed for the player instead;
    otherwise if baf-grimoire is visible:
        if the player carries baf-grimoire:
            if the baf magic word understood is xyzzy:
                say "[one of]A glowing apparition bearing a blue sword materializes before you, towering over the shelves. 'I am the great warrior Xyzzy, ancient foe of all cosmic horrors! How may I serve you, exalted one?'[paragraph break]Before you can reply, it turns as if distracted. 'Hold on, there's another adventurer calling on me. It never ends, does it? I'll be back in a jiffy.' With that, it vanishes.[if baf-librarian is in SPO4][paragraph break]The librarian doesn't seem to have noticed anything.[end if][or]You hear a dial tone.[stopping]";
            otherwise if the baf magic word understood is azban:
                say "[one of]You hear a soft chuckle from the shelves.[or]There it is again. A sort of chittering, high-pitched laugh. You cautiously peer between the shelves but don't see anything.[or]You intone the magic word and immediately peek between the shelves. The biggest, fattest raccoon you've ever seen is standing there, busily pulling books out and stuffing them into a sack on its back. A moment later, it notices you, startles, and scurries out of sight.[or]Nothing happens.[stopping]";
            otherwise if the baf magic word understood is vaadignephod:
                say "You feel a presence at your back, somehow close and unimaginably distant at the same time. Nonverbal thoughts force themselves on your mind: ";
                if the player is wearing baf-dress and the player is wearing baf-wig and the player is wearing baf-mask:
                    say "a sense of welcome return, and of a pomise of reward for a duty fulfilled. The presence leads you irresistably through hidden ways, until your sense of self drops away like a chrysalis.";
                    end the story saying "You have ceased to be as you were";
                otherwise:
                    say "a sense of surprise, a curiosity about your motivations in performing such a summoning. But this curiosity is brief, and soon overwhelmed by hunger.";
                    end the story saying "You were not prepared";
        otherwise if baf-grimoire is enclosed by a container (called C):
            say "You see a flash of light from [the C].";
        otherwise:
            say "There's a brilliant flash of light from [the baf-grimoire].";
    otherwise:
        say "Nothing happens. You feel like you're missing soething."
 
Chapter 6 - For Testing in Isolation - Not for release
 
Test book A is a library book in SPO2. The description is "It has the insignia of the Backwater Public Library stamped on it." The passage is "It's just a fake book provided for testing purposes."
 
Test book B is a library book in SPO2.  The description is "It has the insignia of the Backwater Public Library stamped on it." The passage is "It's just a fake book provided for testing purposes."
 
Test book C is a book in SPO2. The description is "No insignia on this one. It must not belong to the library." The passage is "It's just a fake book provided for testing purposes."
 
Test book D is a library book in SPO2.  The description is "It has the insignia of the Backwater Public Library stamped on it." The passage is "It's just a fake book provided for testing purposes."
 
The player is in SPO2. Printed name of SPO2 is "Welcome, tester!"
The description of SPO2 is "This is a test of Carl Muckenhoupt's room in the Cragne Manor project. Details of the project can be found at http://www.rcveeder.net/blog/2018/06/22/cragne-manor-an-anchorhead-tribute/ , but the gist of it is that a large number of people are collaborating on a parser IF game in the Lovecraftian cosmic horror genre, each author being responsible for the contents of one room. Carl's room, the Backwater Public Library, is to the east of here. This is just a small piece of the full game.[paragraph break]Some necessary context: You are Naomi Cragne. Your husband, Peter, is missing. In the library is something that will help you find him. You will not be apply it in this test; all I ask is that you access it. A message will indicate when you are done.[paragraph break]Throughout the rest of the game, you have been finding various books. The actual books in the finished game are not available in this test, but the test books here are a substitute.[paragraph break]Mostly what I'm looking for at this point is any remaining problems in the game logic (like if you can get it into an unwinnable state) or text formatting (extra punctuation, line breaks in strange places). If you see a default response to an action when you think it should be doing something else, that would be good to report too. To record a complete transcript of your session, type SCRIPT ON now."
 
Instead of going nowhere from SPO2, say "As I said in the room description above, the library is to the EAST."
 
Test grimoire with "get all / e / get jacket / give card / give book A / give B / give D / point at case".
 
To say jj grimoire free:
    say "(If you are seeing this text, you have completed the room's puzzles. Congratulations! Feel free to keep hunting for bugs and/or easter eggs if you want, and if you have the ability to send Carl a transcript of your session, it would be greatly appreciated. If you're playing this on the web, and you typed SCRIPT ON at the beginning, you can access your transcript by typing SAVE and then pressing the EDIT button in the upper right. Yeah it's weird but that's how it works.)".
 
To say jj grimoire in the case:
    say "The grimoire is open on a page describing peeling open the way to someone lost, whether they be in this world or not. You gather from the text that the ritual involves the horn of a black goat, as well as the subject's true star sign and their most treasured memento. How the ritual is actually performed must be further in the book.".
 
[ Joey's original grimoire text follows.
To say jj grimoire free:
    say "Now you can flick through the yellowing pages of the grimoire, you learn that to open a way to your lost husband, you must:[line break]blow the horn of the black goat,[line break]while the stars are reflecting upon the grimoire,[line break]with the stars aligned in Peter's true star sign,[line break]and his most treasured memento placed in a chalk circle,[line break]all as the grimoire is raised up and opened on the page of the ritual.[paragraph break]Only then will the way open.".
]
 
Baf-abouting is an action applying to nothing.
Carry out baf-abouting:
    say the commentary of the location.
Understand "about" as baf-abouting.
 
Release along with a website and an interpreter and the introductory booklet and an introductory postcard.