Hadean Lands: HL Mechanism

Copyright 2014-6 by Andrew Plotkin.

This source code is provided for personal, educational use only. The story and text of Hadean Lands 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.



Version 1 of HL Mechanism by Andrew Plotkin begins here.
 
[### Possible optimization hacks:
- Have a more efficient "move the player without printing a room description" call? Could skip a lot of type checks, and also the SilentlyConsiderLight() function -- at risk of our "pre-check new arrival" rulebook! But this probably isn't called a *whole* lot, even during goal-travel.
- Interpreter option to save undo state to disk, and perhaps without compression. (Have to test.)
- Can any thing-class properties be replaced by sparse (I6) properties? Or ext-object attributes?
- We run the room-visiting activity on every step of goal-travelling. (Which does not mean every single room along the way.) Maybe we can skip the activity? Or have some rules skip themselves for intermediate steps?
- Look for "x=IK2_First: x: x=x.IK2_Link" loops ("all things/everything"). Restrict to subkinds if possible.
]
 
[### perma-fate for recalling the cedar? Since there's a supply of them. May want to make this a mechanism, for other cases (beaker, mustard, ash)]
 
Use authorial modesty.
 
Chapter - Basics
 
Use American dialect.
Use the serial comma.
Use no scoring.
Use full-length room descriptions.
 
To say em -- running on:
    (- style underline; -).
To say /em -- running on:
    (- style roman; -).
 
To say bold -- running on:
    (- style bold; -).
To say /bold -- running on:
    (- style roman; -).
 
To say fixed -- running on:
    (- font off; -).
To say /fixed -- running on:
    (- font on; -).
 
To say input -- running on:
    (- glk_set_style(style_Input); -).
To say /input -- running on:
    (- glk_set_style(style_Normal); -).
 
To say sarge -- running on:
    (- style underline; -).
To say /sarge -- running on:
    (- style roman; -).
 
To say period -- running on:
    (- print "."; -).
 
To say ellipsis -- running on:
    (- print "..."; -).
 
To say question-mark -- running on:
    (- print "?"; -).
 
To say exclam-mark -- running on:
    (- print "!"; -).
 
To say quot -- running on:
    (- print "~"; -).
 
To say br -- running on:
    (- new_line; -).
 
To say para -- running on:
    (- DivideParagraphPoint(); new_line; -).
 
To say going-look-break -- running on:
    (- GoingLookBreak(); -);
 
To say parsermsg:
    say italic type;
    say bracket.
 
To say /parsermsg -- running on:
    say close bracket;
    say roman type.
 
[Implicitly within a parsermsg paragraph.] [Use a user style on iOS? Nah.]
To say excmd:
    say fixed letter spacing;
    say "'".
 
To say /excmd -- running on:
    say "'";
    say italic type.
 
To say excmd (T - text) -- running on (this is excmding text):
    say "[excmd][T][/excmd]".
 
To say TheFullRetort:
    say "[italic type]The Unanswerable Retort[roman type]".
To say Retort:
    say "[italic type]Retort[roman type]".
To say Retort's:
    say "[italic type]Retort's[roman type]".
 
To say it-them (T - thing):
    if T is the player:
        say "yourself";
    else if T is singular-named:
        say "it";
    else:
        say "them".
 
To say its-their (T - thing):
    if T is the player:
        say "your";
    else if T is singular-named:
        say "its";
    else:
        say "their".
 
To say That-Those (T - thing):
    if T is the player:
        say "You";
    else if T is singular-named:
        say "That";
    else:
        say "Those".
 
To say is-are (T - thing):
    if T is the player:
        say "are";
    else if T is singular-named:
        say "is";
    else:
        say "are".
 
To say doesn't-don't (T - thing):
    if T is the player:
        say "don't";
    else if T is singular-named:
        say "doesn't";
    else:
        say "don't".
 
To say was-were (T - thing):
    if T is the player:
        say "were";
    else if T is singular-named:
        say "was";
    else:
        say "were".
 
To say has-have (T - thing):
    if T is the player:
        say "have";
    else if T is singular-named:
        say "has";
    else:
        say "have".
 
To say has-have (N - number):
    if N is 1:
        say "has";
    else:
        say "have".
 
To say open-closed (T - thing):
    if T is open:
        say "open";
    else:
        say "closed".
 
To say objname (O - object):
    [Avoids the mentioned flag of normal name-printing. This should only be used in debug/trace messages.]
    (- @push parameter_object; parameter_object = {O}; STANDARD_NAME_PRINTING_R(); @pull parameter_object; -).
 
To say now-ever-used (O - object):
    now O is ever-used.
 
To decide whether always: (- (1) -).
 
To decide whether bool (N - word value): (- ({N}) -).
 
To really decide on nothing: (- return nothing; -).
 
To break the loop -- in loop: (- break; -).
To continue the loop -- in loop: (- continue; -).
 
To decide which number is (X - number) bitwise-or (Y - number):
    (- ({X} | {Y}) -).
To decide which number is (X - number) bitwise-and (Y - number):
    (- ({X} & {Y}) -).
 
To status cursor pos (N - number): (- VM_MoveCursorInStatusLine(1, {N}); -).
To decide what number is the status line width: (- VM_ScreenWidth() -).
 
To decide whether (T1 - thing) and (T2 - thing) are jointly (R1 - thing) and (R2 - thing):
    if T1 is R1 and T2 is R2:
        decide yes;
    if T1 is R2 and T2 is R1:
        decide yes.
 
To substitute (T1 - thing) for (T2 - thing):
    if T1 is on-stage:
        say "(BUG) Tried to substitute [the T1] for [the T2], but [the T1] is on-stage.";
        stop;
    if T2 is off-stage:
        say "(BUG) Tried to substitute [the T1] for [the T2], but [the T2] is off-stage.";
        stop;
    [We assume that all substitutions are fully known to the player. As with the retirements, we set the fate of T2 and mark it ever-seen/handled.]
    now the fate of T2 is transformed-fate;
    now the fate-object of T2 is T1;
    now T2 is ever-seen;
    now T2 is handled;
    now T1 is ever-seen;
    if T2 is part of something (called composite):
        now T1 is part of the composite;
        now T2 is off-stage;
        stop;
    if a container (called cont) contains T2:
        now cont contains T1;
        now T2 is off-stage;
        stop;
    if a supporter (called supp) supports T2:
        now supp supports T1;
        now T2 is off-stage;
        stop;
    if someone (called carr) carries T2:
        now carr carries T1;
        now T2 is off-stage;
        stop;
    if a room (called dest) contains T2:
        now T1 is in dest;
        now T2 is off-stage;
        stop;
    say "(BUG) Tried to substitute [the T1] for [the T2], but [the T2] is somewhere incomprehensible ([holder of T2]?)."
 
To decide what action name is the action-to-be:
    (- action_to_be -).
 
To decide whether the current action is notional:
    (- (action == (+ visiting action +) or (+ creating action +) or (+ recalling action +)) -).
To decide whether the action-to-be is notional:
    (- (action_to_be == (+ visiting action +) or (+ creating action +) or (+ recalling action +)) -).
 
To decide whether the current action is not notional:
    (- (~~(action == (+ visiting action +) or (+ creating action +) or (+ recalling action +))) -).
To decide whether the action-to-be is not notional:
    (- (~~(action_to_be == (+ visiting action +) or (+ creating action +) or (+ recalling action +))) -).
 
To decide whether the current action is recallish:
    (- (action == (+ recalling-all action +) or (+ recalling-formulae action +) or (+ recalling-rituals action +) or (+ recalling-tidbits action +) or (+ recalling-rooms action +) or (+ recalling-things action +) or (+ recalling-doors action +) or (+ recalling action +)) -).
 
To decide whether the current action is out-of-world:
    (- meta -).
 
To decide whether currently trying silently:
    (- keep_silent -).
 
To decide what object is the untouchable-object:
    (- untouchable_object -).
 
To decide what rulebook outcome is no-outcome: (- 0 -).
 
To clean up c_style: (- c_style = 0; -).
 
To decide whether listing tersely:
    [We want this condition to catch bucket recital, but *not* locale description paragraphs. The latter always use "brief inventory information" (PARTINV_BIT).]
    (- ((c_style & TERSE_BIT) && ~~(c_style & PARTINV_BIT)) -).
 
To decide whether listing roomily:
    (- (c_style & PARTINV_BIT) -).
 
To decide whether listing inventorily:
    (- (c_style & FULLINV_BIT) -).
 
To decide whether listing details:
    [Either roomily or inventorily.]
    (- (c_style & (PARTINV_BIT | FULLINV_BIT)) -).
 
[This selector is 1 for the iOS bound app, 2 for the Lectrote bound app, 0 for general interpreters.]
To decide whether bound-UI: (- (glk_gestalt($2200, 0)) -).
To decide whether iOS-UI: (- (glk_gestalt($2200, 0) == 1) -).
To decide whether Lectrote-UI: (- (glk_gestalt($2200, 0) == 2) -).
 
To decide what object is paranoid-object-check (N - number): (- ParanoidObjCheck({N}) -).
Include (-
! Return val if val is a valid object, otherwise 0.
[ ParanoidObjCheck val;
    if (val < Class + ((#lowest_object_number + #highest_class_number) * GOBJ_TOTAL_LENGTH))
        return 0;
    if (val > Class + ((#highest_object_number) * GOBJ_TOTAL_LENGTH))
        return 0;
    if ((val - Class) % GOBJ_TOTAL_LENGTH ~= 0)
        return 0;
    if (val->0 ~= $70)
        return 0;
    return val;
];
-).
 
 
Section - Bare-Arrays
 
A bare-array is a kind of value.
 
To clear (B - bare-array): (- barearray_clear({B}); -).
To decide what number is the limit of (B - bare-array): (- barearray_limit({B}) -).
To decide what number is the count of (B - bare-array): (- ({B})-->1 -).
To decide what object is object (N - number) of (B - bare-array): (- barearray_get({B}, {N}) -).
To change object (N - number) of (B - bare-array) to (O - object): (- barearray_set({B}, {N}, {O}); -).
To decide whether object (O - object) is listed in (B - bare-array): (- barearray_contains({B}, {O}) -).
To decide what number is the position of object (O - object) in (B - bare-array): (- barearray_find({B}, {O}) -).
To add (O - object) to (B - bare-array): (- barearray_append({B}, {O}); -).
To remove last from (B - bare-array): (- barearray_remove_last({B}); -).
 
To repeat with (loopvar - nonexisting number variable) object (objvar - existing object variable) running through (B - bare-array) begin -- end:
    (- for ({loopvar}=0 : {loopvar}<({B})-->1 && ({objvar}=barearray_get({B}, {loopvar}))+1 : {loopvar}++) -).
 
Barelist-containment relates an object (called O) to a bare-array (called B) when object O is listed in B. The verb to be barelist-in implies the barelist-containment relation.
 
To say the list of (B - bare-array):
    let N be the count of B;
    if N is zero:
        say "nothing";
    else if N is one:
        say the object 0 of B;
    else if N is two:
        say "[the object 0 of B] and [the object 1 of B]";
    else:
        repeat with index running from 0 to N - 1:
            if index is not zero:
                if index is N - 1:
                    say ", and ";
                else:
                    say ", ";
            say the object index of B;
 
Include (-
! arr-->0 is the Inform table size (fixed); arr-->1 is the current count; entries 2 through 11 (ten of them) are the potential entries. Note that the limit is (arr-->0)-1.
Array generic_barearray table 11;
 
[ barearray_clear arr;
    arr-->1 = 0;
];
[ barearray_limit arr;
    return (arr-->0) - 1;
];
[ barearray_append arr obj limit pos;
    limit = (arr-->0) - 1;
    if (arr-->1 >= limit)
        print_ret "(BUG) Bare-array append: overflowed limit of ", limit, ".";
    pos = arr-->1;
    arr-->1 = pos + 1;
    arr-->(pos+2) = obj;
];
[ barearray_remove_last arr;
    if (arr-->1 == 0) {
        print "(BUG) Bare-array remove last: array is empty.^";
        return;
    }
    arr-->1 = (arr-->1) - 1;
];
[ barearray_get arr pos;
    if (pos < 0 || pos >= arr-->1) {
        print "(BUG) Bare-array get: pos ", pos, " out of range of ", arr-->1, ".^";
        return nothing;
    }
    return arr-->(pos+2);
];
[ barearray_set arr pos val;
    if (pos < 0 || pos >= arr-->1) {
        print "(BUG) Bare-array set: pos ", pos, " out of range of ", arr-->1, ".^";
        return;
    }
    arr-->(pos+2) = val;
];
[ barearray_contains arr obj ix;
    for (ix=0 : ix<arr-->1 : ix++) {
        if (arr-->(ix+2) == obj)
            rtrue;
    }
    rfalse;
];
[ barearray_find arr obj ix;
    for (ix=0 : ix<arr-->1 : ix++) {
        if (arr-->(ix+2) == obj)
            return ix;
    }
    return -1;
];
-).
To decide what bare-array is generic-bare-array: (- generic_barearray -).
 
Include (-
! This line ensures that we have a recent I6 compiler version. (Needed for Dictionary directives later on.) The stock I6.32 compiler will choke on this.
Undef COMPLETELY_NONEXISTENT_SYMBOL;
-).
 
Section - Library Customizations
 
A room has a truth state called recall-minor. [Annexes, nooks, etc. This is a boolean property because I ran into some attribute limit. Make sparse?]
 
Does the player mean recalling a room:
    if the recall-minor of the noun is true:
        it is very unlikely;
    else:
        it is unlikely.
Does the player mean visiting a room:
    if the recall-minor of the noun is true:
        it is very unlikely;
    else:
        it is unlikely.
 
[The action goes crazy in this rulebook -- could be wearing or removing or who knows what.]
Does the player mean rule when the noun is not nothing and the noun is the second noun:
    it is very unlikely.
 
Rule for clarifying the parser's choice of a room:
    [Never print "(Nave)", etc.]
    stop.
 
The command-count is a number that varies. [Counts lines input, not turns. Blank lines are ignored, as usual.]
The command-count variable translates into I6 as "command_count".
Include (-
Global command_count = 0;
-) after "Global Variables" in "Output.i6t".
 
Include (-
[ PrintSpaces n;
    while (n > 0) {
        print "  ";   ! two spaces
        n = n - 1;
    }
];
-) instead of "PrintSpaces" in "Utilities.i6t".
 
To say indentation (N - number): (- PrintSpaces({N}); -).
 
To follow (RL - a rule) suppressing breaks:
    (- FollowRulebook({RL}, 0, true); -).
 
To follow (RL - value of kind K based rule producing a value) for (V - K) without suppressing breaks:
    (- FollowRulebook({RL}, {V}); -).
 
Include (-
[ RemoveActionMask acname match   mask at;
    at = FindAction(acname);
    if (at == 0) return;
    mask = ActionData-->(at+AD_REQUIREMENTS);
    ActionData-->(at+AD_REQUIREMENTS) = mask & (~match);
];
-).
 
To remove the carried noun requirement for (A - action name): (-
    RemoveActionMask({A}, CARRY_NOUN_ABIT);
-).
 
The namefake-something-object is a proper-named object. The printed name is "something".
The namefake-just-one-thing-object is a proper-named object. The printed name is "just one thing".
 
To say (N - action name) with direct object (T - object): (- DB_Action_Details({N}, {T}, (+ namefake-something-object +) ); -).
 
To decide what number is the number of match-list items: (- number_matched -).
To decide what object is the first match-list item: (- GetMatchedItem(0) -).
To decide what object is the second match-list item: (- GetMatchedItem(1) -).
 
Include (-
[ GetMatchedItem pos;
    if (number_matched <= pos)
        return nothing;
    return match_list-->pos;
];
-).
 
To decide what action name is the initial action match for verb-word default (N - action name): (- FirstActionMatchForWord(verb_word, {N}) -).
 
Include (-
[ FirstActionMatchForWord wd def   i syntax num_lines line_address res;
    i = DictionaryWordToVerbNum(wd);
    if (~~i)
        return def;
    syntax = (#grammar_table)-->(i+1);
    if (~~syntax)
        return def;
    num_lines = (syntax->0) - 1;
    if (~~num_lines)
        return def;
    line_address = syntax + 1;
    @aloads line_address 0 res;
    return res;
];
-).
 
To decide what number is the start of (S - snippet): (- ({S}/100) -).
To decide what number is the length of (S - snippet): (- ({S}%100) -).
To decide what snippet is snippet starting at (N - number) with length (L - number): (- (({N})*100+({L})) -).
 
To decide whether word (N - number) of the buffer is comma-like: (- (WordFrom({N}, parse) == comma_word or THEN1__WD or AND1__WD) -).
 
Include (-
[ Refers obj wnum   wd k l m;
    if (obj == 0) rfalse;
 
    #Ifdef LanguageRefers;
    k = LanguageRefers(obj,wnum); if (k >= 0) return k;
    #Endif; ! LanguageRefers
 
    k = wn; wn = wnum; wd = NextWordStopped(); wn = k;
 
    if (parser_inflection >= 256) {
        k = indirect(parser_inflection, obj, wd);
        if (k >= 0) return k;
        m = -k;
    }
    else
        m = parser_inflection;
    k = obj.&m; l = (obj.#m)/WORDSIZE-1;
    for (m=0 : m<=l : m++)
        if (wd == k-->m) rtrue;
    rfalse;
];
 
[ WordInProperty wd obj prop k l m;
    k = obj.&prop; l = (obj.#prop)/WORDSIZE-1;
    for (m=0 : m<=l : m++)
        if (wd == k-->m) rtrue;
    if (wd == 'the') rtrue;
    rfalse;
];
-) instead of "Refers" in "Parser.i6t".
 
To decide whether player consents-or-restores: (- YesOrNo(true) -).
 
Include (-
! Bonus feature: Can accept "yes", "no", or "restore" (if requested).
[ YesOrNo canrestore   i j;
    for (::) {
        #Ifdef TARGET_ZCODE;
        if (location == nothing || parent(player) == nothing) read buffer parse;
        else read buffer parse DrawStatusLine;
        j = parse->1;
        #Ifnot; ! TARGET_GLULX;
        KeyboardPrimitive(buffer, parse);
        BufferStripPunctuation();
        j = parse-->0;
        #Endif; ! TARGET_
        if (j) { ! at least one word entered
            i = parse-->1;
            if (i == YES1__WD or YES2__WD or YES3__WD) rtrue;
            if (i == NO1__WD or NO2__WD or NO3__WD) rfalse;
            if (canrestore && i == RESTORE__WD) {
                RESTORE_THE_GAME_R();
                ! If it failed, we've printed a message; skip the "please enter yes or no" line.
                print ">> ";
                continue;
            }
        }
        L__M(##Quit, 1); print "> ";
    }
];
-) instead of "Yes/No Questions" in "Parser.i6t".
 
Include (-
[ BufferStartsWithStar;
    if (num_words && WordAddress(1)->0 == '*')
        rtrue;
    rfalse;
];
 
! Returns true if any punctuation is removed.
[ BufferStripPunctuation   len ix count;
    len = buffer-->0;
    count = 0;
    for (ix=0 : ix<len : ix++) {
        if (buffer->(4+ix) == '(' or ')' or '?' or '!') {
            buffer->(4+ix) = ' ';
            count++;
        }
    }
    if (count) {
        VM_Tokenise(buffer, parse);
        players_command = 100 + WordCount();
        rtrue;
    }
    rfalse;
];
-).
 
A thing can be low-locale-priority. A thing is usually not low-locale-priority.
A thing can be prominent-scenery. A thing is usually not prominent-scenery.
A prominent-scenery thing is usually scenery. [An implication.]
 
The custom notable locale objects rule is listed instead of the standard notable locale objects rule in the for choosing notable locale objects rulebook.
For choosing notable locale objects (this is the custom notable locale objects rule):
    let the domain be the parameter-object;
    let the held item be the first thing held by the domain;
    while the held item is a thing:
        if the held item is low-locale-priority:
            set the locale priority of the held item to 7;
        else if the held item is scenery or the held item is fixed in place:
            set the locale priority of the held item to 3;
        else:
            set the locale priority of the held item to 5;
        now the held item is the next thing held after the held item;
    continue the activity.
 
[We can suppress the display-suppressing properties of scenery by making them prominent-scenery.]
The conditional don't mention scenery in room descriptions rule is listed instead of the don't mention scenery in room descriptions rule in the for printing a locale paragraph about rulebook.
For printing a locale paragraph about a thing (called the item)
    (this is the conditional don't mention scenery in room descriptions rule):
    if the item is scenery and the item is not prominent-scenery:
        set the locale priority of the item to 0;
    continue the activity.
 
[Suppress the pronoun-setting behavior of this rule.]
The pronounless describe what's on scenery supporters in room descriptions rule is listed instead of the describe what's on scenery supporters in room descriptions rule in the for printing a locale paragraph about rulebook.
For printing a locale paragraph about a thing (called the item)
    (this is the pronounless describe what's on scenery supporters in room descriptions rule):
    if the item is [not undescribed and the item is] scenery and
        the item does not enclose the player:
        if a locale-supportable thing is on the item:
            [set pronouns from the item;]
            repeat with possibility running through things on the item:
                now the possibility is marked for listing;
                if the possibility is mentioned:
                    now the possibility is not marked for listing;
            increase the locale paragraph count by 1;
            say "On [the item] ";
            list the contents of the item, as a sentence, including contents,
                giving brief inventory information, tersely, not listing
                concealed items, prefacing with is/are, listing marked items only;
            say ".[paragraph break]";
    continue the activity.
 
The set pronouns from items in room descriptions rule is not listed in any rulebook.
Include (-
    Constant MANUAL_PRONOUNS 1;
-) before "Pronoun Handling" in "Parser.i6t".
 
The roomily search containers rule is listed instead of the standard search containers rule in the report searching rulebook.
Report searching a container (this is the roomily search containers rule):
    if the noun contains a described thing which is not scenery:
        say "In [the noun] ";
        list the contents of the noun, as a sentence, tersely, not listing concealed items, prefacing with is/are, giving brief inventory information;
        say ".";
    else:
        say "[The noun] [is-are noun] empty."
 
The roomily search supporters rule is listed instead of the standard search supporters rule in the report searching rulebook.
Report searching a supporter (this is the roomily search supporters rule):
    if the noun supports a described thing which is not scenery:
        say "On [the noun] ";
        list the contents of the noun, as a sentence, tersely, not listing concealed items, prefacing with is/are, giving brief inventory information;
        say ".";
    else:
        say "There is nothing on [the noun]."
 
Check an actor exiting (this is the unconditionally convert exit into go out rule):
    let the local room be the location of the actor;
    [The Standard Rules only do this when there's an "out" exit, but we want to catch it always.]
    if the container exited from is the local room:
        convert to the going action on the outside.
The unconditionally convert exit into go out rule is listed instead of the convert exit into go out rule in the check exiting rulebook.
 
Check an actor vague-entering (this is the unconditionally convert enter into go in rule):
    convert to the going action on the inside.
 
A room has a text called the can't-go. The can't-go of a room is usually "".
 
Check an actor going (this is the property-based can't go that way rule):
    if the room gone to is nothing:
        if the door gone through is nothing:
            [stop the action with library message going action number 2 for the room gone from;]
            let C be the can't-go of the room gone from;
            if C is "":
                now C is "You can't go that way.";
            say "[C][line break]";
            stop the action;
        stop the action with library message going action number 6 for the door gone through.
The property-based can't go that way rule is listed instead of the can't go that way rule in the check going rulebook.
 
Include (-
#ifdef DEBUG;
! Exactly once, we check that found_in properties are sane.
Global MFO_sanity_check = true;
#endif;
 
! Simplify: Only loop over the I7 door and backdrop classes. Do not remove objects from play when they're not found.
! We assume that doors have the default two-room found_in property. Backdrops can have any of the usual found_in structures.
[ MoveFloatingObjects i k l m address flag;
    if (real_location == nothing) return;
 
    ! Make sure that class 7 is doors (so IK7_First/IK7_Link work).
    if (KindHierarchy-->(2*7) ~= K7_backdrop)
        print "(BUG) Class 7 is not backdrop";
 
    for (i = IK7_First; i; i = i.IK7_Link) {
        address = i.&found_in;
        if (address ~= 0 && i hasnt absent) {
            if (ZRegion(address-->0) == 2) {
                m = address-->0;
                .TestPropositionally;
                if (m.call(real_location) ~= 0) move i to real_location;
                else remove i;
            }
            else {
                k = i.#found_in;
                for (l=0 : l<k/WORDSIZE : l++) {
                    m = address-->l;
                    if (ZRegion(m) == 2) jump TestPropositionally;
                    if (m == real_location || m in real_location) {
                        if (i notin real_location) move i to real_location;
                        flag = true;
                    }
                }
                if (flag == false) { remove i; }
            }
        }
    }
 
    ! Make sure that class 4 is doors (so IK4_First/IK4_Link work).
    if (KindHierarchy-->(2*4) ~= K4_door)
        print "(BUG) Class 4 is not door";
 
    for (i = IK4_First; i; i = i.IK4_Link) {
        #ifdef DEBUG;
        if (MFO_sanity_check) {
            if (i.&found_in == 0)
                print "(BUG) Door ", (name) i, " has no found_in.";
            if (i.#found_in ~= 2*WORDSIZE)
                print "(BUG) Door ", (name) i, " has wrong size found_in.";
        }
        #endif;
        if (i has absent)
            continue;
        address = i.&found_in;
        if (address-->0 == real_location || address-->1 == real_location) {
            if (i notin real_location) move i to real_location;
        }
    }
 
    #ifdef DEBUG;
    MFO_sanity_check = false;
    #endif;
];
 
! No changes
[ MoveBackdrop bd D x address;
    if (~~(bd ofclass K7_backdrop)) return RunTimeProblem(RTP_BACKDROPONLY, bd);
    if (bd.#found_in > WORDSIZE) {
        address = bd.&found_in;
        address-->0 = D;
    } else bd.found_in = D;
    give bd ~absent;
    MoveFloatingObjects();
];
-) instead of "Floating Objects" in "WorldModel.i6t".
 
To completely suppress paragraph newlines: (- suppress_extra_newlines = 1; -).
To restore paragraph newlines: (- suppress_extra_newlines = 0; ClearParagraphing(); -).
 
Include (-
Global suppress_extra_newlines = 0;
[ DivideParagraphPoint;
    #ifdef TRACE_I7_SPACING; print "[DPP", say__p, say__pc, "]"; #endif;
    if (say__p) {
        if (suppress_extra_newlines == 0) new_line;
        say__p = 0; say__pc = say__pc | PARA_COMPLETED;
        if (say__pc & PARA_PROMPTSKIP) say__pc = say__pc - PARA_PROMPTSKIP;
        if (say__pc & PARA_SUPPRESSPROMPTSKIP) say__pc = say__pc - PARA_SUPPRESSPROMPTSKIP;
    }
    #ifdef TRACE_I7_SPACING; print "[-->", say__p, say__pc, "]"; #endif;
    say__pc = say__pc | PARA_CONTENTEXPECTED;
];
 
! The rest of this is cloned from Printing.i6t without change.
 
[ ClearParagraphing;
    say__p = 0; say__pc = 0;
];
 
[ ParaContent;
    if (say__pc & PARA_CONTENTEXPECTED) {
        say__pc = say__pc - PARA_CONTENTEXPECTED;
        say__p = 1;
    }
];
 
[ GoingLookBreak;
    if (say__pc & PARA_COMPLETED == 0) new_line;
    ClearParagraphing();
];
 
[ CommandClarificationBreak;
    new_line;
    ClearParagraphing();
];
 
[ RunParagraphOn;
    #ifdef TRACE_I7_SPACING; print "[RPO", say__p, say__pc, "]"; #endif;
    say__p = 0;
    say__pc = say__pc | PARA_PROMPTSKIP;
    say__pc = say__pc | PARA_SUPPRESSPROMPTSKIP;
];
 
[ SpecialLookSpacingBreak;
    #ifdef TRACE_I7_SPACING; print "[SLS", say__p, say__pc, "]"; #endif;
    say__p = 0;
    say__pc = say__pc | PARA_PROMPTSKIP;
];
 
[ EnsureBreakBeforePrompt;
    if ((say__p) ||
        ((say__pc & PARA_PROMPTSKIP) && ((say__pc & PARA_SUPPRESSPROMPTSKIP)==0)))
        new_line;
    ClearParagraphing();
];
 
[ PrintSingleParagraph matter;
    say__p = 1;
    say__pc = say__pc | PARA_NORULEBOOKBREAKS;
    PrintText(matter);
    DivideParagraphPoint();
    say__pc = 0;
];
-) instead of "State" in "Printing.i6t";
 
To say (something - number) in wordsth:
    (- print (LanguageNumberth) say__n=({something}); -).
 
To say (something - number) in capital words:
    (- print (CapLanguageNumber) say__n=({something}); -).
 
To say (something - number) in words cap (flag - word value):
    (- if ({flag}) print (CapLanguageNumber) say__n=({something}); else print (LanguageNumber) say__n=({something}); -).
 
Include (-
! Only covers -20 through 20, because that's all I need right now.
[ LanguageNumberth val;
    if (val == 0) {
        print "zeroth";
        return;
    }
    if (val < 0) {
        print "minus ";
        val = -val;
    }
    switch (val) {
        1: print "first";
        2: print "second";
        3: print "third";
        4: print "fourth";
        5: print "fifth";
        6: print "sixth";
        7: print "seventh";
        8: print "eighth";
        9: print "ninth";
        10: print "tenth";
        11: print "eleventh";
        12: print "twelfth";
        13: print "thirteenth";
        14: print "fourteenth";
        15: print "fifteenth";
        16: print "sixteenth";
        17: print "seventeenth";
        18: print "eighteenth";
        19: print "nineteenth";
        20: print "twentieth";
        default: print "(BUG)th";
    }
];
 
[ CapLanguageNumber val;
    if (val == 0) {
        print "Zero";
        return;
    }
    if (val < 0) {
        print "Minus ";
        LanguageNumber(-val);
        return;
    }
    switch (val) {
        1: print "One";
        2: print "Two";
        3: print "Three";
        4: print "Four";
        5: print "Five";
        6: print "Six";
        7: print "Seven";
        8: print "Eight";
        9: print "Nine";
        10: print "Ten";
        11: print "Eleven";
        12: print "Twelve";
        13: print "Thirteen";
        14: print "Fourteen";
        15: print "Fifteen";
        16: print "Sixteen";
        17: print "Seventeen";
        18: print "Eighteen";
        19: print "Nineteen";
        20: print "Twenty";
        default: print val;
    }
];
-);
 
Include (-
[ Banner;
   BeginActivity(PRINTING_BANNER_TEXT_ACT);
   if (ForActivity(PRINTING_BANNER_TEXT_ACT) == false) {
           VM_Style(HEADER_VMSTY);
        print (string) Story;
        VM_Style(NORMAL_VMSTY);
        new_line;
        print (string) Headline;
        #ifdef Story_Author;
        print " by ", (string) Story_Author;
        #endif; ! Story_Author
        new_line;
        #ifdef Story_Attribution;
        print (string) Story_Attribution;
        new_line;
        #endif; ! Story_Attribution
        VM_Describe_Release();
        print " / Inform 7 build ", (string) NI_BUILD_COUNT, " ";
        print "(I6/v"; inversion;
        !print " lib ", (string) LibRelease;
        print ") ";
        #Ifdef STRICT_MODE;
        print "S";
        #Endif; ! STRICT_MODE
        #Ifdef DEBUG;
        print "D";
        #Endif; ! DEBUG
        new_line;
    }
    EndActivity(PRINTING_BANNER_TEXT_ACT);
];
 
-) instead of "Banner" in "Printing.i6t".
 
The custom announce the story file version rule is listed instead of the announce the story file version rule in the carry out requesting the story file version rulebook.
The custom announce the story file version rule translates into I6 as "CUSTOM_STORY_FILE_VERSION_R".
 
Include (-
 
[ CUSTOM_STORY_FILE_VERSION_R ix val;
    if (actor ~= player) rfalse;
    Banner();
    print "Identification number: ";
    for (ix=6: ix <= UUID_ARRAY->0: ix++) print (char) UUID_ARRAY->ix;
    print "^";
    @gestalt 1 0 ix;
    print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100,
    ".", ix & $FF, " / ";
    val = glk_gestalt($2200, 0);  ! check bound-UI gestalt
    switch (val) {
        0: break;
        1: print "iOS app / ";
        2: print "Lectrote app / ";
        default: print "app ", val, "? / ";
    }
    @gestalt 0 0 ix;
    print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / ";
    print "Library serial number ", (string) LibSerial, "^";
    #Ifdef LanguageVersion;
    print (string) LanguageVersion, "^";
    #Endif; ! LanguageVersion
    ShowExtensionVersions();
    say__p = 1;
];
 
[ ANNOUNCE_STORY_FILE_VERSION_R;
    ! Never called, but it has to be defined.
];
 
-) instead of "Announce Story File Version Rule" in "Glulx.i6t".
 
Include (-
[ SWITCH_TRANSCRIPT_ON_R;
    if (actor ~= player) rfalse;
    if (gg_scriptstr ~= 0) return GL__M(##ScriptOn, 1);
    .S2Failed;
    if (gg_scriptfref == 0) {
        gg_scriptfref = glk_fileref_create_by_prompt($102, $05, GG_SCRIPTFREF_ROCK);
        if (gg_scriptfref == 0) jump S1Failed;
    }
    ! stream_open_file
    gg_scriptstr = glk_stream_open_file(gg_scriptfref, $05, GG_SCRIPTSTR_ROCK);
    if (gg_scriptstr == 0) {
        ! Could not open selected file; select again
        glk_fileref_destroy(gg_scriptfref);
        gg_scriptfref = 0;
        jump S2Failed;
    }
    glk_window_set_echo_stream(gg_mainwin, gg_scriptstr);
    GL__M(##ScriptOn, 2);
    VersionSub();
    return;
    .S1Failed;
    GL__M(##ScriptOn, 3);
];
-) instead of "Switch Transcript On Rule" in "Glulx.i6t".
 
Include (-
Global wn_at_upto_pe = 0; ! saves wn when we generate UPTO_PE
-) before "Parser.i6t".
 
[This chunk has a couple of tiny changes:
    - The Examine action bails out at the first multi-object error ("can't use multiple objects error"), instead of continuing to later grammar lines. This works around the obscure bug where "examine impets" throws an "noun did not make sense in that context error" instead of the multi-objects one.
    - When the UPTO_PE ("only understood as far as...") error occurs, we save the current value of wn in a global. This is necessary for printing a verbose parser error.
]
Include (-
        for (pcount=1 : : pcount++) {
            pattern-->pcount = PATTERN_NULL; scope_token = 0;
 
            token = line_token-->(pcount-1);
            lookahead = line_token-->pcount;
 
            #Ifdef DEBUG;
            if (parser_trace >= 2)
                print " [line ", line, " token ", pcount, " word ", wn, " : ", (DebugToken) token,
                  "]^";
            #Endif; ! DEBUG
 
            if (token ~= ENDIT_TOKEN) {
                scope_reason = PARSING_REASON;
                AnalyseToken(token);
 
                l = ParseToken(found_ttype, found_tdata, pcount-1, token);
                while ((l >= GPR_NOUN) && (l < -1)) l = ParseToken(ELEMENTARY_TT, l + 256);
                scope_reason = PARSING_REASON;
 
                if (l == GPR_PREPOSITION) {
                    if (found_ttype~=PREPOSITION_TT && (found_ttype~=ELEMENTARY_TT ||
                        found_tdata~=TOPIC_TOKEN)) params_wanted--;
                    l = true;
                }
                else
                    if (l < 0) l = false;
                    else
                        if (l ~= GPR_REPARSE) {
                            if (l == GPR_NUMBER) {
                                if (nsns == 0) special_number1 = parsed_number;
                                else special_number2 = parsed_number;
                                nsns++; l = 1;
                            }
                            if (l == GPR_MULTIPLE) l = 0;
                            parser_results-->(parameters+INP1_PRES) = l;
                            parameters++;
                            pattern-->pcount = l;
                            l = true;
                        }
 
                #Ifdef DEBUG;
                if (parser_trace >= 3) {
                    print "  [token resulted in ";
                    if (l == REPARSE_CODE) print "re-parse request]^";
                    if (l == 0) print "failure with error type ", etype, "]^";
                    if (l == 1) print "success]^";
                }
                #Endif; ! DEBUG
 
                if (l == REPARSE_CODE) jump ReParse;
                if (l == false) break;
            }
            else {
 
                ! If the player has entered enough already but there's still
                ! text to wade through: store the pattern away so as to be able to produce
                ! a decent error message if this turns out to be the best we ever manage,
                ! and in the mean time give up on this line
 
                ! However, if the superfluous text begins with a comma or "then" then
                ! take that to be the start of another instruction
 
                if (wn <= num_words) {
                    l = NextWord();
                    if (l == THEN1__WD or THEN2__WD or THEN3__WD or comma_word) {
                        held_back_mode = 1; hb_wn = wn-1;
                    }
                    else {
                        for (m=0 : m<32 : m++) pattern2-->m = pattern-->m;
                        pcount2 = pcount;
                        wn_at_upto_pe = wn; ! --ZARF: save wn value
                        etype = UPTO_PE;
                        break;
                    }
                }
 
                ! Now, we may need to revise the multiple object because of the single one
                ! we now know (but didn't when the list was drawn up).
 
                if (parameters >= 1 && parser_results-->INP1_PRES == 0) {
                    l = ReviseMulti(parser_results-->INP2_PRES);
                    if (l ~= 0) { etype = l; parser_results-->ACTION_PRES = action_to_be; break; }
                }
                if (parameters >= 2 && parser_results-->INP2_PRES == 0) {
                    l = ReviseMulti(parser_results-->INP1_PRES);
                    if (l ~= 0) { etype = l; break; }
                }
 
                ! To trap the case of "take all" inferring only "yourself" when absolutely
                ! nothing else is in the vicinity...
 
                if (take_all_rule == 2 && parser_results-->INP1_PRES == actor) {
                    best_etype = NOTHING_PE;
                    jump GiveError;
                }
 
                #Ifdef DEBUG;
                if (parser_trace >= 1) print "[Line successfully parsed]^";
                #Endif; ! DEBUG
 
                ! The line has successfully matched the text.  Declare the input error-free...
 
                oops_from = 0;
 
                ! ...explain any inferences made (using the pattern)...
 
                if (inferfrom ~= 0) {
                    PrintInferredCommand(inferfrom);
                    ClearParagraphing();
                }
 
                ! ...copy the action number, and the number of parameters...
 
                parser_results-->ACTION_PRES = action_to_be;
                parser_results-->NO_INPS_PRES = parameters;
 
                ! ...reverse first and second parameters if need be...
 
                if (action_reversed && parameters == 2) {
                    i = parser_results-->INP1_PRES;
                    parser_results-->INP1_PRES = parser_results-->INP2_PRES;
                    parser_results-->INP2_PRES = i;
                    if (nsns == 2) {
                        i = special_number1; special_number1 = special_number2;
                        special_number2 = i;
                    }
                }
 
                ! ...and to reset "it"-style objects to the first of these parameters, if
                ! there is one (and it really is an object)...
 
                if (parameters > 0 && parser_results-->INP1_PRES >= 2)
                    PronounNotice(parser_results-->INP1_PRES);
 
                ! ...and return from the parser altogether, having successfully matched
                ! a line.
 
                if (held_back_mode == 1) {
                    wn=hb_wn;
                    jump LookForMore;
                }
                rtrue;
 
            } ! end of if(token ~= ENDIT_TOKEN) else
        } ! end of for(pcount++)
 
        .LineFailed;
        ! The line has failed to match.
        ! We continue the outer "for" loop, trying the next line in the grammar.
 
        if (etype > best_etype) best_etype = etype;
        if (etype ~= ASKSCOPE_PE && etype > nextbest_etype) nextbest_etype = etype;
 
        ! ...unless the line was something like "take all" which failed because
        ! nothing matched the "all", in which case we stop and give an error now.
 
        if (take_all_rule == 2 && etype==NOTHING_PE) break;
        if (action_to_be == ##Examine && etype == MULTI_PE) break; ! --ZARF: added case
 
    } ! end of for(line++)
 
    ! The grammar is exhausted: every line has failed to match.
-) instead of "Parser Letter G" in "Parser.i6t".
 
[When the UPTO_PE ("only understood as far as...") error occurs, we save the current value of wn in a global. This is necessary for printing a verbose parser error.]
Include (-
    ! At this point, the return value is all prepared, and we are only looking
    ! to see if there is a "then" followed by subsequent instruction(s).
 
  .LookForMore;
 
    if (wn > num_words) rtrue;
 
    i = NextWord();
    if (i == THEN1__WD or THEN2__WD or THEN3__WD or comma_word) {
        if (wn > num_words) {
           held_back_mode = false;
           return;
        }
        i = WordAddress(verb_wordnum);
        j = WordAddress(wn);
        for (: i<j : i++) i->0 = ' ';
        i = NextWord();
        if (i == AGAIN1__WD or AGAIN2__WD or AGAIN3__WD) {
            ! Delete the words "then again" from the again buffer,
            ! in which we have just realised that it must occur:
            ! prevents an infinite loop on "i. again"
 
            i = WordAddress(wn-2)-buffer;
            if (wn > num_words) j = INPUT_BUFFER_LEN-1;
            else j = WordAddress(wn)-buffer;
            for (: i<j : i++) buffer3->i = ' ';
        }
        VM_Tokenise(buffer,parse);
        held_back_mode = true;
        return;
    }
    wn_at_upto_pe = wn; ! --ZARF: save wn value
    best_etype = UPTO_PE;
    jump GiveError;
-) instead of "Parser Letter K" in "Parser.i6t".
 
Section - List-Writing Customizations
 
[We save the "cl" argument in a global, so that grouping-together rules can capitalize adequately.]
To decide what number is cap-class-group: (- (capitalize_class_group) -).
Include (-
Global capitalize_class_group;
 
[ WriteMultiClassGroup cl memb depth partition_class_sizes q k2 l;
    ! Save the style, because the activity below is allowed to change it
    q = c_style;
    if (c_style & INDENT_BIT ~= 0) PrintSpaces(2*(depth+c_margin));
 
    capitalize_class_group = ((cl == 1) && (c_style & CFIRSTART_BIT));
    BeginActivity(GROUPING_TOGETHER_ACT, memb);
 
    if (ForActivity(GROUPING_TOGETHER_ACT, memb)) {
        c_style = c_style &~ NEWLINE_BIT;
    } else {
 
        if (memb.list_together ofclass String) {
            ! Set k2 to the number of objects covered by the group
            k2 = 0;
            for (l=0 : l<listing_size : l++) k2 = k2 + partition_class_sizes->(l+cl);
            EnglishNumber(k2); print " ";
            print (string) memb.list_together;
            if (c_style & ENGLISH_BIT ~= 0) print " (";
            if (c_style & INDENT_BIT ~= 0)  print ":^";
        } else {
            inventory_stage = 1;
            parser_one = memb; parser_two = depth + c_margin;
            if (RunRoutines(memb, list_together) == 1) jump Omit__Sublist2;
        }
 
        c_margin++;
        @push capitalize_class_group; @push lt_value; @push listing_together; @push listing_size;
 
        lt_value = memb.list_together; listing_together = memb;
        #Ifdef DBLW; print "^^DOWN lt_value = ", lt_value, " listing_together = ", memb, "^^";
        @push DBLW_no_classes; @push DBLW_no_objs; #Endif;
        WriteListR(memb, depth, false);
        #Ifdef DBLW; print "^^UP^^"; @pull DBLW_no_objs; @pull DBLW_no_classes; #Endif;
 
        @pull listing_size; @pull listing_together; @pull lt_value; @pull capitalize_class_group;
        c_margin--;
 
        if (memb.list_together ofclass String) {
            if (q & ENGLISH_BIT ~= 0) print ")";
        } else {
            inventory_stage = 2;
            parser_one = memb; parser_two = depth+c_margin;
            RunRoutines(memb, list_together);
        }
        .Omit__Sublist2;
    }
 
    EndActivity(GROUPING_TOGETHER_ACT, memb);
 
    ! If the NEWLINE_BIT has been forced by the activity, act now
    ! before it vanishes...
    if (q & NEWLINE_BIT ~= 0 && c_style & NEWLINE_BIT == 0) new_line;
 
    ! ...when the original style is restored again:
    c_style = q;
];
-) instead of "Write Multiple Class Group" in "ListWriter.i6t".
 
[Comment out the code that clears and resets list_together. We do that statically, at startup.
We also use a somewhat more efficient loop to set the list_filter_permits attribute.]
Include (-
 
! Set/clear the list_filter_permits attribute. We optimize on the assumption that
! list_filter_routine is always "a is mentioned", which is a tiny but nonzero
! improvement.
! Do this recursively on the object and its contents (if any).
[ ListFilterContents a o;
    if ((list_filter_routine) && (a has mentioned))
        give a ~list_filter_permits;
    else
        give a list_filter_permits;
 
    objectloop (o in a) {
        ListFilterContents(o);
    }
];
 
[ WriteListFrom first style depth noactivity iter i a;
    @push c_iterator; @push c_style; @push c_depth; @push c_margin;
    if (iter) c_iterator = iter; else c_iterator = ObjectTreeIterator;
    c_style = style; c_depth = depth;
    c_margin = 0; if (style & EXTRAINDENT_BIT) c_margin = 1;
 
    ! Set or clear the list_filter_permits flag. Try to do it efficiently.
    if (c_iterator == ObjectTreeIterator) {
        ! For the tree iterator, we follow the tree.
        for (a = first : a : a = sibling(a)) {
            ListFilterContents(a);
        }
    }
    else if (c_iterator == MarkedListIterator) {
        ! For the list iterator, we follow the list.
        for (i=0: i<MarkedObjectLength: i++) {
            a = MarkedObjectArray-->i;
            ListFilterContents(a);
        }
    }
    else {
        ! The sad inefficient old way -- loops through all objects.
        ! (We don't bother with recursion because we're hitting all objects
        ! anyway.)
        objectloop (a ofclass Object) {
            if ((list_filter_routine) && (a has mentioned))
                give a ~list_filter_permits;
            else
                give a list_filter_permits;
        }
    }
 
    first = c_iterator(first, depth, 0, START_ITF);
    if (first == nothing) {
        print (string) NOTHING__TX;
        if (style & NEWLINE_BIT ~= 0) new_line;
    } else {
        if ((noactivity) || (iter)) {
            WriteListR(first, c_depth, true);
            say__p = 1;
        } else {
            !objectloop (ol provides list_together) ol.list_together = 0;
            CarryOutActivity(LISTING_CONTENTS_ACT, parent(first));
        }
    }
 
    @pull c_margin; @pull c_depth; @pull c_style; @pull c_iterator;
];
 
! This does the work of WriteListFrom, with a style and details activities, but only names a single object. (ISARE_BIT is ignored.)
[ WriteListSingleton obj style;
    @push c_iterator; @push c_style; @push c_depth; @push c_margin;
    c_iterator = nothing;
    c_style = style; c_depth = 0;
    c_margin = 0; if (style & EXTRAINDENT_BIT) c_margin = 1;
 
    ListFilterContents(obj);
 
     if (obj == nothing) {
        print (string) NOTHING__TX;
        if (style & NEWLINE_BIT ~= 0) new_line;
    } else {
        ! WriteListR() is iterator-oriented, so we include a cut-down version of it.
        WriteSingleClassGroup(1, obj, c_depth, 1);
        say__p = 1;
    }
 
    @pull c_margin; @pull c_depth; @pull c_style; @pull c_iterator;
];
-) instead of "WriteListFrom" in "ListWriter.i6t".
 
Include (-
[ WriteListOfMarkedContentsObjects style common_parent
    obj first length;
 
    objectloop (obj in common_parent && obj has workflag2) {
        length++;
        if (first == nothing) { first = obj; }
    }
 
    if (length == 0) {
        if (style & ISARE_BIT ~= 0) print (string) IS3__TX, " ", (string) NOTHING__TX;
        else if (style & CFIRSTART_BIT ~= 0) print (string) NOTHING2__TX;
        else print (string) NOTHING__TX;
    } else {
        @push MarkedObjectArray; @push MarkedObjectLength;
        MarkedObjectArray = RequisitionStack(length);
        MarkedObjectLength = length;
        if (MarkedObjectArray == 0) return RunTimeProblem(RTP_LISTWRITERMEMORY);
 
        ! common_parent is always set
        ObjectTreeCoalesce(child(common_parent));
        length = 0;
        objectloop (obj in common_parent) ! object tree order
            if (obj has workflag2) MarkedObjectArray-->length++ = obj;
 
        WriteListFrom(first, style, 0, false, MarkedListIterator);
 
        FreeStack(MarkedObjectArray);
        @pull MarkedObjectLength; @pull MarkedObjectArray;
    }
    return;
];
-) after "WriteListOfMarkedObjects" in "ListWriter.i6t".
 
[Copy the "inventory details" activity hook from 6L02.]
Printing inventory details of something is an activity.
Include (-
[ WriteAfterEntry o depth
    p recurse_flag parenth_flag eldest_child child_count combo;
 
    inventory_stage = 2;
    if (c_style & PARTINV_BIT) {
        BeginActivity(PRINTING_ROOM_DESC_DETAILS_ACT);
        if (ForActivity(PRINTING_ROOM_DESC_DETAILS_ACT) == false) {
 
        combo = 0;
        if (o has light && location hasnt light) combo=combo+1;
        if (o has container && o hasnt open)     combo=combo+2;
        if ((o has container && (o has open || o has transparent))
            && (child(o)==0))                    combo=combo+4;
        if (combo) L__M(##ListMiscellany, combo, o);
        }
        EndActivity(PRINTING_ROOM_DESC_DETAILS_ACT);
    }   ! end of PARTINV_BIT processing
 
    if (c_style & FULLINV_BIT) {
        BeginActivity((+ printing inventory details +), o);
        if (ForActivity((+ printing inventory details +), o) == false) {
            if (o has light && o has worn) { L__M(##ListMiscellany, 8, o);  parenth_flag = true; }
            else {
                if (o has light)           { L__M(##ListMiscellany, 9, o);  parenth_flag = true; }
                if (o has worn)            { L__M(##ListMiscellany, 10, o); parenth_flag = true; }
            }
 
            if (o has container)
                if (o has openable) {
                    if (parenth_flag) {
                        #Ifdef SERIAL_COMMA; print ","; #Endif;
                        print (string) AND__TX;
                    } else            L__M(##ListMiscellany, 11, o);
                    if (o has open)
                        if (child(o)) L__M(##ListMiscellany, 12, o);
                        else          L__M(##ListMiscellany, 13, o);
                    else
                        if (o has lockable && o has locked) L__M(##ListMiscellany, 15, o);
                        else                                L__M(##ListMiscellany, 14, o);
                    parenth_flag = true;
                }
                else
                    if (child(o)==0 && o has transparent)
                        if (parenth_flag) L__M(##ListMiscellany, 16, o);
                        else              L__M(##ListMiscellany, 17, o);
 
            if (parenth_flag) print ")";
        }
        EndActivity((+ printing inventory details +), o);
    }   ! end of FULLINV_BIT processing
 
    child_count = 0;
    eldest_child = nothing;
    objectloop (p in o)
        if ((c_style & CONCEAL_BIT == 0) || (p hasnt concealed && p hasnt scenery))
            if (p has list_filter_permits) {
                child_count++;
                if (eldest_child == nothing) eldest_child = p;
            }
 
    if (child_count && (c_style & ALWAYS_BIT)) {
        if (c_style & ENGLISH_BIT) L__M(##ListMiscellany, 18, o);
        recurse_flag = true;
    }
 
    if (child_count && (c_style & RECURSE_BIT)) {
        if (o has supporter) {
            if (c_style & ENGLISH_BIT) {
                if (c_style & TERSE_BIT) L__M(##ListMiscellany, 19, o);
                else                     L__M(##ListMiscellany, 20, o);
                if (o has animate)       print (string) WHOM__TX;
                else                     print (string) WHICH__TX;
            }
            recurse_flag = true;
        }
        if (o has container && (o has open || o has transparent)) {
            if (c_style & ENGLISH_BIT) {
                if (c_style & TERSE_BIT) L__M(##ListMiscellany, 21, o);
                else                     L__M(##ListMiscellany, 22, o);
                if (o has animate)       print (string) WHOM__TX;
                else                     print (string) WHICH__TX;
            }
            recurse_flag = true;
        }
    }
 
    if (recurse_flag && (c_style & ENGLISH_BIT))
        if (child_count > 1 || eldest_child has pluralname) print (string) ARE2__TX;
        else                                                print (string) IS2__TX;
 
    if (c_style & NEWLINE_BIT) new_line;
 
    if (recurse_flag) {
        o = child(o);
        @push lt_value; @push listing_together; @push listing_size;
        @push c_iterator;
        c_iterator = ObjectTreeIterator;
        lt_value = 0;   listing_together = 0;   listing_size = 0;
        WriteListR(o, depth+1, true);
        @pull c_iterator;
        @pull listing_size; @pull listing_together; @pull lt_value;
        if (c_style & TERSE_BIT) print ")";
    }
];
-) instead of "Write After Entry" in "ListWriter.i6t".
 
[This is a simplified copy of the list-writing code for a single group. The argument should be a description of a known subclass, like "ever-seen impets".]
To say group-list (desc - description of things): (- WriteSoloClassGroup({desc}); -).
 
Include (-
[ WriteSoloClassGroup desc  obj ix;
    obj = desc(-2);
    if (obj == nothing) {
        print "nothing";
        return;
    }
    @push capitalize_class_group; @push listing_size; @push c_style;
    listing_size = desc(-3);
    c_style = 0;
    capitalize_class_group = false;
 
    BeginActivity(GROUPING_TOGETHER_ACT, obj);
    if (ForActivity(GROUPING_TOGETHER_ACT, obj)) {
    }
    else {
        obj = nothing;
        for (ix=0 : ix<listing_size : ix++) {
            obj = desc(-2, obj, ix);
            if (ix) {
                if (listing_size == 2)
                    print " and ";
                else if (ix+1 == listing_size)
                    print ", and ";
                else
                    print ", ";
            }
            print (name) obj;
            give obj workflag;
        }
    }
    EndActivity(GROUPING_TOGETHER_ACT, obj);
 
    @pull c_style; @pull listing_size; @pull capitalize_class_group;
];
-).
 
[ObjectTreeCoalesce fix -- see Mantis bug 1913.]
Include (-
[ ObjectTreeCoalesce obj memb lt later;
    #Ifdef DBLW; print "^^Sorting out: "; DiagnoseSortList(obj); #Endif;
    .StartAgain;
    memb = obj;
    while (memb~=nothing) {
        ! Find the next object in a list_together run.
        lt = memb.list_together;
        if (lt == 0) {
            memb = sibling(memb);
            continue;
        }
        ! Find first object after the contiguous run with this list_together value:
        for (memb=sibling(memb): (memb) && (memb.list_together == lt): memb = sibling(memb)) ;
        ! If the contiguous run extends to end of list, the list is now perfect:
        if (memb == 0) {
            return obj;
        }
        ! And otherwise we look to see if any future entries belong in the run:
        for (later=sibling(memb): later: later=sibling(later)) {
            if (later.list_together == lt) {
                ! Yes, they do: so we perform a regrouping of the list and start again:
                obj = GroupChildren(parent(obj), list_together, lt);
                #Ifdef DBLW; print "^^Sorted to: "; DiagnoseSortList(obj); #Endif;
                jump StartAgain;
            }
        }
        ! No, that run is complete. Continue with the element that followed the run.
    }
    return obj;
];
#Ifdef DBLW;
[ DiagnoseSortList obj memb;
    for (memb=child(obj): memb~=nothing: memb=sibling(memb)) print memb, " --> "; new_line;
];
#Endif;
-) instead of "Coalesce Object Tree" in "ListWriter.i6t".
 
 
Section - UI Go-To Events
 
Include (-
[ HandleGlkEvent ev ischar args   val;
    if (ischar == 0 && ev-->0 == $80002200) {
        val = ev-->2;
        glk_cancel_line_event(gg_mainwin, gg_event);
        VM_PrintToBuffer(buffer, INPUT_BUFFER_LEN-WORDSIZE, PrintVisitNum, val);
        return 2;
    }
    return 0;
];
[ PrintVisitNum val;
    print "-VISIT-NUM ", val;
];
-) before "Stubs" in "Glulx.i6t".
 
Section - Library Deletions
 
Include (- -) instead of "Procedural Rule Changes" in "Rulebooks.i6t";
 
Include (-
[ UpdateActionBitmap; ];   ! Not used in this game
-) instead of "Actions Bitmap" in "Actions.i6t";
 
[I will be scrubbing the action_bitmap property from object definitions in the final build. But I'm nervous about it not existing as a property at all.]
Include (- with action_bitmap 1 -) when defining the Abstraction Layer.
 
Section - Extra Attributes
 
Include (-
{-call:Properties::alias_translations}
{-call:Properties::Implementation::OfObjects::compile_attributes}
{-array:Properties::Implementation::OfObjects::property_metadata}
Constant attributed_property_offsets_SIZE 56; ! Not 48!
Array attributed_property_offsets --> attributed_property_offsets_SIZE;
Constant valued_property_offsets_SIZE (100 + {-value:NUMBER_CREATED(property)} + INDIV_PROP_START-48);
Array valued_property_offsets --> valued_property_offsets_SIZE;
 
{-routine:Properties::Implementation::OfObjects::CreatePropertyOffsets}
 
-) instead of "Properties" in "Output.i6t".
 
Include (-
! These attributes are defined after the 47 that I7 knows about. We can define up to eight, since Glulx really allows 56.
Attribute attr_extra_metallic;
Attribute attr_extra_glassy;
Attribute attr_extra_mineralish;
Attribute attr_extra_readable;
[ CheckAttrExtraMetallic obj; return (obj has attr_extra_metallic); ];
[ CheckAttrExtraGlassy obj; return (obj has attr_extra_glassy); ];
[ CheckAttrExtraMineralish obj; return (obj has attr_extra_mineralish); ];
[ CheckAttrExtraReadable obj; return (obj has attr_extra_readable); ];
-) after "Properties" in "Output.i6t".
 
Section - Reaching Component Rules
 
Reaching component rules is an object-based rulebook.
Reaching component rules have outcomes allow access (success) and deny access (failure).
 
The access to parts rule is listed in the accessibility rulebook.
The access to parts rule translates into I6 as "AccessToPartsRule".
Include (-
[ AccessToPartsRule o p res;
    !p = touch_persona;
    !if (p == 0) p = actor;
 
    o = untouchable_object;
    while (o && (o provides component_parent) && (o.component_parent)) {
        p = o.component_parent;
        @push self;
        self = o;
        res = (ProcessRulebook( (+ Reaching component rules +), p) && RulebookFailed());
        @pull self;
        if (res)
            rtrue;
        o = p;
    }
 
    rfalse;
];
-).
 
Section - Altered Parser Errors
 
Rule for printing a parser error when the latest parser error is the I beg your pardon error:
    [Can't tutor a node here, because we won't recycle to before-reading-command.]
    if tutorial-display is true:
        invoke tutor-blank-command;
    do nothing.
 
To say current-pronoun-word: (- print (address) pronoun_word; -).
Rule for printing a parser error when the latest parser error is the not sure what it refers to error:
    say "[parsermsg]I'm not sure what '[current-pronoun-word]' refers to[period]";
    say "[/parsermsg][br]"
 
Rule for printing a parser error when the latest parser error is the not a verb I recognise error:
    tutor tut-invalid-verb;
    say "[parsermsg]That's not an action I understand[period]";
    if tut-initial is open:
        say " For right now, type [excmd]LOOK[/excmd] or [excmd]LOOK AROUND[/excmd][period]";
    else if tutorial-phase is 1:
        say " Common actions include [excmd]EXAMINE[/excmd] ([excmd]X[/excmd]), [excmd]TAKE[/excmd], and [excmd]DROP[/excmd]. Type [excmd]LOOK[/excmd] ([excmd]L[/excmd]) to review your surroundings[period]";
    say "[/parsermsg][br]"
 
To say you-can't-see-any-such-thing:
    if current-tense is:
        -- present-tense: say "You can't see any such thing.";
        -- past-tense: say "You couldn't see any such thing.";
        -- perfect-tense: say "You cannot see any such thing.";
        -- future-tense: say "You will not see any such thing."
 
Rule for printing a parser error when the latest parser error is the can't see any such thing error:
    say you-can't-see-any-such-thing;
 
To say don't-know-tense:
    if current-tense is:
        -- present-tense: say "don't know";
        -- past-tense: say "did not know";
        -- perfect-tense: say "have not learned";
        -- future-tense: say "will not know"
 
Rule for printing a parser error when the latest parser error is the noun did not make sense in that context error:
    if the action-to-be is:
        -- the inspecting it with action: say you-can't-see-any-such-thing;
        -- the examining action: say you-can't-see-any-such-thing;
        -- the recalling action: say "Nothing [if current-tense is present-tense]comes[else if current-tense is past-tense]came[else if current-tense is perfect-tense]has come[else if current-tense is future-tense]will come[else]comes[end if] to mind.";
        -- the invoking action: say "You [don't-know-tense] any such formula.";
        -- the performing action: say "You [don't-know-tense] any such ritual.";
        -- the visiting action: say "You [don't-know-tense] any such location.";
        -- the creating action: say "You [don't-know-tense] what that might be.";
        -- otherwise: say "That noun did not make sense in this context."
 
Rule for printing a parser error when the latest parser error is the can't see it at the moment error and the pronoun reference object is a formula:
    [separate case for formula-relevant actions, saying "you no longer recall..."? I'm not sure what fires this error, anyhow. (In I6 I think it was "x it" when "it" has been yanked away.)]
    say "[The pronoun reference object] exists only in your mind."
 
Rule for printing a parser error when the latest parser error is the can't use multiple objects error:
    [We'd like to catch "touch X and Y" and suggest "try touching X *to* Y". This is difficult. The action-to-be gets stuck on tapping-it-on even if the player just types "touch all", because it's the last grammar line. We work around this by picking the *first* grammar line -- usually better -- but either way we've lost the distinction.]
    let AC be the initial action match for verb-word default action-to-be;
    if AC is:
        -- dropping action:
            say you-can't-see-any-such-thing;
            stop;
        -- recalling-all action:
            say "You can't use multiple terms that way. [parsermsg]Try just [excmd]RECALL[/excmd].[/parsermsg][br]";
            stop;
        -- vague-invoking action:
            say "You can't use multiple terms that way.";
            stop;
        -- vague-entering action:
            now AC is the entering action;  [and continue...]
        -- brush-rubbing action:
            now AC is the rubbing action;  [and continue...]
    say "You can't use multiple objects that way";
    let O be the first match-list item;
    if O is nothing or the number of match-list items is greater than 3:
        say ". [parsermsg]Try [AC with direct object namefake-just-one-thing-object].[/parsermsg][br]";
    else:
        say ". [parsermsg]Try [AC with direct object O].[/parsermsg][br]"
 
Rule for printing a parser error when the latest parser error is the only understood as far as error:
    say parsermsg;
    display the alternate only-understood error;
    say /parsermsg;
    say line break.
 
To display the alternate only-understood error: (- Alt_Only_Understood_Rule(); -).
 
Include (-
[ Alt_Only_Understood_Rule  m ix addr len;
    print "I understood the command ~";
 
    for (ix=1: ix < wn_at_upto_pe-1 && ix <= num_words; ix++) {
        if (ix ~= 1) print " ";
        addr = WordAddress(ix);
        len = WordLength(ix);
        while (len) {
            print (char) addr->0;
            addr++; len--;
        }
    }
 
    if (parse-->1 == 'look' or 'l//') {
        addr = (+ excmding text +)-->1;
        print "~, but not the following words. To look more closely at something, try ";
        addr("LOOK AT OBJECT");
        print " or ";
        addr("EXAMINE OBJECT");
        print ". You can also use the abbreviation ";
        addr("X OBJECT");
        print ".";
        return;
    }
 
    print "~ (that is, ";
 
    for (m=0 : m<32 : m++) pattern-->m = pattern2-->m;
    pcount = pcount2;
    PrintCommand(0);
 
    print "); but not the word";
    if (wn_at_upto_pe-1 ~= num_words) print "s";
    print " ~";
 
    for (ix=wn_at_upto_pe-1 : ix <= num_words; ix++) {
        if (ix ~= wn_at_upto_pe-1) print " ";
        addr = WordAddress(ix);
        len = WordLength(ix);
        while (len) {
            print (char) addr->0;
            addr++; len--;
        }
    }
    print "~ at the end.";
];
-).
 
Section - Fast Iterating Through Contents
 
Include (-
Global rawloop_temp;
! Wrapper for sibling() which is safe to pass nothing to.
[ sibling_or_nothing obj;
if (~~obj) return nothing;
return sibling(obj);
];
-) after "Global Variables" in "Output.i6t".
 
[This uses a global variable, so it cannot be nested.]
To repeat with (loopvar - nonexisting object variable) in raw contents of (O - object) begin -- end: (-
    for ({loopvar} = child({O}), rawloop_temp = sibling_or_nothing({loopvar})
        : {loopvar}
        : {loopvar} = rawloop_temp, rawloop_temp = sibling_or_nothing({loopvar}))
-).
 
To decide what number is the raw contents count of (O - object): (- children({O}) -).
 
[This ignores incorporation relations, wearing relations, and all that modern world-model jazz. Only use it for non-things (formulas, etc).]
To raw-remove (O - object) from play: (- remove({O}); -).
 
 
Section - Static Listing Contents
 
The initially listing contents rules are a rulebook.
 
When play begins (this is the initially list contents rule):
    follow the initially listing contents rules.
 
To initially group (OS - description of objects) together: (- InitiallyGroupTogether({OS}, {-list-together}); -).
 
Include (-
! We've commented out the code in WriteListFrom that clears the list_together flag. Instead we do it all at startup time, here.
[ InitiallyGroupTogether desc func  obj;
    obj = nothing;
    while (obj = desc(-2, obj)) {
        obj.list_together = func;
    }
];
-).
 
To say a (O - object) roomily: (- WriteListSingleton({O}, ENGLISH_BIT+PARTINV_BIT); -).
To say A (O - object) roomily: (- WriteListSingleton({O}, ENGLISH_BIT+CFIRSTART_BIT+PARTINV_BIT); -).
 
To say a list of (OS - description of objects) *in (parent - object):
    (- @push subst__v;
        objectloop (subst__v in {parent}) if ({-bind-variable:OS})
        give subst__v workflag2; else give subst__v ~workflag2;
        WriteListOfMarkedContentsObjects(ENGLISH_BIT, {parent});
        @pull subst__v; -).
To say a list of (OS - description of objects) *in (parent - object) roomily:
    (- @push subst__v;
        objectloop (subst__v in {parent}) if ({-bind-variable:OS})
        give subst__v workflag2; else give subst__v ~workflag2;
        WriteListOfMarkedContentsObjects(ENGLISH_BIT+PARTINV_BIT, {parent});
        @pull subst__v; -).
To say A list of (OS - description of objects) *in (parent - object):
    (- @push subst__v;
        objectloop (subst__v in {parent}) if ({-bind-variable:OS})
        give subst__v workflag2; else give subst__v ~workflag2;
        WriteListOfMarkedContentsObjects(ENGLISH_BIT+CFIRSTART_BIT, {parent});
        @pull subst__v; -).
To say A list of (OS - description of objects) *in (parent - object) roomily:
    (- @push subst__v;
        objectloop (subst__v in {parent}) if ({-bind-variable:OS})
        give subst__v workflag2; else give subst__v ~workflag2;
        WriteListOfMarkedContentsObjects(ENGLISH_BIT+CFIRSTART_BIT+PARTINV_BIT, {parent});
        @pull subst__v; -).
To say list of (OS - description of objects) *in (parent - object):
    (- @push subst__v;
        objectloop (subst__v in {parent}) if ({-bind-variable:OS})
        give subst__v workflag2; else give subst__v ~workflag2;
        WriteListOfMarkedContentsObjects(ENGLISH_BIT+NOARTICLE_BIT, {parent});
        @pull subst__v; -).
To say the list of (OS - description of objects) *in (parent - object):
    (- @push subst__v;
        objectloop (subst__v in {parent}) if ({-bind-variable:OS})
        give subst__v workflag2; else give subst__v ~workflag2;
        WriteListOfMarkedContentsObjects(ENGLISH_BIT+DEFART_BIT, {parent});
        @pull subst__v; -).
To say the list of (OS - description of objects) *in (parent - object) roomily:
    (- @push subst__v;
        objectloop (subst__v in {parent}) if ({-bind-variable:OS})
        give subst__v workflag2; else give subst__v ~workflag2;
        WriteListOfMarkedContentsObjects(ENGLISH_BIT+DEFART_BIT+PARTINV_BIT, {parent});
        @pull subst__v; -).
To say The list of (OS - description of objects) *in (parent - object):
    (- @push subst__v;
        objectloop (subst__v in {parent}) if ({-bind-variable:OS})
        give subst__v workflag2; else give subst__v ~workflag2;
        WriteListOfMarkedContentsObjects(ENGLISH_BIT+DEFART_BIT+CFIRSTART_BIT, {parent});
        @pull subst__v; -).
To say is-are a list of (OS - description of objects) *in (parent - object):
    (- @push subst__v;
        objectloop (subst__v in {parent}) if ({-bind-variable:OS})
        give subst__v workflag2; else give subst__v ~workflag2;
        WriteListOfMarkedContentsObjects(ENGLISH_BIT+ISARE_BIT, {parent});
        @pull subst__v; -).
To say is-are a list of (OS - description of objects) *in (parent - object) roomily:
    (- @push subst__v;
        objectloop (subst__v in {parent}) if ({-bind-variable:OS})
        give subst__v workflag2; else give subst__v ~workflag2;
        WriteListOfMarkedContentsObjects(ENGLISH_BIT+ISARE_BIT+PARTINV_BIT, {parent});
        @pull subst__v; -).
To say is-are list of (OS - description of objects) *in (parent - object):
    (- @push subst__v;
        objectloop (subst__v in {parent}) if ({-bind-variable:OS})
        give subst__v workflag2; else give subst__v ~workflag2;
        WriteListOfMarkedContentsObjects(ENGLISH_BIT+ISARE_BIT+NOARTICLE_BIT, {parent});
        @pull subst__v; -).
To say is-are the list of (OS - description of objects) *in (parent - object):
    (- @push subst__v;
        objectloop (subst__v in {parent}) if ({-bind-variable:OS})
        give subst__v workflag2; else give subst__v ~workflag2;
        WriteListOfMarkedContentsObjects(ENGLISH_BIT+DEFART_BIT+ISARE_BIT, {parent});
        @pull subst__v; -).
 
 
Include (-
! Sort the first N rows of a table, rather than the whole thing. The rest
! of the table is untouched. Blank rows are sorted down to position N (not
! to the very end).
[ TableSortPartial tab rows col dir test_flag algorithm i j k f;
    for (i=1:i<=tab-->0:i++) {
        j = tab-->i; ! Address of column table
        if ((j-->1) & TB_COLUMN_DONTSORTME)
            return RunTimeProblem(RTP_TABLE_CANTSORT, tab);
    }
    if (col >= 100) col=TableFindCol(tab, col, false);
    k = rows; ! Not the entire table
    k = TableMoveBlanksToBack(tab, 1, k);
    if (test_flag) {
        print "After moving blanks to back:^"; TableColumnDebug(tab, col);
    }
 
    SetSortDomain(TableSwapRows, TableCompareRows);
    SortArray(tab, col, dir, k, test_flag, algorithm);
 
    if (test_flag) {
        print "Final state:^"; TableColumnDebug(tab, col);
    }
];
-) after "Sort" in "Tables.i6t".
 
To sort (T - table name) up to row (N - number) in (TC - table column) order
        (documented at ph_sortcolumn):
        (- TableSortPartial({T}, {N}, {TC}, 1); -).
 
[We have to clear these flags for every thing. It's worth having a routine that skips I7's usual SetEitherOrProperty() mechanism and all its safety checks.]
To rapidly set all things not mentioned: (- OptimizedAllThingsUnsetMentioned(); -).
To rapidly set all things not marked for listing: (- OptimizedAllThingsUnsetWorkflag(); -).
 
Include (-
[ OptimizedAllThingsUnsetMentioned obj;
    for (obj=IK2_First: obj: obj=obj.IK2_Link) {
        give obj ~mentioned;
    }
];
[ OptimizedAllThingsUnsetWorkflag obj;
    for (obj=IK2_First: obj: obj=obj.IK2_Link) {
        give obj ~workflag;
    }
];
-).
 
[We never want to search (or sort) through the entire Table of Locale Priorities, so we manually keep track of the number of "live" rows. We'll also avoid use of the I7 notion of blank rows. Unused rows will be marked by "nothing" in the object column.]
The locale-table-count is a number that varies.
 
[This replacement phrase is heavily optimized. It behaves the same as the standard version, except that deleted rows get "nothing" in the object column instead of being marked blank.]
To set the/-- locale priority of (O - an object) to (N - a number):
    if O is a thing:
        if N <= 0:
            now O is mentioned;
        [search the active part of the table for O; also note the first null row]
        let rownum be 0;
        let blanknum be 0;
        repeat with I running from 1 to locale-table-count:
            let ent be the notable-object in row I of  the Table of Locale Priorities;
            if ent is nothing:
                if blanknum is 0:
                    now blanknum is I;
                next;
            if ent is O:
                now rownum is I;
                break;
        if rownum > 0: [found it]
            if N > 0:
                [change the existing row]
                choose row rownum in the Table of Locale Priorities;
                now the locale description priority entry is N;
            else:
                [delete the existing row, by putting in "nothing".]
                choose row rownum in the Table of Locale Priorities;
                now the notable-object entry is nothing;
                now the locale description priority entry is 999;
        otherwise: [didn't find it]
            if N > 0:
                if blanknum is 0:
                    [add a new row]
                    increment locale-table-count;
                    choose row locale-table-count in the Table of Locale Priorities;
                    now the notable-object entry is O;
                    now the locale description priority entry is N;
                else:
                    [use the found null row]
                    choose row blanknum in the Table of Locale Priorities;
                    now the notable-object entry is O;
                    now the locale description priority entry is N.
 
The optimized initialise locale description rule is listed instead of the initialise locale description rule in the before printing the locale description rulebook.
This is the optimized initialise locale description rule:
    now the locale paragraph count is 0;
    rapidly set all things not mentioned; [loops through all things]
    [Mark the table as empty (without blanking every single row)]
    now the locale-table-count is zero.
 
The optimized interesting locale paragraphs rule is listed instead of the interesting locale paragraphs rule in the for printing the locale description rulebook.
This is the optimized interesting locale paragraphs rule:
    let the domain be the parameter-object;
    sort the Table of Locale Priorities up to row locale-table-count in locale description priority order;
    repeat with I running from 1 to locale-table-count:
        let O be the notable-object in row I of  the Table of Locale Priorities;
        if O is not nothing:
            carry out the printing a locale paragraph about activity with O;
    continue the activity.
 
The optimized you-can-also-see rule is listed instead of the you-can-also-see rule in the for printing the locale description rulebook.
This is the optimized you-can-also-see rule:
    let the domain be the parameter-object;
    let the mentionable count be 0;
    let the marked count be 0;
    rapidly set all things not marked for listing;  [loops through all things]
    repeat with I running from 1 to locale-table-count:
        let O be the notable-object in row I of the Table of Locale Priorities;
        if O is not nothing:
            let N be the locale description priority in row I of the Table of Locale Priorities;
            [say "[O] - [N].";]
            if N is greater than 0 and O is not mentioned:
                now O is marked for listing;
                increment the marked count;
            increase the mentionable count by 1;
    if the mentionable count is greater than 0:
        [note that mentioned things have not been marked for listing]
        begin the listing nondescript items activity with the domain;
        if the marked count is 0:
            abandon the listing nondescript items activity with the domain;
        otherwise:
            if handling the listing nondescript items activity:
                if the domain is a room:
                    if the domain is the location, say "You ";
                    otherwise say "In [the domain] you ";
                otherwise if the domain is a supporter:
                    say "On [the domain] you ";
                otherwise if the domain is an animal:
                    say "On [the domain] you ";
                otherwise:
                    say "In [the domain] you ";
                say "can [if the locale paragraph count is greater than 0]also [end if]see ";
                let the common holder be nothing;
                let contents form of list be true;
                repeat with I running from 1 to locale-table-count:
                    let list item be the notable-object in row I of the Table of Locale Priorities;
                    if list item is nothing or list item is not marked for listing:
                        next;
                    if the holder of the list item is not the common holder:
                        if the common holder is nothing,
                            now the common holder is the holder of the list item;
                        otherwise now contents form of list is false;
                    if the list item is mentioned, now the list item is not marked for listing;
                filter list recursion to unmentioned things;
                if contents form of list is true and the common holder is not nothing,
                    list the contents of the common holder, as a sentence, including contents,
                        giving brief inventory information, tersely, not listing
                        concealed items, listing marked items only;
                otherwise say "[a list of marked for listing things including contents]"; [loops through all things]
                if the domain is the location, say " here";
                say ".[paragraph break]";
                unfilter list recursion;
            end the listing nondescript items activity with the domain;
    continue the activity.
 
 
 
 
To begin cheap list for (N - number): (- cheaplist_count = 0; cheaplist_total = {N}; @push subst__v; -).
To end cheap list: (- cheaplist_count = 0; cheaplist_total = 0; @pull subst__v; -).
To say cheap list (T - object) with (M - text): (- cheaplist_entry({T}, {M}); -).
Include (-
Global cheaplist_count = 0;
Global cheaplist_total = 0;
[ cheaplist_entry obj text;
    subst__v = obj;
    if (cheaplist_count) {
        if (cheaplist_total == 2)
            print " and ";
        else if (cheaplist_count + 1 == cheaplist_total)
            print ", and ";
        else
            print ", ";
    }
    print (PrintText) text;
    cheaplist_count++;
];
-) before "Parser.i6t".
 
Section - Miscellany of Doors
 
A glass-window is a kind of door.
A glass-window is usually open.
A glass-window is usually unopenable.
A glass-window is usually glassy.
A glass-window is usually scenery.
The printed name of a glass-window is usually "window".
The description of a glass-window is usually "A glass window."
 
Understand "locked", "sealed" as a door when the item described is locked.
Understand "open", "opened" as a door when the item described is open and the item described is not a glass-window.
Understand "closed" as a door when the item described is closed and the item described is not a glass-window.
 
The description of a door is usually "[The item described] is [open-closed item described]."
 
 
Section - Absent Doors
 
Definition: a door is absent rather than present if I6 routine "AssertDoorAbsent" makes it so (it is out of scope and unusable).
 
Include (-
[ AssertDoorAbsent door flag
    addr rm1 rm2 dir1 dir2 off1 off2;
 
    if (flag == -1) {
        return (door has absent);
    }
 
    ! door.found_in should be a list of two rooms, which is I7's normal arrangement
    addr = door.&found_in;
    if (addr == 0 || door.#found_in ~= 2*WORDSIZE)
        "(BUG) Cannot activate/deactivate door: malformed found_in: ", (name) door;
    rm1 = addr-->0;
    rm2 = addr-->1;
 
    @push location;
    location = rm1;
    dir1 = door.door_dir();
    location = rm2;
    dir2 = door.door_dir();
    @pull location;
 
    if (~~(dir1 ofclass (+ direction +) && dir2 ofclass (+ direction +) ))
        "(BUG) Cannot activate/deactivate door: directions not found: ", (name) door;
 
    off1 = ((rm1.IK1_Count)*No_Directions + dir1.IK3_Count);
    off2 = ((rm2.IK1_Count)*No_Directions + dir2.IK3_Count);
 
    if (flag) {
        if (door hasnt absent) {
            !print "(DEBUG) absentify ", (name) door, "^";
            SignalMapChange();
 
            if (Map_Storage-->off1 == door)
                Map_Storage-->off1 = 0;
            else
                print "(BUG) Map_Storage from door does not match^";
            if (Map_Storage-->off2 == door)
                Map_Storage-->off2 = 0;
            else
                print "(BUG) Map_Storage from door does not match^";
 
            give door absent;
            remove door;
        }
    }
    else {
        if (door has absent) {
            !print "(DEBUG) presentify ", (name) door, "^";
            SignalMapChange();
 
            if (Map_Storage-->off1 == 0)
                Map_Storage-->off1 = door;
            else
                print "(BUG) Map_Storage from door does not match^";
            if (Map_Storage-->off2 == 0)
                Map_Storage-->off2 = door;
            else
                print "(BUG) Map_Storage from door does not match^";
 
            give door ~absent;
            if (rm1 == real_location || rm2 == real_location)
                move door to real_location;
            else
                remove door;
        }
    }
];
-).
 
Section - Tenses
 
[The endgame involves some tense-shifting. We do *not* try to tense-enable all of the game text! Only a few generic messages and errors that can show up in the endgame.]
 
Tense-type is a kind of value. The tense-types are present-tense, past-tense, perfect-tense, and future-tense.
The current-tense is a tense-type that varies. The current-tense is present-tense.
 
To say you're-not-sure:
    if current-tense is:
        -- present-tense: say "You're not sure.";
        -- past-tense: say "You weren't sure.";
        -- perfect-tense: say "You aren't sure.";
        -- future-tense: say "You won't be sure."
 
 
Section - Early Type Declarations
 
The no-thing is a thing.
 
[These types should cover everything the player can pick up and move -- everything which can be "handled".]
A takeable-thing is a kind of thing.
A takeable-supporter is a kind of supporter. A takeable-supporter is always portable.
[There are no takeable-containers.]
Definition: a thing is takeable rather than non-takeable if it is a takeable-thing or it is a takeable-supporter.
 
Room-atmosphere is a kind of value.
The room-atmospheres are normal-atm, fire-atm, water-atm, vacuum-atm.
A room has a room-atmosphere called the atmosphere.
Definition: a room is aroma-proof if the atmosphere of it is not normal-atm.
Definition: a room is airless if the atmosphere of it is water-atm or the atmosphere of it is vacuum-atm.
 
An inscribable is a kind of takeable-thing.
 
Descriptor-type is a kind of value.
The descriptor-types are no-descriptor, brass-descriptor, steel-descriptor, bronze-descriptor, glass-descriptor, earthy-descriptor, wood-descriptor, spiritual-descriptor.
 
Definition: a thing is descriptor-compatible if it provides the property descriptor-type.
The verb to descriptor-match (it descriptor-matches, they descriptor-match, it is descriptor-matching) implies the descriptor-type property.
 
A inscribable has a descriptor-type. The descriptor-type of an inscribable is usually no-descriptor.
 
[Always use these adjectives, rather than "if nothing is in..."]
Definition: a container is empty rather than non-empty if the first thing held by it is nothing.
Definition: a supporter is empty rather than non-empty if the first thing held by it is nothing.
 
[Used to refer to a recalled item, where we want to be conservative about dynamic name-changes.]
A thing has some text called the remote-name. The remote-name of a thing is usually "the [item described]".
The remote-name of the player is "yourself".
 
[Applies to mass nouns, anything with "quantity of..." etc. Used in sentences like "You need more ..." as opposed to "You need another ..."]
A thing can be mass-named.
 
A thing can be alight. [Relevant to the fire daemon, but we define it early to catch an attribute slot.]
 
A thing can be metallic. [Gensaturation almost works on it.]
A thing can be glassy. [Glass-pass almost works on it.]
A thing can be mineralish. [The solvents are customized for every stone object.]
A thing can be symbolish. [An object too fancy for the word of essential nature.]
 
[Use direct I6 attributes for some read-only binary properties. We need the extra definitions because the default attribute test goes through GetEitherOrProperty, and trips over some type-checking. (The attributed_property_offsets table isn't valid for these extras.)]
The metallic property translates into I6 as "attr_extra_metallic".
Definition: an object is metallic if I6 routine "CheckAttrExtraMetallic" says so (hack).
The glassy property translates into I6 as "attr_extra_glassy".
Definition: an object is glassy if I6 routine "CheckAttrExtraGlassy" says so (hack).
The mineralish property translates into I6 as "attr_extra_mineralish".
Definition: an object is mineralish if I6 routine "CheckAttrExtraMineralish" says so (hack).
 
[Used to refer to a room in sentences.]
A room has some text called the refer-name. The refer-name of a room is usually "[the item described]".
A room has some text called the refer-preposition. The refer-preposition of a room is usually "in".
Understand "room" as a room.
 
A room-proxy is a kind of thing. A room-proxy is usually scenery.
 
Check getting off a room-proxy:
    instead try exiting.
 
Check smelling a room-proxy:
    instead try smelling the location.
 
Check inserting something into a room-proxy:
    instead try dropping the noun.
 
 
Section - Utility Classes
 
A far-sight is a kind of thing.
A far-sight is usually scenery.
A far-sight has a text called the reach-reason. The reach-reason of a far-sight is usually "[The item described] is out of reach."
 
Instead of doing anything except examining or searching or entering to a far-sight (this is the far-sight out of reach rule):
    if inspecting a far-sight with something:
        continue the action;
    if reading a readable far-sight:
        continue the action;
    instead say "[the reach-reason of the noun][line break]".
Check putting something on a far-sight:
    instead try touching the second noun.
Check inserting something into a far-sight:
    instead try touching the second noun.
Check tapping something on a far-sight:
    instead try touching the second noun.
 
Check entering a far-sight:
    [not caught by the Instead rule; can be customized separately.]
    instead try touching the noun.
 
Check searching a far-sight:
    [not caught by the Instead rule; can be customized separately.]
    instead try touching the noun.
 
 
Section - Epistemology
 
Definition: a thing is ever-made-this-cycle rather than never-made-this-cycle if it is handled or it is on-stage. [This is only meant for created takeables (such as wire).]
 
A room can be visited-this-cycle or unvisited-this-cycle. A room is always unvisited-this-cycle.
 
A room can be recallable. [Rooms which can be explicitly visited/gone to from other rooms.]
 
A thing can be recallable. [Things that can be recalled from out of scope. All takeable things are recallable, but some scenery (important machines) are also recallable.]
A thing can be ever-seen. [Never reset; this marks what the player knows about. This is splashed around liberally -- everything whose name is printed, everything in the location and the player's inventory.]
 
A takeable-thing is usually recallable.
A takeable-supporter is usually recallable.
 
[### probably make the red and white amalgam wires non-recallable, so that they don't fluff up the "findable" namespace. Ditto all the amalgam file seals. Possibly the plain gold rod?]
[### more of a nuisance: objects like "rough diamond" / "perfect diamond", where the latter form keeps "rough" as a synonym. Which is good for normal interactions, but terrible for find/recall. Maybe we want a set of does-the-player-mean rules.]
 
Include (-
[ NOTE_OBJECT_ACQUISITIONS_R obj;
    objectloop (obj in player) {
        give obj moved ~concealed; ! "moved" is "handled"
        give obj (+ ever-seen +);
        ! We don't need to worry about concealed things indirectly-contained in the player.
    }
    ! We don't need to worry about RUCKSACK_CLASS either.
    rfalse;
];
-) instead of "Note Object Acquisitions Rule" in "OrderOfPlay.i6t".
 
[Override the library's "set pronouns from..." phrase, though not the low-level PronounNotice() call.]
To set pronouns from (O - an object):
    (- ExplicitPronounNotice({O}); -).
Include (-
[ ExplicitPronounNotice obj;
    PronounNotice(obj);
    give obj (+ ever-seen +);
];
-).
 
Before printing the name of a thing (called T) (this is the extended make named things mentioned rule):
    now T is mentioned;
    unless the current action is out-of-world:
        now T is ever-seen.
The extended make named things mentioned rule is listed instead of the make named things mentioned rule in the before printing the name rulebook.
 
[The correct fix for Mantis bug 1368.]
The fixed offer items to writing a paragraph about rule is listed instead of the offer items to writing a paragraph about rule in the for printing a locale paragraph about rulebook.
For printing a locale paragraph about a thing (called the item) (this is the fixed offer items to writing a paragraph about rule):
    if the item is not mentioned:
        if a paragraph break is pending, say "[conditional paragraph break]";
        carry out the writing a paragraph about activity with the item;
        if a paragraph break is pending:
            increase the locale paragraph count by 1;
            now the item is mentioned;
            say "[conditional paragraph break]";
    continue the activity.
 
The last-visited-room is a room that varies. The last-visited-room is the Abstraction Layer.
 
Include (-
[ SilentlyConsiderLight;
    lightflag = true;  ! no true darkness (if there were true darkness, we'd have to pre-check new arrivals in the adjust light rule too!)
    location = real_location;   ! if ~~lightflag, location = thedark;
    ProcessRulebook( (+ pre-check new arrival rule +) );
    rfalse;
];
-) instead of "Silent Light Consideration" in "Light.i6t".
 
This is the pre-check new arrival rule:
    if not in darkness and the location is a room:
        if the location is not the last-visited-room:
            now the last-visited-room is the location;
            repeat with T in raw contents of the location:
                now T is ever-seen;
            carry out the room-visiting activity with the location;
        now the location is visited-this-cycle.
 
Room-visiting something is an activity on rooms.
[The room will be "unvisited" ("unvisited-this-cycle") if this is the first trip (this cycle).]
 
Before room-visiting when goal-achieving:
    increment the room-count of goalstate.
 
Definition: a thing is quick-visible if it is quick-visible-to the location.
 
To decide whether (T - thing) is quick-visible-to (R - room):
    (- QuickVisibleTo({T}, {R}) -).
 
Include (-
[ QuickVisibleTo obj loc
    next;
    if (obj == nothing || loc == nothing)
        rfalse;
    if (obj ofclass (+ door +) ) {
        print "(DEBUG) QuickVisibleTo does not work on doors.^";
        rfalse;
    }
    if (obj ofclass (+ backdrop +) ) {
        print "(DEBUG) QuickVisibleTo does not work on backdrops.^";
        rfalse;
    }
    while (obj) {
        next = obj.component_parent;
        if (next) {
            obj = next;
            continue;
        }
        next = parent(obj);
        if (~~next)
            rfalse;
        if (next == loc)
            rtrue;
        if (IsSeeThrough(next)) {
            obj = next;
            continue;
        }
        rfalse;
    }
    rfalse;
];
-).
 
 
Section - Abstract Buckets
 
The Abstraction Layer is a room. The description is "(BUG) This room only exists for things to be temporarily out of the game, but not off-stage."
 
[Decide whether a room value is outside the world (not a game room). Returns true for "nothing". Do not call this on things.] [This can't be a definition because we have to avoid type-checking. "nothing" never type-checks as any kind.]
To decide whether (R - object) is-room off-stagey: (- (RoomIsOffstage({R})) -).
To decide whether (R - object) is-not-room off-stagey: (- (~~RoomIsOffstage({R})) -).
Include (-
[ RoomIsOffstage rm;
    if (rm == nothing)
        rtrue;
    if (rm == (+ Abstraction Layer +) )
        rtrue;
    rfalse;
];
-).
 
An abstraction-bucket is a kind of container.
An abstraction-bucket has some text called the short-description. The short-description of an abstraction-bucket is usually "(BUG)s".
An abstraction-bucket has some text called the short-description-multi. The short-description-multi of an abstraction-bucket is usually "(BUG)".
All abstraction-buckets are in the Abstraction Layer.
 
To sanity-check the empty buckets:
    let total-buckets be the number of non-empty abstraction-buckets;
    if total-buckets is not zero:
        say "(BUG) [total-buckets] buckets were left nonempty ([list of non-empty abstraction-buckets])."
 
To recite the buckets, omitting final period:
    let total-buckets be the number of non-empty abstraction-buckets;
    if total-buckets is zero:
        stop;
    let count be zero;
    repeat with bucket running through non-empty abstraction-buckets:
        if count is zero:
            say ", ";
        else:
            say "; ";
        list the contents of bucket, tersely, as a sentence, using the definite article;
        say " [if the number of things in bucket is one][short-description of bucket][else][short-description-multi of bucket][end if]";
        increment count;
    unless omitting final period:
        say "."
 
Section - Better Lock-Matching
 
Check an actor unlocking something with (this is the better can't unlock without the correct key rule):
    unless the holder of the second noun is the actor and lock the noun really matches key the second noun:
        instead say "[That-Those second noun] [doesn't-don't second noun] seem to fit the lock."
 
Check an actor locking something with (this is the better can't lock without the correct key rule):
    unless the holder of the second noun is the actor and lock the noun really matches key the second noun:
        instead say "[That-Those second noun] [doesn't-don't second noun] seem to fit the lock."
 
The better can't unlock without the correct key rule is listed instead of the can't unlock without the correct key rule in the check unlocking it with rulebook.
The better can't lock without the correct key rule is listed instead of the can't lock without the correct key rule in the check locking it with rulebook.
 
The key-param is an object that varies.
The lock-param is an object that varies.
The lock-param variable translates into I6 as "parameter_object".
 
To decide whether lock (L - object) really matches key (K - thing):
    now the key-param is K;
    [lock-param is the normal parameter variable, so we don't need to set it.]
    follow the lock-matching rules for L;
    if rule failed:
        decide no;
    else:
        decide yes.
 
Lock-matching is an object-based rulebook.
 
The last lock-matching rule when lock-param provides the property matching key (this is the original property-based lock-matching rule):
    let T be the matching key of lock-param;
    if T is not nothing:
        if key-param is T:
            rule succeeds;
        else:
            rule fails.
 
The last lock-matching rule (this is the give-up lock-matching rule):
    rule fails.
 
 
Section - The Thing-Taken-From
 
The taking action has an object called the thing-taken-from.
 
Carry out an actor taking (this is the better taking rule):
    [I suspect this is not completely reliable. (Components, maybe some check-taking rules that bypass the standard action.) But it's good enough for report rules.]
    now the thing-taken-from is the holder of the noun;
    now the actor carries the noun.
 
The better taking rule is listed instead of the standard taking rule in the carry out taking rulebook.
 
 
Section - Better Implicit Taking
 
Definition: a thing is sessile if it is scenery or it is fixed in place or it is the player.
Definition: a thing is sessile-besides-player if it is scenery or it is fixed in place.
 
To decide whether interrupted carrying out the (A - activity on nothing) activity:
    (- CarryOutActivity({A}) -).
To decide whether interrupted carrying out the (A - activity on value of kind K) activity with (val - K):
    (- CarryOutActivity({A}, {val}) -).
 
Check an actor inserting something into (this is the better can't insert what's not held rule):
    if the actor is carrying the noun, continue the action;
    if the actor is wearing the noun, continue the action;
    if interrupted carrying out the implicitly taking activity with the noun:
        stop the action;
    issue miscellaneous library message number 26 for the noun;
    silently try the actor taking the noun;
    if the actor is carrying the noun:
        now the noun is handled;
        continue the action;
    stop the action.
 
Check an actor putting something on (this is the better can't put what's not held rule):
    if the actor is carrying the noun, continue the action;
    if the actor is wearing the noun, continue the action;
    if interrupted carrying out the implicitly taking activity with the noun:
        stop the action;
    issue miscellaneous library message number 26 for the noun;
    silently try the actor taking the noun;
    if the actor is carrying the noun:
        now the noun is handled;
        continue the action;
    stop the action.
 
The better can't insert what's not held rule is listed instead of the can't insert what's not held rule in the check inserting it into rulebook.
 
The better can't put what's not held rule is listed instead of the can't put what's not held rule in the check putting it on rulebook.
 
Rule for implicitly taking the player (this is the don't implicitly take myself rule):
    say "You can't haul yourself around like that."
 
Check eating something not sessile (this is the can't eat what's not held rule):
    if the actor is carrying the noun, continue the action;
    if the actor is wearing the noun, continue the action;
    if interrupted carrying out the implicitly taking activity with the noun:
        stop the action;
    issue miscellaneous library message number 26 for the noun;
    silently try the actor taking the noun;
    if the actor is carrying the noun, continue the action;
    stop the action.
 
The can't wave what's not held rule is not listed in any rulebook.
First check waving something not sessile (this is the better can't wave what's not held rule):
    if the actor is carrying the noun, continue the action;
    if interrupted carrying out the implicitly taking activity with the noun:
        stop the action;
    issue miscellaneous library message number 26 for the noun;
    silently try the actor taking the noun;
    if the actor is carrying the noun, continue the action;
    stop the action.
 
First check shaking something not sessile (this is the can't shake what's not held rule):
    if the actor is carrying the noun, continue the action;
    if interrupted carrying out the implicitly taking activity with the noun:
        stop the action;
    issue miscellaneous library message number 26 for the noun;
    silently try the actor taking the noun;
    if the actor is carrying the noun, continue the action;
    stop the action.
 
First check inspecting something with something not sessile (this is the can't inspect with what's not held rule):
    if the actor is carrying the second noun, continue the action;
    if interrupted carrying out the implicitly taking activity with the second noun:
        stop the action;
    issue miscellaneous library message number 26 for the second noun;
    silently try the actor taking the second noun;
    if the actor is carrying the second noun, continue the action;
    stop the action.
 
Check burning it with (this is the can't burn with what's not held rule):
    if the noun is sessile-besides-player and the second noun is sessile:
        instead say "You cannot move them together.";
    if the second noun is sessile:
        if the actor is carrying the noun, continue the action;
        if the actor is the noun, continue the action;
        if interrupted carrying out the implicitly taking activity with the noun:
            stop the action;
        issue miscellaneous library message number 26 for the noun;
        silently try the actor taking the noun;
        if the actor is carrying the noun, continue the action;
        stop the action;
    if the actor is not carrying the noun and the actor is not carrying the second noun:
        if the actor is the noun, continue the action;
        if interrupted carrying out the implicitly taking activity with the second noun:
            stop the action;
        issue miscellaneous library message number 26 for the second noun;
        silently try the actor taking the second noun;
        if the actor is carrying the second noun, continue the action;
        stop the action.
 
Check taking the paten when something is on the paten:
    let N be the number of things on the paten;
    if N is greater than one:
        instead say "The paten has too many things on it to be moved.";
    let T be the first thing held by the paten;
    if interrupted carrying out the implicitly taking activity with T:
        stop the action;
    say "(first taking [the T] from the paten)";
    silently try the actor taking T;
    if something is on the paten:
        stop the action.
 
Check taking the labyrinth-tile when something is on the labyrinth-tile:
    let N be the number of things on the labyrinth-tile;
    if N is greater than one:
        instead say "The tile has too many things on it to be moved.";
    let T be the first thing held by the labyrinth-tile;
    if interrupted carrying out the implicitly taking activity with T:
        stop the action;
    say "(first taking [the T] from the tile)";
    silently try the actor taking T;
    if something is on the labyrinth-tile:
        stop the action.
 
Check taking a clay-mold when something is on the noun:
    let N be the number of things on the noun;
    if N is greater than one:
        instead say "The mold disk has too many things on it to be moved.";
    let T be the first thing held by the noun;
    if T is a low-melting-seal metal-seal and T matches the noun:
        if the noun is in the kiln:
            say "You lift [the noun], and blow on the [smetal of T] until it cools a bit. Then you";
        else:
            say "You lift [the noun], and";
        now the player carries T;
        now the player carries the noun;
        instead say " dump the seal out into your palm. It's a [first time]perfect -- well, it's a [only]pretty good impression of the [file of T] File badge.";
    if interrupted carrying out the implicitly taking activity with T:
        stop the action;
    say "(first taking [the T] from the clay mold)";
    silently try the actor taking T;
    if something is on the noun:
        stop the action.
 
 
Chapter - Seeking Beyond the Boundary
 
Section - Goal Basics
 
A goal is a kind of object.
A room-goal is a kind of goal. [A region of rooms, for goal-tracking purposes.]
 
An action-goal is a kind of goal. [Do something.]
An action-goal can be known or unknown. An action-goal is usually unknown. [Has the player read about it? If so, it's in known-rituals. Only meaningful for recallable goals.]
An action-goal can be ever-done. [Has the player done it? Or done a ritual which is close enough that the experience carries over? (Ever-done and recallable implies known.)]
An action-goal can be reentrant. [Can be on the goal stack more than once.]
An action-goal can be described or undescribed. An action-goal is usually described. [Listed when reciting the goal stack on failure.]
An action-goal can be recallable. [Actions which can be explicitly performed.]
An action-goal has some text called the short-description. The short-description of an action-goal is usually "do something".
An action-goal has some text called the description. The description of an action-goal is usually "(BUG) Undescribed action-goal."
 
An action-goal can be privately-named or publically-named. An action-goal is usually publically-named. [They are typable, in the "perform" grammar.]
Understand "ritual", "goal" as an action-goal.
 
A thing has an action-goal called the creation-action. The creation-action of a thing is usually impossible-goal.
 
The known-rituals is a container.
To mark (G - action-goal) as known: (- MarkActionGoalKnown({G}); -).
To mark (G - action-goal) as done: (- MarkActionGoalDone({G}); -).
 
Include (-
[ MarkActionGoalKnown goal;
    if (goal == nothing || goal == (+ impossible-goal +)) {
        print "(BUG) MarkActionGoalKnown(", (name) goal, ")!^";
        return;
    }
    if (~~GetEitherOrProperty(goal, (+ recallable +) )) {
        print "(BUG) MarkActionGoalKnown(", (name) goal, "), which is not recallable!^";
    }
    if (~~(goal in (+ known-rituals +) )) {
        move goal to (+ known-rituals +);
    }
    SetEitherOrProperty(goal, (+ known +) );
    #ifdef DEBUG;
    if (goal_practice_flag) {
        SetEitherOrProperty(goal, (+ ever-done +) );
    }
    #endif; ! DEBUG
];
 
[ MarkActionGoalDone goal;
    if (goal == nothing || goal == (+ impossible-goal +)) {
        print "(BUG) MarkActionGoalKnown(", (name) goal, ")!^";
        return;
    }
    if (GetEitherOrProperty(goal, (+ recallable +) ) && ~~GetEitherOrProperty(goal, (+ known +) )) {
        ! For recallable goals, ensure they are thrown into the "known" bucket.
        MarkActionGoalKnown(goal);
    }
    SetEitherOrProperty(goal, (+ ever-done +) );
    #ifdef DEBUG_RITUAL;
    ! It's possible for a goal to be fulfilled several times in a turn, but let's only name it once.
    if ((~~not_yet_in_play) && (~~barearray_contains(debugrituals_barearray, goal))) {
        if (debugrituals_barearray-->1 < barearray_limit(debugrituals_barearray)) {
            if (debugrituals_barearray-->1 < barearray_limit(debugrituals_barearray)-1)
                barearray_append(debugrituals_barearray, goal);
            else
                barearray_append(debugrituals_barearray, "...too many to list...");
        }
    }
    #endif; ! DEBUG_RITUAL
];
-).
 
No-zone is a room-goal. [Not eligible for goto-tracking; apologize. Used for in-between states like being underwater or lost.]
 
A room has a room-goal called the zone. The zone of a room is usually no-zone.
The verb to zone-inhabit (it zone-inhabits, they zone-inhabit, it is zone-inhabiting) implies the zone property.
Definition: a room is zoneless if the zone of it is no-zone.
A room has a room called the near-zone-room. The near-zone-room of a room is usually nothing. [Only meaningful for zoneless rooms.]
 
A room-goal has a room called the canon-room. The canon-room of a room-goal is usually nothing.
 
The impossible-goal is an action-goal. [Vague that's-impossible refusal.]
The short-description of impossible-goal is "achieve the impossible".
 
To decide what room-goal is the current zone:
    decide on the zone of the location.
 
To decide what room-goal is the containing zone of (T - thing):
    if T is off-stage:
        decide on no-zone;
    let R be the location of T;
    if R is nothing:
        decide on no-zone;
    decide on the zone of R.
 
To decide what room is the canonical room of (G - room-goal):
    if G is no-zone:
        really decide on nothing;
    let R be the canon-room of G;
    if R is not nothing:
        decide on R;
    [We'll have to do this the slow way. (Can't use "if a room (called R) zone-inhabits G..." due to Mantis bug 1046.)]
    repeat with R2 running through rooms:
        if R2 zone-inhabits G:
            decide on R2;
    really decide on nothing.
 
To decide what number is maximum-goal-depth: (- MAXIMUM_GOAL_DEPTH -).
To decide what bare-array is prereq-bare-array: (- prereq_barearray -).
To decide what bare-array is goalstack-bare-array: (- goalstack_barearray -).
Include (-
Constant MAXIMUM_GOAL_DEPTH 18;
Array prereq_barearray table 11;
Array goalstack_barearray table (MAXIMUM_GOAL_DEPTH+2);
-).
 
Section - Goal Entry Points
 
[Game-callable utility phrase: perform an action goal. (This is called directly by the "perform ..." grammar.)]
To goal-perform (G - action-goal):
    if G is not ever-done:
        if G is recallable and G is known:
            say "You've learned the ritual, but never performed it. Once you have gone through the steps, you'll have a better grasp of the technique.";
        else:
            say "You do not know how to do that.";
        stop;
    let origroom be the location;
    ensure no ritual is left behind "Before you begin";
    if attempt to achieve G:
        do nothing;
    if origroom is not the location:
        say "(You are now [refer-preposition of location] [refer-name of location].)"
 
[Test whether performing a goal is possible. Should not affect state.]
[...I wound up not implementing this.
To decide whether goal-performance possible for (G - action-goal):
    if G is not recallable:
        decide no;
    if G is not ever-done:
        decide no;
    if attempt to achieve G, hypothetically:
        decide yes;
    else:
        decide no.
]
 
[Game-callable utility phrase: create a (currently offstage) object. (This is called directly by the "create ..." grammar.)]
To goal-create (T - thing):
    if T is not recallable:
        say "(BUG) [T] is not recallable.";
        stop;
    if the player carries T:
        say "You're holding [the T].";
        stop;
    if T is not ever-seen:
        say "You do not know what that is.";
        stop;
    let origroom be the location;
    let loc be the holder of T;
    let room-loc be loc;
    while room-loc is not nothing and room-loc is not a room:
        let room-loc be the holder of room-loc;
    if room-loc is not nothing:
        if room-loc is the location:
            say "[The T] is right here.";
        else:
            say "[The T] is [refer-preposition of room-loc] [refer-name of room-loc], as you recall.";
        stop;
    ensure no ritual is left behind "Before you begin";
    if attempt to achieve T:
        do nothing;
    if origroom is not the location:
        say "(You are now [refer-preposition of location] [refer-name of location].)"
 
[Test whether creating a thing is possible. Should not affect state.]
[...I wound up not implementing this.
To decide whether goal-creation possible for (T - thing):
    if T is not recallable:
        decide no;
    if the player carries T:
        decide no; [?]
    if T is not ever-seen:
        decide no;
    let loc be the holder of T;
    let room-loc be loc;
    while room-loc is not nothing and room-loc is not a room:
        let room-loc be the holder of room-loc;
    if room-loc is not nothing:
        decide no; [?]
    if attempt to achieve T, hypothetically:
        decide yes;
    else:
        decide no.
]
 
[Game-callable utility phrase: go to where something is. (This is called directly by the "go to ..." grammar.)]
To goal-travel to (T - thing):
    if T is not recallable:
        say "(BUG) [T] is not recallable.";
        stop;
    if the player carries T:
        say "You're holding [the T].";
        stop;
    if T is not ever-seen:
        say "You do not know what that is.";
        stop;
    ensure no ritual is left behind "Before you leave";
    let loc be nothing;
    let room-loc be nothing;
    [Follow transform chain if necessary.]
    let transcount be zero;
    while always:
        let loc be the holder of T;
        let room-loc be loc;
        while room-loc is not nothing and room-loc is not a room:
            let room-loc be the holder of room-loc;
        if room-loc is nothing and T is handled and the fate of T is transformed-fate and transcount < 4:
            let O be the fate-object of T;
            say "[if transcount is zero]([The T][else], which[end if] became [the O]";
            now T is O;
            increment transcount;
            next;
        break;
    if transcount is not zero:
        say ".)";
    if room-loc is nothing and the creation-action of T is a supply-action-goal:
        [Sneakily swap in the supply object, which will have a simple location.]
        let T be the creation-target of the creation-action of T;
        now room-loc is the location of T;
        set pronouns from T; [sorta wrong in a utility function, but appropriate for the "go to ..." grammar.]
    if room-loc is nothing:
        if T is not handled:
            say "You have not made [the T], yet.";
        else:
            say "Impossible. ";
            recall T at depth zero;
            say ".";
        stop;
    if room-loc is the location:
        say "[The T] is right here.";
        stop;
    say "[The T] is [refer-preposition of room-loc] [refer-name of room-loc], as you recall. You head that way.";
    goal-travel to room-loc.
 
[Game-callable utility phrase: go to a room. (This is called directly by the "go to ..." grammar.)]
To goal-travel to (R - room):
    if R is a reset-room:
        [Special case; we presume that *some* reset-room is always accessible. R is going to be the Void-Room, rather than the nearest, but whatever.]
        say "You make your way back to the Void.";
        now the player is in R;
        stop;
    if the location is R:
        say "You are already [refer-preposition of R] [refer-name of R].";
        stop;
    if R is not visited:
        say "You do not know where that is.";
        stop;
    let origroom be the location;
    let targetzone be the zone of R;
    if targetzone is no-zone and the near-zone-room of R is not nothing and the near-zone-room of R is visited:
        [Safe, but not very satisfactory to the player.]
        say "You'll have to be more specific about getting to [refer-name of R].";
        stop;
    if targetzone is no-zone:
        say "You're not sure how to get to [refer-name of R].";
        stop;
    ensure no ritual is left behind "Before you leave";
    if targetzone is the current zone:
        [There are no goal-obstacles; just go.]
        now the player is in R;
        stop;
    if attempt to achieve R:
        try looking; [### should restrict for brief mode!]
        say going-look-break;
    else:
        if origroom is not the location:
            say "(You are now [refer-preposition of location] [refer-name of location].)"
 
[Test whether going to a room is possible. Should not affect state.]
[...I wound up not implementing this.
To decide whether goal-travel possible to (R - room):
    if the location is R:
        decide yes;
    if R is not visited:
        decide no;
    let origroom be the location;
    let targetzone be the zone of R;
    if targetzone is no-zone:
        decide no;
    if targetzone is the current zone:
        [There are no goal-obstacles; just go.]
        decide yes;
    if origroom is not the location:
        say "(BUG) Checking goal-travel possible caused the player to actually move from [origroom] to [location].";
    if attempt to achieve R, hypothetically:
        decide yes;
    else:
        decide no.
]
 
Section - Goal Internals
 
The goalstate is a thing.
The goalstate has a number called the depth. [require goal depth]
[The goalstate can be hypothetical.] [Not implemented.]
The goalstate has an object called the top-goal. The top-goal of goalstate is impossible-goal.
The goalstate can be latest-req-failed or latest-req-succeeded.
The goalstate can be error-stack-recited.
The goalstate has a room-goal called the zone-step-target.
The goalstate has a room called the pickup-room.
The goalstate has a room called the pickup-stretch-room.
The goalstate has an object called the pickup-holder.
The goalstate has a number called the room-count. [number of new rooms visited]
 
To decide whether goalstate is hypothetical: (- 0 -).
To decide whether goalstate is not hypothetical: (- 1 -).
 
[Top-level entry point to the goal mechanism.]
To decide whether attempt to achieve (G - object), hypothetically:
    if goal-tracing:
        say "(trace) setting up a goal attempt[if hypothetically] (hypothetical)[end if]...";
    if the top-goal of goalstate is not impossible-goal:
        say "(BUG) attempt-to-achieve was called recursively, and we don't support that.";
        decide no;
    completely suppress paragraph newlines;
    [If this were recursive, we'd push existing goalstate here.]
    now the top-goal of goalstate is G;
    now the depth of goalstate is zero;
    now the goalstate is not error-stack-recited;
    now the goalstate is latest-req-failed;
    now the zone-step-target of goalstate is no-zone;
    now the room-count of goalstate is zero;
    if hypothetically:
        say "(BUG) 'Hypothetically' is not implemented.";
        decide no;
        [now the goalstate is hypothetical;]
    [else:
        now the goalstate is not hypothetical;]
    clear the prereq-bare-array;
    clear the goalstack-bare-array;
    require G;
    if the depth of goalstate is not zero:
        say "(BUG) Goalstate depth wound up [depth of goalstate]!";
    let top-req-succeeded be whether or not goalstate is latest-req-succeeded;
    if not hypothetically:
        [Do this while the goalstate still indicates goal-achieving.]
        clean up timers remaining;
    now the top-goal of goalstate is impossible-goal;
    if goal-tracing:
        say "(trace) end of goal attempt; success was [top-req-succeeded].";
    [If this were recursive, we'd pop existing goalstate here.]
    restore paragraph newlines;
    if not hypothetically:
        say "[line break][run paragraph on]";
    decide on top-req-succeeded.
 
To decide whether goal-achieving:
    if the top-goal of goalstate is not impossible-goal:
        decide yes.
 
To decide whether goal-tracing: (- goal_tracing_flag -).
 
To decide whether goal-practiced: (- goal_practice_flag -).
 
[Shortcut for "require G; if goalstate is latest-req-failed, rule fails;"]
To require-or-fail (G - object): (-
    ( (+ goal-requiring +)-->1 ) ( {G} );
    if (GetEitherOrProperty( (+ goalstate +), (+ latest-req-failed +) )) {
        RulebookFails(); rtrue;
    }
-).
 
[Same as above, but it also sets a boolean local whether you already had the thing. Note that we invoke the goal machinery even if the thing seems to be already carried.]
To require-or-fail (G - thing) noting (hadflag - nonexisting truth state variable): (-
    {hadflag} = ( (+ takeable +) ( {G} ) && parent( {G} ) == (+ player +) );
    ( (+ goal-requiring +)-->1 ) ( {G} );
    if (GetEitherOrProperty( (+ goalstate +), (+ latest-req-failed +) )) {
        RulebookFails(); rtrue;
    }
-).
 
[An ad-hoc shortcut for invoking the "goal environment available" utility.]
To attain-or-fail environment (E - ritual-env) noting (tool - nonexisting thing variable): (-
    ! Set up the input "argument" of the goal.
    WriteGProperty(OBJECT_TY, (+ create-ritual-env-goal +), (+ goal-env +), {E});
    ( (+ goal-requiring +)-->1 ) ( (+ create-ritual-env-goal +) );
    if (GetEitherOrProperty( (+ goalstate +), (+ latest-req-failed +) )) {
        RulebookFails(); rtrue;
    }
    {tool} = GProperty(OBJECT_TY, (+ create-ritual-env-goal +), (+ goal-env-tool +));
    ! Clear the output "argument" of the goal.
    WriteGProperty(OBJECT_TY, (+ create-ritual-env-goal +), (+ goal-env-tool +), (+ no-thing +));
-).
 
To auto-drop (T - thing):
    if T is nothing or T is no-thing:
        stop;
    if the player does not carry T:
        say "(BUG) Cannot auto-drop [T].";
        stop;
    now T is handled;
    if T is an impet:
        now T is closed;
    now T is in the location.
 
To auto-drop (T - thing) unless (skip - truth state):
    unless bool skip:
        auto-drop T.
 
To auto-drop (T - thing) if (doit - truth state):
    if bool doit:
        auto-drop T.
 
To recite the goal stack:
    now goalstate is error-stack-recited;
    let N be the count of goalstack-bare-array;
    let flag be true;
    let prev-G be nothing;
    while N > 0:
        decrement N;
        let G be object N of goalstack-bare-array;
        if G is an undescribed action-goal:
            continue the loop;
        if G is a thing and the creation-action of G is prev-G:
            continue the loop;
        if flag is true:
            say "(While trying to ";
        else:
            say ", to ";
        now flag is false;
        if G is an action-goal:
            say short-description of G;
        else if G is a room-goal:
            let R be the canonical room of G;
            say "reach [refer-name of R]";
        else if G is a room:
            say "reach [refer-name of G]";
        else if G is a thing:
            say "acquire [the G]";
        else:
            say "[G]";
        now prev-G is G;
    if flag is false:
        say ".)"
 
[Invoke one goal in the goal tree; will recursively require more goals. G must be a room-goal, an actual room, an action-goal, or a takeable.]
To require (G - object) (this is goal-requiring):
    if the top-goal of goalstate is impossible-goal:
        say "(BUG) require (-or-fail) was called outside an attempt-to-achieve.";
        stop;
    if goal-tracing:
        say "(trace) (depth [depth of goalstate]) require [objname G].";
    if depth of goalstate >= maximum-goal-depth:
        now the goalstate is latest-req-failed;
        if goalstate is not hypothetical:
            say "This has become too confusing. You stop.";
            if goalstate is not error-stack-recited:
                recite the goal stack;
        stop;
    if G is not reentrant and the object G is listed in goalstack-bare-array:
        now the goalstate is latest-req-failed;
        add G to goalstack-bare-array;
        if goalstate is not hypothetical:
            say "This is impossible, so you stop.";
            if goalstate is not error-stack-recited:
                recite the goal stack;
        stop;
    increment depth of goalstate;
    add G to goalstack-bare-array;
    if the depth of goalstate is not the count of goalstack-bare-array:
        say "(BUG) goalstack-bare-array size does not match depth.";
    now the goalstate is latest-req-failed;
    if G is an action-goal:
        if generic action prereqs for G succeeded:
            now the goalstate is latest-req-succeeded;
        else:
            now the goalstate is latest-req-failed;
    else if G is a room-goal:
        let R be the canonical room of G;
        if generic zone prereqs for R in G succeeded:
            now the goalstate is latest-req-succeeded;
        else:
            now the goalstate is latest-req-failed;
    else if G is a room:
        if generic zone prereqs for G in zone of G succeeded:
            now the goalstate is latest-req-succeeded;
        else:
            now the goalstate is latest-req-failed;
    else if G is a thing:
        if generic thing prereqs for G succeeded:
            now the goalstate is latest-req-succeeded;
        else:
            now the goalstate is latest-req-failed;
    else:
        say "(BUG) require [objname G] invoked, but that is not a goal or thing.";
    decrement depth of goalstate;
    remove last from goalstack-bare-array;
    if the goalstate is latest-req-failed and goalstate is not error-stack-recited and goalstate is not hypothetical:
        recite the goal stack;
    [if goal-tracing:
        say "(trace) (depth [depth of goalstate]) exiting [objname G]; latest req [if goalstate is latest-req-succeeded]succeeded[else]failed[end if].";]
 
To decide whether generic thing prereqs for (G - thing) succeeded:
    if G is not takeable:
        say "(BUG) Tried to require [objname G], which is not takeable.";
        decide no;
    if G is not ever-seen:
        if goalstate is not hypothetical:
            say "You do not know how to proceed.";
            if not release mode:
                say "(DEBUG) ...with thing [objname G].";
        decide no;
    if goalstate is hypothetical and G is barelist-in prereq-bare-array:
        decide yes;
    let loc be the holder of G;
    if loc is the player:
        decide yes;
    let room-loc be loc;
    while room-loc is not nothing and room-loc is not a room:
        let room-loc be the holder of room-loc;
    let creategoal be the creation-action of G;
    if room-loc is nothing and creategoal is not impossible-goal and creategoal is ever-done:
        require creategoal;
        if goalstate is latest-req-failed:
            decide no;
        if goalstate is hypothetical:
            add G to prereq-bare-array;
        else:
            if the player does not carry G:
                say "(BUG) Goal create action for [objname G] succeeded, but G is not carried.";
                decide no;
        decide yes;
    else if room-loc is nothing:
        if goalstate is not hypothetical:
            recall G at depth zero;
            if G is handled:
                say ". You don't know where to get ";
                if G is plural-named or G is mass-named:
                    say "more";
                else:
                    say "another one";
            say ".";
        decide no;
    else:
        if room-loc is not visited:
            if goalstate is not hypothetical:
                say "You do not know where [the G] is.";
            decide no;
        let targetzone be the zone of room-loc;
        let stretchroom be room-loc;
        if targetzone is no-zone and the near-zone-room of room-loc is not nothing and the near-zone-room of room-loc is visited:
            now room-loc is the near-zone-room of room-loc;
            now targetzone is the zone of room-loc;
            if targetzone is no-zone:
                say "(BUG) zone of a near-zone-room is no-zone.";
                decide no;
        if targetzone is no-zone:
            if goalstate is not hypothetical:
                say "You're not sure how to get to [refer-name of room-loc].";
            decide no;
        if room-loc is the location:
            do nothing;
        else if targetzone is the current zone:
            if goalstate is not hypothetical:
                say "You head to [refer-name of room-loc].";
                move the player to room-loc, without printing a room description;
        else:
            require room-loc;
            if goalstate is latest-req-failed:
                decide no;
            if goalstate is not hypothetical:
                [travel message was handled by the require call]
                move the player to room-loc, without printing a room description;
        [only needs to persist until the pickup rule begins]
        now the pickup-room of goalstate is room-loc;
        now the pickup-stretch-room of goalstate is stretchroom;
        now the pickup-holder of goalstate is loc;
        follow the goal pickup rules for G;
        if rule failed:
            decide no;
        if goalstate is hypothetical:
            add G to prereq-bare-array;
        else:
            if the player does not carry G:
                say "(BUG) Goal pickup rules for [objname G] succeeded, but G is not carried.";
                decide no;
        decide yes.
 
[Deals with picking up (existent) objects for thing goals. Presume that the player is in pickup-room (although this will not be true for hypothetical attempts).]
The goal pickup rulebook is a thing based rulebook.
 
Goal pickup rule for a thing (called G) when the pickup-holder of goalstate is the kiln or the pickup-holder of goalstate is in the kiln (this is the kiln pickup rule):
    if not currently fireproof and kiln-reach-goal is ever-done:
        require-or-fail kiln-reach-goal;
    else if not currently fireproof:
        if goalstate is not hypothetical:
            say "[The G] is in the kiln, and you're not fireproof.";
        rule fails;
    require-or-fail the location of the kiln;
    if goalstate is not hypothetical:
        say "You reach into the kiln and take [the G].";
        now the player carries G;
    rule succeeds.
 
Goal pickup rule for a thing (called G) when the pickup-holder of goalstate is the retort (this is the retort pickup rule):
    if rstate is active:
        if goalstate is not hypothetical:
            say "[The G] is within an active ritual.";
        rule fails;
    if goalstate is not hypothetical:
        say "[The G] is currently inside the retort.";
    rule fails.
 
Goal pickup rule for a thing (called G) when the pickup-holder of goalstate is a ritual-bound (this is the ritual-bound pickup rule):
    if rstate is active:
        if goalstate is not hypothetical:
            say "[The G] is within an active ritual.";
        rule fails;
    if goalstate is not hypothetical:
        say "You take [the G] from [the pickup-holder of goalstate].";
        now the player carries G;
    rule succeeds.
 
Goal pickup rule for a thing (called G) when the pickup-room of goalstate is not the pickup-stretch-room of goalstate (this is the give-up-on-stretch pickup rule):
    if goalstate is not hypothetical:
        say "You'll have to be more specific about reaching [refer-name of pickup-stretch-room of goalstate].";
    rule fails.
 
Goal pickup rule for a thing (called G) when the pickup-room of goalstate is the pickup-holder of goalstate (this is the standard lying-on-the-floor pickup rule):
    if goalstate is not hypothetical:
        say "You take [the G].";
        now the player carries G;
    rule succeeds.
 
Last goal pickup rule for a thing (called G) when the pickup-holder of goalstate is an open container (this is the general container pickup rule):
    if goalstate is not hypothetical:
        say "You take [the G] from [the pickup-holder of goalstate].";
        now the player carries G;
    rule succeeds.
 
Last goal pickup rule for a thing (called G) when the pickup-holder of goalstate is a supporter (this is the general supporter pickup rule):
    if goalstate is not hypothetical:
        say "You take [the G] from [the pickup-holder of goalstate].";
        now the player carries G;
    rule succeeds.
 
The last goal pickup rule for a thing (called G) (this is the last-ditch give-up pickup rule):
    if goalstate is not hypothetical:
        say "You cannot reach [the G].";
    rule fails.
 
[This covers all action goals.]
The goal prereqs rulebook is a goal based rulebook.
 
To decide whether generic action prereqs for (G - action-goal) succeeded:
    if G is not ever-done:
        if goalstate is not hypothetical:
            say "You're not sure how to proceed.";
            if not release mode:
                say "(DEBUG) ...with goal [objname G].";
        decide no;
    follow the goal prereqs for G;
    if rule succeeded:
        decide yes;
    else:
        decide no.
 
Goal prereqs rule for the impossible-goal:
    [Say nothing.]
    rule fails.
 
The last goal prereqs rule for a goal (called G):
    say "(BUG) unhandled goal prereqs for [objname G].";
    rule fails.
 
To decide whether generic zone prereqs for (targetroom - room) in (targetzone - room-goal) succeeded:
    if targetzone is no-zone:
        say "(BUG) Tried to require the no-zone.";
        decide no;
    if targetroom is-room off-stagey:
        say "(BUG) Tried to require the no-place.";
        decide no;
    let origzone be the current zone;
    if origzone is no-zone:
        if goalstate is not hypothetical:
            say "Get out of here first; then you can worry about finding your way around.";
        decide no;
    if origzone is targetzone:
        if goalstate is not hypothetical:
            move the player to targetroom, without printing a room description;
        decide yes;
    let curzone be origzone;
    let steps be zero;
    while always:
        if steps > 12:
            say "(BUG) Go-to tracker apparently got stuck! (Going from [origzone] to [targetzone].) That's bad.";
            decide no;
        now the zone-step-target of goalstate is targetzone; [only needs to persist until the zone step rule begins]
        if goal-tracing:
            say "(trace) step from [curzone] to [targetzone].";
        let newzone be the room-goal produced by the zone step rulebook for curzone;
        if newzone is nothing:
            decide no;
        if newzone is no-zone:
            say "You're not sure which way to go.";
            decide no;
        if newzone is targetzone:
            if goalstate is not hypothetical:
                say "You make your way to [refer-name of targetroom].";
                move the player to targetroom, without printing a room description;
            decide yes;
        now curzone is newzone;
        if goalstate is not hypothetical:
            move the player to canonical room of curzone, without printing a room description;
        increment steps.
 
[Zone step rule for CURZONE (from CURZONE to zone-step-target of goalstate)]
The zone step rulebook is a room-goal based rulebook producing a room-goal.
 
The last zone step rule for a room-goal (called G):
    say "(BUG) [objname G] step rule: not implemented.";
    rule fails.
 
[Called at the end of any (top-level) goal attempt, successful or not. The extra tick simulates the extra passage of time for a compound action. It also ensures that any potion drunk in the goal attempt wears off right away.]
To clean up timers remaining:
    [A goal that fails instantly shouldn't trigger these timers. Ditto a goal which is so simple that you can do it in place.]
    if the room-count of goalstate is not zero:
        [To be nice (and to avoid taking actions in a "compressed" context), we skip this step if the goal ended underwater. Successful goals don't end underwater, but failed goals might.]
        if the atmosphere of the location is not water-atm:
            follow the breath daemon rule;
        [Similarly.]
        if the atmosphere of the location is not fire-atm:
            follow the fire-resistance daemon rule.
 
 
Section - The Fates of Things
 
[Our model: "handled" is the master switch. An unhandled object is in its original place (if onstage) or it never existed (if offstage). The fate is only meaningful for offstage, handled things. For those, we can recall what happened, possibly with an argument -- although the argument may always be missing. (Shortcut actions probably won't set it.)]
 
An offstage-fate is a kind of value.
A thing has an offstage-fate called the fate.
A thing has an object called the fate-object.
A thing has some text called the fate-text.
 
The verb to retire to (it retired to, they retired to, it was retired to) implies the fate property.
The verb to retire with (it retired with, they retired with, it was retired with) implies the fate-object property.
 
The offstage-fates are no-fate, text-fate, wrecked-fate, transformed-fate, chasm-fate, maze-fate, drunk-fate, dissolved-fate, incinerated-fate, water-fate, aeroclave-fate, vacuum-fate, burned-fate, burnout-fate, applied-fate, ritual-fate, chymic-fate.
 
The fate of a thing is usually no-fate.
The fate-object of a thing is usually nothing.
 
To retire (T - thing) vaguely:
    now T is off-stage;
    now T is handled;
    now T is ever-seen;
    now the fate of T is no-fate.
 
To retire (T - thing) with explanation (msg - text):
    now T is off-stage;
    [don't handle or mark ever-seen; leave that to the caller.]
    now the fate of T is text-fate;
    now the fate-text of T is msg.
 
To retire (T - thing) by ritual-or-alchemy:
    if rstate is active:
        retire T by ritual;
    else:
        retire T by alchemy.
 
To retire (T - thing) by ritual:
    now T is off-stage;
    now T is handled;
    now T is ever-seen;
    now the fate of T is ritual-fate;
    now the fate-object of T is the location.
 
To retire (T - thing) by ritual in (R - room):
    now T is off-stage;
    now T is handled;
    now T is ever-seen;
    now the fate of T is ritual-fate;
    now the fate-object of T is R.
 
To retire (T - thing) by alchemy:
    now T is off-stage;
    now T is handled;
    now T is ever-seen;
    now the fate of T is chymic-fate;
    now the fate-object of T is the location.
 
To retire (T - thing) by drinking:
    now T is off-stage;
    now T is handled;
    now T is ever-seen;
    now the fate of T is drunk-fate;
    now the fate-object of T is the location.
 
To retire (T - thing) by drinking in (R - room):
    now T is off-stage;
    now T is handled;
    now T is ever-seen;
    now the fate of T is drunk-fate;
    now the fate-object of T is R.
 
To retire (T - thing) by burning out:
    now T is off-stage;
    now T is handled;
    now T is ever-seen;
    now the fate of T is burnout-fate.
 
To retire (T - thing) by burning in (cause - thing):
    now T is off-stage;
    now T is handled;
    now T is ever-seen;
    now the fate of T is burned-fate;
    now the fate-object of T is cause.
 
To retire (T - thing) by applying to (target - thing):
    now T is off-stage;
    now T is handled;
    now T is ever-seen;
    now the fate of T is applied-fate;
    now the fate-object of T is target.
 
To retire (T - thing) by dissolution in (cause - thing):
    now T is off-stage;
    now T is handled;
    now T is ever-seen;
    now the fate of T is dissolved-fate;
    now the fate-object of T is cause.
 
To retire (T - thing) by manual destruction:
    now T is off-stage;
    now T is handled;
    now T is ever-seen;
    now the fate of T is wrecked-fate;
    now the fate-object of T is nothing.
 
To retire (T - thing) by manual destruction in (cause - thing):
    now T is off-stage;
    now T is handled;
    now T is ever-seen;
    now the fate of T is wrecked-fate;
    now the fate-object of T is cause.
 
To retire (T - thing) by transformation into (result - thing):
    now T is off-stage;
    now T is handled;
    now T is ever-seen;
    now the fate of T is transformed-fate;
    now the fate-object of T is result.
 
To retire (T - thing) by chasm-plummeting:
    now T is off-stage;
    now T is handled;
    now T is ever-seen;
    now the fate of T is chasm-fate.
 
To retire (T - thing) by maze-discarding:
    now T is off-stage;
    now T is handled;
    now T is ever-seen;
    now the fate of T is maze-fate.
 
Section - Recalling Things
 
[For stitchability, this routine does *not* print a closing period.]
 
[This whole routine uses "[The T]" rather than "[remote-name of T]", which is wrong, but capitalization is screwing me here. If I yank "the" out of remote-names, then we get mentions of "the yourself" and probably other proper nouns.]
 
To recall (T - thing) at depth (depth - number):
    if T is not recallable:
        say "(BUG) [T] is not recallable";
        stop;
    if T is not ever-seen:
        say "You do not know what that is";
        stop;
    let loc be the holder of T;
    let room-loc be loc;
    while room-loc is not nothing and room-loc is not a room:
        let room-loc be the holder of room-loc;
    if room-loc is nothing and the creation-action of T is a supply-action-goal:
        if depth is not zero:
            say ". ";
        let supply be the creation-target of the creation-action of T;
        let suploc be the location of supply;
        say "[The supply] is [refer-preposition of suploc] [refer-name of suploc]";
        stop;
    if room-loc is nothing:
        if T is not handled:
            if depth is not zero:
                say ". ";
            say "You have not made [the T], yet";
        else if depth > 3:
            say ", and then you lost track";
        else:
            if the fate of T is:
                -- no-fate:
                    say "[if depth is zero][The T][else], which";
                    say " [is-are T] gone";
                -- text-fate:
                    say fate-text of T;
                -- wrecked-fate:
                    if depth is zero:
                        say "You destroyed [the T]";
                    else:
                        say ", which you destroyed";
                    let O be the fate-object of T;
                    if O is not nothing:
                        say " in [the O]";
                -- burned-fate:
                    if depth is zero:
                        say "You burned [the T]";
                    else:
                        say ", which you burned";
                    let O be the fate-object of T;
                    if O is not nothing:
                        if O is a wood-splint:
                            say " using [remote-name of O]";
                        else if O is phlo-gold or O is phlo-electrum:
                            say " using elemental fire";
                        else:
                            say " in [remote-name of O]";
                -- applied-fate:
                    if depth is zero:
                        say "You applied [the T] to";
                    else:
                        say ", which you applied to";
                    let O be the fate-object of T;
                    if O is nothing:
                        say " something";
                    else:
                        say " [remote-name of O]";
                -- transformed-fate:
                    say "[if depth is zero][The T][else], which";
                    say " became";
                    let O be the fate-object of T;
                    if O is nothing:
                        say " something else";
                    else:
                        say " [remote-name of O]";
                        recall O at depth ( depth + 1 );
                -- chymic-fate:
                    if depth is zero:
                        say "[The T] is gone; you added it to a chymic mixture";
                    else:
                        say ", which you added to a chymic mixture";
                    say recall location fate-object of T;
                -- ritual-fate:
                    if depth is zero:
                        say "[The T] is gone; you used it in a ritual";
                    else:
                        say ", which you used in a ritual";
                    say recall location fate-object of T;
                -- drunk-fate:
                    if depth is zero:
                        say "You drank [the T]";
                    else:
                        say ", which was drunk";
                    say recall location fate-object of T;
                -- vacuum-fate:
                    say "[if depth is zero][The T][else], which";
                    say " [was-were T] destroyed by vacuum exposure";
                    say recall location fate-object of T;
                -- water-fate:
                    say "[if depth is zero][The T][else], which";
                    say " [was-were T] ruined by water";
                    if fate-object of T is not nothing:
                        say " in [refer-name of fate-object of T]";
                -- aeroclave-fate:
                    say "[if depth is zero][The T][else], which";
                    say " [was-were T] destroyed by elemental air";
                -- dissolved-fate:
                    if depth is zero:
                        say "You dissolved [the T]";
                    else:
                        say ", which you dissolved";
                    let O be the fate-object of T;
                    if O is not nothing:
                        say " with [the O]";
                -- incinerated-fate:
                    say "[if depth is zero][The T][else], which";
                    say " [was-were T] incinerated";
                    say recall location fate-object of T;
                -- burnout-fate:
                    say "[if depth is zero][The T][else], which";
                    say " [is-are T] gone; you let it burn away";
                -- chasm-fate:
                    if depth is zero:
                        say "You lost [the T] in a chasm";
                    else:
                        say ", which was lost in a chasm";
                -- maze-fate:
                    if depth is zero:
                        say "You lost [the T] in the maze";
                    else:
                        say ", which was lost in the maze";
                -- otherwise:
                    say "(BUG) [The T] retired to [fate of T]";
        stop;
    [...begin the on-stage case]
    if loc is the player:
        if depth is zero:
            say "You're holding [the T]";
        else:
            say ", which you're holding";
        stop;
    let adverb be a text;
    if T is sessile:
        now adverb is "";
    else if T is not handled:
        now adverb is " still";
    else:
        now adverb is " now";
    if room-loc is not visited-this-cycle:
        say "[if depth is zero]You[else]. You";
        say " have not been there yet, but you presume [the T]";
        say " [is-are T]";
        if T is not handled:
            now adverb is " waiting";
    else:
        say "[if depth is zero][The T][else], which";
        say " [is-are T]";
    if loc is not room-loc:
        if T is part of loc:
            say "[adverb] within";
        else if loc is a container:
            say "[adverb] in";
        else:
            say "[adverb] on";
        say " [the loc]";
        if the room-loc is the location:
            say " (right here)";
        else:
            say " ([refer-preposition of room-loc] [refer-name of room-loc])";
    else:
        if the room-loc is the location:
            say " right here";
            say " ([refer-preposition of room-loc] [refer-name of room-loc])";
        else:
            say "[adverb] [refer-preposition of room-loc] [refer-name of room-loc]";
    stop.
 
To say recall (T - thing) briefly:
    [like the above, but as "you're holding it" or "it's in the Kitchen". No history, no punctuation.]
    let loc be the holder of T;
    let room-loc be loc;
    while room-loc is not nothing and room-loc is not a room:
        let room-loc be the holder of room-loc;
    if room-loc is nothing:
        say "it's gone";
    else if loc is the player:
        say "you're holding it";
    else if loc is not room-loc:
        say "it's";
        if T is part of loc:
            say " within";
        else if loc is a container:
            say " in";
        else:
            say " on";
        say " [the loc]";
        if the room-loc is the location:
            say " (right here)";
        else:
            say " ([refer-preposition of room-loc] [refer-name of room-loc])";
    else:
        say "it's";
        if the room-loc is the location:
            say " right here";
            say " ([refer-preposition of room-loc] [refer-name of room-loc])";
        else:
            say " [refer-preposition of room-loc] [refer-name of room-loc]";
    stop.
 
To say recall location (R - room):
    if R is nothing:
        stop;
    if R is the location:
        say ", here";
    say " [refer-preposition of R] [refer-name of R]"
 
To say recall location (T - thing):
    if T is nothing:
        stop;
    say " in [the T]"
 
Chapter - Pure Information
 
Section - Magic Words
 
A formula is a kind of object.
A formula can be privately-named or publically-named. A formula is usually publically-named. [They are typable.]
Understand "formula" as a formula when the item described is not xyzzy.
 
A formula has a text called the description.
A formula can be known or unknown. A formula is usually unknown.
A formula can be sealish or nonsealish. A formula is usually nonsealish.
A formula can be vocal or nonvocal. A formula is usually vocal.
 
To mark (F - formula) as known: (- MarkFormulaKnown({F}); -).
 
Include (-
[ MarkFormulaKnown form;
    if (form == nothing) {
        print "(BUG) MarkFormulaKnown(", (name) form, ")!^";
        return;
    }
    if (form == (+ xyzzy +) ) {
        ! This should never wind up listed in known-formulas.
        return;
    }
    if (~~(form in (+ known-formulas +) )) {
        move form to (+ known-formulas +);
    }
    SetEitherOrProperty(form, (+ known +) );
];
-).
 
The known-formulas is a container.
When play begins (this is the known-formulas container setup rule):
    repeat with F running through known formulas:
        mark F as known.
 
Check invoking a vocal formula when the location is airless:
    if the atmosphere of the location is water-atm:
        instead say "You can't speak; you're holding your breath.";
    instead say "You can't speak; there's no air."
 
The alien-glyph non-ritual invocation rule is listed before the generic non-ritual formula invocation rule in the carry out invoking rulebook.
Carry out invoking an alien-glyph (this is the alien-glyph non-ritual invocation rule):
    if the noun is consumed:
        instead say "You try to visualize [the noun], but the shape doesn't seem interesting any more.";
    instead say "You have no idea how it's pronounced, but you visualize [the noun] as clearly as possible. Nothing seems to result, however."
 
The alien-pattern non-ritual invocation rule is listed before the generic non-ritual formula invocation rule in the carry out invoking rulebook.
Carry out invoking an alien-pattern (this is the alien-pattern non-ritual invocation rule):
    instead say "You begin running through the geometric sequence in your head. When you reach the end, you feel slightly dizzy, but there is no other result."
 
Carry out invoking the resonant-tone:
    instead say "You hum the resonant tone, but there is no effect."
 
Carry out invoking an nonsealish formula when the rstate is active:
    instead try rit-speaking the noun.
 
Carry out invoking an nonsealish formula (this is the generic non-ritual formula invocation rule):
    tutor tut-formula-outside-ritual;
    instead say "You [one of]say[or]recite[or]invoke[or]speak[at random] [the noun][one of]. Nothing happens[or], but nothing results[or]. There is no effect[or], but there is no effect[at random]."
 
Carry out invoking a sealish formula:
    if a ritual-bound (called B) is in the location:
        instead try rit-sealing B with the noun;
    instead say "You [one of]say[or]recite[or]invoke[or]speak[at random] [the noun]. But there is no ritual bound here to concentrate on, so [one of]nothing happens[or]there is no effect[purely at random]."
 
Carry out invoking an sealish formula when the rstate is active:
    say "The ritual is already in progress. [if the initial-sealing of rstate is the noun]Repeating the sealing word[else]Invoking another sealing word[end if] would tangle the bound";
    unless chapter-1-done:
        say ". If you want to start over, you'll have to halt the ritual first, by reciting your unsealing mantra";
    instead say "."
 
 
The no-word is a formula.
Understand "word", "word of", "fake", "fake-word" as the no-word.
 
The unseal-word is a known formula. The printed name is "unsealing mantra".
The description is "The unsealing mantra isn't an alchemical formula. It's just a way to divert your mind from a ritual in progress, breaking open the bound and dissipating any energies."
Understand "mantra", "unsealing", "unseal", "unbinding", "unbind" as the unseal-word.
 
Carry out invoking the unseal-word:
    instead say "You chant the unsealing mantra. [one of]But[or]However,[purely at random] [one of]you are not concentrating on any ritual[or]no ritual is in progress[cycling], so there's nothing to [one of]unseal[or]break[purely at random]."
 
Carry out invoking the unseal-word when the rstate is active:
    tutor tut-step-unseal;
    say "You let the unsealing mantra run through your mind, clearing away the ritual energy. The bound goes dark.";
    shut down the ritual state;
    stop.
 
The simple-seal-word is a known sealish formula. The printed name is "simple sealing word".
The description is "The simple sealing word creates a boundary circle around a ritual space. Most alchemical procedures begin with a sealing word."
Understand "simple", "sealing", "word" as the simple-seal-word.
 
The ka-seal-word is a sealish formula. The printed name is "Ka Sealing". The indefinite article is "the".
The description is "The Ka Sealing word creates a boundary circle. It is derived from the Classical Egyptian analytical model of the human mind, or spirit."
Understand "ka", "sealing", "word" as the ka-seal-word.
 
The hermetic-seal-word is a sealish formula. The printed name is "Hermetic Sealing". The indefinite article is "the".
The description is "The Hermetic Sealing word creates a boundary circle. It is always used for chymical transformations in the retort, although it has other uses as well."
Understand "hermetic", "sealing", "word" as the hermetic-seal-word.
 
The shamash-seal-word is a sealish formula. The printed name is "Sealing of Shamash". The indefinite article is "the".
The description is "The Sealing of Shamash creates a boundary circle. It comes from a Babylonian ritual tradition, where it is associated with order, the calendar, and clockwork[first time]. You didn't know the Babylonians [em]had[/em] clockwork, but that's what the textbook said[only]."
Understand "shamash", "sealing", "sealing of" as the shamash-seal-word.
 
The mithraic-seal-word is a sealish formula. The printed name is "Mithraic Sealing". The indefinite article is "the".
The description is "The Mithraic Sealing word creates a boundary circle. The Mithraic tradition is a mystery cult, associated with labyrinths and secrets."
Understand "mithraic", "sealing", "word" as the mithraic-seal-word.
 
The phlegmatic-seal-word is a sealish formula. The printed name is "phlegmatic sealing word".
The description is "The phlegmatic sealing word creates a boundary circle. It has a stable, passive pattern -- Yin in the Oriental traditions, cool and moist in the Greek."
Understand "phlegmatic", "sealing", "word" as the phlegmatic-seal-word.
 
The grendel-seal-word is a proper-named sealish formula. The printed name is "Grendel's Sealing".
The description is "Grendel's Sealing creates a boundary circle. It is used in dragon-ordering rituals. (The marcher-construct sort of dragon, that is.) It derives from an Old English narrative tradition of dragon-hunting. (The scaly mythical sort.)"
Understand "grendel", "grendels", "grendel's", "sealing" as the grendel-seal-word.
 
The marcher-seal-word is a sealish formula. The printed name is "Marcher's Sealing". The indefinite article is "the".
The description is "The Marcher's Sealing creates a boundary circle. You recall it from the great rituals that launch the [Retort] and bring it home."
Understand "marcher", "marcher's", "sealing", "invocation" as the marcher-seal-word.
 
The nature-word is a known formula. The printed name is "word of essential nature".
The description is "[tutor tut-saw-nature]The word of essential nature is used in rituals to invoke the principle of sympathy."
Understand "word", "word of", "essential", "nature" as the nature-word.
 
The anaphylaxis-word is a formula. The printed name is "word of anaphylaxis".
The description is "The word of anaphylaxis inflames the sensitivity of contrary elements."
Understand "word", "word of", "anaphylaxis" as the anaphylaxis-word.
 
The emulgence-word is a formula. The printed name is "word of emulgence".
The description is "The word of emulgence allows immiscible elements to blend into a homogenous composition."
Understand "word", "word of", "emulgence" as the emulgence-word.
 
The entension-word is a formula. The printed name is "word of entension".
The description is "The word of entension delays a reaction, which can later be resolved by a word of culmination."
Understand "word", "word of", "entension" as the entension-word.
 
The culmination-word is a formula. The printed name is "word of culmination".
The description is "The word of culmination resolves a reaction which has been delayed by a word of entension."
Understand "word", "word of", "culmination" as the culmination-word.
 
The binding-word is a known formula. The printed name is "elementary word of binding".
The description is "The elementary word of binding is frequently used to make simple chymical compounds."
Understand "word", "word of", "elementary word of", "elementary", "binding" as the binding-word.
 
The Crystalline Tempering is a formula. The indefinite article is "the".
The description is "The Crystalline Tempering is a rhythmic chain of sounds, which tends to pull mineral substances into more regular order."
Understand "crystal tempering" as the Crystalline Tempering.
 
The Anodyne Evocation is a formula. The indefinite article is "the".
The description is "The Anodyne Evocation aids the health and growth of the body."
 
The Celestial Sphere is a formula. The printed name is "Binding of the Celestial Sphere". The indefinite article is "the".
The description is "The Binding of the Celestial Sphere is appropriate for astrological constructs and compounds of aither."
Understand "binding", "binding of" as the Celestial Sphere.
 
The tortoise-name is a formula. The printed name is "Name of the Tortoise".  The indefinite article is "the".
The description is "The Name of the Tortoise is an elemental invocation of water, in the fivefold Oriental symbology."
Understand "name", "name of", "tortoise", "turtle" as the tortoise-name.
 
The binding-antipathy is a formula. The printed name is "Binding of Antipathy". The indefinite article is "the".
The description is "The Binding of Antipathy can hold contradictory elements in accord, or amplify an element's opposition to external influences."
Understand "binding", "binding of", "antipathy" as the binding-antipathy.
 
The chi-binding is a formula.  The printed name is "Chi Binding". The indefinite article is "the".
The description is "The Chi Binding is an elemental binding used in certain Chinese ritual traditions, particularly the syntheses of the Song Dynasty."
Understand "chi", "ki", "qi", "binding" as the chi-binding.
 
The counterbalance is a formula. The printed name is "syllable of counterbalance".
The description is "The syllable of counterbalance is a precise phoneme cluster which permits opposing forces to be brought into stasis."
Understand "syllable", "syllable of" as the counterbalance.
 
The resonant-tone is a formula. The printed name is "resonant tone".
The description is "The tone is a particular pitch that resonates with the structure of matter. It allows substances to be tuned for various vibrational effects."
Understand "resonant", "resonance", "tone" as the resonant-tone.
 
The categorical imperative is a formula. The indefinite article is "the".
The description is "The categorical imperative is a phonological argument for generalizing a transformation."
 
The Lesser Phlogistical Saturation is a formula. The indefinite article is "the".
The description is "The Lesser Phlogistical Saturation is a knot of breathy syllables. It has to do with reversing processes of tarnish and rust."
 
The Greater Phlogistical Saturation is a formula. The indefinite article is "the".
The description is "The Greater Phlogistical Saturation is a tonal chain of bitten-off sounds and exhalations. It has to do with reversing processes of tarnish and rust."
 
The Phlogistical Catalysis is a formula. The indefinite article is "the".
The description is "The Phlogistical Catalysis is a tedious sequence of murmuring. It's used to stabilize some of the more complex chymical reagents."
[Understand "catalytic" as the Phlogistical Catalysis.] [No, don't collide with the catalytic-env-note.]
 
The Major Animus is a formula.
The description is "The Major Animus is a complex, polyrhythmic glottal intonation. It can impart significant changes in kinetic energy, under controlled circumstances."
 
The Minor Animus is a formula.
The description is "The Minor Animus is a rhythmic glottal intonation. It can impart small changes in kinetic energy, slightly altering the movement of an object."
 
The Mediate Anima is a formula.
The description is "The Mediate Anima is a complex ululation of vowels. It can modulate the forces between moving objects."
 
The Relative Anima is a formula.
The description is "The Relative Anima is a complex ululation of vowels. It can serve as an eye of stability among moving objects."
 
The idempotent group is a formula.
The description is "The idempotent group is a mathematical structure which maps many things to one thing."
Understand "idempot" as the idempotent group.
 
The isomorphic group is a formula.
The description is "The isomorphic group is a mathematical structure which maps things to equivalent things."
Understand "isomorph" as the isomorphic group.
 
The symmetric sequence is a formula.
The description is "The symmetric sequence is a mathematical structure which is the same back-to-front."
 
The antisymmetric sequence is a formula.
The description is "The antisymmetric sequence is a mathematical structure which is upside-down back-to-front."
Understand "anti", "anti-symmetric" as the antisymmetric sequence.
 
The dracon-invocation is a formula. The printed name is "Dracon Invocation". The indefinite article is "the".
The description is "The Dracon Invocation has something to do with dragons, clearly."
Understand "dragon", "dracon", "invocation" as the dracon-invocation.
 
An alien-glyph is a kind of formula.
An alien-glyph is usually nonvocal.
The indefinite article of an alien-glyph is usually "the".
The description of an alien-glyph is usually "The glyph is [short-description]. The glyph [if unconsumed]burns in your memory like something startling you have always known[else]feels familiar, no longer startling[end if]."
An alien-glyph can be consumed or unconsumed.
An alien-glyph has some text called the short-description.
Understand "alien", "glyph" as an alien-glyph.
 
After printing the name of an alien-glyph when the current action is recallish:
    if the item described is consumed:
        say " (spent)".
 
The glyph-1 is an alien-glyph. The printed name is "[if glyph-2 is known]first [end if]alien glyph".
The short-description is "a multidimensional structure -- a surface which is curved back on itself, but with no edges".
Understand "first" as glyph-1 when glyph-2 is known.
 
The glyph-2 is an alien-glyph. The printed name is "second alien glyph".
The short-description is "a multidimensional knot of curves and gaps".
Understand "second" as glyph-2.
 
The glyph-3 is an alien-glyph. The printed name is "third alien glyph".
The short-description is "a multidimensional helix which bends back on itself without end".
Understand "third" as glyph-3.
 
The glyph-4 is an alien-glyph. The printed name is "fourth alien glyph".
The short-description is "a multidimensional flower of petals which curve into each other, surrounding an edgeless space".
Understand "fourth" as glyph-4.
 
An alien-pattern is a kind of formula.
An alien-pattern is usually nonvocal.
The indefinite article of an alien-pattern is usually "the".
Understand "alien", "pattern", "geometric", "sequence" as an alien-pattern.
 
The radix-pattern is an alien-pattern. The printed name is "[em]radix access[/em] pattern".
The description is "A sequence of outward geometric relations, forming a pattern which you can barely hold in your mind's eye."
Understand "radix", "outward", "access" as the radix-pattern.
 
The caudex-pattern is an alien-pattern. The printed name is "[em]caudex access[/em] pattern".
The description is "A sequence of inward geometric relations, forming a pattern which you can barely hold in your mind's eye."
Understand "caudex", "inward", "access" as the caudex-pattern.
 
The calyx-pattern is an alien-pattern. The printed name is "[em]calyx access[/em] pattern".
The description is "A sequence of semantic relations, forming a pattern which you can barely hold in your mind's eye. The pattern has the scent of dragon about it."
Understand "calyx", "access" as the calyx-pattern.
 
The xyzzy is a known formula. The printed name is "silly magic word".
The description is "You read about this magic word in a fantasy novel once."
Understand "plugh", "frotz", "gnusto" as the xyzzy.
 
Check invoking xyzzy:
    instead say "You don't know how to pronounce that."
 
 
Section - Tidbits of Knowledge
 
A tidbit is a kind of object.
[We presume they're all recallable.]
A tidbit can be privately-named or publically-named. A tidbit is usually publically-named. [They are typable.]
A tidbit can be known or unknown. A tidbit is usually unknown.
A tidbit has some text called the description.
The description of a tidbit is usually "(BUG) Tidbit lacks description."
 
Understand "fact" as a tidbit.
Understand "facts" as the plural of tidbit.
 
To mark (T - tidbit) as known: (- MarkTidbitKnown({T}); -).
To say mark (T - tidbit) as known: (- MarkTidbitKnown({T}); -).
 
Include (-
[ MarkTidbitKnown tid;
    if (tid == nothing) {
        print "(BUG) MarkTidbitKnown(", (name) tid, ")!^";
        return;
    }
    if (~~(tid in (+ known-tidbits +) )) {
        move tid to (+ known-tidbits +);
    }
    SetEitherOrProperty(tid, (+ known +) );
];
-).
 
The known-tidbits is a container.
When play begins (this is the known-tidbits container setup rule):
    repeat with T running through known tidbits:
        mark T as known.
 
Chapter - Actions
 
Section - Meta Actions
 
Abouting is an action out of world and applying to nothing.
Understand "about", "credit", "credits" as abouting.
[Carry-out rule is in hadean.ni.]
 
Backer-requesting is an action out of world and applying to nothing.
Understand "backers", "funders", "kickstarters" as backer-requesting.
[Carry-out rule is in hadean.ni.]
 
Help-requesting is an action out of world and applying to one topic.
Understand "help" as help-requesting.
Understand "help [text]" as help-requesting.
Understand the command "hint" as "help".
[Carry-out rule is in hadean.ni.]
 
Command-requesting is an action out of world and applying to nothing.
Understand "command", "commands" as command-requesting.
[Carry-out rule is in hadean.ni.]
 
Vague-restarting is an action out of world and applying to nothing.
 
Carry out vague-restarting:
    unless there is a recallable reset-room (called R):
        instead say "(BUG) There is no recallable reset-room.";
    if R is not visited:
        instead say "[parsermsg]You have not yet learned how to reset the world. Type [excmd]RESTART COMPLETELY[/excmd] to really start the game over from the very beginning.[/parsermsg][br]";
    instead say "[parsermsg]Type [excmd]RESET[/excmd] to re-enter the void, keeping your memories. Type [excmd]RESTART COMPLETELY[/excmd] to really start the game over from the very beginning.[/parsermsg][br]";
 
Void-going is an action applying to nothing.
 
Carry out void-going:
    unless there is a recallable reset-room (called R):
        instead say "(BUG) There is no recallable reset-room.";
    if R is not visited:
        instead say "[parsermsg]You have not yet learned how to reset the world.[/parsermsg][br]";
    instead try visiting R.
 
Understand the command "restart" as something new.
Understand "restart" as vague-restarting.
Understand "restart game/world" as vague-restarting.
Understand "restart completely/entirely/all" as restarting the game.
Understand "reset" as void-going.
Understand "reset game/world" as void-going.
Understand "reset completely/entirely/all" as restarting the game.
Understand "beginning" as void-going.
 
To print custom restart query (this is custom restart querying):
    say "[parsermsg]Are you sure you want to completely restart the game? This will return you to the tutorial. You will forget all the rituals, formulas, and puzzle solutions you have learned. Type [excmd]YES[/excmd] if you're sure.[/parsermsg]";
To print custom restart refusal (this is custom restart refusing):
    say "[parsermsg]Didn't think so.[/parsermsg]";
 
The custom restart the game rule is listed instead of the restart the game rule in the carry out restarting the game rulebook.
The custom restart the game rule translates into I6 as "CUSTOM_RESTART_THE_GAME_R".
Include (-
[ CUSTOM_RESTART_THE_GAME_R;
    if (actor ~= player) rfalse;
    ( (+ custom restart querying +) -->1)();
    print "^>>";
    if (YesOrNo() ~= 0) {
        @restart;
        print "Failed.";
    }
    ( (+ custom restart refusing +) -->1)();
    new_line;
];
-).
 
Understand "use", "use [text]" as a mistake ("[parsermsg]The command 'use' is vague. Try a more specific action. Notes are for reading, dials are for turning, levers are for pulling, and so on.[/parsermsg]").
 
Understand the commands "superbrief", "short", "normal" as something new.
Understand the command "short" as "brief".
 
Exits-listing is an action out of world and applying to nothing.
Understand "exits" as exits-listing.
 
Carry out exits-listing:
    let C be the can't-go of the location;
    if C is "":
        say you're-not-sure;
    else:
        say "[C][line break]".
 
Tutorial-toggling is an action out of world and applying to nothing.
Tutorial-on-flipping is an action out of world and applying to nothing.
Tutorial-off-flipping is an action out of world and applying to nothing.
 
Understand "tutorial" as tutorial-toggling.
Understand "tutorial on/yes" as tutorial-on-flipping.
Understand "tutorial off/no" as tutorial-off-flipping.
 
The tutorial-display is a truth state that varies. The tutorial-display is false.
[Set in the initial tutorial query rule, in the main source.]
 
Carry out tutorial-toggling:
    if tutorial-display is false:
        instead try tutorial-on-flipping;
    else:
        instead try tutorial-off-flipping.
 
Carry out tutorial-on-flipping:
    if tutorial-display is true:
        instead say "[parsermsg]The introductory tutorial is already on.[/parsermsg][br]";
    if tutorial-phase is 99:
        instead say "[parsermsg]You completed the introductory tutorial when you escaped the first room.[/parsermsg][br]";
    now tutorial-display is true;
    instead say "[parsermsg]Tutorial help will be displayed as you explore this room.[/parsermsg][br]";
 
Carry out tutorial-off-flipping:
    if tutorial-display is false:
        instead say "[parsermsg]The introductory tutorial is already off.[/parsermsg][br]";
    now tutorial-display is false;
    if tutorial-phase is 99:
        instead say "[parsermsg]You completed the introductory tutorial when you escaped the first room.[/parsermsg][br]";
    let was-locked be false;
    if tut-initial is open:
        close tut-initial; [get out of the must-LOOK-first mode]
        now was-locked is true;
    instead say "[parsermsg]I will stop showing tutorial help. To turn the messages back on, type [excmd]TUTORIAL ON[/excmd][period][if bool was-locked] (You probably still want to type [excmd]LOOK[/excmd][exclam-mark])[end if][/parsermsg][br]";
 
Understand the commands "curses", "drat", "darn", "bother" as something new.
Understand the commands "shit", "fuck", "damn" as something new.
 
Understand the command "sorry" as something new.
Understand "sorry" as swearing obscenely.
 
 
Section - Internal Actions
 
Topically-applying it to is an action applying to one visible thing and one thing.
[The noun is already off-stage.]
 
Check topically-applying it to when the atmosphere of the location is water-atm:
    [Conveniently, potion bottles shatter in fire and vacuum, so I don't have to worry about those cases.]
    instead say "You try to pour out the [short-description of the noun] over [the second noun], but it just swirls away in the water."
 
Report topically-applying it to:
    instead say "(BUG) You topically apply [the noun] to [the second noun]."
 
Ingesting is an action applying to one visible thing.
[The noun is already off-stage.]
 
Report ingesting:
    instead say "(BUG) [Generic potion ingestion of the noun], but it's not clear what happens."
 
Igniting it with is an action applying to one thing and one thing.
[Implicit taking and reach-checking has already occurred. The second noun is alight.]
 
Section - Actions at a Distance
 
Definition: an object is findable-or-here if it is an ever-seen recallable thing or it is in the location.
Definition: an object is findable-animate if it is an ever-seen recallable mem-character or it is an ever-seen recallable dragon.
Definition: an object is available-knowledge if it is a known formula or it is a known tidbit or it is a known recallable action-goal.
Definition: an object is findable-or-visitable-or-here if it is an ever-seen recallable thing or it is in the location or it is a recallable visited room.
[Definition: an object is findable-or-knowledge-or-here if it is a known formula or it is a known tidbit or it is a known recallable action-goal or it is an ever-seen recallable thing or it is in the location or it is a recallable visited room.]
Definition: an object is visitable-or-findable if it is a recallable visited room or it is an ever-seen recallable thing.
 
Understand "[any known formula]" as "[formula-spec]".
Understand "[any ever-seen recallable thing]" as "[findable-spec]".
Understand "[any recallable visited room]" as "[visitable-spec]".
Understand "[any recallable known action-goal]" as "[performable-spec]".
Understand "[any known tidbit]" as "[quizzable-spec]".
 
Understand "[any findable-or-here object]" as "[findable-or-here-spec]".
Understand "[any findable-animate object]" as "[findable-animate-spec]".
Understand "[any available-knowledge object]" as "[knowledge-spec]".
Understand "[any findable-or-visitable-or-here object]" as "[findable-or-visitable-or-here-spec]".
[Understand "[any findable-or-knowledge-or-here object]" as "[findable-or-knowledge-or-here-spec]".]
Understand "[any visitable-or-findable object]" as "[visitable-or-findable-spec]".
 
Visiting is an action applying to one visible thing.
 
Understand "visit [visitable-or-findable-spec]" as visiting.
Understand the commands "find", "locate" as "visit".
Understand "go to [visitable-or-findable-spec]" as visiting.
Understand "go back to [visitable-or-findable-spec]" as visiting.
 
Carry out visiting a room (called R):
    goal-travel to R;
    stop the action.
Carry out visiting a recallable mem-character (called T):
    let R be the last-met-room of T;
    if R is-room off-stagey:
        instead say "You don't know where [the T] is.";
    let V be the last-met-avatar of T;
    goal-travel to R;
    if the location is not R:
        [Didn't make it.]
        stop the action;
    if V is nothing or V is no-thing or V is not in R:
        say "That's odd. Where did [the T] go?";
    set pronouns from V;
    stop the action.
Carry out visiting a recallable thing (called T):
    goal-travel to T;
    set pronouns from T; [maybe we didn't make it, but set pronouns anyhow]
    stop the action.
Carry out visiting:
    if the noun is visible:
        instead say "[The noun] [is-are noun] right here.";
    else:
        instead say "You're not sure how."
 
Numeric-visiting is an action applying to one number.
[Players shouldn't type this, although they shouldn't be able to break anything if they try.]
Understand "-visit-num [number]" as numeric-visiting.
 
Carry out numeric-visiting:
    let N be the number understood;
    let O be paranoid-object-check N;
    if O is nothing:
        instead say "That address ([N]) is not an object!";
    if O is not a room:
        instead say "That address ([N]) is not a room!";
    if O is the Abstraction Layer:
        instead say "That address ([N]) is not a existent room!";
    say ">>[input]go to [the O][/input][command clarification break]";
    [The visiting action will check the visited flag, as well as reset-rooms and so on. But we do an early check so that we're on a par with the normal "VISIT" scope. This avoids, for example, resetting the game before any reset-room is visited.]
    if O is not visited:
        instead say "That address ([N]) is not a visited room!";
    instead try visiting O.
 
Creating is an action applying to one visible thing.
 
[As with recall, we allow "create X" for scenery in scope.]
Understand "create [findable-or-here-spec]" as creating.
Understand the commands "make", "construct", "build", "concoct", "synthesize", "synthesise", "brew" as "create".
 
Carry out creating a recallable mem-character (called T):
    instead say "You can't create crew members."
Carry out creating a recallable thing (called T):
    goal-create T;
    stop the action.
Carry out creating:
    if the noun is visible:
        instead say "[The noun] [is-are noun] right here.";
    else:
        instead say "You're not sure how."
 
Performing is an action applying to one visible thing.
 
Understand "perform [performable-spec]" as performing.
Understand the commands "enact", "do" as "perform".
 
Carry out performing a recallable action-goal (called G):
    goal-perform G;
    stop the action.
Carry out performing:
    instead say "You're not sure how."
 
 
Section - Returning
 
Returning is an action applying to nothing.
The return-room is a room that varies. The return-room is the Abstraction Layer.
The current-return-room is a room that varies. The current-return-room is the Abstraction Layer.
Understand "return" as returning.
Understand "return to [visitable-or-findable-spec]" as visiting.
Understand "go back" as returning.
 
Carry out returning:
    if the return-room is-room off-stagey:
        instead say "You haven't been anywhere yet.";
    let R be the return-room;
    if R is a reset-room:
        now R is the near-room of R;
    if R is-room off-stagey:
        instead say "You're not sure how.";
    if R is the location:
        instead say "You haven't gone anywhere.";
    say "(return to [the R])[br]";
    instead try visiting R.
 
The last every turn rule (this is the return-room setting rule):
    [We don't rely on last-visited-room because that gets updated many times per "go to X" command.]
    if the current-return-room is not the location:
        now the return-room is the current-return-room;
        now the current-return-room is the location.
 
 
Section - Memory Actions
 
Recalling is an action applying to one visible thing.
 
[We want to permit recalling scenery which is in scope. (With a default "It's right here" message.) Checking whether it's in the location is a cheap way of doing this. It will fail for some cases, e.g. parts-of-scenery, but whatever.
 
A few scenery items have special recall messages. We use "check recalling" rules for those, but never for takeables or memory items.
 
We do *not* use the "findable-or-knowledge-or-here-spec" token. Splitting up the grammar lines (physical, then mental) gives us better disambiguation -- the parser will select a physical object if at all possible.]
 
Understand "recall [findable-or-visitable-or-here-spec]" as recalling.
Understand "recall [knowledge-spec]" as recalling.
Understand "recall about [findable-or-visitable-or-here-spec]" as recalling.
Understand "recall about [knowledge-spec]" as recalling.
 
Carry out recalling the player:
    if current-tense is:
        -- present-tense: say "That's not how memory works";
        -- past-tense: say "That wasn't how memory worked";
        -- perfect-tense: say "That's not how memory works";
        -- future-tense: say "That won't be how memory works";
    instead say "."
 
Check recalling a not recallable character:
    let MC be the mem-character associated with the persona of the noun;
    if MC is not nothing and MC is not the noun:
        instead try recalling MC.
 
Carry out recalling a recallable mem-character:
    if the ever-met-avatar of the noun is true:
        let P be the persona of the noun;
        if P is primary:
            let PF be whether or not a non-shadowy character in the location persona-matches P;
            say the recalled-description of the noun present PF;
            say line break;
            if the aspect-text-seen of the noun is:
                -- 1: say "[His-Her P] shadow read: [the oc-message-basic for the noun][br]";
                -- 2: say "[His-Her P] shadow read: [the oc-message-final for the noun][br]";
    let R be the last-met-room of the noun;
    let R2 be the last-shadow-room of the noun;
    if R is-room off-stagey:
        say "You don't know where [the noun] is";
        unless R2 is-room off-stagey:
            say ", but [his-her noun] shadow is";
            if R2 is the location:
                say " right here";
            else:
                say " [refer-preposition of R2] [refer-name of R2]";
        instead say ".";
    let T be the last-met-avatar of the noun;
    if R is the location:
        say "[The noun] is right here[if T is fracture-blocked], stuck in the fracture[end if]";
    else:
        say "You last saw [the noun] [refer-preposition of R] [refer-name of R][if T is fracture-blocked], caught in a fracture[end if]";
    unless R2 is-room off-stagey:
        say ". ([His-Her noun] shadow is";
        if R2 is the location:
            say " right here";
        else:
            say " [refer-preposition of R2] [refer-name of R2]";
        instead say ".)";
    instead say "."
 
Carry out recalling a recallable thing:
    recall the noun at depth zero;
    instead say "."
 
Carry out recalling a room:
    if the noun is the location:
        instead say "You're right there.";
    instead say "You remember where [refer-name of noun] is[if not visited-this-cycle], although you haven't visited yet[end if]."
 
Carry out recalling a recallable action-goal:
    if the noun is not known:
        instead say you're-not-sure;
    close tut-recalling-all;
    instead say "[the description of the noun][line break]".
 
Carry out recalling a formula:
    if the noun is not known:
        instead say you're-not-sure;
    close tut-recalling-all;
    instead say "[the description of the noun][line break]".
 
Carry out recalling a tidbit:
    if the noun is not known:
        instead say you're-not-sure;
    close tut-recalling-all;
    instead say "[the description of the noun][line break]".
 
Carry out recalling:
    if the noun is visible:
        instead say "[The noun] [is-are noun] right here.";
    else:
        instead say you're-not-sure.
 
Visualizing is an action applying to one visible thing.
[Always redirects to recalling, except for the alien-glyphs, which are invoked directly by visualization.]
 
Understand "visualize [findable-or-visitable-or-here-spec]" as visualizing.
Understand "visualize [knowledge-spec]" as visualizing.
Understand "concentrate on [findable-or-visitable-or-here-spec]" as visualizing.
Understand "concentrate on [knowledge-spec]" as visualizing.
Understand "concentrate on formulas/formulae" as recalling-formulae.
Understand "concentrate on rituals" as recalling-rituals.
Understand "concentrate on facts/notes" as recalling-tidbits.
Understand "concentrate on rooms/locations/places" as recalling-rooms.
Understand "concentrate on objects/things/items" as recalling-things.
Understand "concentrate on doors/locks" as recalling-doors.
 
Understand the command "visualise" as "visualize".
 
Check visualizing a nonvocal formula:
    instead try invoking the noun.
 
Check visualizing:
    instead try recalling the noun.
 
Understand "where is/are/am [findable-or-visitable-or-here-spec]" as visualizing.
Understand "what is/are/am [knowledge-spec]" as visualizing.
Understand "who is/are/am [findable-animate-spec]" as visualizing.
 
Recalling-formulae is an action applying to nothing.
Recalling-rituals is an action applying to nothing.
Recalling-tidbits is an action applying to nothing.
Recalling-rooms is an action applying to nothing.
Recalling-things is an action applying to nothing.
Recalling-doors is an action applying to nothing.
Recalling-all is an action applying to nothing.
 
Understand "recall" as recalling-all.
Understand "recall formulas/formulae" as recalling-formulae.
Understand "formula", "formulas", "formulae" as recalling-formulae.
Understand "recall rituals" as recalling-rituals.
Understand "ritual", "rituals" as recalling-rituals.
Understand "recall facts/notes" as recalling-tidbits.
Understand "facts", "notes" as recalling-tidbits.
Understand "recall rooms/locations/places" as recalling-rooms.
Understand "rooms", "locations", "places" as recalling-rooms.
Understand "recall objects/things/items" as recalling-things.
Understand "objects", "things", "items" as recalling-things.
Understand "recall doors/locks" as recalling-doors.
Understand "doors", "locks" as recalling-doors.
 
Understand the command "think" as something new.
Understand the command "remember", "think", "consider" as "recall".
Understand "concentrate" as recalling-all.
 
Carry out recalling-all:
    let N be the number of action-goals in known-rituals;
    let M be the number of formulas in known-formulas;
    let K be the number of tidbits in known-tidbits;
    if (N + M + K) is greater than 40:
        tutor tut-recalling-query;
        if (N + M + K) is less than 60:
            say "Your store of knowledge is becoming unwieldy. ";
        instead say "Do you want to recall formulas, rituals, facts, places, objects, or doors?";
    tutor tut-recalling-all;
    if N is not zero:
        follow the recalling-rituals rule;
    if M is not zero:
        follow the recalling-formulae rule;
    if K is not zero:
        follow the recalling-tidbits rule.
 
Carry out recalling-formulae (this is the recalling-formulae rule):
    tutor tut-recalling-formulae;
    say "[one of]After months of diligent practice, you have memorized[or]You know[stopping]";
    say " [if less than ten formulas are in known-formulas]several common[else]an impressive list of[end if] alchemical formulae:[line break]";
    list the contents of known-formulas, with newlines, indented, with extra indentation;
 
To say you-are-still-orienting-yourself:
    if current-tense is:
        -- present-tense: say "You are still orienting yourself.";
        -- past-tense: say "You were still orienting yourself.";
        -- perfect-tense: say "You are still orienting yourself.";
        -- future-tense: say "You will still be orienting yourself."
 
Carry out recalling-rituals (this is the recalling-rituals rule):
    let N be the number of action-goals in known-rituals;
    if N is zero:
        instead say you-are-still-orienting-yourself;
    say "You have learned [if N is one]one ritual[else][N in words] rituals[end if]:";
    if there is a not ever-done action-goal in known-rituals:
        say " (* marks rituals you have not yet completed)";
    say line break;
    repeat with O in raw contents of known-rituals:
        say "[indentation 2][O][if O is not ever-done] (*)[end if][br]";
 
Carry out recalling-tidbits (this is the recalling-tidbits rule):
    let K be the number of tidbits in known-tidbits;
    if K is zero:
        instead say you-are-still-orienting-yourself;
    say "You have picked up [if K is one]at least one fact[else if K is two]a couple of facts[else]assorted facts[end if]:[line break]";
    list the contents of known-tidbits, using the definite article, with newlines, indented, with extra indentation;
 
Carry out recalling-rooms (this is the recalling-rooms rule):
    unless escaped first room:
        instead say "You have not yet escaped from this room.";
    let R be the number of visited recallable rooms;
    if R < 2:
        instead say "You have escaped from the Secondary Alchemy Lab, but not explored far.";
    say "Since the accident, you have visited these notable locations:[br]";
    repeat with O running through visited recallable rooms:
        say "[indentation 2][the O][br]";
    recite the spark-unchecked rooms.
 
Carry out recalling-things (this is the recalling-things rule):
    say "Since the accident, you have found (or created) these (portable) items:[br]";
    [Yes, this is slow and there ain't nothing nobody can do about it. As a sop to efficiency we will not loop over *all things*, but over the two takeable classes separately.]
    rapidly set all things not marked for listing;  [loops through all things]
    now the beaker is marked for listing;
    now the nonexistent-stone is marked for listing;
    skip certain objects for listing in recall;
    if two potion-vials are ever-seen:
        say "[indentation 2][group-list ever-seen unmarked for listing potion-vials][br]";
    if two non-potiony chem-vials are ever-seen:
        say "[indentation 2][group-list ever-seen unmarked for listing non-potiony chem-vials][br]";
    if two chem-flasks are ever-seen:
        say "[indentation 2][group-list ever-seen unmarked for listing chem-flasks][br]";
    if two impets are ever-seen:
        say "[indentation 2][group-list ever-seen unmarked for listing impets][br]";
    if two metal-rods are ever-seen:
        say "[indentation 2][group-list ever-seen unmarked for listing metal-rods][br]";
    if two metal-wires are ever-seen:
        say "[indentation 2][group-list ever-seen unmarked for listing metal-wires][br]";
    if two pebbles are ever-seen:
        say "[indentation 2][group-list ever-seen unmarked for listing pebbles][br]";
    if two wood-splints are ever-seen:
        say "[indentation 2][group-list ever-seen unmarked for listing wood-splints][br]";
    if two chimes are ever-seen:
        say "[indentation 2][group-list ever-seen unmarked for listing chimes][br]";
    if two clay-molds are ever-seen:
        say "[indentation 2][group-list ever-seen unmarked for listing clay-molds][br]";
    if two metal-seals are ever-seen:
        say "[indentation 2][group-list ever-seen unmarked for listing metal-seals][br]";
    repeat with O running through ever-seen takeable-things:
        if O is unmarked for listing:
            say "[indentation 2][a O][br]";
    repeat with O running through ever-seen takeable-supporters:
        if O is unmarked for listing:
            say "[indentation 2][a O][br]";
 
[Recalling-doors implementation is very game-specific, so it lives in hadean.ni.]
 
Vague-invoking is an action applying to nothing.
Invoking is an action applying to one visible thing.
 
Understand "invoke" as vague-invoking.
Understand "invoke [formula-spec]" as invoking.
Understand the commands "say", "shout", "speak", "sing" as something new.
Understand the commands "recite", "say", "shout", "speak", "chant", "sing", "intone", "vocalize", "vocalise", "pronounce" as "invoke".
 
Carry out vague-invoking:
    tutor tut-vague-invoke;
    instead say "You'll have to name the formula you want to invoke."
 
Carry out invoking:
    instead say "(BUG) You invoke [the noun]."
 
Understand "examine [formula-spec]" as examining.
[Understand "examine [performable-spec]" as examining.] [Should "x fungicide" fall back to the fungicide creation ritual? Probably not, not even on a separate grammar line.]
 
[Some "recall" forms are defined above.]
 
 
Section - Physical Actions
 
Vague-entering is an action applying to nothing.
[Converted to "going inside", see above.]
 
Understand the command "get" as something new.
Understand "get in/on" as vague-entering.
Understand "get out/off/down/up" as exiting.
Understand "get [things]" as taking.
Understand "get in/into/on/onto/inside [something]" as entering.
Understand "get off/down/out [something]" as getting off.
Understand "get off/out of/from [something]" as getting off.
Understand "get [things inside] from [something]" as removing it from.
 
Understand the commands "enter", "cross" as something new.
Understand "enter" as vague-entering.
Understand "enter [something]" as entering.
Understand "cross [something]" as entering.
 
Understand "go out [something]" as getting off.
Understand "go out of/from [something]" as getting off.
 
Understand "exit [something]" as getting off.
Understand "exit from [something]" as getting off.
Understand the command "escape" as "exit".
 
Understand the command "out" as something new.
Understand "out" as exiting.
Understand "out of/from [something]" as getting off.
 
Check getting off the player:
    instead say "Identity is inescapable."
 
Check getting off a door:
    instead try entering the noun.
 
Understand "put [other things] through [something]" as inserting it into.
Understand "add [other things] to/into [something]" as inserting it into.
 
Understand "place [other things] in/inside/into [something]" as inserting it into.
Understand "place [other things] on/onto [something]" as putting it on.
Understand "place [other things] through [something]" as inserting it into.
 
Understand "lie on/in/inside [something]" as entering.
Understand "lay on/in/inside [something]" as entering. [yeah, yeah]
Understand "lay [other things] in/inside/into [something]" as inserting it into.
Understand "lay [other things] on/onto [something]" as putting it on.
 
Understand "lay down [things preferably held]" as dropping.
Understand "lay [things preferably held] down" as dropping.
 
Understand the command "take" as something new.
Understand "take [things]" as taking.
Understand "take off [something]" as vague-removing.
Understand "take [something] off" as vague-removing.
Understand "take [things inside] from/off [something]" as removing it from.
Understand "take inventory" as taking inventory.
 
Understand the command "carry", "hold" as something new.
Understand "carry [things]" as taking.
Understand "carry [things inside] from/off [something]" as removing it from.
Understand the command "hold" as "carry".
 
Vague-removing is an action applying to one thing.
[Redirects to taking-off for clothing; removing for contained/supported things; freeing otherwise. Do not customize.]
 
Understand the command "remove" as something new.
Understand "remove [something]" as vague-removing.
Understand "remove [things inside] from [something]" as removing it from.
 
Check vague-removing something worn:
    instead try taking off the noun.
Check vague-removing something wearable:
    instead try taking off the noun.
 
Check vague-removing something contained by a container (called C):
    say "(from [the C])";
    instead try removing the noun from C.
Check vague-removing something supported by a supporter (called C):
    say "(from [the C])";
    instead try removing the noun from C.
 
Check vague-removing:
    instead try freeing the noun.
 
[The push-to action is entirely gone.]
 
Understand the commands "push", "shift", "move" as something new.
Understand "push [something]" as pushing.
Understand the commands "shift", "move" as "push".
 
Understand the command "clear" as something new. [removed from grammar]
 
Understand the command "press" as something new.
Understand "press [something]" as pushing.
Understand "press [something] to/on/onto/against [something]" as tapping it on.
 
Understand the commands "screw", "unscrew" as something new.
[Exclude setting-to meanings of "turn", which used to be available for "screw". Also parse "screw on" as simply turning, not switching-on.]
Understand "screw [something]" as turning.
Understand "screw on/off [something]" as turning.
Understand "screw [something] on/off" as turning.
Understand the command "unscrew" as "screw".
 
Understand the commands "rotate", "twist" as something new.
Understand "rotate [something]" as turning.
Understand "rotate [something] to [text]" as setting it to.
[Exclude setting-to meanings of "turn", which used to be available for "rotate".]
Understand the commands "twist", "spin", "crank" as "rotate".
 
The block setting it to rule is not listed in any rulebook.
 
Understand the command "align" as "set".
Understand "turn [something] to [text]" as setting it to.
 
Vague-setting is an action applying to one thing.
Understand "set [something]" as vague-setting.
 
Check vague-setting the player:
    instead say "You aren't adjustable."
 
Report vague-setting:
    say "[The noun] [is-are noun]n't a device you can set."
 
Check setting the player to:
    instead say "You aren't adjustable."
 
Report setting it to:
    instead say "[The noun] [is-are noun]n't a device you can set."
 
Understand the command "unseal" as "open".
Understand the command "seal" as "close".
 
Freeing is an action applying to one thing.
[Note that vague-removing can redirect here, but freeing does not have the "remove X (from container)" meaning.]
Understand "free [something]" as freeing.
Understand the commands "untie", "loose", "loosen", "unbind" as "free".
 
Check freeing a door:
    instead try opening the noun.
 
Check freeing the player:
    instead say "You're not sure how you're bound."
 
Report freeing:
    if the noun is sessile:
        instead say "You can't.";
    else if the noun is carried:
        instead say "[That-Those noun] [is-are noun]n't fastened.";
    else:
        instead say "[That-Those noun] [is-are noun]n't held."
 
Releasing is an action applying to one thing.
[Always redirects to dropping or freeing. Customize those, not releasing.]
Understand "release [something]" as releasing.
 
Check releasing something carried:
    instead try dropping the noun.
 
Check releasing:
    instead try freeing the noun.
 
Burning it with is an action applying to one thing and one thing.
Understand "burn [something] with/from/in/on [something]" as burning it with.
Understand the commands "ignite", "melt" as "burn".
 
The block burning rule is not listed in any rulebook.
 
Carry out burning:
    let H be the best visible fire source besides the noun;
    if H is no-thing and the noun is alight:
        instead say "[The noun] is itself the only handy source of flame.";
    if H is no-thing:
        instead say "You lack any handy way to set [if the noun is the player]yourself[else]things[end if] on fire.";
    say "([if H is sessile]in[else]with[end if] [the H])";
    instead try burning the noun with H.
 
Check burning something with something not alight:
    if the noun is alight:
        instead say "[The second noun] [is-are second noun] not a source of fire, and [the noun] is already on fire anyhow.";
    instead say "[The second noun] [is-are second noun] not a source of fire."
 
Check burning it with when the location is airless:
    if the noun is the fire-sucker:
        continue the action; [special case for underwater/vacuum!]
    instead say "The environment is not conducive to ignition."
 
Check burning something alight with when the noun is the second noun:
    instead say "Logically, [the noun] is already burning itself."
 
Carry out burning it with:
    instead try igniting the noun with the second noun.
 
Ringing is an action applying to one thing.
[Always redirects to touching, or a failure message. (Rit-ringing comes in at a later stage.)]
Understand "ring [something]" as ringing.
Understand the command "play" as "ring".
 
Report ringing:
    say "You're not sure how that could be done."
 
Check ringing a chime:
    instead try touching the noun.
Check ringing the miasma-gong:
    instead try touching the noun.
 
Understand the command "wave" as something new.
Understand "wave [something]" as waving.
 
Check waving the player:
    instead say "You're not sure what that would look like."
 
Last check waving when the noun is scenery or the noun is fixed in place:
    instead say "[if the noun is singular-named]It doesn't[else]They don't[end if] move."
 
Shaking is an action applying to one thing.
Understand "shake [something]" as shaking.
Understand the command "swing" as something new.
Understand the command "swing" as "shake".
 
Check shaking the player:
    instead say "You shake it all about."
 
Last check shaking when the noun is scenery or the noun is fixed in place:
    instead say "[if the noun is singular-named]It doesn't[else]They don't[end if] move."
 
Report shaking:
    instead say "You shake [it-them noun] about, to no effect."
 
The report waving things rule is not listed in any rulebook.
Report waving:
    instead say "You wave [it-them noun] tentatively around."
 
Understand the command "feel" as something new.
Understand "feel [something]" as touching.
 
Tapping it on is an action applying to two things.
Understand "touch [something] to/on/onto/against [something]" as tapping it on.
Understand "touch [something] with [something]" as tapping it on (with nouns reversed).
Understand the commands "tap", "poke" as "touch".
 
Understand the commands "tie", "attach", "fasten" as something new.
Understand "tie [something] to/on/onto [something]" as tapping it on.
Understand the commands "attach", "fasten", "bind" as "tie".
 
Understand "connect [something] to/onto/with [something]" as tapping it on.
 
Understand "apply [something] to/on/onto [something]" as tapping it on.
 
Understand "brush [something]" as brush-rubbing.
Understand "brush [something] to/on/onto/against [something]" as tapping it on.
Understand "brush [something] with [something]" as tapping it on (with nouns reversed).
 
Understand the command "clean" as something new.
Understand "clean [something]" as rubbing.
Understand "clean [something] with [something]" as tapping it on (with nouns reversed).
[Leave "dust", "shine", "polish", "sweep" with no second object (just rubbing).]
 
Understand the commands "rub", "scrub", "wipe" as something new.
Understand "rub [something]" as rubbing.
Understand "rub [something] to/on/onto [something]" as tapping it on.
Understand "rub [something] with [something]" as tapping it on (with nouns reversed).
Understand the commands "scrub", "scrape", "wipe" as "rub".
 
Brush-rubbing is an action applying to one thing.
[Always redirects to rubbing, unless you have the brush.]
 
Check brush-rubbing when the player carries the dispersal-brush:
    say "(with [the dispersal-brush])";
    instead try tapping the dispersal-brush on the noun.
Check brush-rubbing:
    instead try rubbing the noun.
 
Check touching the player:
    instead say "Not now."
Check rubbing the player:
    instead say "Not now."
 
Instead of tapping something sessile on something not sessile (this is the tapping-sessile reversal rule):
    instead try tapping the second noun on the noun.
 
Instead of tapping the player on:
    if the second noun is the player:
        instead say "Logically, you [em]are[/em] always touching yourself.";
    instead try tapping the second noun on the player.
 
Check tapping something sessile on (this is the no-tapping-sessile rule):
    if the second noun is the player:
        instead try touching the noun;
    instead say "You can't haul [the noun] around like that."
 
First check tapping something not carried on (this is the no-tapping-not-held rule):
    if the noun is contained in something (called C) and C is carried:
        if interrupted carrying out the implicitly taking activity with the noun:
            stop the action;
        say "(first removing [the noun] from [the C])";
        silently try taking the noun;
        if the noun is carried:
            continue the action;
    if the second noun is the dispersal-brush:
        continue the action; [special case]
    if the second noun is the player:
        say "(that is, touch [the noun] to yourself)[line break]";
    instead say "You aren't holding [the noun]."
 
First check tapping something on something alight (this is the tapping-thing-on-fire rule):
    instead try burning the noun with the second noun.
 
First check tapping something alight on something (this is the tapping-fire-on-thing rule):
    instead try burning the second noun with the noun.
 
First check tapping a topical chem-source on something (this is the tapping-topical-on-thing rule):
    instead try putting the noun on the second noun.
 
Check tapping it on when the noun is the second noun:
    instead say "The question of whether an entity always touches itself is food for many a late-night philosophical argument. It's not going to help you right now."
 
Report tapping it on:
    instead say "You touch [the noun] [one of]lightly[or]carefully[or]gently[at random] to [the second noun], with no result."
 
Repairing is an action applying to one thing.
Understand "repair [something]" as repairing.
Understand the command "fix" as "repair".
 
Report repairing:
    instead say "[if the noun is singular-named]That isn't[else]Those aren't[end if] obviously in need of repair."
 
Report repairing the player:
    instead say "That's Sergeant Brooks[apostrophe] job."
 
Understand the commands "torture", "wreck", "thump" as something new.
Understand the command "strike" as "hit".
 
Smashing is an action applying to one thing.
 
Understand the commands "smash", "destroy", "break", "crack" as something new.
Understand "smash [something]" as smashing.
Understand the commands "crush", "destroy", "break", "crack" as "smash".
 
Check smashing the player:
    instead try attacking the player.
 
Report smashing:
    if the noun is scenery or the noun is fixed in place:
        instead say "Unlikely.";
    else:
        instead say "You don't want to damage [the noun]."
 
The block attacking rule is not listed in any rulebook.
 
Check attacking:
    instead say "You see no reason to start a fight with [the noun]."
 
Check attacking the player:
    [Could modify after you've died a few times.]
    instead say "After all you've survived?"
 
 
Understand the commands "inhale", "snort" as "smell".
Understand "breathe" as smelling.
Understand "breathe in" as smelling.
Understand "breathe [something]" as smelling.
Understand "breathe in [something]" as smelling.
 
Blowing on is an action applying to one thing.
 
Understand "blow [something]" as blowing on.
Understand "blow in/on/out [something]" as blowing on.
Understand "blow [something] out" as blowing on.
Understand the command "puff" as "blow".
 
Check blowing on a person:
    instead say "Don't be crass."
Report blowing on:
    say "Blowing on [the noun] is pointless."
 
 
Extinguishing is an action applying to one thing.
 
Understand "extinguish [something]" as extinguishing.
Understand "put out [something]" as extinguishing.
Understand "put [something] out" as extinguishing.
Understand the command "douse" as "extinguish".
 
Check extinguishing something alight:
    instead try blowing on the noun.
 
[### if the player carries the fire-sucker, maybe we should be using it. Test with burning splints, kiln, but mostly the Charred Hall inferno.]
 
Report extinguishing the player:
    instead say "You aren't on fire[if the atmosphere of the location is fire-atm], despite appearances[end if]."
Report extinguishing:
    say "[if the noun is singular-named]That isn't[else]They aren't[end if] on fire."
 
 
When play begins (this is the carried noun requirement setup rule):
    remove the carried noun requirement for the eating action.
Understand the command "eat" as something new.
Understand "eat [something]" as eating.
 
Understand the commands "drink", "swallow", "sip" as something new.
Understand the commands "drink", "swallow", "quaff" as "eat".
Understand the commands "sip", "lick" as "taste".
 
Check eating the player:
    instead say "You're not hungry. You've never been [em]that[/em] hungry."
 
 
Emptying is an action applying to one thing.
 
Check emptying the player:
    instead say "You aren't feeling the urge."
 
Last check emptying when the noun is a container (this is the general container emptying rule):
    if the noun is empty:
        instead say "[The noun] [is-are noun] already empty.";
    if the number of things in the noun is one:
        let T be the first thing held by the noun;
        say "(taking [the T])";
        instead try taking T;
    instead say "Just take what you need."
 
Last check emptying when the noun is a supporter (this is the general supporter emptying rule):
    if the noun is empty:
        instead say "There's nothing on [the noun].";
    if the number of things on the noun is one:
        let T be the first thing held by the noun;
        say "(taking [the T])";
        instead try taking T;
    instead say "Just take what you need."
 
Report emptying:
    say "[The noun] [is-are noun]n't something you can empty."
 
Understand "pour [something]" as emptying.
Understand "pour out [something]" as emptying.
Understand "pour [something] out" as emptying.
Understand "pour [other things] in/inside/into [something]" as inserting it into.
Understand "pour out [other things] in/inside/into [something]" as inserting it into.
Understand "pour [other things] on/onto/over [something]" as putting it on.
Understand "pour out [other things] on/onto/over [something]" as putting it on.
Understand the command "empty", "spill", "dump" as "pour".
 
Understand "discharge [something]" as emptying.
Understand "discharge [other things] in/inside/into [something]" as inserting it into.
Understand "discharge [other things] on/onto/at/over [something]" as putting it on.
Understand the commands "vent", "decant", "sprinkle" as "discharge".
 
Understand "set [other things] in/inside/into [something]" as inserting it into.
Understand "set [other things] on/onto [something]" as putting it on.
 
Understand "fill [something] with/from [something]" as inserting it into (with nouns reversed).
 
 
Understand the command "scale" as something new.
Understand "scale [something]" as climbing.
Understand "climb down [something]" as climbing.
Understand "climb in/inside/into/on/onto/through [something]" as entering.
Understand "climb out [something]" as getting off.
Understand "climb out of [something]" as getting off.
 
Check inserting something into an open door:
    instead say "Flinging things through open doors would be messy."
 
Instead of putting the player on something sessile (this is the put-me is entering rule):
    instead try entering the second noun.
 
Instead of inserting the player into something sessile (this is the insert-me is entering rule):
    instead try entering the second noun.
 
Instead of putting something on something alight (this is the put-on-fire rule):
    instead try burning the noun with the second noun.
 
Instead of inserting something into something alight (this is the insert-in-fire rule):
    instead try burning the noun with the second noun.
 
 
Understand the command "feed" as something new.
Understand "feed [other things] to/in/inside/into [something]" as inserting it into.
 
 
Understand the command "consult" as something new.
 
Dir-looking is an action out of world applying to one thing.
Check dir-looking:
    if the noun is not a direction:
        instead say "(BUG) Dir-looking [noun], which is not a direction.";
    [We could check "the door [noun] from the location" but the results are inconsistent and unsatisfying.]
    instead say "[parsermsg]This game does not permit you to look into adjacent rooms. Try going [noun] and seeing what you find.[/parsermsg][br]".
 
[I don't know why I have to define this grammar token in I6. You'd think "look [direction]" would work, but it breaks the "look" grammar.]
[Since we're defining this, we take the opportunity to ignore "in/out" directions.]
The Understand token direction-spec translates into I6 as "DirectionSpecToken".
Include (-
[ DirectionSpecToken   wd obj;
    wd = NextWord();
    objectloop (obj in Compass) {
        if (obj == in_obj or out_obj)
            continue;
        if (WordInProperty(wd, obj, name))
            return obj;
    }
    return GPR_FAIL;
];
-).
 
Understand the command "look", "l" as something new.
Understand "look" as looking.
Understand "look [direction-spec]" as dir-looking.
Understand "look around" as looking.
Understand "look at [something]" as examining.
Understand "look at [something] in/with/through [something]" as inspecting it with.
Understand "look inside/in/into/within/through/on [something]" as searching.
Understand "look inside/in/into/within/through [something] at [something]" as inspecting it with (with nouns reversed).
Understand "look under [something]" as looking under.
Understand "look out/outside" as look-outward-ing.
Understand "look out/outside [something]" as searching.
Understand the command "l" as "look".
Understand the command "peer" as "look".
 
Understand "swabbie", "apprentice", "ensign", "forsyth" as yourself.
The description of the player is "Not the most promising Ensign in His Majesty's Navy."
 
Check examining a direction (this is the new examine directions rule):
    instead try dir-looking the noun.
 
Inspecting it with is an action applying to one visible thing and one thing.
 
Understand "examine [something] in/with/through [something]" as inspecting it with.
Understand the command "inspect" as "examine".
 
Understand "view [something]" as examining.
[Omit "view formula", though]
Understand "view [something] in/with/through [something]" as inspecting it with.
 
A thing has some text called the lens-view. [for the planetary lens]
 
Check inspecting a direction with (this is the inspect directions with rule):
    instead try dir-looking the noun.
 
Check inspecting it with when the noun is the second noun (this is the reflexive inspection rule):
    instead say "You can't inspect [the noun] with itself."
 
Report inspecting it with:
    instead say "You can't look at things through [the second noun]."
 
Reading is an action applying to one visible thing and requiring light.
[Generally this should either redirect to "examine" or be blocked.]
A thing can be readable.
 
The readable property translates into I6 as "attr_extra_readable".
Definition: an object is readable if I6 routine "CheckAttrExtraReadable" says so (hack).
 
Understand the command "read" as something new.
Understand "read [something]" as reading.
Understand "read [something] with/through [something]" as inspecting it with.
 
Check reading a readable thing:
    instead try examining the noun.
Check reading:
    instead say "There's nothing to read there."
 
Look-outward-ing is an action applying to nothing.
[Redirects to "examine outside" unless a room customizes it (to look out a window).]
 
Check look-outward-ing:
    instead try examining outside.
 
[ The singing action is gone.
The block singing rule is not listed in any rulebook.
Check singing:
    if the atmosphere of the location is water-atm:
        instead say "You have no talent for underwater singing.";
    if the atmosphere of the location is vacuum-atm:
        instead say "You can't sing; there's no air.";
    instead say "You have no talent for singing."
]
 
Understand "jump out/off/down/up" as exiting.
Understand "jump in/into/on/onto/inside [something]" as entering.
Understand "jump off [something]" as getting off.
Understand "jump off/out of/from [something]" as getting off.
Understand the command "skip" as something new. [Drop this as a "jump" synonym.]
 
The block jumping rule is not listed in any rulebook.
Check jumping:
    if the atmosphere of the location is water-atm:
        instead try going up;
    if the atmosphere of the location is vacuum-atm:
        instead say "You jump up and down. The gravity feels roughly normal, at least.";
    instead say "You jump up and down for a bit."
 
The block sleeping rule is not listed in any rulebook.
Check sleeping:
    instead say "You aren't at all tired."
 
The block waking up rule is not listed in any rulebook.
Check waking up:
    instead say "This may be a nightmare, but it is real."
 
Understand the commands "buy", "purchase" as something new. [removed from grammar]
 
 
Chapter - The Characters
 
A persona is a kind of value. The plural of persona is personae.
 
No-persona is a persona.
 
The Ensign is a persona. [Only used for self-imitation.]
The Sergeant is a persona. [Only used for attempts to recall (which will fail).]
 
The Grafter is a persona.
The Climber is a persona.
The Scholar is a persona.
The Captain is a persona.
 
Definition: a persona is primary if it is Captain or it is Climber or it is Grafter or it is Scholar.
Definition: a persona is high-rank if it is Captain or it is Climber or it is Grafter.
 
A character is a kind of thing.
A character has a persona.
A character is always fixed in place.
Include (- has animate -) when defining a character.
A character can be fracture-blocked.
A character can be female or male.
A character is usually proper-named.
The printed name of a character is usually "[persona of the item described]".
The remote-name of a character is usually "[persona of the item described]".
Understand "person", "figure", "marchman" as a character.
 
The verb to persona-match (it persona-matches, they persona-match, it is persona-matching) implies the persona property.
 
To say he-she (P - persona):
    if P is Captain or P is Grafter:
        say "she";
    else:
        say "he".
To say He-She (P - persona):
    if P is Captain or P is Grafter:
        say "She";
    else:
        say "He".
To say his-her (P - persona):
    if P is Captain or P is Grafter:
        say "her";
    else:
        say "his".
To say His-Her (P - persona):
    if P is Captain or P is Grafter:
        say "Her";
    else:
        say "His".
To say him-her (P - persona):
    if P is Captain or P is Grafter:
        say "her";
    else:
        say "him".
 
To say he-she (C - character):
    if C is a shadow-character:
        say "it";
    else:
        say he-she persona of C.
To say He-She (C - character):
    if C is a shadow-character:
        say "It";
    else:
        say He-She persona of C.
To say his-her (C - character):
    if C is a shadow-character:
        say "its";
    else:
        say his-her persona of C.
To say His-Her (C - character):
    if C is a shadow-character:
        say "Its";
    else:
        say His-Her persona of C.
To say him-her (C - character):
    if C is a shadow-character:
        say "it";
    else:
        say him-her persona of C.
 
 
Section - Base Character Rules
 
Check searching a character:
    instead say "That's not really possible when [his-her noun] clothing is as rigid as ice."
 
Check inspecting a character with the planetary-lens:
    instead say "You peer at [the noun] through the lens. [He-She noun] has Gaian associations, as human beings always do. The image is oddly distant, though."
 
Check inspecting a character with the oculus:
    say "You peer through the oculus, and see the complex mesh of elements that makes up a human body.[para]";
    instead try examining the noun.
 
Check touching a character:
    let C be the noun;
    instead say "Although [he-she C] is no longer fracture-blocked, [he-she C] feels like a statue -- not stone, but hard and utterly still. It's as if [he-she C] exists within an imperceptible layer of altered time."
Check rubbing a character:
    instead try touching the noun.
 
Check taking a character:
    instead say "[The noun] cannot be moved."
Check pushing a character:
    instead try taking the noun.
Check pulling a character:
    instead try taking the noun.
Check turning a character:
    instead try taking the noun.
 
Check listening to a character:
    instead say "[The noun] is silent."
 
Check freeing a character:
    instead say "You don't know what's wrong with [him-her noun]."
Check waking a character:
    instead try freeing the noun.
 
Check inserting something not sessile into a character:
    if the noun is topical:
        continue the action;
    instead say "[The second noun] is in no state to swallow."
 
Check attacking a character:
    let P be the persona of the noun;
    if P is Captain:
        instead say "The very thought makes your soul curl up and whimper.";
    if P is high-rank:
        instead say "It's not that you've never thought about clouting an officer, but this is not the time. For several reasons.";
    instead say "You've never been the type for donnybrooks with the other apprentices. Anyway, this is not the time, for several reasons."
 
Check cutting a character:
    instead try attacking the noun.
 
Check kissing a character:
    instead say "The Navy frowns on such informality."
Check tasting a character:
    instead try kissing the noun.
Check squeezing a character:
    instead try kissing the noun.
 
 
Section - Fracture-Blocked (Base) Characters
 
Instead of doing anything except examining or searching or recalling to a fracture-blocked character (this is the fracture-blocked character out of reach rule):
    if inspecting a character with something:
        continue the action;
    instead say "[He-She noun] is behind the fracture, out of reach."
Check putting something on a fracture-blocked character:
    instead try touching the second noun.
Check inserting something into a fracture-blocked character:
    instead try touching the second noun.
Check tapping something on a fracture-blocked character:
    instead try touching the second noun.
 
Check searching a fracture-blocked character:
    instead try examining the noun.
 
 
Section - Shadow Characters
 
A shadow-character is a kind of character.
A shadow-character is usually not proper-named.
A shadow-character can be neuter. A shadow-character is always neuter.
The printed name of a shadow-character is usually "shadow of [persona of the item described]".
Understand "shadow", "shadow of", "faint", "trailing" as a shadow-character.
 
Definition: a character is shadowy rather than non-shadowy if it is a shadow-character.
 
To move-and-shadow (NC - character) to (NR - room) with (SC - shadow-character) and (OC - character):
    if OC is fracture-blocked:
        now SC is fracture-blocked;
    else:
        now SC is not fracture-blocked;
    move NC to NR;
    let OR be the location of OC;
    now OC is off-stage;
    if OR is-room off-stagey:
        say "(BUG) move-and-shadow: [OC] was off-stage.";
    else:
        now SC is in OR;
        [We retain the incorrect memory of the avatar location, but we wipe the memory of the shadow location. It's inconvenient to maintain that as a separate mistake.]
        let MC be the mem-character associated with the persona of SC;
        if MC is not nothing:
            now the last-shadow-room of MC is the Abstraction Layer.
 
The initial appearance of a shadow-character is usually "[meet item described][persona of the item described] has vanished. Only a shadow remains[if the item described is fracture-blocked] within the fracture[end if]."
 
The description of a shadow-character is usually "You see a faint trailing shadow where [persona of the item described] was standing."
 
Instead of doing anything except examining or searching or recalling to a shadow-character (this is the shadow-character untouchable rule):
    if inspecting a character with something:
        continue the action;
    if entering a character:
        instead say "This isn't a play.";
    instead say "The shadow is intangible."
Check putting something on a shadow-character:
    instead try touching the second noun.
Check inserting something into a shadow-character:
    instead try touching the second noun.
Check tapping something on a shadow-character:
    instead try touching the second noun.
 
Check searching a shadow-character:
    instead say "As far as you can tell, it's just a shadow."
 
Check inspecting a shadow-character with the planetary-lens:
    instead say "You peer at [the noun]. It doesn't seem to be visible through the lens at all."
 
Check inspecting a shadow-character with the oculus:
    let P be the persona of the noun;
    let MC be the mem-character associated with P;
    if MC is nothing:
        instead say "(BUG) [The noun] has no mem-character.";
    if the story-resolution of MC is no-persona:
        say "[one of]This is very strange. Through the oculus you do not see a shadow, but[or]Again, strangely, the oculus renders the shadow in[stopping] words:[para]";
        if the aspect-text-seen of MC < 1:
            now the aspect-text-seen of MC is 1;
        instead say the oc-message-basic for MC;
    else:
        if the aspect-text-seen of MC is 1:
            say "The shadow forms words when viewed through the oculus. But the text is longer than before:[para]";
        else:
            say "The shadow forms words when viewed through the oculus:[para]";
        if the aspect-text-seen of MC < 2:
            now the aspect-text-seen of MC is 2;
        instead say the oc-message-final for MC.
 
The Sha-Captain is a shadow-character. The persona of Sha-Captain is Captain.
The Sha-Scholar is a shadow-character. The persona of Sha-Scholar is Scholar.
The Sha-Grafter is a shadow-character. The persona of Sha-Grafter is Grafter.
The Sha-Climber is a shadow-character. The persona of Sha-Climber is Climber.
 
 
Section - Recallable Characters
 
A mem-character is a kind of character.
A mem-character is usually recallable.
A mem-character is usually scenery.
A mem-character has a room called last-met-room. The last-met-room of a mem-character is usually the Abstraction Layer. [reset if you meet a shadow and discover the avatar gone]
A mem-character has a room called last-shadow-room. The last-shadow-room of a mem-character is usually the Abstraction Layer.
A mem-character has a thing called last-met-avatar. The last-met-avatar of a mem-character is usually no-thing.
A mem-character has a truth state called ever-met-avatar. The ever-met-avatar of a mem-character is usually false. [once set, always set]
A mem-character has a persona called the story-resolution. The story-resolution of a mem-character is usually no-persona.
A mem-character can be aspect-positive or aspect-negative.
A mem-character can be aspect-endorsed or aspect-reproached. A mem-character is usually aspect-endorsed.
A mem-character has a number called the aspect-text-seen. [0: never oculused a shadow; 1: oculused a shadow before resolution; 2: after resolution]
[Understanding lines are in hadean.ni.]
 
Mem-Captain is a female mem-character. The persona of Mem-Captain is Captain.
Mem-Scholar is a male mem-character. The persona of Mem-Scholar is Scholar.
Mem-Grafter is a female mem-character. The persona of Mem-Grafter is Grafter.
Mem-Climber is a male mem-character. The persona of Mem-Climber is Climber.
Mem-Sergeant is a male mem-character. The persona of Mem-Sergeant is Sergeant.
 
To decide what mem-character is the mem-character associated with (P - persona):
    if P is:
        -- Captain: decide on Mem-Captain;
        -- Scholar: decide on Mem-Scholar;
        -- Grafter: decide on Mem-Grafter;
        -- Climber: decide on Mem-Climber;
    really decide on nothing.
 
To say meet (C - character):
    let P be the persona of C;
    let MC be the mem-character associated with P;
    [I am blowing off the possibility that you complete chapter 1 and encounter a shadow without first seeing its ch1 avatar.]
    now the ever-met-avatar of MC is true;
    now C is ever-seen;
    now MC is ever-seen;
    if C is a shadow-character:
        now the last-shadow-room of MC is the location of C;
        if the last-met-room of MC is the location of C:
            now the last-met-avatar of MC is no-thing;
            now the last-met-room of MC is Abstraction Layer;
    else:
        now the last-met-avatar of MC is C;
        now the last-met-room of MC is the location of C.
 
To decide what persona is the resolution of (P - persona):
    let MC be the mem-character associated with P;
    if MC is nothing:
        decide on no-persona;
    decide on the story-resolution of MC.
 
To decide what number is the aspect-text-seen for (P - persona):
    let MC be the mem-character associated with P;
    if MC is nothing:
        decide on 0;
    decide on the aspect-text-seen of MC.
 
Definition: a persona (called P) is aspect-positive:
    let MC be the mem-character associated with P;
    if MC is nothing:
        decide no;
    if MC is aspect-positive:
        decide yes.
Definition: a persona (called P) is aspect-negative:
    let MC be the mem-character associated with P;
    if MC is nothing:
        decide yes;
    if MC is aspect-negative:
        decide yes.
To flip the first aspect of (P - persona):
    let MC be the mem-character associated with P;
    if MC is nothing:
        stop;
    if MC is aspect-negative:
        now MC is aspect-positive;
    else:
        now MC is aspect-negative.
 
Definition: a persona (called P) is aspect-endorsed:
    let MC be the mem-character associated with P;
    if MC is nothing:
        decide no;
    if MC is aspect-endorsed:
        decide yes.
Definition: a persona (called P) is aspect-reproached:
    let MC be the mem-character associated with P;
    if MC is nothing:
        decide yes;
    if MC is aspect-reproached:
        decide yes.
To flip the second aspect of (P - persona):
    let MC be the mem-character associated with P;
    if MC is nothing:
        stop;
    if MC is aspect-reproached:
        now MC is aspect-endorsed;
    else:
        now MC is aspect-reproached.
 
To resolve story of (P1 - persona) towards (P2 - persona):
    let MC be the mem-character associated with P1;
    if MC is nothing:
        say "(BUG) Resolving story of [P1], but no mem-char.";
        stop;
    if the story-resolution of MC is not no-persona:
        say "(BUG) Resolving story of [P1], but it is already [story-resolution of MC].";
    now the story-resolution of MC is P2.
 
Mem-Captain is ever-seen. [At startup.]
Mem-Sergeant is ever-seen. [At startup. But we'll never meet him.]
 
 
Chapter - How About a Little Fire, Scarecrow
 
[A thing can be alight.] [Defined earlier to catch an attribute slot.]
A thing has a number called the flame-point.
The verb to burn at (it burns at, they burn at, it is burning at) implies the flame-point property.
 
[For efficiency, we declare that the only fire-consumable items are wood-splints.]
A wood-splint is a kind of takeable-thing.
A wood-splint has a number called the burn-life.
A wood-splint has a number called the max-burn-life.
 
[Definition: a thing is flammable if the flame-point of it is greater than zero.
Definition: a thing is nonflammable if the flame-point of it is not greater than zero.]
Definition: a wood-splint is fire-consumable if the max-burn-life of it is greater than zero.
 
To decide what thing is the best visible fire source besides (ignore - thing):
    let result be no-thing;
    let temp be zero;
    [It's actually important that we check "alight" before "quick-visible" here. The QV code chokes on multilocated things like doors and backdrops. (Do not create a flaming door.)]
    repeat with T running through alight quick-visible things:
        if T is not ignore and the flame-point of T is greater than temp:
            now temp is the flame-point of T;
            now result is T;
    decide on result.
 
 
To decide whether currently fireproof:
    if fire-potion-remaining is greater than zero:
        decide yes.
 
 
Check igniting the player with something when currently fireproof:
    if the second noun is el-fire:
        instead say "You're not willing to test the efficacy of fire resistance against elemental fire. Not with your own flesh, anyhow.";
    if the atmosphere of the location is fire-atm:
        instead say "You're already completely enveloped in fire.";
    if the second noun is swamp-pith:
        instead say "You stick your finger in the flame. You can't feel it at all.";
    instead say "You stick your finger in the flame. It's just a little warm."
 
Check igniting the player with something:
    if the second noun is el-fire:
        instead say "Elemental fire would consume your flesh instantly.[first time][br][em]Hands off the pure elementals, swabbie. No marchmen will melt themselves in my classroom.[/em][br][only]";
    if the second noun is linden:
        instead say "You wave your finger through the flame. And again -- ow. Well, it's still fire, but weaker than even a candle-flame; you can [em]nearly[/em] hold your finger in it.";
    if the second noun is swamp-pith:
        instead say "You wave your finger through the pith flame. It's hot, but not burning-hot. How strange.";
    instead say "You think about setting yourself on fire, and decide not to."
 
Check igniting something alight with something (this is the generic already-alight rule):
    instead say "[The noun] [is-are noun] already alight."
 
Report igniting it with:
    say "Randomly setting things on fire won't help."
 
To say general-contact-ignite:
    if the player carries the second noun:
        say "You hold [the second noun] to [the noun]";
    else:
        say "You hold [the noun] to [the second noun]".
 
 
Check blowing on something alight:
    instead say "The flame only flickers."
 
Check touching something alight:
    instead try igniting the player with the noun.
 
Section - The Fire-Consumption Daemon
 
["now the burn-life of T is the max-burn-life of T" -- this is handled by the initial world reset.]
 
The fire-consumption count is a number that varies.
 
To update fire consumption:
    now the fire-consumption count is the number of alight fire-consumable wood-splints.
 
Every turn when the fire-consumption count is greater than zero (this is the fire-consumption daemon rule):
    let change-count be zero;
    repeat with T running through alight fire-consumable wood-splints:
        decrement the burn-life of T;
        let N be the burn-life of T;
        if N is:
            -- 0:
                now T is not alight; [so that splinters are not named as "burning splinters"]
                if the player carries T:
                    say "You drop [the T] as it burns down to nothing[if not currently fireproof]. Ouch[end if].";
                else if T is visible:
                    say "[The T] has burned away entirely.";
                increment change-count;
                retire T by burning out;
            -- 1:
                if T is visible:
                    say "[The T] is nearly gone.";
            -- 3:
                if T is visible:
                    say "[The T] is getting very short.";
            -- 6:
                if T is visible:
                    say "[The T] is noticeably smaller.";
    if change-count is greater than zero:
        update fire consumption.
 
Section - The Fire-Resistance Daemon
 
The fire-potion-remaining is a number that varies. [resettable]
 
Every turn (this is the fire-resistance daemon rule):
    if fire-potion-remaining is greater than zero:
        decrement fire-potion-remaining;
        if fire-potion-remaining is:
            -- 6:
                if the atmosphere of the location is fire-atm:
                    say "The flames licking against your skin feel warmer now.";
            -- 4: say "Your fingers begin to buzz with returning circulation.";
            -- 2:
                if the atmosphere of the location is fire-atm:
                    say "The air is distinctly hot now.";
            -- 1:
                say "Your fingers are tingling";
                if the atmosphere of the location is fire-atm:
                    say ", and the flames are becoming painfully hot. It might be time to retreat";
                say ".";
            -- 0:
                if the atmosphere of the location is not fire-atm:
                    if not goal-achieving:
                        say "Your fingers are no longer tingling. The potion must have worn off.";
                    else:
                        say "The fire-resistance potion has worn off.";
                else:
                    say "Your fingers are no longer tingling. Instead, they're burning, along with the rest of you. Your dissolution is brief but extremely unpleasant.";
                    invoke reset, involuntarily.
 
 
Section - The Camphrost Daemon
 
Every turn when the holder of the camphrost is not nothing (this is the camphrost daemon rule):
    decrement the vapor-life of the camphrost;
    if the camphrost is in the crock and the crock is closed:
        increment the vapor-pressure of the crock;
        if the vapor-pressure of the crock is greater than 2 and the blackwood is in the crock and the blackwood is alight:
            perform camphrost flashover;
            continue the action;
    if the vapor-life of the camphrost is:
        -- 9:
            if the player carries the camphrost or the camphrost is visible:
                say "Wisps of blue vapor steam from the camphrost";
                say extra camphrost note;
                say ".";
        -- 6:
            if the player carries the camphrost or the camphrost is visible:
                say "The lump of camphrost is shrinking visibly";
                say extra camphrost note;
                say ".";
        -- 2:
            if the player carries the camphrost or the camphrost is visible:
                say "The camphrost is nearly gone";
                say extra camphrost note;
                say ".";
        -- 0:
            if the player carries the camphrost or the camphrost is visible:
                say "The bit of camphrost has sublimed entirely away";
                say extra camphrost note;
                say ".";
            retire the camphrost with explanation "The lump of camphrost sublimated away";
 
To say extra camphrost note:
    if the camphrost is in the crock:
        if the crock is open:
            say ". The vapor drifts from the open crock";
        else:
            say ". The vapor accumulates in the crock"
 
To perform camphrost flashover:
    say "The blackwood flares up. Then, with a violent hiss and an electric-blue flash, the camphrost vapor ignites.";
    now the vapor-pressure of the crock is zero;
    now the crock is shifted;
    perform crock incineration.
 
The camphrost-flare is scenery. The printed name is "camphrost flare".
[Used only in the crock incineration routine. Not referrable to.]
The flame-point is 35.
 
Section - Kindlology
 
To derive the kindling of (T - thing) from (F - thing):
    if T is not a mixing-container:
        say "(BUG) Tried to derive kindling of random thing [T] from [F].";
        stop;
    now the mixture-result is no-subst;
    try subst-kindling T from F;
    if the mixture-result is no-subst:
        stop;
    now T comprises the mixture-result;
    fix up the substance of T.
 
Subst-kindling it from is an action applying to two visible things.
 
Check subst-kindling:
    if the second noun is not alight:
        instead say "(BUG) Subst-kindling, but [the second noun] is not alight."
 
Carry out subst-kindling:
    follow the kindle-processing rules.
 
Kindle-processing is a rulebook.
 
Rule for kindle-processing when the noun is the reservoir and noun comprises nickel-oil-subst and the second noun is el-fire:
    unless rstate is active and rstate bestates RSChymicStart and rstate is entension-word-used:
        dephlogisticate the second noun;
        if the nickel-wire is in the retort:
            retire the nickel-wire by ritual-or-alchemy;
        if rstate is active:
            now rstate bestates RSFailed;
        now the reservoir comprises brown-paste-subst;
        fix up the substance of the reservoir;
        instead say "The nickel filings glow red. Then orange, then yellow -- and then the oil ignites, an ugly boil of smoke that splatters molten nickel across the inside of the retort.[para]When the smoke clears, the oil has been reduced to a greasy brown paste, and the [base-description of the second noun] rod is extinguished.";
    unless (the retort contains exactly the second noun) or (the retort contains exactly the nickel-wire and the second noun):
        dephlogisticate the second noun;
        if the nickel-wire is in the retort:
            retire the nickel-wire by ritual-or-alchemy;
        if rstate is active:
            now rstate bestates RSFailed;
        now the reservoir comprises brown-paste-subst;
        fix up the substance of the reservoir;
        instead say "The nickel filings glow red -- then orange, then yellow. You wince, expecting the oil to ignite at any moment; but it does not. Instead, the nickel slowly liquifies into a shining metal pool. The oil shimmers and ripples above it.[para]White smoke rises within the retort. No, that's not right -- your extra additions must be throwing off the balance of the distillation. Nothing condenses out, anyhow. In moments the [base-description of the second noun] rod is extinguished, lying in a pool of greasy brown paste.";
    now the player carries the second noun;
    now the fire-source-used of sublime-creation is the second noun;
    dephlogisticate the second noun;
    if the nickel-wire is in the retort:
        retire the nickel-wire by ritual;
    mark the sublime-creation as done;
    shut down the ritual state;
    shut down the retort;
    now the player carries the sublime;
    set pronouns from the sublime;
    instead say "The nickel filings glow red -- then orange, then yellow. You wince, expecting the oil to ignite at any moment; but it does not. Instead, the nickel slowly liquifies into a shining metal pool. The oil shimmers and ripples above it.[para]Pale vapors rise within the retort -- the volatile fractions of the oil. They condense on the inner surface of the glass. Minute droplets gather and flow downwards. When they reach the release valve, you tap the sublime spirit into a fresh vial.[para]When you have extracted all the fractions you need, you pull the dump lever. The greasy remains of the oil and nickel are washed away. The [base-description of the second noun] rod -- dephlogisticated and cool now -- falls into your hand."
 
Rule for kindle-processing when the noun is the reservoir and noun comprises mineral-oil-subst and the second noun is el-fire and the nickel-wire is in the retort:
    unless rstate is active and rstate bestates RSChymicStart and rstate is entension-word-used:
        dephlogisticate the second noun;
        retire the nickel-wire by ritual-or-alchemy;
        if rstate is active:
            now rstate bestates RSFailed;
        now the reservoir comprises brown-paste-subst;
        fix up the substance of the reservoir;
        instead say "The nickel glows red where the elemental flame touches it. Then orange, then yellow -- and then the oil ignites, an ugly boil of smoke that splatters molten nickel across the inside of the retort.[para]When the smoke clears, the oil has been reduced to a greasy brown paste, and the [base-description of the second noun] rod is extinguished.";
    unless the retort contains exactly the nickel-wire and the second noun:
        dephlogisticate the second noun;
        retire the nickel-wire by ritual-or-alchemy;
        if rstate is active:
            now rstate bestates RSFailed;
        now the reservoir comprises brown-paste-subst;
        fix up the substance of the reservoir;
        instead say "The nickel glows red where the elemental flame touches it -- then orange, then yellow. You wince, expecting the oil to ignite at any moment; but it does not. Instead, the nickel slowly liquifies into a shining metal pool. The oil shimmers and ripples above it.[para]White smoke rises within the retort. No, that's not right -- your extra additions must be throwing off the balance of the distillation. Nothing condenses out, anyhow. In moments the [base-description of the second noun] rod is extinguished, lying in a pool of greasy brown paste.";
    now the player carries the second noun;
    now the fire-source-used of sublime-creation is the second noun;
    dephlogisticate the second noun;
    retire the nickel-wire by ritual;
    mark the sublime-creation as done;
    shut down the ritual state;
    shut down the retort;
    now the player carries the sublime;
    set pronouns from the sublime;
    instead say "The nickel glows red where the elemental flame touches it -- then orange, then yellow. You wince, expecting the oil to ignite at any moment; but it does not. Instead, the nickel slowly liquifies into a shining metal pool. The oil shimmers and ripples above it.[para]Pale vapors rise within the retort -- the volatile fractions of the oil. They condense on the inner surface of the glass. Minute droplets gather and flow downwards. When they reach the release valve, you tap the sublime spirit into a fresh vial.[para]When you have extracted all the fractions you need, you pull the dump lever. The greasy remains of the oil and nickel are washed away. The [base-description of the second noun] rod -- dephlogisticated and cool now -- falls into your hand."
 
Rule for kindle-processing when the noun is the reservoir and noun comprises ori-muriatic-subst and the second noun is the burner and the heating-time of the reservoir >= 4:
    increment the heating-time of the reservoir;
    if the heating-time of the reservoir is:
        -- 5: instead say "The green acid solution is noticeably reducing in volume.";
        -- 6: instead say "The green acid is now a thick pool in the bottom of the reservoir.";
    now the mixture-result is calcinate-crystal-subst;
    instead say "The green acid thickens to a paste, and then rapidly dries, leaving a residue of coarse, dark-green crystals."
 
Rule for kindle-processing when the noun is the reservoir and noun comprises ori-muriatic-2-subst and the second noun is the burner and the heating-time of the reservoir >= 2:
    increment the heating-time of the reservoir;
    if the heating-time of the reservoir is:
        -- 3: instead say "The viridian acid solution is noticeably reducing in volume.";
        -- 4: instead say "The viridian acid is now a thick pool in the bottom of the reservoir.";
    unless the retort contains exactly nothing:
        now the mixture-result is unknown-subst;
        instead say "The viridian solution turns to an unpleasant murky olive -- no doubt the result of contamination.";
    unless rstate is active and at RSPercalcinateTempered:
        now the mixture-result is unknown-subst;
        instead say "Something precipitates out of the viridian solution, turning it to an unpleasant murky olive. The ritual balance must have been disrupted.";
    mark the percalcinate-creation as done;
    shut down the ritual state;
    shut down the retort;
    now the player carries the percalcinate;
    set pronouns from the percalcinate;
    instead say "The viridian acid thickens to a paste, and then rapidly dries, leaving a residue of green-gold powder. This must be your percalcinate. You extract it into a fresh vial, and switch off the gas flames."
 
Rule for kindle-processing when the noun is the reservoir and noun comprises muriatic-subst and the second noun is the burner and the orichalcum is in the retort and the heating-time of the reservoir >= 3:
    now the mixture-result is ori-muriatic-subst;
    retire the orichalcum by ritual-or-alchemy;
    now the heating-time of the reservoir is 3; [control timing]
    instead say "The orichalcum slowly dissolves into the acid, lending it a lovely grass-green tint."
 
Rule for kindle-processing when the noun is the reservoir and noun comprises vitriolic-subst and the second noun is the burner and the orichalcum is in the retort and the heating-time of the reservoir >= 3:
    now the mixture-result is ori-vitriol-subst;
    retire the orichalcum by ritual-or-alchemy;
    instead say "The orichalcum slowly dissolves into the acid, lending it a lovely sky-blue tint."
 
Rule for kindle-processing when the noun is the reservoir and noun comprises vitriolic-subst and the second noun is the burner and the fluorite is in the retort and the heating-time of the reservoir >= 3:
    now the mixture-result is fluor-vitriol-subst;
    retire the fluorite by ritual-or-alchemy;
    instead say "The fluorspar crystal slowly dissolves into the acid, giving it a rich amber tint."
 
Rule for kindle-processing when the noun is the reservoir and noun comprises violet-mix-subst and the second noun is the burner and the retort contains exactly el-earth and at RSGaianAlumed and the heating-time of the reservoir >= 2:
    retire the el-earth by ritual;
    mark Gaian-precip-creation as done;
    shut down the ritual state;
    shut down the retort;
    now the player carries the Gaian-precip;
    set pronouns from the Gaian-precip;
    instead say "The elemental earth dissolves. The violet solution boils more vigorously, now releasing a thick cloud of steam.[para]Slowly, the solution is reduced, growing darker and more opaque. You coddle the gas valve as it thickens. After several careful moments, you have dried the solution to a purple-grey dust. Excellent. You shut off the heat, and tap the Gaian precipitate from the retort into a fresh vial."
 
Rule for kindle-processing when the noun is the reservoir and noun comprises indigo-mix-subst and the second noun is the burner and the retort contains exactly el-earth and at RSCounterGaianAlumed and the heating-time of the reservoir >= 2:
    retire the el-earth by ritual;
    mark counter-Gaian-precip-creation as done;
    shut down the ritual state;
    shut down the retort;
    now the player carries the counter-Gaian-precip;
    set pronouns from the counter-Gaian-precip;
    instead say "The elemental earth dissolves. The indigo solution boils more vigorously, now releasing a thick cloud of steam.[para]Slowly, the solution is reduced, growing darker and more opaque. You coddle the gas valve as it thickens. After several careful moments, you have dried the solution to a indigo-blue dust. Excellent. You shut off the heat, and tap the counter-Gaian precipitate from the retort into a fresh vial."
 
Rule for kindle-processing when the noun is the reservoir and noun comprises violet-mix-subst and the second noun is the burner and the retort contains exactly perfect-diamond and at RSGaianAlumed and the heating-time of the reservoir >= 2:
    retire the perfect-diamond by ritual;
    now rstate bestates RSFailed;
    instead say "The diamond dissolves. The violet solution boils more vigorously, now releasing a thick cloud of steam.[para]After a few moments, the steam dies away. The solution does not appear to be reducing."
 
Rule for kindle-processing when the noun is the reservoir and noun comprises indigo-mix-subst and the second noun is the burner and the retort contains exactly perfect-diamond and at RSCounterGaianAlumed and the heating-time of the reservoir >= 2:
    retire the perfect-diamond by ritual;
    now rstate bestates RSFailed;
    instead say "The diamond dissolves. The indigo solution boils more vigorously, now releasing a thick cloud of steam.[para]After a few moments, the steam dies away. The solution does not appear to be reducing."
 
Rule for kindle-processing when the noun is the reservoir and the noun comprises lubanja-subst:
    now the mixture-result is clear-subst;
    instead say "The spirit erupts in a burst of blue flame, which rapidly burns down until the volatile fractions have been consumed."
 
Rule for kindle-processing when the noun is the reservoir and the noun comprises alcohol-subst:
    now the mixture-result is clear-subst;
    instead say "There's a (startling but satisfying) [em]poof.[/em] Blue flames dance on the surface for a few moments, until too much alcohol burns off to sustain them."
 
Rule for kindle-processing when the noun comprises lubanja-subst:
    say "You dip [the second noun] into [the noun]";
    let M be the substance of the noun;
    now the mixture-result is clear-subst;
    instead say ". The spirit erupts in a burst of blue flame, which rapidly burns down until the volatile fractions have been consumed.";
 
Rule for kindle-processing when the noun comprises alcohol-subst:
    say "You dip [the second noun] into [the noun]";
    let M be the substance of the noun;
    now the mixture-result is clear-subst;
    instead say ". There's a (startling but satisfying) [em]poof.[/em] Blue flames dance on the surface for a few moments, until too much alcohol burns off to sustain them.";
 
Rule for kindle-processing when the noun is the reservoir and noun comprises layered-subst and the second noun is el-fire:
    now the mixture-result is unknown-subst;
    instead say "The mixture bubbles furiously, but the elemental fire is not extinguished. The liquid layers break apart in the turbulence, however."
 
Rule for kindle-processing when the noun is the reservoir and noun comprises layered-subst and the second noun is the burner and the heating-time of the reservoir > 2:
    now the mixture-result is unknown-subst;
    instead say "The mixture begins to simmer, and the liquid layers break apart in the turbulence."
 
Rule for kindle-processing when noun comprises layered-subst and the second noun is el-fire:
    say "You dip [the second noun] into the liquid";
    now the mixture-result is unknown-subst;
    instead say ". It bubbles furiously, but the elemental fire is not extinguished. The liquid layers break apart in the turbulence, however."
 
Rule for kindle-processing when the noun is the reservoir and noun comprises mineral-oil-subst and the second noun is el-fire:
    now the mixture-result is brown-paste-subst;
    instead say "The oil spatters and smokes furiously around [the second noun]. The oil doesn't quite ignite, but gradually the elemental heat reduces it to a thick brown consistency."
 
Rule for kindle-processing when noun comprises mineral-oil-subst and the second noun is el-fire:
    say "You dip [the second noun] into the oil";
    now the mixture-result is brown-paste-subst;
    instead say ", which spatters and smokes furiously. The oil doesn't quite ignite, but gradually the elemental heat reduces it to a thick brown consistency."
 
Rule for kindle-processing when the noun is the reservoir and noun comprises nickel-oil-subst and the second noun is el-fire:
    now the mixture-result is brown-paste-subst;
    instead say "The oil spatters and smokes furiously around [the second noun]. The oil doesn't quite ignite, but gradually the elemental heat reduces it to a thick brown consistency."
 
Rule for kindle-processing when noun comprises nickel-oil-subst and the second noun is el-fire:
    say "You dip [the second noun] into the oil";
    now the mixture-result is brown-paste-subst;
    instead say ", which spatters and smokes furiously. The oil doesn't quite ignite, but gradually the elemental heat reduces it to a thick brown consistency."
 
Rule for kindle-processing when the noun is the reservoir and the second noun is el-fire:
    let M be the substance of the noun;
    if M is powdery:
        instead say "The elemental fire crackles in the powder, but is not extinguished.";
    if M is pasty:
        instead say "The elemental fire crackles in the [generic term for M], but is not extinguished.";
    instead say "The [if M is unknown-subst][M] bubble[else][M] bubbles[end if] furiously, but the elemental fire is not extinguished."
 
Rule for kindle-processing when the second noun is el-fire:
    let M be the substance of the noun;
    say "You dip [the second noun] into the [generic term for M]";
    if M is powdery:
        instead say ". The elemental fire crackles, but is not extinguished.";
    if M is pasty:
        instead say ". The elemental fire crackles, but is not extinguished.";
    instead say ". It bubbles furiously, but the elemental fire is not extinguished."
 
Rule for kindle-processing when the second noun is the burner:
    if the noun is not the reservoir:
        instead say "(BUG) Kindle rule tried to heat [the noun] with the gas burner.";
    increment the heating-time of the reservoir;
    instead follow the general-reservoir-heating rule.
 
Rule for kindle-processing when the noun is the reservoir:
    let M be the substance of the noun;
    now the second noun is not alight;
    update fire consumption;
    instead say "The [M] has extinguished [the second noun]."
 
The last kindle-processing rule:
    let M be the substance of the noun;
    say "You dip [the second noun] into the [generic term for M]";
    now the second noun is not alight;
    update fire consumption;
    instead say ", but it just extinguishes the flame."
 
This is the general-reservoir-heating rule:
    let M be the substance of the noun;
    let H be the heating-time of the reservoir;
    if M is pasty:
        if H > 3:
            instead say "The gas flame heats the [M], which simmers thickly.";
        instead say "The gas flame heats the [M].";
    if M is powdery:
        instead say "The gas flame heats the [M].";
    if M is unknown-subst:
        if H > 2:
            instead say "The [M] simmer quietly over the flame.";
        instead say "The gas flame heats the [M].";
    if M is mineral-oil-subst:
        if H > 6:
            instead say "The [M] simmers quietly, and smokes a bit.";
        if H > 3:
            instead say "The [M] simmers quietly over the flame.";
        instead say "The gas flame heats the [M].";
    if M is a substance-type:
        if H > 5:
            instead say "The [M] boils vigorously.";
        if H > 2:
            instead say "The [M] bubbles over the flame.";
        instead say "The gas flame heats the [M].";
    instead say "(BUG) General-reservoir-heating should not get here ([M])."
 
 
Section - Enkilning Rules
 
The enkilning source is a thing that varies. The enkilning source is no-thing.
The enkilning rulebook is an object-based rulebook.
 
Rule for enkilning a low-melting-rod metal-rod (called T):
    say "[The T] immediately slumps into a puddle, and dribbles away into the kiln.";
    rule fails.
 
Rule for enkilning a low-melting-wire metal-wire (called T):
    say "[The T] immediately melts into droplets, and dribbles away into the kiln.";
    rule fails.
 
Rule for enkilning rutilum-seal:
    say "Rutilum melts at, what, three thousand degrees? This kiln won't do it.";
    rule succeeds.
 
Rule for enkilning a metal-seal (called T):
    say "[The T] immediately slumps into a puddle, and dribbles away into the kiln.";
    rule fails.
 
Rule for enkilning the mercury:
    say "The mercury bubbles in the heat, and soon boils away. (You hope the kiln has good exhaust ventilation.)";
    rule fails.
 
Rule for enkilning a dried-vegetable thing (called T):
    say "[The T] flares up and falls to aromatic ash.";
    rule fails.
Rule for enkilning the mushroom:
    say "The mushroom doesn't exactly burn, but it quickly crumbles to ash.";
    rule fails.
Rule for enkilning the coral:
    say "The coral doesn't exactly burn, but it quickly crumbles to ash.";
    rule fails.
 
Rule for enkilning a feather-or-feather thing:
    say "The feather doesn't exactly burn, but it quickly crumbles to ash.";
    rule fails.
 
Rule for enkilning the silk-cord:
    say "The silk burns away, though not quickly.";
    rule fails.
 
Rule for enkilning the dirty scalpel:
    say "Whatever's on the scalpel only seems to be baking on there more firmly."
 
Rule for enkilning the rock-salt:
    now the rock-salt is not moist;
    rule succeeds.
 
Rule for enkilning the camphrost:
    say "The camphrost explodes in a puff of blue vapor.";
    rule fails.
 
Rule for enkilning el-water:
    say "The capsule shatters, spraying elemental water into steam.";
    rule fails.
 
Rule for enkilning el-fire:
    rule succeeds.
 
Rule for enkilning phlo-gold:
    if the phlo-gold is alight:
        say "The gold doesn't seem to burn any faster in the kiln than it already was.";
    else:
        say "The phlogisticated gold does not ignite. Elemental fire is devilishly difficult to ignite."
Rule for enkilning phlo-electrum:
    if the phlo-electrum is alight:
        say "The electrum doesn't seem to burn any faster in the kiln than it already was.";
    else:
        say "The phlogisticated electrum does not ignite. Elemental fire is devilishly difficult to ignite."
 
Rule for enkilning a bubble (called T):
    if T is empty:
        say "The fragile bubble shatters in the heat.";
    else:
        say "The charged bubble bursts in the heat. The elemental air's ripple is lost in the heat-ripple of the kiln.";
    rule fails.
 
Rule for enkilning fire-sucker:
    say "The bottle cracks in the heat; the crimson fire-devourer spills into the kiln. There is a mighty [em]whump[/em] as the interior of the kiln goes dark.[para]However, you have not extinguished the flames beneath, and the fire-brick retains most of its heat. The kiln's red glow returns within moments.";
    rule fails.
 
Rule for enkilning fire-resistance:
    say "The bottle cracks in the heat; the potion of fire resistance boils uselessly away. (Apparently just because it makes you resistant to fire, that doesn't mean it is.)";
    rule fails.
 
Rule for enkilning a potion-vial (called T):
    say "The bottle cracks in the heat; the potion of [short-description of T] boils uselessly away.";
    rule fails.
 
Rule for enkilning brun-oil:
    say "The vial cracks in the heat; the [brun-oil-subst] explodes into a tiny orange fireball.";
    rule fails.
 
Rule for enkilning sublime:
    say "The vial cracks in the heat; the [sublime-subst] explodes into a tiny blue fireball.";
    rule fails.
 
Rule for enkilning perfect-mud:
    say "The vial cracks in the heat; the [perfect-mud-subst] dries out and falls to dust.";
    rule fails.
 
Rule for enkilning mineral-oil:
    say "The flask cracks in the heat; the [mineral-oil-subst] spills into the kiln and burns away in a smear of yellow flame.";
    rule fails.
 
Rule for enkilning alcohol:
    say "The flask cracks in the heat; the [alcohol-subst] spills into the kiln and explodes in a brief blue fireball.";
    rule fails.
 
Rule for enkilning lubanja:
    say "The flask cracks in the heat; the [lubanja-subst] spills into the kiln and explodes in a brief blue fireball.";
    rule fails.
 
Rule for enkilning a chem-source (called T):
    say "The [if T is a chem-flask]flask[else]vial[end if] cracks in the heat";
    let M be the substance of T;
    if M is acidic:
        say "; the [M] boils away into acrid steam.";
    else if M is powdery:
        say "; the [M] scatters uselessly across the kiln.";
    else:
        say "; the [M] boils away.";
    rule fails.
 
Rule for enkilning a wood-splint (called T):
    let temp be the flame-point of the enkilning source;
    if temp < ignition-point of T:
        if T is not alight:
            say "[The T] lies inertly, unaffected by the heat.";
    else if temp >= vaporization-point of T:
        say "[The T] flares up in the heat and is instantly consumed.";
        now T is not alight;
        rule fails;
    else if T is not alight:
        say "[The T] quickly bursts into flame.";
        now T is alight;
        update fire consumption.
 
Rule for enkilning the torch-lighter:
    say "The torch-lighter explodes in a tiny yellow fireball.";
    rule fails.
 
 
Section - Incinerating Rules
 
The incinerating rulebook is an object-based rulebook.
The incinerating rulebook has outcomes inert subject (failure - the default), ignite subject, vaporize subject, melt subject, burn subject, shatter subject, explode subject, boil subject, extinguish subject.
 
The ignite-bucket is an abstraction-bucket.
The short-description is "catches fire". The short-description-multi is "catch fire".
The extinguish-bucket is an abstraction-bucket.
The short-description is "is extinguished". The short-description-multi is "are extinguished".
The vaporize-bucket is an abstraction-bucket.
The short-description is "vaporizes". The short-description-multi is "vaporize".
The melt-bucket is an abstraction-bucket.
The short-description is "melts". The short-description-multi is "melt".
The boil-bucket is an abstraction-bucket.
The short-description is "boils away". The short-description-multi is "boil away".
The shatter-bucket is an abstraction-bucket.
The short-description is "shatters". The short-description-multi is "shatter".
The explode-bucket is an abstraction-bucket.
The short-description is "explodes". The short-description-multi is "explode".
The burn-bucket is an abstraction-bucket.
The short-description is "burns up". The short-description-multi is "burn up".
 
To incinerate (T - thing):
    follow the incinerating rulebook for T;
    if the outcome of the rulebook is no-outcome:
        stop;
    if the outcome of the rulebook is:
        -- inert subject outcome: do nothing;
        -- ignite subject outcome: now T is in the ignite-bucket;
        -- vaporize subject outcome: now T is in the vaporize-bucket;
        -- melt subject outcome: now T is in the melt-bucket;
        -- burn subject outcome: now T is in the burn-bucket;
        -- shatter subject outcome: now T is in the shatter-bucket;
        -- explode subject outcome: now T is in the explode-bucket;
        -- boil subject outcome: now T is in the boil-bucket;
        -- extinguish subject outcome: now T is in the extinguish-bucket;
        -- otherwise: say "(BUG) Incinerate failure for [T].";
 
To perform inventory incineration in (source - thing):
    now the enkilning source is the source;
    repeat with T in raw contents of the player:
        incinerate T;
    update fire consumption;
    if there is a non-empty abstraction-buckets:
        say "[line break]Unfortunately, your possessions do not fare so well. In the heat";
        recite the buckets;
    now the enkilning source is no-thing;
    repeat with T in raw contents of the ignite-bucket:
        now the player carries T;
    repeat with B running through all abstraction-buckets:
        repeat with T in raw contents of B:
            now T retired to incinerated-fate;
            now T retired with source;
            now T is off-stage;
    sanity-check the empty buckets.
 
To perform crock incineration:
    now the enkilning source is the camphrost-flare;
    repeat with T in raw contents of the crock:
        incinerate T;
    update fire consumption;
    if the phlo-gold is in the ignite-bucket:
        now the phlo-gold is in the crock;
        mark the gold-ignition as done;
        say "[line break]The light swirls around the phlogisticated gold, like innumerable fireflies drawn to something greater. You hear a distinct basso [em]pop[/em] as the metal bursts into flame -- the lambent gold aura of elemental fire.";
    if there is a non-empty abstraction-buckets:
        say "[line break]In the brief flare";
        recite the buckets;
    now the enkilning source is no-thing;
    repeat with T in raw contents of the ignite-bucket:
        now T is in the crock;
    repeat with T in raw contents of the extinguish-bucket:
        now T is in the crock;
    repeat with B running through all abstraction-buckets:
        repeat with T in raw contents of B:
            now T retired to incinerated-fate;
            now T retired with camphrost-flare;
            now T is off-stage;
    sanity-check the empty buckets.
 
Rule for incinerating a low-melting-rod metal-rod:
    melt subject.
 
Rule for incinerating a low-melting-wire metal-wire:
    melt subject.
 
Rule for incinerating the rutilum-seal:
    inert subject.
 
Rule for incinerating a metal-seal:
    melt subject.
 
Rule for incinerating the mercury:
    boil subject.
 
Rule for incinerating the silk-cord:
    burn subject.
 
Rule for incinerating a dried-vegetable thing:
    burn subject.
 
Rule for incinerating the mushroom:
    burn subject.
 
Rule for incinerating the coral:
    burn subject.
 
Rule for incinerating a feather-or-feather thing:
    burn subject.
 
Rule for incinerating the camphrost:
    vaporize subject.
 
Rule for incinerating a bubble:
    shatter subject.
 
Rule for incinerating a chem-vial:
    explode subject.
 
Rule for incinerating a chem-flask:
    shatter subject.
 
Rule for incinerating el-water:
    explode subject.
 
Rule for incinerating the blackwood when the enkilning source is the camphrost-flare:
    now the blackwood is not alight;
    extinguish subject.
 
Rule for incinerating a wood-splint (called T):
    let temp be the flame-point of the enkilning source;
    if temp < ignition-point of T:
        inert subject;
    else if temp >= vaporization-point of T:
        now T is not alight;
        vaporize subject;
    else if T is not alight:
        now T is alight;
        ignite subject.
 
Rule for incinerating the rock-salt:
    now the rock-salt is not moist;
    inert subject.
 
Rule for incinerating the not alight phlo-gold when the enkilning source is the camphrost-flare:
    now the phlo-gold is alight;
    ignite subject.
 
Rule for incinerating the phlo-electrum when the enkilning source is the camphrost-flare:
    now the phlo-electrum is not alight;
    melt subject.
 
Rule for incinerating the torch-lighter:
    shatter subject.
 
 
Section - The Kiln
 
The kiln is a recallable scenery container.
Understand "massive", "towering", "stack", "edifice", "brick", "firebrick", "interior", "cavity", "red", "glow", "heat", "narrow", "opening" as the kiln.
 
The lens-view of the kiln is "the bowels of the Earth".
 
Check examining the kiln:
    say "The kiln is a towering stack of firebrick. You can see gas burners roaring behind gaps in the base, pouring heat into the mass. Above, a narrow opening reveals the kiln's interior. The cavity shows no open flame, only a red glow and a thick ripple of heated air.";
    instead try searching the kiln.
 
Check searching the kiln:
    let N be the number of things in the kiln;
    if N is zero:
        say "The kiln is empty";
    else if N is one:
        say "Within the kiln's fury, you see [a first thing held by the kiln roomily]";
    else:
        say "The kiln contains [a list of things *in the kiln roomily]";
    [### should show supported items in both cases]
    instead say "."
 
Check switching on the kiln:
    instead try switching on the kiln-burner.
Check switching off the kiln:
    instead try switching off the kiln-burner.
Check extinguishing the kiln:
    instead try switching off the kiln-burner.
 
Check repairing the kiln:
    instead try repairing the kiln-burner.
 
Check touching the kiln when currently fireproof:
    instead say "You lay your hand on the firebrick. It feels warmish."
 
Check touching the kiln:
    instead say "[one of]You brush the firebrick with your finger. As you might expect, it's scorchingly hot, and you spend a moment waving your hand around and swearing[or]It's still scorchingly hot[stopping]."
 
Check smelling the kiln:
    instead say "The kiln smells of hot brick."
 
Check pushing the kiln:
    instead try touching the kiln.
Check pulling the kiln:
    instead try touching the kiln.
 
Check taking the kiln:
    if not currently fireproof:
        say "Even if it weren't blazingly hot, it";
    else:
        say "It";
    instead say " weighs tons."
 
Check entering the kiln:
    if currently fireproof:
        instead say "Sure, you're fireproof, but the kiln isn't large enough to climb into.";
    instead say "You have no desire to incinerate yourself."
 
The insert-stuff-in-kiln rule is listed after the better can't insert what's not held rule in the check inserting it into rulebook.
Check inserting something takeable into the kiln (this is the insert-stuff-in-kiln rule):
    if currently fireproof:
        mark kiln-reach-goal as done;
        say "You slide [the noun] unhurriedly into the kiln.";
    else:
        say "You push [the noun] into the kiln's heat; but you have to yank your hand away instantly.";
    now the noun is in the kiln;
    now the enkilning source is the kiln-burner;
    follow the enkilning rulebook for the noun without suppressing breaks;
    if rule failed:
        retire the noun by burning in the kiln;
    now the enkilning source is no-thing;
    stop the action.
 
The put-stuff-on-supporters-in-kiln rule is listed after the better can't put what's not held rule in the check putting it on rulebook.
Check putting something takeable on a portable supporter when the second noun is in the kiln (this is the put-stuff-on-supporters-in-kiln rule):
    if currently fireproof:
        mark kiln-reach-goal as done;
        say "You slide [the noun] unhurriedly onto [the second noun].";
    else:
        say "You push [the noun] onto [the second noun], amid the heat; but you have to yank your hand away instantly.";
    if the second noun is a clay-mold and the second noun is empty:
        let F be the file of the second noun;
        if the noun is a low-melting-wire metal-wire or the noun is a low-melting-rod metal-rod or the noun is a low-melting-seal metal-seal:
            let M be the seal-metal associated with the noun;
            let T be the seal form of M with F;
            if T is no-thing:
                retire the noun vaguely;
                instead say "(BUG) [The noun] melts into nothing.";
            retire the noun by transformation into T;
            now T is on the second noun;
            set pronouns from T;
            instead say "[line break]The [smetal of T] melts immediately, filling the [file of T] File mold.";
    now the noun is on the second noun;
    now the enkilning source is the kiln-burner;
    follow the enkilning rulebook for the noun without suppressing breaks;
    if rule failed:
        retire the noun by burning in the kiln;
    now the enkilning source is no-thing;
    stop the action.
 
Rule for reaching inside the kiln when not currently fireproof:
    if putting something on and the second noun is a portable supporter and the second noun is in the kiln:
        allow access;
    if inserting something into and the second noun is a portable supporter and the second noun is in the kiln:
        allow access;
    say "You can barely come near the kiln's opening. Reaching inside is impossible.";
    deny access.
 
Rule for reaching inside the kiln when currently fireproof:
    mark kiln-reach-goal as done;
    allow access;
 
Check blowing on something when the noun is in the kiln:
    instead say "Blowing on something inside the furnace-hot kiln is pointless."
 
The kiln-burner is a plural-named scenery thing. The printed name is "gas burners".
The description is "Gaps in the kiln's base reveal a row of gas burners, all blazing furiously. There is a gas valve set into the floor nearby."
The kiln-burner is alight. It burns at 15.
Understand "fire", "flame", "gas", "burner", "burners", "gap", "gaps", "base", "valve" as the kiln-burner.
 
Check switching on the kiln-burner:
    instead say "The gas burners are already alight."
 
Check switching off the kiln-burner:
    instead say "[one of]You twist the gas valve, but it seems to be stuck[or]You grip the gas valve as hard as you can, but it won't budge[stopping]."
 
Check turning the kiln-burner:
    instead try switching off the kiln-burner.
Check pushing the kiln-burner:
    instead try switching off the kiln-burner.
Check pulling the kiln-burner:
    instead try switching off the kiln-burner.
Check extinguishing the kiln-burner:
    instead try switching off the kiln-burner.
Check vague-setting the kiln-burner:
    instead try switching off the kiln-burner.
Check freeing the kiln-burner:
    instead try switching off the kiln-burner.
 
Check repairing the kiln-burner:
    instead say "You're not sure how to unstick the gas valve."
 
Check blowing on the kiln-burner:
    instead say "One of the gas flames flickers a bit."
 
Check smelling the kiln-burner:
    instead try smelling the kiln.
 
Check attacking the kiln-burner:
    instead say "You bang on the gas valve, but it doesn't loosen."
Check smashing the kiln-burner:
    instead say "You bang on the gas valve, but it doesn't loosen."
 
Instead of putting the mineral-oil on the kiln-burner:
    instead say "Despite the stories, oil doesn't magically unstick everything."
 
Section - Vapor Crock
 
The crock is a recallable glassy scenery transparent open openable container. The printed name is "vapor crock".
Understand "vapor", "wide", "glass", "vapor-ware", "vaporware", "cylinder", "lid", "McGrew", "McGrew's" as the crock.
The crock has a number called the vapor-pressure.
The crock can be shifted. [smell of burning; resettable]
Understand "pale", "blue" as the crock when vapor-pressure of the crock is not zero.
 
Check examining the crock:
    say "A McGrew Crock is a piece of vapor-ware; it allows you to submerge items in a controlled atmosphere or aitheric medium. It's a wide glass cylinder, a foot wide and two feet high, with a gasketted lid.[para]";
    instead try searching the crock.
 
Check searching the crock:
    if the crock is empty:
        if the crock is open:
            say "The crock is empty; its lid is standing open";
        else:
            say "The crock is sealed but empty";
        if the vapor-pressure of the crock is not zero:
            if the vapor-pressure of the crock is less than 3:
                say ", except for a thin, pale blue vapor";
            else:
                say ", except for a dense, pale blue vapor";
    else:
        if the crock is open:
            say "The crock's lid is standing open";
        else:
            say "The crock is sealed";
        say ". You see [a list of things *in the crock roomily] within";
        if the vapor-pressure of the crock is not zero:
            if the vapor-pressure of the crock is less than 3:
                say ".[para]A pale blue vapor is rising in the crock";
            else:
                say ".[para]A pale blue vapor swirls densely in the crock";
    instead say "."
 
Check opening the closed crock:
    say "You unseal and open the lid";
    if the vapor-pressure of the crock is not zero:
        now the vapor-pressure of the crock is zero;
        say ". The blue vapor spills out and dissipates";
    now the crock is open;
    if the crock is shifted:
        say ". A remnant scorched aroma drifts out";
        now the crock is not shifted;
    instead say "."
 
Report closing the crock:
    instead say "You close the crock and seal its lid."
 
Check inspecting the crock with the oculus:
    instead say "Through the oculus, the vapor crock shows traces of sublimation and ignition."
 
 
Chapter - Vacuum Work
 
The vacuum-potion-remaining is a number that varies. [resettable]
 
The vacuumizing rulebook is an object-based rulebook.
The vacuumizing rulebook has outcomes inert subject (failure - the default), extinguish subject, vaporize subject, shatter subject, explode subject, boil subject.
 
To vacuumize (T - thing):
    follow the vacuumizing rulebook for T;
    if the outcome of the rulebook is no-outcome:
        stop;
    if the outcome of the rulebook is:
        -- inert subject outcome: do nothing;
        -- extinguish subject outcome: now T is in the extinguish-bucket;
        -- vaporize subject outcome: now T is in the vaporize-bucket;
        -- shatter subject outcome: now T is in the shatter-bucket;
        -- explode subject outcome: now T is in the explode-bucket;
        -- boil subject outcome: now T is in the boil-bucket;
        -- otherwise: say "(BUG) Vacuumize failure for [T].";
 
To perform inventory vacuumization in (dest - room):
    repeat with T in raw contents of the player:
        vacuumize T;
    update fire consumption;
    if there is a non-empty abstraction-bucket:
        say "[line break]Unfortunately, your possessions do not fare so well. In the vacuum";
        recite the buckets;
    repeat with T in raw contents of the extinguish-bucket:
        now the player carries T;
    repeat with B running through all abstraction-buckets:
        repeat with T in raw contents of B:
            now T retired to vacuum-fate;
            now T retired with dest;
            now T is off-stage;
    sanity-check the empty buckets.
 
[We assume that all containers and supporters, including takeable-supporters, and also the player, are vacuum-stable.]
To recursively vacuumize (T - thing):
    if T is the player:
        repeat with T2 running through things carried by the player:
            vacuumize T2;
        stop;
    if T is a container:
        repeat with T2 running through things in T:
            recursively vacuumize T2;
    if T is a supporter:
        repeat with T2 running through things on T:
            recursively vacuumize T2;
    if T is takeable:
        vacuumize T.
 
To perform room vacuumization in (dest - room):
    [Not using the fast contents iteration, because this is recursive.]
    repeat with T running through things in dest:
        recursively vacuumize T;
    if there is a non-empty abstraction-bucket:
        say "[line break]Unfortunately, your possessions do not fare so well. In the vacuum";
        recite the buckets;
    [This always returns extinguished splints to the player, even if they were on the floor. Oh well.]
    repeat with T in raw contents of the extinguish-bucket:
        now the player carries T;
    repeat with B running through all abstraction-buckets:
        repeat with T in raw contents of B:
            now T retired to vacuum-fate;
            now T retired with dest;
            now T is off-stage;
    sanity-check the empty buckets.
 
Rule for vacuumizing a charged bubble:
    explode subject.
 
Rule for vacuumizing el-water:
    shatter subject.
 
Rule for vacuumizing the lubanja:
    boil subject.
 
Rule for vacuumizing the sublime:
    boil subject.
 
Rule for vacuumizing the polar-oil:
    [alien technology]
    inert subject.
 
Rule for vacuumizing the aither-protection:
    [why punish the player at this point?]
    inert subject.
 
Rule for vacuumizing a potion-vial:
    shatter subject.
 
Rule for vacuumizing a chem-source (called T):
    let M be the substance of T;
    if M is powdery:
        inert subject;
    if M is water-based:
        boil subject;
    if M is acidic:
        boil subject;
 
Rule for vacuumizing an alight wood-splint (called T):
    now T is not alight;
    extinguish subject.
 
Rule for vacuumizing alight phlo-gold:
    now the phlo-gold is not alight;
    extinguish subject.
 
Rule for vacuumizing alight phlo-electrum:
    now the phlo-electrum is not alight;
    extinguish subject.
 
Rule for vacuumizing the torch-lighter:
    shatter subject.
 
Rule for vacuumizing the camphrost:
    vaporize subject.
 
Rule for vacuumizing the rock-salt:
    now the rock-salt is not moist;
    inert subject.
 
Rule for vacuumizing the mushroom:
    now the mushroom is not moist;
    inert subject.
 
Rule for vacuumizing the honeysuckle:
    now the honeysuckle is not moist;
    inert subject.
 
Rule for vacuumizing the pinecone:
    now the pinecone is not moist;
    inert subject.
 
 
Chapter - Alien Aither
 
The aither-potion-remaining is a number that varies. [resettable]
 
A room can be alien-aither-env.
 
Every turn when the location is alien-aither-env (this is the aither daemon rule):
    if aither-potion-remaining is zero:
        say "The ache in your bones becomes worse -- horribly worse -- and the lights go dim and red. Or a dim red vapor is bleeding into the world. Perhaps your sight is failing. Perhaps everything else is.";
        invoke reset, involuntarily;
    else:
        mark aither-survival-goal as done.
 
 
Chapter - Underwater
 
[A thing can be moist.]
[To save space, moist is defined per-object: pinecone, mushroom, honeysuckle, rock-salt.]
 
The moisturizing rulebook is an object-based rulebook.
The moisturizing rulebook has outcomes inert subject (failure - the default), extinguish subject, dissolve subject.
 
The dissolve-bucket is an abstraction-bucket.
The short-description is "dissolves". The short-description-multi is "dissolve".
 
To moisturize (T - thing):
    follow the moisturizing rulebook for T;
    if the outcome of the rulebook is no-outcome:
        stop;
    if the outcome of the rulebook is:
        -- inert subject outcome: do nothing;
        -- extinguish subject outcome: now T is in the extinguish-bucket;
        -- dissolve subject outcome: now T is in the dissolve-bucket;
        -- otherwise: say "(BUG) Moisturize failure for [T].";
 
To perform inventory moisturization in (dest - room):
    repeat with T in raw contents of the player:
        moisturize T;
    update fire consumption;
    let spoken be false;
    if the extinguish-bucket is non-empty:
        now all things in the extinguish-bucket are not alight;
        say "[line break]Your plunge has doused ";
        list the contents of the extinguish-bucket, tersely, as a sentence, using the definite article;
        now spoken is true;
        repeat with T in raw contents of the extinguish-bucket:
            now the player carries T;
    let N be the number of el-fire things carried by the player;
    if N is not zero:
        if spoken is false:
            say "[line break]Elemental fire burns underwater, it seems";
        else:
            say ". Elemental fire burns underwater, however";
        if N is one:
            let T be a random el-fire thing carried by the player;
            say "; the [short-description of T] rod bubbles and sputters away";
        else:
            say "; the phlogisticated rods bubble and sputter away";
        say " furiously";
        now spoken is true;
    if there is a non-empty abstraction-bucket:
        if spoken is false:
            say "[line break]In the water";
        else:
            say ".[para]On top of that";
        recite the buckets;
        repeat with B running through all abstraction-buckets:
            repeat with T in raw contents of B:
                now T retired to water-fate;
                now T retired with dest;
                now T is off-stage;
        now spoken is false;
    if spoken is true:
        say ".";
    sanity-check the empty buckets.
 
To perform throw moisturization with (T - thing) in (dest - room):
    moisturize T;
    update fire consumption;
    if T is in the extinguish-bucket:
        now T is not alight;
        say "[The T] falls into the water and is doused";
        now T is in dest;
    else if T is in an abstraction-bucket:
        say "In the water";
        recite the buckets, omitting final period;
        now T retired to water-fate;
        now T retired with dest;
        now T is off-stage;
    else if T is el-fire:
        say "Elemental fire burns underwater, it seems";
        say "; the [short-description of T] rod bubbles and sputters as it sinks";
        now T is in dest;
    else:
        say "[The T] [if T is singular-named]falls[else]fall[end if] into the water and [if T is singular-named]sinks[else]sink[end if]";
        now T is in dest;
    say ".";
    sanity-check the empty buckets.
 
Rule for moisturizing an alight wood-splint (called T):
    now T is not alight;
    extinguish subject.
 
Rule for moisturizing the pinecone:
    now the pinecone is moist;
    inert subject.
 
Rule for moisturizing the mushroom:
    now the mushroom is moist;
    inert subject.
 
Rule for moisturizing the honeysuckle:
    now the honeysuckle is moist;
    inert subject.
 
Rule for moisturizing the rock-salt:
    now the rock-salt is moist;
    inert subject.
 
Rule for moisturizing the zafranum:
    dissolve subject.
 
Rule for moisturizing the camphrost:
    dissolve subject.
 
Rule for moisturizing the torch-lighter:
    now the torch-lighter is not alight;
    inert subject.
 
 
Section - Breath-Holding
 
The breath-remaining is a number that varies. [resettable]
The breath-potion-remaining is a number that varies. [resettable]
 
To begin underwater activity:
    say "You[if breath-potion-remaining is zero] take a deep breath and[end if] jump into the chilly water";
    if breath-potion-remaining is greater than zero:
        say ". The potion [one of]seems to be[or]is still[stopping] working -- you feel no urge to breathe";
    [good thing we can't go from vacuum to water, or vice versa]
    now breath-remaining is seven;
    say "."
 
To cease underwater activity:
    if breath-potion-remaining is greater than zero or breath-remaining is greater than four:
        say "You pull yourself out of the water.";
    else if breath-remaining is greater than two:
        say "You break the surface, blow out breath, and pull yourself from the water.";
    else if breath-remaining is not zero:
        say "You break the surface, suck in a gasp of air, and pull yourself from the water.";
    else:
        say "You kick desperately upwards. Your face breaks the surface, and you suck in air for several moments before you find the strength to pull yourself out of the water.";
    now breath-remaining is zero.
 
To exert yourself underwater:
    if breath-remaining > 4:
        now breath-remaining is 4.
 
Every turn (this is the breath daemon rule):
    if breath-potion-remaining is greater than zero:
        decrement breath-potion-remaining;
        if breath-potion-remaining is:
            -- 5: say "The heavy sensation in your lungs begins to fade.";
            -- 2: say "The heavy sensation in your lungs is dissipating.";
            -- 1: say "Your lungs feel nearly normal again.";
            -- 0:
                if not goal-achieving:
                    say "You suddenly realize that you haven't [em]breathed[/em] in ten minutes";
                else:
                    say "The breath potion has worn off";
                if the atmosphere of the location is:
                    -- normal-atm: say ". You suck in a startling gasp of air.";
                    -- fire-atm: say ". You suck in a startling gasp of air, and nearly choke again on the smoke and heat.";
                    -- vacuum-atm: say ". A moment later you realize that whatever your lungs are doing, it's not breathing in the usual sense. Carry on, then.";
                    -- water-atm:
                        now breath-remaining is two;
                        say ". ";
    if the atmosphere of the location is not water-atm:
        if breath-remaining is not zero:
            say "(BUG) Breath-remaining timer is [breath-remaining], even though not underwater.";
            now breath-remaining is zero;
    else:
        if breath-remaining is zero:
            say "(BUG) Breath-remaining timer is zero while underwater!";
            now breath-remaining is one;
        if breath-potion-remaining is zero:
            decrement breath-remaining;
            if breath-remaining is:
                -- 3: say "You can't hold your breath much longer.";
                -- 1: say "Your lungs spasm, trying to gasp air that is not there.";
                -- 0: try going outside.
 
 
Chapter - Aeroclave and Valves
 
The aeroclave is a recallable scenery openable transparent glassy container.
The aeroclave can be ever-used. [resettable]
Understand "glass", "chamber", "box", "gasket", "gasketed", "enclosed", "panel", "pedestal" as the aeroclave.
Understand "open", "opened" as the aeroclave when the aeroclave is open.
Understand "closed", "sealed" as the aeroclave when the aeroclave is closed.
 
Check examining the aeroclave:
    say "The aeroclave is an enclosed glass chamber, with a gasketed panel on top. This device is used to sterilize medical instruments in a stream of elemental air -- quite sufficient to dissolve away blood, grease, disease, or any other vestige of living matter. A hose runs from the nearby tank to the base of the chamber; the coupling bears a large brass knob.[para]";
    say "The panel[if the aeroclave is open] stands open[else] is sealed shut[end if]";
    if the aeroclave is empty:
        say ", but the aeroclave chamber is empty";
    else:
        say ". Inside you see [the list of things *in the aeroclave roomily]";
    if the aeroclave is ever-used:
        say ".[para]The atmosphere within the chamber seems to have cleared, mostly";
    instead say "."
 
Check searching the aeroclave:
    if the aeroclave is empty:
        say "The aeroclave chamber is empty";
    else:
        say "Inside you see [the list of things *in the aeroclave roomily]";
    instead say "."
 
Check taking the aeroclave:
    instead say "The aeroclave is fastened down."
 
Check switching on the aeroclave:
    instead try turning the air-knob.
Check switching off the aeroclave:
    instead try switching off the air-knob.
 
Check smelling the aeroclave:
    instead say "You smell just the faintest whiff of the ozonic tang of elemental air."
 
Check pushing the aeroclave:
    instead try closing the aeroclave.
Check pulling the aeroclave:
    instead try opening the aeroclave.
Check freeing the aeroclave:
    instead try opening the aeroclave.
 
Report closing the aeroclave:
    instead say "You push the glass panel closed. It takes a bit of force, due to the tight gaskets."
 
Report opening the aeroclave:
    say "You pull the aeroclave open";
    if the aeroclave is ever-used:
        say ". An ozoney whiff of elemental air drifts out; your nose prickles";
    now the aeroclave is not ever-used;
    instead say "."
 
Check inserting a chem-source into the aeroclave:
    instead say "[The noun] might be well-sealed enough to survive the elemental air uncontaminated. Or, then, it might not. You decide not to try it."
 
Check inspecting the aeroclave with the oculus:
    instead say "Through the oculus, the aeroclave shows traces of dissolution and sterilization."
 
The air-tank is metallic scenery. The printed name is "pressure tank".
The air-tank is readable.
The description is "The air tank is several feet high, a construction of solid steel, painted with warning notices. A heavy hose runs to the aeroclave. The tank also sports a needle valve, used to fill portable containers with elemental air."
Understand "pressure", "pressurized", "container", "elemental", "air", "steel", "tank", "warning", "warnings", "notice", "notices" as the air-tank.
Understand "needle", "valve" as the air-tank.
 
The lens-view of the air-tank is "Mars, with elemental air shining through".
 
Check reading the air-tank:
    instead say "'Do not attempt to move by hand,' 'Do not attempt to unfasten couplings without safety gear,' 'Do not hit valve with hammer,' 'Not even if it sticks and you are in a hurry,' that sort of thing. There is an epic pictogram of puffs of air emerging from a loose hose and melting the stick-figure bystanders."
 
Check smelling the air-tank:
    instead say "You smell just the faintest whiff of the ozonic tang of elemental air."
 
Check taking the air-tank:
    instead say "The tank is chest-high and probably weighs three hundred pounds, empty."
 
Check pushing the air-tank:
    instead try taking the air-tank.
Check pulling the air-tank:
    instead try taking the air-tank.
 
Check attacking the air-tank:
    instead say "Damaging the tank would kill you quickly. Or so the warning notices imply."
 
Check opening the air-tank:
    instead say "The needle valve will open automatically when you put a matching pressure container onto it."
Check closing the air-tank:
    instead say "The needle valve is always closed, when not in use."
Check freeing the air-tank:
    instead try opening the air-tank.
Check emptying the air-tank:
    instead try opening the air-tank.
 
Check putting a bubble on the air-tank:
    instead try tapping the noun on the air-tank.
 
Check tapping a bubble on the air-tank:
    if the noun is charged:
        instead say "You press the bubble onto the needle valve. It emits a faint, brief hiss, but no more. The pressure in the bubble is already as high as it will go.";
    now the noun is charged;
    mark el-air-goal as done;
    if the noun is the dusty-bubble:
        now el-air-goal is double-bubble-known;
    instead say "You press the bubble onto the needle valve. The valve emits a sharp, rising hiss; you can just see the jet of elemental air, like a heat-ripple inside the [short-description of the noun] bubble. After a few seconds, the valve shuts off, and you remove the fully-charged bubble[first time]. The pressure within gives it a heavy appearance, like clear oil[only]."
 
Does the player mean rule when the noun is a bubble and the second noun is the air-tank:
    if the noun is uncharged:
        it is very likely;
    else:
        it is likely.
Does the player mean rule when the noun is the air-tank and the second noun is a bubble:
    if the second noun is uncharged:
        it is very likely;
    else:
        it is likely.
 
The air-hose is scenery part of the air-tank. The printed name is "hose".
The description is "A hose joins the tank to the aeroclave chamber. It's a monstrous affair, thicker than your arm, made of heavy passivated vulcanized rubber."
Understand "vulcanized", "rubber", "passivated", "heavy", "air", "hose" as the air-hose.
Understand "locked", "safety", "coupling", "couplings" as the air-hose.
 
Check taking the air-hose:
    instead say "The hose is hooked into locked safety couplings at either end. You won't get it free without an axe, which is probably a good thing, considering the corrosive properties of elemental air."
 
Check pushing the air-hose:
    instead try taking the air-hose.
Check pulling the air-hose:
    instead try taking the air-hose.
Check turning the air-hose:
    instead try taking the air-hose.
Check opening the air-hose:
    instead try taking the air-hose.
Check freeing the air-hose:
    instead try taking the air-hose.
 
Check switching on the air-hose:
    instead try turning the air-knob.
Check switching off the air-hose:
    instead try switching off the air-knob.
 
Check putting a bubble on the air-hose:
    instead try tapping the noun on the air-hose.
 
Check tapping a bubble on the air-hose:
    instead say "The hose has no outlet for filling containers; it just connects to the aeroclave chamber."
 
The air-knob is metallic scenery part of the air-tank. The printed name is "brass knob".
The description is "This spring-loaded knob releases elemental air into the glass chamber."
The lens-view is "Venus and Ganymede".
Understand "brass", "knob" as the air-knob.
 
Check taking the air-knob:
    instead say "That seems to be part of the aeroclave."
 
Check opening the air-knob:
    instead try turning the air-knob.
Check closing the air-knob:
    instead try switching off the air-knob.
Check pushing the air-knob:
    instead try turning the air-knob.
Check switching on the air-knob:
    instead try turning the air-knob.
Check switching off the air-knob:
    instead say "The air flow is already turned off."
 
Check turning the air-knob:
    if the aeroclave is open:
        instead say "A safety mechanism prevents you from turning the knob while the aeroclave is open.";
    say "You twist the knob, and elemental air hisses into the chamber";
    if the aeroclave is not ever-used:
        say ". You can see the jet swirling behind the glass, almost invisible, like ripples in water";
    now the aeroclave is ever-used;
    if the aeroclave is empty:
        instead say ". When you release the knob, the flow shuts itself off.";
    repeat with T in raw contents of the aeroclave:
        aeroclavize T;
    update fire consumption;
    let inert-count be the number of things in the aeroclave; [...that didn't get pushed into a bucket]
    let first-inert be the first thing held by the aeroclave;
    let spoken be false;
    if the cleanse-bucket is not empty:
        say ".[para]The filth on [the list of things *in the cleanse-bucket] erodes away in the elemental air! The metal soons shines clean";
        if the scalpel is in the cleanse-bucket:
            now the scalpel is clean;
            mark the clean-scalpel-goal as done;
        repeat with T in raw contents of the cleanse-bucket:
            now T is in the aeroclave;
        now spoken is true;
    if there is a non-empty abstraction-bucket:
        if spoken is false:
            say ".[para]In the stream of elemental air";
        else:
            say ".[para]Other than that";
        recite the buckets, omitting final period;
        repeat with T in raw contents of the extinguish-bucket:
            now T is in the aeroclave;
        repeat with B running through all abstraction-buckets:
            repeat with T in raw contents of B:
                now T retired to aeroclave-fate;
                now T retired with the location;
                now T is off-stage;
        now spoken is true;
    if inert-count is one:
        if spoken is false:
            say ".[para][The first-inert] is not affected by the elemental air";
        else:
            say ".[para][The first-inert], however, is not affected";
    else if inert-count is greater than one:
        if spoken is false:
            say ".[para]None of the items in the aeroclave are affected by the elemental air";
        else:
            say ".[para]The other items, however, are not affected";
    if a bubble is in the aeroclave:
        say ". Apparently the bubble valve doesn't respond to gas just flowing by";
    say ".[para]";
    sanity-check the empty buckets;
    instead say "You release the knob, and the flow of air shuts off."
 
Check tapping the brass-pin on the air-knob when the symbol-type of the brass-pin is some-saturation-symbol:
    say "You carefully lay the [symbol-type of the brass-pin] symbol against the brass knob";
    uninscribe the brass-pin;
    instead say ". The symbol discharges with a faint pop. The brass of the knob was quite clean, however, so it does not get noticeably cleaner."
 
Report topically-applying the clock-tincture to the air-knob:
    instead say "You carefully pour the tincture over the brass knob. The knob must already be in good alignment, though, because nothing happens."
 
 
Section - Aeroclaving Rules
 
The aeroclaving rulebook is an object-based rulebook.
The aeroclaving rulebook has outcomes inert subject (failure - the default), extinguish subject, sublime subject, shatter subject, cleanse subject.
 
The cleanse-bucket is an abstraction-bucket.
The short-description is "cleanses". The short-description-multi is "cleanse".
 
The sublime-bucket is an abstraction-bucket.
The short-description is "sublimes away". The short-description-multi is "sublime away".
 
To aeroclavize (T - thing):
    follow the aeroclaving rulebook for T;
    if the outcome of the rulebook is no-outcome:
        stop;
    if the outcome of the rulebook is:
        -- inert subject outcome: do nothing;
        -- extinguish subject outcome: now T is in the extinguish-bucket;
        -- sublime subject outcome: now T is in the sublime-bucket;
        -- shatter subject outcome: now T is in the shatter-bucket;
        -- cleanse subject outcome: now T is in the cleanse-bucket;
        -- otherwise: say "(BUG) Aeroclavize failure for [T].";
 
Rule for aeroclaving the dirty scalpel:
    [we'll remove the dirt in the recitation process]
    cleanse subject.
 
Rule for aeroclaving a dried-vegetable thing:
    sublime subject.
 
Rule for aeroclaving the coral:
    sublime subject.
 
Rule for aeroclaving a wood-splint (called T):
    now T is not alight;
    sublime subject.
 
Rule for aeroclaving alight phlo-gold:
    now the phlo-gold is not alight;
    extinguish subject.
 
Rule for aeroclaving alight phlo-electrum:
    now the phlo-electrum is not alight;
    extinguish subject.
 
Rule for aeroclaving the silk-cord:
    sublime subject.
 
Rule for aeroclaving an impet:
    shatter subject.
 
 
Chapter - The Wire Devices
 
Definition: something is metal-rod-or-wire if it is a metal-rod or it is a metal-wire.
 
 
To decide what thing is the wire form of (T - thing):
    if T is:
        -- lead-rod: decide on lead-wire;
        -- platinum-rod: decide on platinum-wire;
        -- nickel-rod: decide on nickel-wire;
        -- moon-metal-rod: decide on moon-metal-wire;
        -- white-amalgam: decide on white-amalgam-wire;
        -- gold-amalgam: decide on gold-amalgam-wire;
        -- whitgold-rod: decide on whitgold-wire;
        -- moongold-rod: decide on moongold-wire;
        -- gold-rod: decide on gold-wire;
        -- phlo-gold: decide on gold-wire;
        -- electrum: decide on electrum-wire;
        -- phlo-electrum: decide on electrum-wire;
        -- otherwise: decide on no-thing.
 
To decide what thing is the rod form of (T - thing):
    if T is:
        -- lead-wire: decide on lead-rod;
        -- platinum-wire: decide on platinum-rod;
        -- nickel-wire: decide on nickel-rod;
        -- moon-metal-wire: decide on moon-metal-rod;
        -- white-amalgam-wire: decide on white-amalgam;
        -- gold-amalgam-wire: decide on gold-amalgam;
        -- whitgold-wire: decide on whitgold-rod;
        -- moongold-wire: decide on moongold-rod;
        -- gold-wire: decide on gold-rod;
        -- electrum-wire: decide on electrum;
        -- otherwise: decide on no-thing.
 
To decide what thing is the rod combination of (T1 - thing) and (T2 - thing):
    if T1 and T2 are jointly platinum-wire and moon-metal-wire:
        decide on electrum;
    if T1 and T2 are jointly gold-wire and nickel-wire:
        decide on ring-gold-rod;
    if T1 and T2 are jointly gold-wire and platinum-wire:
        decide on whitgold-rod;
    if T1 and T2 are jointly gold-wire and moon-metal-wire:
        decide on moongold-rod;
    decide on no-thing.
 
To decide what thing is the first wire component of (T - thing):
    if T is:
        -- electrum: decide on platinum-wire;
        -- ring-gold-rod: decide on gold-wire;
        -- whitgold-rod: decide on gold-wire;
        -- moongold-rod: decide on gold-wire;
        -- otherwise: decide on no-thing.
To decide what thing is the second wire component of (T - thing):
    if T is:
        -- electrum: decide on moon-metal-wire;
        -- ring-gold-rod: decide on nickel-wire;
        -- whitgold-rod: decide on platinum-wire;
        -- moongold-rod: decide on moon-metal-wire;
        -- otherwise: decide on no-thing.
 
The wire-drawer is a recallable scenery container.
Understand "drawer", "drawing", "device", "machine", "contrivance", "groove", "crank", "cranked", "hand-crank" as the wire-drawer.
Understand "devices", "machines" as the plural of wire-drawer.
Understand "roller", "rollers", "die", "dies" as the wire-drawer.
 
Check examining the wire-drawer:
    say "[one of]Not a drawer full of wire, but a wire-drawer. It's[or]The wire-drawing device is[stopping] a simple mechanical contrivance for turning metal rods into wire";
    if something (called T) is in the wire-drawer:
        instead say ".[para][A T] rests in the groove, waiting for the turn of the crank.";
    instead say ". You drop your rod into the groove, and then start turning the crank -- or more accurately, leaning all your weight on the crank. With sufficient effort, the metal is forced through a set of rollers and dies, and reduced to wire."
 
Check inserting pin-or-bolt into the wire-drawer:
    instead say "After some fiddling, you decide that [the noun] is the wrong shape to be run through the wire-drawer."
 
Check inserting silver-chain into the wire-drawer:
    instead say "The silver chain would probably break and clog up the device."
 
Check inserting silk-cord into the wire-drawer:
    instead say "The silk cord would probably tear and gum up the device."
 
Check inserting a wood-splint into the wire-drawer:
    instead say "Wood would just splinter in the wire-drawing device."
 
Check inserting a metal-wire into the wire-drawer:
    instead say "The device can't draw the [short-description of the noun] wire any thinner than it already is."
 
Check inserting a pebble into the wire-drawer:
    instead say "Minerals aren't ductile. You'd just crush [the noun], and probably damage the rollers."
 
Check inserting the jade into the wire-drawer:
    instead say "Minerals aren't ductile. You'd just crush [the noun], and probably damage the rollers."
 
Check inserting the iron-bead into the wire-drawer:
    instead say "After some fiddling, you decide that the iron bead is the wrong shape to be run through the wire-drawer. It's probably too hard, anyway -- it would damage the rollers."
 
Check inserting the mustard into the wire-drawer:
    instead say "[The noun] would just fall through the rollers."
 
Check inserting the zafranum into the wire-drawer:
    instead say "[The noun] would just fall through the rollers."
 
Check inserting the mercury into the wire-drawer:
    instead say "[The noun] would just fall through the rollers."
 
Check inserting the nickel-filings into the wire-drawer:
    instead say "The nickel filings would just fall through the rollers."
 
Check inserting something into the wire-drawer:
    if the noun is not a metal-rod:
        instead say "[The noun] is much too large to be drawn into the device.";
    if something (called T) is in the wire-drawer:
        if the noun is T:
            instead say "[The T] is already in the groove.";
        instead say "[The T] is already in the groove, and there's only enough room for one such."
 
Report inserting something into the wire-drawer:
    instead say "You slide [the noun] into the groove, ready to be drawn into the device."
 
Check putting something on the wire-drawer:
    instead try inserting the noun into the wire-drawer.
 
Check pushing the wire-drawer:
    instead try turning the wire-drawer.
Check pulling the wire-drawer:
    instead say "The wire-drawer's crank doesn't turn backwards. Something about the gearing."
 
Check switching on the wire-drawer:
    instead try turning the wire-drawer.
Check switching off the wire-drawer:
    instead say "The wire-drawer is hand-cranked. If you're not turning the crank, it's off."
 
Check turning the wire-drawer:
    unless something (called T) is in the wire-drawer:
        instead say "No metal is running through the wire-drawer, so the crank turns freely.";
    if T is orichalcum or T is red-amalgam or T is ring-gold-rod:
        retire T by manual destruction in the wire-drawer;
        instead say "You begin hauling on the crank, and [the T] is slowly drawn into the device.[para]The crank jerks painfully -- oh dear. You realize that the wire has snapped; [short-description of T] must be too [if T is orichalcum or T is ring-gold-rod]brittle[else]weak[end if] to be drawn like this. You try to free the rod, but it's too far in, and the crank won't turn backwards. Your only option is to keep cranking, and watch [the T] break into useless crumbled bits that are lost in the guts of the device.";
    let W be the wire form of T;
    if W is no-thing:
        instead say "(BUG) You are unable to draw [the T] into wire for some reason.";
    retire T by transformation into W;
    now W is in the current toolshop destination;
    set pronouns from W;
    say "You begin hauling on the crank, and [the T] is slowly drawn into the device. [if W is nickel-wire]It's terrible work -- nickel isn't a soft metal -- but you throw your weight on it, and soon[else]Soon[end if] wire begins spooling out onto the counter";
    if T is phlo-gold or T is phlo-electrum:
        say ".[para]You notice sparks flying from between the rollers, however, and the wire emerges without the luster you expect. Apparently you're pressing the phlogiston right out of the metal. That's a disappointment[if T is alight]. When the burning end of the rod is pulled into the device, it is summarily snuffed out[end if]";
        now T is not alight;
    instead say ".[para]After several minutes of sweat, sore hands, and metallic creaking noises, the rod is entirely consumed. The [short-description of W] wire falls free, into a loose coil."
 
 
The wire-splicer is a recallable scenery container.
Understand "splicer", "splicing", "device", "machine", "contrivance", "tiny", "hole", "holes", "wheel" as the wire-splicer.
Understand "devices", "machines" as the plural of wire-splicer.
Understand "reel", "reels", "gear", "gears" as the wire-splicer.
Understand "rumpel", "rumple", "rumpelstilt", "rumplestilt", "skinner" as the wire-splicer.
 
Check examining the wire-splicer:
    let N be the number of things in the wire-splicer;
    if N is zero:
        instead say "The wire-splicer -- affectionately known to the apprentice crew as the Rumpelstiltskin wheel -- sports a pair of tiny holes beneath a fearsome array of reels and gears. You feed in two lengths of metal wire, and it folds them together -- then folds them again and again, until the metals have blended into a uniform alloy. (Turning the wheel is a tedious chore, but it's easier than messing around with furnaces and crucibles.)";
    say "The wire-splicer -- affectionately known to the apprentice crew as the Rumpelstiltskin wheel -- sports a pair of tiny holes beneath a fearsome array of reels and gears";
    if N is one:
        say ". [A first thing held by the wire-splicer] has been fed into one hole";
    else:
        say ". You see that [a list of things *in the wire-splicer] have been fed into the holes. The wheel is ready to be turned";
    instead say "."
 
Check inserting mercury into the wire-splicer:
    instead say "The mercury would just drip out of the machinery."
 
Check inserting the nickel-filings into the wire-splicer:
    instead say "The splicer works on wire, not filings."
 
Check inserting something into the wire-splicer:
    if the noun is not a metal-wire:
        instead say "The splicer's feed holes are only large enough for wire.";
    let N be the number of things in the wire-splicer;
    if N >= 2:
        instead say "The splicer already holds two lengths of wire; there's no room for more."
 
Report inserting something into the wire-splicer:
    instead say "You feed the [short-description of the noun] wire's end into one of the holes."
 
Check putting something on the wire-splicer:
    instead try inserting the noun into the wire-splicer.
 
Check pushing the wire-splicer:
    instead try turning the wire-splicer.
Check pulling the wire-splicer:
    instead say "The splicer's wheel doesn't turn backwards. Something about the gearing."
 
Check switching on the wire-splicer:
    instead try turning the wire-splicer.
Check switching off the wire-splicer:
    instead say "The splicer is hand-operated. If you're not turning the wheel, it's off."
 
Check turning the wire-splicer:
    let N be the number of things in the wire-splicer;
    if N is zero:
        instead say "No metal is running through the wire-splicer, so the wheel turns freely.";
    if N is one:
        let T be the first thing held by the wire-splicer;
        let R be the rod form of T;
        if R is no-thing:
            instead say "(BUG) You are unable to splice [the T] for some reason.";
        retire T by transformation into R;
        now R is in the current toolshop destination;
        if R is the lead-rod:
            now the symbol-type of lead-rod is no-symbol;
        set pronouns from R;
        [Non-alloy rods typically are found, not initially made, so their goals are ever-done.]
        instead say "You begin turning the wheel, and [the T] is pulled into the splicer. Since it's just one length of wire, the metal is not compounded; it's simply refolded into its original rod-shape. [The R] rolls tidily out onto the counter.";
    if N is two:
        let T1 be the first thing held by the wire-splicer;
        let T2 be the next thing held after T1;
        let R be the rod combination of T1 and T2;
        if R is no-thing:
            retire T1 by manual destruction in the wire-splicer;
            retire T2 by manual destruction in the wire-splicer;
            instead say "You begin turning the wheel, and the [short-description of T1] and [short-description of T2] wires are pulled into the splicer. Back and forth they are folded, in thinner and thinner layers, as you turn the wheel.[para]Unfortunately, the metals don't seem to be alloyable. Instead of fusing, the layers split apart, splaying into fine flakes of metal that sift down from the splicer's gears. When you finish turning the wheel, both lengths of wire have been entirely ground away.";
        retire T1 by transformation into R;
        retire T2 by transformation into R;
        now R is in the current toolshop destination;
        set pronouns from R;
        if the creation-action of R is not impossible-goal:
            mark the creation-action of R as done;
        instead say "You begin turning the wheel, and the [short-description of T1] and [short-description of T2] wires are pulled into the splicer. Back and forth they are folded, in thinner and thinner layers, as you turn the wheel.[para]After several minutes, the metals are fused into a single rod of [short-description of R]. The rod rolls tidily out onto the counter.";
    instead say "(BUG) Why are there [N] things in the splicer?"
 
Chapter - Mixed Drinks
 
Section - Basic Types
 
Substance-type is a kind of value.
 
Substance-types are no-subst, unknown-subst, chalky-paste-subst. [Base cases]
Substance-types are saline-subst, alcohol-subst, mineral-oil-subst, vinegar-subst, lubanja-subst, muriatic-subst, vitriolic-subst, alum-subst, sand-subst. [Flasks]
Substance-types are weak-acid-subst, moderate-acid-subst, strong-acid-subst, clear-subst, layered-subst, dry-subst. [Combinations, occur only in the beaker]
Substance-types are clock-paste-subst, clock-solution-subst, breath-bubbly-subst, aither-sparkly-subst, brown-paste-subst, yellowish-subst, sucker-crimson-subst. [Combinations in ritual, occur only in the beaker]
Substance-types are ori-vitriol-subst, ori-muriatic-subst, ori-muriatic-2-subst, fluor-vitriol-subst, grey-acid-subst, black-reagent-subst, calcinate-crystal-subst, sand-earth-subst, sand-water-subst, damp-sand-subst, indigo-mix-subst, violet-mix-subst, swirl-mixture-subst, nickel-oil-subst. [Combinations in ritual, occur only in the reservoir]
Substance-types are sublime-subst, percalcinate-subst, bamuriatic-subst, gaian-subst, counter-gaian-subst, anti-tellurian-subst, nickel-subst, brun-oil-subst, perfect-mud-subst, highlime-subst, viridigris-subst, potion-subst, fake-vial-subst. [Vials, never occur in the game world or in player input]
 
Understand "strong", "concentrated" as strong-acid-subst.
Understand "moderate", "moderated" as moderate-acid-subst.
Understand "weak", "dilute" as weak-acid-subst.
Understand "layer", "layers", "layered" as layered-subst.
Understand "clear" as clear-subst.
Understand "dry" as dry-subst.
Understand "unknown", "compound", "compounds", "murky" as unknown-subst.
Understand "pale", "glittering" as clock-paste-subst.
Understand "silvery" as clock-solution-subst.
Understand "bubbly", "effervescent" as breath-bubbly-subst.
Understand "sparkling", "sparkly", "blue" as aither-sparkly-subst.
Understand "greasy", "brown" as brown-paste-subst.
Understand "yellow", "yellowish" as yellowish-subst.
Understand "brilliant", "red", "crimson" as sucker-crimson-subst.
Understand "sky", "sky-blue" as ori-vitriol-subst. ["blue" is usurped by the aither-sparkly]
Understand "green", "grass", "grass-green" as ori-muriatic-subst.
Understand "viridian" as ori-muriatic-2-subst. ["brilliant" is usurped by the sucker-crimson]
Understand "amber" as fluor-vitriol-subst.
Understand "grey", "gray", "slate-grey", "slate-gray" as grey-acid-subst.
Understand "black", "thick", "goo", "gooey", "reagent" as black-reagent-subst.
Understand "dark-green" as calcinate-crystal-subst. ["green" is usurped by the ori-muriatic]
Understand "swirl", "swirling", "filament", "filaments" as the swirl-mixture-subst.
Understand "golden" as the nickel-oil-subst.
Understand "glassy", "translucent" as sand-earth-subst.
Understand "watery" as sand-water-subst.
Understand "indigo" as indigo-mix-subst.
Understand "violet" as violet-mix-subst.
Understand "chalky" as chalky-paste-subst.
Understand "damp" as damp-sand-subst.
 
Extra-substance-type is a kind of value.
The extra-substance-types are extra-nil-subst, extra-acid-subst, extra-spirit-subst, extra-mixture-subst, extra-powder-subst, extra-crystal-subst, extra-paste-subst, extra-solution-subst.
Understand "liquid" as extra-nil-subst.
Understand "acid", "acidic" as extra-acid-subst.
Understand "mixture" as extra-mixture-subst.
Understand "spirit", "essence" as extra-spirit-subst.
Understand "powder" as extra-powder-subst.
Understand "coarse", "crystal", "crystals", "sand" as extra-crystal-subst.
Understand "paste" as extra-paste-subst.
Understand "solution" as extra-solution-subst.
 
[Optimization hack!]
To decide whether substance (M - substance-type) between (min-val - substance-type) and (max-val - substance-type):
    (- {M} >= {min-val} && {M} <= {max-val} -).
 
Definition: a substance-type is in-stock if substance it between saline-subst and sand-subst.
Definition: a substance-type is vial-based if substance it between sublime-subst and fake-vial-subst.
Definition: a substance-type is strongly acidic if it is strong-acid-subst or it is muriatic-subst or it is vitriolic-subst or it is bamuriatic-subst or it is grey-acid-subst.
Definition: a substance-type is moderately acidic if it is moderate-acid-subst or it is vinegar-subst or it is ori-vitriol-subst or it is ori-muriatic-subst or it is fluor-vitriol-subst or it is swirl-mixture-subst or it is black-reagent-subst.
Definition: a substance-type is acidic if it is strongly acidic or it is moderately acidic.
Definition: a substance-type is water-based if it is saline-subst or it is alcohol-subst.
Definition: a substance-type is powdery if it is dry-subst or it is alum-subst or it is percalcinate-subst or it is gaian-subst or it is counter-gaian-subst or it is highlime-subst or it is nickel-subst or it is viridigris-subst or it is sand-subst or it is sand-earth-subst or it is calcinate-crystal-subst.
Definition: a substance-type is pasty if it is clock-paste-subst or it is brown-paste-subst or it is chalky-paste-subst or it is sand-water-subst or it is damp-sand-subst or it is nickel-oil-subst.
 
To say generic term for (T - substance-type):
    if T is powdery:
        say "powder";
    else if T is pasty:
        if T is sand-water-subst or T is damp-sand-subst:
            say "sand";
        else:
            say "paste";
    else:
        say "liquid";
 
To fix up the substance of (O - thing):
    let T be the substance of O;
    if T is vinegar-subst or T is muriatic-subst or T is vitriolic-subst or T is weak-acid-subst or T is moderate-acid-subst or T is strong-acid-subst or T is ori-vitriol-subst or T is ori-muriatic-subst or T is ori-muriatic-2-subst or T is fluor-vitriol-subst or T is grey-acid-subst or T is swirl-mixture-subst:
        now the extra-substance of O is extra-acid-subst;
    else if T is lubanja-subst or T is alcohol-subst:
        now the extra-substance of O is extra-spirit-subst;
    else if T is unknown-subst or T is layered-subst or T is clear-subst or T is nickel-oil-subst:
        now the extra-substance of O is extra-mixture-subst;
    else if T is dry-subst or T is alum-subst:
        now the extra-substance of O is extra-powder-subst;
    else if T is clock-paste-subst or T is brown-paste-subst or T is chalky-paste-subst:
        now the extra-substance of O is extra-paste-subst;
    else if T is clock-solution-subst or T is breath-bubbly-subst or T is aither-sparkly-subst or T is yellowish-subst or T is indigo-mix-subst or T is violet-mix-subst:
        now the extra-substance of O is extra-solution-subst;
    else if T is calcinate-crystal-subst or T is sand-subst or T is damp-sand-subst or T is sand-earth-subst or T is sand-water-subst:
        now the extra-substance of O is extra-crystal-subst;
    else:
        now the extra-substance of O is extra-nil-subst.
 
To say (T - substance-type):
    if T is:
        -- no-subst: say "(BUG) no-subst";
        -- unknown-subst: say "unknown compounds";
        -- saline-subst: say "saline";
        -- alcohol-subst: say "rubbing alcohol";
        -- mineral-oil-subst: say "mineral oil";
        -- vinegar-subst: say "vinegar";
        -- lubanja-subst: say "lubanja";
        -- muriatic-subst: say "muriatic acid";
        -- vitriolic-subst: say "vitriolic acid";
        -- alum-subst: say "alum";
        -- sand-subst: say "sand";
        -- weak-acid-subst: say "dilute acid";
        -- moderate-acid-subst: say "moderate acid";
        -- strong-acid-subst: say "strong acid";
        -- layered-subst: say "layered mixture";
        -- clear-subst: say "clear mixture";
        -- dry-subst: say "dry powder";
        -- sublime-subst: say "sublime spirit";
        -- percalcinate-subst: say "copper percalcinate";
        -- bamuriatic-subst: say "bamuriatic acid";
        -- gaian-subst: say "Gaian precipitate";
        -- counter-gaian-subst: say "counter-Gaian precipitate";
        -- anti-tellurian-subst: say "anti-Tellurian distillate";
        -- brun-oil-subst: say "yang oil";
        -- perfect-mud-subst: say "perfect mud";
        -- highlime-subst: say "highlime";
        -- nickel-subst: say "nickel";
        -- viridigris-subst: say "viridigris";
        -- potion-subst: say "potion";
        -- clock-paste-subst: say "pale glittering paste";
        -- clock-solution-subst: say "silvery solution";
        -- breath-bubbly-subst: say "effervescent solution";
        -- aither-sparkly-subst: say "sparkling blue solution";
        -- brown-paste-subst: say "greasy brown paste";
        -- yellowish-subst: say "yellowish solution";
        -- sucker-crimson-subst: say "crimson liquid";
        -- ori-vitriol-subst: say "sky-blue acid";
        -- ori-muriatic-subst: say "grass-green acid";
        -- ori-muriatic-2-subst: say "viridian acid";
        -- fluor-vitriol-subst: say "amber acid";
        -- grey-acid-subst: say "grey acid";
        -- black-reagent-subst: say "gooey black reagent";
        -- calcinate-crystal-subst: say "dark-green crystals";
        -- sand-earth-subst: say "glassy sand";
        -- sand-water-subst: say "watery sand";
        -- damp-sand-subst: say "damp sand";
        -- indigo-mix-subst: say "indigo solution";
        -- violet-mix-subst: say "violet solution";
        -- swirl-mixture-subst: say "swirling mixture";
        -- nickel-oil-subst: say "golden mixture";
        -- chalky-paste-subst: say "chalky paste";
        -- otherwise: say "(BUG) substance".
 
To say s re (T - substance-type):
    if T is:
        -- unknown-subst: stop;
        -- calcinate-crystal-subst: stop;
        -- otherwise: say "s".
 
To invoke duplicate-ritual for (T - thing):
    mark the dup-ritual-fact as known;
    if dup-ritual-fact is not ever-used:
        say "You recall something about the Blinovna Limitation? ";
    else:
        say "It's the Blinovna Limitation again. ";
    say "[The T] already exists; [recall T briefly]."
 
Section - The Beaker
 
The beaker is a takeable-thing. It is ever-seen.
The beaker has a substance-type called the substance.
The beaker has a extra-substance-type called the extra-substance.
The printed name of the beaker is "beaker[if substance of beaker is not no-subst] of [substance][end if]".
The description is "A wide beaker, containing a quantity of [substance]."
Understand "quantity", "quantity of", "measure", "measure of", "beaker of", "wide" as the beaker.
Understand the substance property as describing the beaker.
Understand the extra-substance property as describing the beaker.
 
To discard the beaker:
    now the substance of the beaker is no-subst;
    now the extra-substance of the beaker is extra-nil-subst;
    now the beaker is off-stage. [leave its fate alone]
 
Check taking the beaker:
    if rstate is active:
        instead say "That would surely disrupt the ritual.";
    let T be the holder of the beaker;
    let subst be the substance of beaker;
    discard the beaker;
    instead say "You remove the beaker from [the T], dispose of the [if subst is in-stock]surplus [subst][else][subst] (whatever it is)[end if], and set the beaker aside."
 
Check emptying the beaker:
    instead try taking the beaker.
 
Check touching the beaker:
    instead say "Sticking your fingers into reaction vessels is bad practice."
Check smelling the beaker:
    instead say "Don't go shoving your face into the ritual bound."
 
Check searching the beaker:
    instead try examining the beaker.
 
Check inserting a chem-flask into a ritual-bound (called B) when rstate is inactive:
    if the beaker is on-stage:
        now the beaker is in B;
        let M be the substance of the noun;
        derive the mixture of M into the beaker;
        stop the action;
    now the beaker is in B;
    now the substance of the beaker is the substance of the noun;
    fix up the substance of the beaker;
    instead say "You locate a beaker in the clutter, pour a measure of [the substance of the beaker] into it, and place it within the [short-adjective of B]."
 
Check inserting a chem-vial into a ritual-bound (called B) when rstate is inactive and the beaker is on-stage:
    now the beaker is in B;
    retire the noun by alchemy;
    let M be the substance of the noun;
    derive the mixture of M into the beaker;
    stop the action.
 
Check inserting something alight into the beaker when rstate is active:
    instead try igniting the beaker with the noun.
Check putting something alight on the beaker when rstate is active:
    instead try igniting the beaker with the noun.
 
Check inserting something takeable into the beaker when rstate is active:
    instead try rit-adding the noun.
 
Check putting something takeable on the beaker:
    instead try inserting the noun into the beaker.
 
Check inserting a chem-source into the beaker:
    instead try inserting the noun into the holder of the beaker.
Check inserting something alight into the beaker:
    instead try igniting the beaker with the noun.
Check inserting something into the beaker:
    instead say "You don't want to go dropping things into random chymic substances, other than during a ritual."
Check putting a chem-source on the beaker:
    instead try inserting the noun into the holder of the beaker.
Check putting something alight on the beaker:
    instead try igniting the beaker with the noun.
Check putting something on the beaker:
    instead say "You don't want to go dropping things into random chymic substances, other than during a ritual."
 
Check igniting the beaker with something:
    derive the kindling of the beaker from the second noun;
    stop the action.
 
Section - Miscology
 
The verb to comprise (it comprises, they comprise, it is comprising) implies the substance property.
 
Definition: a thing is a mixing-container if it is the beaker or it is the reservoir.
 
To derive the mixture of (M - substance-type) into (T - thing):
    if T is not a mixing-container:
        say "(BUG) Tried to derive mixture of [M] into random thing [T].";
        stop;
    if T is the reservoir:
        if the heating-time of the reservoir is not zero:
            now the heating-time of the reservoir is one;
    now the mixture-result is no-subst;
    try subst-mixing T from M;
    if the mixture-result is no-subst:
        say "(BUG) Mixture-processing produced no result.";
        stop;
    now T comprises the mixture-result;
    fix up the substance of T.
 
The mixture-result is a substance-type that varies.
 
Subst-mixing it from is an action applying to one visible thing and one substance-type.
 
Carry out subst-mixing:
    follow the mixture-processing rules.
 
To say base-add-subst:
    let M be the substance-type understood;
    if M is vial-based:
        say "You empty the vial of [M] into";
    else:
        say "You add a quantity of [M] to";
    say " [if the noun is the beaker]the beaker[else]the retort[end if]";
 
Mixture-processing is a rulebook.
The mixing a substance with itself rule is listed first in the mixture-processing rulebook.
 
Mixture-processing rule for subst-mixing when the noun comprises the substance-type understood (this is the mixing a substance with itself rule):
    now the mixture-result is the substance-type understood;
    instead say "You add some more [the substance-type understood] to [if the noun is the beaker]the beaker[else]the retort[end if]."
 
Mixture-processing rule for subst-mixing something from bamuriatic-subst when the noun comprises muriatic-subst:
    now the mixture-result is grey-acid-subst;
    instead say "[base-add-subst]. The acid mixture fumes acridly, and turns slate-grey."
 
Mixture-processing rule for subst-mixing something from muriatic-subst when the noun comprises grey-acid-subst:
    now the mixture-result is grey-acid-subst;
    instead say "[base-add-subst]. The acid mixture is a slightly paler grey."
 
Mixture-processing rule for subst-mixing something from muriatic-subst when the noun comprises calcinate-crystal-subst:
    unless rstate is active and at RSPercalcinateTempered:
        now the mixture-result is ori-muriatic-subst;
        instead say "[base-add-subst]. The crystals redissolve into grass-green acid.";
    now the mixture-result is ori-muriatic-2-subst;
    instead say "[base-add-subst]. The crystals dissolve, forming a brilliant viridian acid."
 
Mixture-processing rule for subst-mixing something from muriatic-subst when the noun comprises ori-muriatic-subst:
    now the mixture-result is ori-muriatic-subst;
    instead say "[base-add-subst], diluting the green solution."
 
Mixture-processing rule for subst-mixing something from muriatic-subst when the noun comprises ori-muriatic-2-subst:
    now the mixture-result is ori-muriatic-2-subst;
    instead say "[base-add-subst], diluting the viridian solution."
 
Mixture-processing rule for subst-mixing something from saline-subst when the noun comprises fluor-vitriol-subst:
    unless rstate is active and at RSChymicStart and rstate is entension-word-used:
        now the mixture-result is moderate-acid-subst;
        instead say "[base-add-subst]. Hot amber acid bubbles and spatters around the inside of the retort, but the diluted result eventually settles down.";
    now the mixture-result is swirl-mixture-subst;
    instead say "[base-add-subst]. The liquids mix, but not entirely -- the retort now contains a swirling mixture of amber filaments."
 
Mixture-processing rule for subst-mixing something from saline-subst when the noun comprises alcohol-subst:
    now the mixture-result is clear-subst;
    instead say "[base-add-subst]."
 
Mixture-processing rule for subst-mixing something from alcohol-subst when the noun comprises saline-subst:
    now the mixture-result is clear-subst;
    instead say "[base-add-subst]."
 
 
Mixture-processing rule for subst-mixing something from nickel-subst when the noun comprises mineral-oil-subst:
    now the mixture-result is nickel-oil-subst;
    instead say "[base-add-subst]. The nickel shavings disperse into the oil, forming a golden mixture."
 
Mixture-processing rule for subst-mixing something from brun-oil-subst when the substance of the noun is water-based:
    now the mixture-result is layered-subst;
    instead say "[base-add-subst]. The oil forms a yellow layer on the surface."
 
Mixture-processing rule for subst-mixing something from brun-oil-subst when the noun comprises mineral-oil-subst:
    now the mixture-result is mineral-oil-subst;
    instead say "[base-add-subst]. The orange tinge disperses into the oil."
 
Mixture-processing rule for subst-mixing something from mineral-oil-subst when the substance of the noun is water-based:
    now the mixture-result is layered-subst;
    instead say "[base-add-subst]. The oil forms a clear layer on the surface."
 
Mixture-processing rule for subst-mixing something from mineral-oil-subst when the substance of the noun is moderately acidic:
    now the mixture-result is layered-subst;
    instead say "[base-add-subst]. The oil forms a hazy layer on the surface."
 
Mixture-processing rule for subst-mixing something from mineral-oil-subst when the substance of the noun is strongly acidic:
    now the mixture-result is layered-subst;
    instead say "[base-add-subst]. The oil forms a cloudy layer on the surface."
 
Mixture-processing rule for subst-mixing something from water-based when the noun comprises mineral-oil-subst:
    now the mixture-result is layered-subst;
    instead say "[base-add-subst]. The oil floats in a clear layer on the surface."
 
Mixture-processing rule for subst-mixing something from moderately acidic when the noun comprises mineral-oil-subst:
    now the mixture-result is layered-subst;
    instead say "[base-add-subst]. The oil floats in a hazy layer on the surface."
 
Mixture-processing rule for subst-mixing something from strongly acidic when the noun comprises mineral-oil-subst:
    now the mixture-result is layered-subst;
    instead say "[base-add-subst]. The oil floats in a cloudy layer on the surface."
 
Mixture-processing rule for subst-mixing something from brun-oil-subst when the noun comprises nickel-oil-subst:
    now the mixture-result is nickel-oil-subst;
    instead say "[base-add-subst]. The orange tinge disperses into the oil."
 
Mixture-processing rule for subst-mixing something from water-based when the noun comprises nickel-oil-subst:
    now the mixture-result is layered-subst;
    instead say "[base-add-subst]. The oil floats in a clear layer on the surface."
 
Mixture-processing rule for subst-mixing something from acidic when the noun comprises nickel-oil-subst:
    now the mixture-result is layered-subst;
    instead say "[base-add-subst]. The oil floats in a cloudy layer on the surface."
 
Mixture-processing rule for subst-mixing something that comprises layered-subst from water-based:
    now the mixture-result is layered-subst;
    instead say "[base-add-subst]. The aqueous layer is now a little deeper."
 
Mixture-processing rule for subst-mixing something that comprises layered-subst from acidic:
    now the mixture-result is layered-subst;
    instead say "[base-add-subst]. The aqueous layer is now a little deeper."
 
Mixture-processing rule for subst-mixing something that comprises layered-subst from mineral-oil-subst:
    now the mixture-result is layered-subst;
    instead say "[base-add-subst]. The oil layer is now a little deeper."
 
 
Mixture-processing rule for subst-mixing something from highlime-subst when the substance of the noun is strongly acidic:
    now the mixture-result is weak-acid-subst;
    instead say "[base-add-subst]. The acid bubbles and foams furiously."
 
Mixture-processing rule for subst-mixing something from highlime-subst when the substance of the noun is acidic:
    now the mixture-result is clear-subst;
    instead say "[base-add-subst]. The acid bubbles and foams furiously as it is neutralized."
 
Mixture-processing rule for subst-mixing something from highlime-subst when the noun comprises saline-subst:
    now the mixture-result is clear-subst;
    instead say "[base-add-subst]. The saline bubbles furiously."
 
 
Mixture-processing rule for subst-mixing something from water-based when the substance of the noun is strongly acidic:
    now the mixture-result is moderate-acid-subst;
    instead say "[base-add-subst]. The mixture bubbles and steams as you dilute the[one of] acid. (You recall that you're not supposed to do that.)[or] acid.[stopping]"
 
Mixture-processing rule for subst-mixing something from water-based when the substance of the noun is moderately acidic:
    now the mixture-result is weak-acid-subst;
    instead say "[base-add-subst], diluting the acid further."
 
Mixture-processing rule for subst-mixing something from water-based when noun comprises weak-acid-subst:
    now the mixture-result is weak-acid-subst;
    instead say "[base-add-subst], diluting the acid further."
 
Mixture-processing rule for subst-mixing something from a moderately acidic when the substance of the noun is strongly acidic:
    now the mixture-result is moderate-acid-subst;
    instead say "[base-add-subst], diluting the acid somewhat."
 
Mixture-processing rule for subst-mixing something from a moderately acidic when the substance of the noun is moderately acidic:
    now the mixture-result is moderate-acid-subst;
    instead say "[base-add-subst], compounding the acids."
 
Mixture-processing rule for subst-mixing something from a moderately acidic when the noun comprises weak-acid-subst:
    now the mixture-result is moderate-acid-subst;
    instead say "[base-add-subst], compounding the acids."
 
Mixture-processing rule for subst-mixing something from a moderately acidic when the substance of the noun is water-based:
    now the mixture-result is weak-acid-subst;
    instead say "[base-add-subst]; the mixture becomes more acidic."
 
Mixture-processing rule for subst-mixing something from a strongly acidic when the substance of the noun is strongly acidic:
    now the mixture-result is strong-acid-subst;
    instead say "[base-add-subst], no doubt creating some monstrous corrosive brew."
 
Mixture-processing rule for subst-mixing something from a strongly acidic when the substance of the noun is moderately acidic:
    now the mixture-result is strong-acid-subst;
    instead say "[base-add-subst], compounding the acid into something stronger."
 
Mixture-processing rule for subst-mixing something from a strongly acidic when the noun comprises weak-acid-subst:
    now the mixture-result is moderate-acid-subst;
    instead say "[base-add-subst], compounding the acid into something stronger."
 
Mixture-processing rule for subst-mixing something from a strongly acidic when the substance of the noun is water-based:
    now the mixture-result is weak-acid-subst;
    instead say "[base-add-subst]; the mixture becomes somewhat acidic."
 
 
Mixture-processing rule for subst-mixing something from sand-subst when the substance of the noun is water-based:
    now the mixture-result is damp-sand-subst;
    instead say "[base-add-subst]. Now you have damp sand."
 
Mixture-processing rule for subst-mixing something from a water-based when the substance of the noun is sand-subst:
    now the mixture-result is damp-sand-subst;
    instead say "[base-add-subst], moistening the sand."
 
Mixture-processing rule for subst-mixing something from sand-subst when the substance of the noun is damp-sand-subst or the substance of the noun is sand-water-subst:
    now the mixture-result is damp-sand-subst;
    instead say "[base-add-subst], where it absorbs some of the moisture."
 
Mixture-processing rule for subst-mixing something from a powdery when the substance of the noun is damp-sand-subst or the substance of the noun is sand-water-subst:
    now the mixture-result is brown-paste-subst;
    instead say "[base-add-subst], forming a dark paste."
 
Mixture-processing rule for subst-mixing something from a water-based when the substance of the noun is damp-sand-subst or the substance of the noun is sand-water-subst:
    now the mixture-result is damp-sand-subst;
    instead say "[base-add-subst], moistening the sand further."
 
 
Mixture-processing rule for subst-mixing something that comprises unknown-subst from:
    now the mixture-result is unknown-subst;
    instead say "[base-add-subst]. The liquid remains murky."
 
Mixture-processing rule for subst-mixing something that comprises layered-subst from:
    now the mixture-result is unknown-subst;
    instead say "[base-add-subst]. The layers break, amalgamating into a murky emulsion."
 
Mixture-processing rule for subst-mixing something that comprises a powdery substance-type from a powdery:
    now the mixture-result is dry-subst;
    instead say "[base-add-subst], mixing the powders."
 
Mixture-processing rule for subst-mixing something that comprises a pasty substance-type from a powdery:
    now the mixture-result is brown-paste-subst;
    instead say "[base-add-subst]. The paste darkens."
 
Mixture-processing rule for subst-mixing something that comprises a powdery substance-type from:
    now the mixture-result is unknown-subst;
    instead say "[base-add-subst]. The powder disperses into a murky suspension."
 
Mixture-processing rule for subst-mixing something that comprises a pasty substance-type from:
    now the mixture-result is unknown-subst;
    instead say "[base-add-subst]. The paste liquefies into a murky suspension."
 
The last mixture-processing rule:
    now the mixture-result is unknown-subst;
    instead say "[base-add-subst]. The liquid goes murky."
 
 
Chapter - Miscellaneous Physical Processes
 
Section - Magnetization Rules
 
The magnetization rulebook is a thing based rulebook.
 
[We've already checked that the target item has the same location as the player.]
[Currently this is only ever called on the F-sharp-chime.]
 
Magnetization rule when the player carries the item described:
    say "[The item described] jerks sharply towards the other chime. Your finger winds up rather badly pinched between them. Ow.";
    rule fails.
 
Magnetization rule when the item described is in a ritual-bound (called T) and rstate is active:
    say "[The item described] does not respond, however. The active ritual isolates it from outside influence.";
    rule fails.
 
Magnetization rule when the item described is in the retort:
    say "[The item described] bounces around inside the glass retort.";
    rule fails.
 
Magnetization rule when the item described is in a ritual-bound (called T):
    say "[The item described] vibrates in response, and leaps out of [the T] into your hand.";
    rule succeeds.
 
Magnetization rule when the item described is enclosed by the kiln:
    say "[The item described] vibrates in response, and leaps out of the kiln into your hand";
    if not currently fireproof:
        say ". You swear and juggle it for a few moments, until it cools";
    say ".";
    rule succeeds.
 
Last magnetization rule when the item described is on a supporter (called T):
    say "[The item described] vibrates in response, and leaps from [the T] into your hand.";
    rule succeeds.
 
Last magnetization rule when the item described is in a container (called T):
    say "[The item described] rattles around inside [the T].";
    rule fails.
 
Last magnetization rule when the item described is part of something:
    say "[The item described] does not budge.";
    rule fails.
 
The last magnetization rule:
    say "[The item described] vibrates in response, and leaps into your hand.";
    rule succeeds.
 
[The bronze F chime is *not* in the locale. Check other possibilities.]
The locale-magnetization rulebook is a rulebook.
 
Locale-magnetization rule when the location is the location of the miasma-gong:
    say "The bronze gong sways gently towards you.";
    rule succeeds.
 
The last locale-magnetization rule:
    say "Nothing nearby responds, however, and the [attraction-symbol] symbol fades away."
 
Chapter - Material Components
 
Section - Elementals
 
[Note that all elemental things are takeable-things. This lets us optimize a bit.]
 
Definition: a thing is elemental if it is the el-water or it is the el-earth or it is the el-wood or (it is the phlo-gold and it is alight) or (it is the phlo-electrum and it is alight) or it is a charged bubble.
 
Definition: a thing is el-fire if (it is the phlo-gold and it is alight) or (it is the phlo-electrum and it is alight).
Definition: a thing is el-air if it is a charged bubble.
 
To dephlogisticate (T - thing), auto-dropping:
    if T is not el-fire:
        say "(BUG) Tried to dephlogisticate [the T].";
        stop;
    now T is not alight;
    update fire consumption;
    if T is phlo-gold:
        substitute gold-rod for the phlo-gold;
        if auto-dropping:
            auto-drop gold-rod;
    else:
        substitute electrum for the phlo-electrum;
        if auto-dropping:
            auto-drop electrum.
 
A bubble is a kind of takeable-thing.
A bubble can be uncharged or charged. [resettable for all bubbles!]
A bubble is usually uncharged.
A bubble is usually glassy.
A bubble has some text called the short-description.
The printed name of a bubble is usually "[short-description] bubble".
The description of a bubble is usually "This is a glass bubble, slightly [short-description], with a valve attached[if uncharged]. These bubbles are designed to contain elemental air; the inside surface is insulated with Baio's wax. However, this one is empty -- or rather, it contains only the ordinary sort of air[else]. The odd fisheye effect within indicates that it is charged with elemental air[end if]."
Understand "glass", "bubble", "valve", "air", "elemental", "fist", "fist-sized" as a bubble.
Understand "empty", "uncharged" as a bubble when the item described is uncharged.
Understand "full", "charged" as a bubble when the item described is charged.
 
Definition: a bubble is empty rather than non-empty if it is uncharged.
 
For printing inventory details of a bubble:
    if the item described is uncharged:
        say " (empty)";
    else:
        say " (charged with elemental air)"
 
Check inspecting a charged bubble with the planetary-lens:
    instead say "The lens only shows you a glare of elemental air."
 
Check opening a bubble:
    if the noun is uncharged:
        instead say "If the bubble were charged, you could vent the elemental air on whatever you want.";
    instead say "Vent the elemental air on whatever you want."
 
Check emptying a bubble:
    instead try opening the noun.
Check freeing a bubble:
    instead try opening the noun.
 
Check inserting something into a bubble:
    if the noun is the air-tank:
        instead try tapping the second noun on the air-tank;
    if the noun is a bubble:
        instead try tapping the second noun on the noun;
    instead say "The bubble cannot be filled with anything but air."
 
Check putting a bubble on the player:
    if the noun is uncharged:
        instead say "You can't vent elemental air onto yourself, because [the noun] is empty. Also because it's a bad idea.";
    instead say "Elemental air is wonderfully corrosive. Wonderful, that is, when it comes to cleaning metal and glass. Not so wonderful when it touches your skin. You don't do it.[first time][br][em]No snorting the pure elementals, swabbie. No marchmen will melt themselves in my classroom.[/em][br][only]".
 
Check putting a charged bubble on the scalpel when the scalpel is dirty:
    now the noun is uncharged;
    now the scalpel is clean;
    mark the clean-scalpel-goal as done;
    instead say "You hold [the noun] over the scalpel and twist the valve. Elemental air hisses out. The guck on the scalpel recedes in the blast! It's a slow process, but with some care, you manage to clean off the blade before the bubble is empty."
 
Check putting a charged bubble on the scalpel when the scalpel is clean:
    instead say "The scalpel is pretty well cleaned off already. You don't see any reason to waste the elemental air."
 
Check putting a bubble on something not sessile (this is the check putting an air-bubble on rule):
    if the second noun is a bubble:
        instead try tapping the second noun on the noun;
    if the noun is uncharged:
        instead say "You can't vent elemental air onto [the second noun], because [the noun] is empty.";
    if the second noun is in a ritual-bound (called B) and rstate is active:
        instead try inserting the noun into B;
    instead say "You don't want to go spraying elemental air on things outside the bounds of a ritual."
 
Check tapping a bubble on a bubble:
    say "The bubbles are meant to be filled from the air tank. Their valves won't connect to each other";
    if the noun is charged and the second noun is charged:
        say ". Anyhow, they're both full";
    if the noun is uncharged and the second noun is uncharged:
        say ". Anyhow, they're both empty";
    instead say "."
 
[### Maybe permit venting air to destroy small organic takeables -- vegetable matter, wood splints. But not the coral.]
 
Check blowing on a bubble:
    if the noun is uncharged:
        instead say "You can't fill [the noun] by blowing into it.";
    else:
        instead say "You could try venting the charged bubble onto something."
 
The scratched-bubble is a bubble. The short-description is "scratched".
Understand "scratch" as the scratched-bubble.
 
The dusty-bubble is a bubble. The short-description is "dusty".
Understand "dust", "dusty" as the dusty-bubble.
 
 
The el-earth is a takeable-thing. The printed name is "shard of elemental earth".
The description is "A shard of elemental earth -- colorless crystal with a milky translucency -- set in a fine crystal bezel."
Understand "elemental", "element", "pure", "shard", "shard of", "colorless", "bezel", "fine", "crystal", "earth", "earth-shard" as the el-earth.
 
[The el-earth is found as part of something (a heap of glass), in which state it is mostly not-referrable-to.]
 
Instead of doing anything to the el-earth when the el-earth is part of something and the current action is not notional:
    if the location is not the location of el-earth:
        instead say "(BUG) Action applies remotely to el-earth!";
    if taking the el-earth and the el-earth-location is ever-done:
        instead goal-perform el-earth-location;
    instead say "One shard in this mess may be special, but you'll need some way to pick it out."
 
Check inspecting the el-earth with the planetary-lens:
    instead say "The lens only shows you a glare of elemental earth."
 
Check putting something on the el-earth when the el-earth is part of something:
    instead try touching the el-earth.
Check inserting something into the el-earth when the el-earth is part of something:
    instead try touching the el-earth.
Check tapping something on the el-earth when the el-earth is part of something:
    instead try touching the el-earth.
 
Check searching the el-earth:
    instead say "The elemental shard has a lucent depth, into which you cannot see."
Check inspecting something with the el-earth:
    instead say "The elemental shard has a lucent depth, through which you cannot see."
 
Check touching the el-earth:
    instead say "As a pure elemental substance, the shard will draw anything it touches to its own level of crystalline harmony. That's not good for the elementally mixed substance you call your body. Elemental burns are nastier and more painful than frostbite. This shard is set into a crystal bezel, so that you can handle it safely.[first time][br][em]Hands off the pure elementals, swabbie. No marchmen will melt themselves in my classroom.[/em][br][only]".
 
Check tasting the el-earth:
    instead try touching the el-earth.
 
Check putting the el-earth on the player:
    instead try touching the el-earth.
Check tapping the el-earth on the player:
    instead try touching the el-earth.
 
[### tapping el-earth to things? And vice versa?]
 
 
The el-water is a takeable-thing. The printed name is "capsule of elemental water".
The description is "A delicate capsule, no longer than your thumb, full of elementally pure water."
Understand "elemental", "element", "pure", "water", "delicate", "capsule", "capsule of" as the el-water.
 
Check searching the el-water:
    instead say "The capsule contains nothing but elemental water."
Check inspecting something with the el-water:
    instead say "You see only distortion."
 
Check inspecting the el-water with the planetary-lens:
    instead say "The lens only shows you a glare of elemental water."
 
Check eating the el-water:
    instead say "As a pure elemental substance, the water will draw any impurities into itself. Your body is made of impure water. Allowing the elemental water to touch you would -- well, it wouldn't turn you into a splash of brine, but it would poison you pretty effectively.[first time][br][em]Hands off the pure elementals, swabbie. No marchmen will melt themselves in my classroom.[/em][br][only]".
 
Check tasting the el-water:
    instead try eating the el-water.
Check touching the el-water:
    instead try eating the el-water.
 
Check opening the el-water:
    instead say "If you need to pour the elemental water onto something, you can. Breaking the capsule won't be difficult."
Check smashing the el-water:
    instead try opening the el-water.
Check squeezing the el-water:
    instead try opening the el-water.
 
Check emptying the el-water:
    instead try opening the el-water.
 
Check shaking the el-water:
    instead say "You shake the capsule. The elemental water sparkles just like ordinary water... or perhaps a bit more."
Check waving the el-water:
    instead try shaking the el-water.
 
Check putting the el-water on the player:
    instead try touching the el-water.
 
[### maybe responses for putting the el-water on things -- salt, etc]
 
Check putting the el-water on the scalpel when the scalpel is dirty:
    retire the el-water by applying to the scalpel;
    now the scalpel is clean;
    [Don't mark the clean-scalpel-goal. In theory this could confuse the player, but I'm not worrying about it.]
    instead say "You dribble elemental water over the scalpel, and the guck starts to dissolve away. It's a slow process, but with some care, you manage to clean off the blade before the capsule is empty."
 
Check putting the el-water on the scalpel when the scalpel is clean:
    instead say "The scalpel is pretty well cleaned off already. You don't see any reason to waste the elemental water."
 
 
Section - Hardware and Minerals
 
Definition: a thing is pin-or-bolt if it is the brass-pin or it is the steel-bolt.
 
The brass-pin is a metallic inscribable. The printed name is "brass pin".
The lens-view is "Venus and Ganymede".
Understand "brass", "pin", "short", "straight", "bit", "bit of", "metal" as the brass-pin.
 
The descriptor-type of the brass-pin is brass-descriptor.
 
Check examining the brass-pin:
    say "It's a short, straight bit of brass, no longer than your thumb-joint";
    if the brass-pin is inscribed:
        say ". A tiny symbol shines from one side: the alchemical sign for [symbol-type of brass-pin]";
    if the brass-pin symbol-matches fixation-symbol and the fixit-brass-inscription is lit:
        say ".[para]The pin has a vague hazy glow about it";
    instead say "."
 
The steel-bolt is a metallic inscribable. The printed name is "steel bolt".
 
The descriptor-type of the steel-bolt is steel-descriptor.
The lens-view is "Mars".
 
Check examining the steel-bolt:
    if the steel-bolt is undiscovered:
        now the steel-bolt is discovered;
        if the steel-bolt is not handled:
            say "Oh, there's something under the bench... ";
    say "A single steel bolt, somewhat worn in the thread";
    if the steel-bolt is inscribed:
        say ". A small symbol shines on the end of the bolt: the alchemical sign for [symbol-type of steel-bolt]";
    instead say "."
 
Understand "single", "loose", "steel", "bolt", "small", "worn", "thread", "metal" as the steel-bolt.
 
Check touching the steel-bolt when the steel-bolt is uninscribed:
    instead say "It feels like cool metal; a little dirty, a little rough."
 
Check opening the steel-bolt:
    instead say "Since the loose bolt isn't bolted to anything, you can't unbolt it."
 
Check turning the steel-bolt:
    instead try opening the steel-bolt.
 
 
Definition: a thing is chain-or-chain if it is the silver-chain or it is the purity-lodestone.
 
The silver-chain is a metallic takeable-thing. The printed name is "length of silver chain".
The silver-chain is mass-named.
Understand "length", "length of", "fine", "silver", "chain", "original" as the silver-chain.
The description is "A short length of fine silver chain."
The lens-view is "the Moon".
 
Rule for printing the name of the silver-chain while asking which do you mean:
    if the action-to-be is notional and the purity-lodestone is ever-seen:
        say "original ";
    say printed name of the silver-chain.
 
Check waving the silver-chain:
    instead say "[one of]You dangle the chain from your hand and swing it back and forth a bit. It doesn't accomplish much, but it certainly has a nice heft for swinging[or]You swing the chain for a few moments[stopping]."
Check shaking the silver-chain:
    instead try waving the silver-chain.
 
[### "tie silver-chain..."]
 
 
The silk-cord is a takeable-thing. The printed name is "[if not listing tersely]length of [end if]silk cord".
The silk-cord is mass-named.
Understand "length", "length of", "raw", "silk", "lax", "cord", "original" as the silk-cord.
The description is "You have found a short length of cord, woven of raw silk."
 
Rule for printing the name of the silk-cord while asking which do you mean:
    if the action-to-be is notional and the purity-lodestone is ever-seen:
        say "original ";
    say printed name of the silk-cord.
 
Check waving the silk-cord:
    instead say "[one of]You dangle the cord from your hand and swing it back and forth a bit. It swings laxly[or]You swing the lax cord for a few moments[stopping]."
Check shaking the silk-cord:
    instead try waving the silk-cord.
 
[### "tie cord..."]
 
Definition: a thing is loop-or-loop if it is the glass-loop or it is the oculus.
 
The glass-loop is a glassy takeable-thing. The printed name is "glass loop".
Understand "glass", "loop", "ring", "circle", "thread", "original" as the glass-loop.
The description is "A circular thread of clear glass; it's about an inch across. This sort of glass loop can be used as the basis for various optickal viewing devices."
 
Rule for printing the name of the glass-loop while asking which do you mean:
    if the action-to-be is notional and the oculus is ever-seen:
        say "original ";
    say printed name of the glass-loop.
 
Check searching the glass-loop:
    instead say "You peer through the glass loop. Nothing looks any different."
 
Check inspecting something with the glass-loop:
    instead say "You peer through the glass loop at [the noun]. [if the noun is the player]You don't[else if the noun is singular-named]It doesn't[else]They don't[end if] look any different."
 
Check squeezing the glass-loop:
    instead try smashing the glass-loop.
 
Definition: a thing is lens-or-lens if it is the convex-lens or it is the concave-lens.
 
The concave-lens is a glassy takeable-thing. The printed name is "concave glass lens".
Understand "glass", "lens", "concave" as the concave-lens.
Understand "lenses" as the plural of the concave-lens.
The description is "A concave lens, about an inch and a half wide, with a heavy rim and an in-curved face."
 
Check searching the concave-lens:
    instead say "You peer through the concave lens. The world looks smaller."
 
Check wearing the concave-lens:
    instead say "You're not near-sighted. Anyway, there's no way to attach it to your face."
 
Check inspecting something with the concave-lens:
    instead say "You peer through the concave lens. [if the noun is the player]Your body looks[else if the noun is singular-named][The noun] looks[else][The noun] look[end if] smaller."
 
The convex-lens is a glassy takeable-thing. The printed name is "convex glass lens".
Understand "glass", "lens", "convex" as the convex-lens.
Understand "lenses" as the plural of the convex-lens.
The description is "A convex lens, about an inch and a half wide, with a sharp rim and curved faces."
 
Check searching the convex-lens:
    instead say "You peer through the convex lens. The world looks larger."
 
Check wearing the convex-lens:
    instead say "You're not far-sighted. Anyway, there's no way to attach it to your face."
 
Check inspecting something with the convex-lens:
    instead say "You peer through the convex lens. [if the noun is the player]Your body looks[else if the noun is singular-named][The noun] looks[else][The noun] look[end if] larger."
 
Check tapping the convex-lens on the concave-lens:
    if rstate is active and the second noun is in the bound of rstate:
        instead try inserting the noun into the bound of rstate;
    if rstate is active and the noun is in the bound of rstate:
        instead try inserting the second noun into the bound of rstate;
    instead say "The lenses fit together, but the combination is not optickally interesting, so you take them apart again."
Check tapping the concave-lens on the convex-lens:
    if rstate is active and the second noun is in the bound of rstate:
        instead try inserting the noun into the bound of rstate;
    if rstate is active and the noun is in the bound of rstate:
        instead try inserting the second noun into the bound of rstate;
    instead say "The lenses fit together, but the combination is not optickally interesting, so you take them apart again."
 
Check inserting the convex-lens into the concave-lens:
    instead try tapping the noun on the second noun.
Check inserting the concave-lens into the convex-lens:
    instead try tapping the noun on the second noun.
Check putting the convex-lens on the concave-lens:
    instead try tapping the noun on the second noun.
Check putting the concave-lens on the convex-lens:
    instead try tapping the noun on the second noun.
 
 
The rock-salt is a mineralish takeable-thing. The printed name is "lump of rock salt".
The description is "It's a pale, grainy lump of rock salt, the size of your fist[if moist]. The salt is rather moist, but not too much of it has dissolved[end if]."
The rock-salt can be moist.
Understand "rock", "salt", "rocksalt", "lump", "lump of", "pale", "grainy" as the rock-salt.
Understand "damp", "moist" as the rock-salt when the rock-salt is moist.
The lens-view is "the Earth".
 
Check eating the rock-salt (this is the rock-salt-eating rule):
    instead say "You nibble a bit. Yes, it's salt."
The rock-salt-eating rule is listed after the can't eat what's not held rule in the check eating rulebook.
 
Check tasting the rock-salt:
    instead try eating the rock-salt.
 
 
A pebble is a kind of inscribable.
A pebble has some text called the short-description.
The descriptor-type of a pebble is earthy-descriptor.
Understand "small", "pebble", "stone", "chip", "chip of" as a pebble.
Understand "pebbles", "stones", "chips" as the plural of pebble.
The printed name of a pebble is "chip of [short-description]".
A pebble is usually mineralish.
The lens-view of a pebble is usually "the Earth".
 
Rule for initially listing contents:
    initially group pebbles together.
Before grouping together pebbles:
    say "[listing group size in words cap cap-class-group] stone chips (".
After grouping together pebbles:
    say ")".
Rule for printing the name of a pebble when grouping together:
    say "[short-description]";
 
Check examining a pebble:
    say description of noun;
    if the noun is inscribed:
        say " A tiny symbol shines on it: the alchemical sign for [symbol-type of noun].";
    else:
        say line break;
    if the noun symbol-matches leverage-symbol and the fulcrum-inscription is lit:
        say "[br]The [short-description of noun] pebble is glowing with a silvery light.";
    stop the action.
 
The granite-pebble is a pebble. The short-description is "granite".
The description is "A small, rough-edged bit of grey granite."
Understand "granite", "grey", "gray" as the granite-pebble.
 
The sandstone-pebble is a pebble. The short-description is "sandstone".
The description is "A small chip of rough, reddish sandstone."
Understand "red", "reddish" as the sandstone-pebble.
 
The flint-pebble is a pebble. The short-description is "flint".
The description is "A small sharp chunk of banded flint."
Understand "flint", "banded", "sharp", "chunk" as the flint-pebble.
 
The basalt-pebble is a pebble. The short-description is "basalt".
The description is "A small, smooth bit of black basalt."
Understand "black", "smooth", "basalt" as the basalt-pebble.
 
The marble-pebble is a pebble. The short-description is "marble".
The description is "A small chip of white marble."
Understand "white", "marble" as the marble-pebble.
 
The obsidian-pebble is a pebble. The short-description is "obsidian".
The description is "A small sharp chunk of black, glassy obsidian."
Understand "black", "glassy", "obsidian", "sharp", "chunk" as the obsidian-pebble.
 
The nonexistent-stone is a pebble. The short-description is "nonexistent-stone".
 
The jade is a mineralish inscribable. The printed name is "jade bead".
The description is "It's a thumbnail-sized bead of pale green jade. Not the most valuable stone you've worked with, but it's pretty."
The descriptor-type of the jade is spiritual-descriptor.
Understand "bead", "pale", "green" as the jade.
 
The lens-view of the jade is "Eden".
 
Check examining the jade:
    say description of noun;
    if the noun is inscribed:
        say " A tiny symbol shines on the bead: the alchemical sign for [symbol-type of noun].";
    else:
        say line break;
    stop the action.
 
Check rubbing the jade:
    instead say "You rub the jade with your thumb. It's rather nice."
 
The fluorite is a mineralish takeable-thing. The printed name is "fluorspar crystal".
The description is "It's a small, roughly cubical chunk of orange-yellow fluorspar crystal."
Understand "fluorspar", "flourite", "flourspar", "crystal", "orange", "yellow", "orange-yellow", "cube", "cubical", "chunk" as the fluorite.
 
A quartz-prism is a kind of inscribable.
The descriptor-type of a quartz-prism is spiritual-descriptor.
A quartz-prism is usually mineralish.
Understand "quartz", "prism", "crystal" as a quartz-prism.
Understand "prisms" as the plural of quartz-prism.
The lens-view of a quartz-prism is usually "the Earth".
 
Check examining a quartz-prism:
    say description of noun;
    if the noun is inscribed:
        say " A tiny symbol shines from one facet: the alchemical sign for [symbol-type of noun].";
    else:
        say line break;
    stop the action.
 
The long-quartz is a quartz-prism. The printed name is "long quartz prism".
The description is "It's a hexagonal prism of clear quartz crystal, rather long."
The broad-quartz is a quartz-prism. The printed name is "broad quartz prism".
The description is "It's a hexagonal prism of clear quartz crystal, rather broad."
Understand "long" as the long-quartz.
Understand "broad" as the broad-quartz.
 
[Really always an inscribable]
Definition: a thing is quartz-or-jade if it is a quartz-prism or it is the jade.
 
[Really always a takeable-thing]
Definition: a thing is soluble-stone if it is a quartz-prism or it is a pebble or it is the baros-key.
 
[Really always a takeable-thing]
Definition: a thing is diamond-or-diamond if it is the rough-diamond or it is the perfect-diamond.
 
The rough-diamond is a mineralish takeable-thing. The printed name is "rough diamond".
Understand "rough", "diamond", "imperfect", "cloudy", "flawed", "grey", "gray", "crystal" as the rough-diamond.
The description is "The diamond is a rough bit of cloudy grey crystal.[first time] (You don't get gem-quality stones in alchemy storerooms, of course.)[only]".
The lens-view is "the Earth".
 
Check searching the rough-diamond:
    instead say "The rough diamond is not transparent."
Check inspecting something with the rough-diamond:
    instead try searching the rough-diamond.
 
The perfect-diamond is a mineralish takeable-thing. The printed name is "perfect diamond".
Understand "perfect", "diamond", "clear", "transparent", "irregular", "glittering", "bright", "flawless", "crystal" as the perfect-diamond.
The description is "The diamond is still irregular in outline, but absolutely flawless -- a glittering bit of transparent crystal."
The lens-view is "Eden".
 
Check searching the perfect-diamond:
    instead say "The diamond is filled with scintillation and light."
Check inspecting something with the perfect-diamond:
    instead say "You hold the diamond up to your eye, but you can see nothing through the refraction but light."
 
 
The paten is a mineralish takeable-supporter. The printed name is "porcelain paten".
Understand "porcelain", "disc", "disk", "feathers" as the paten.
 
Check examining the paten:
    say "This is a palm-sized porcelain disc, painted with feathers and the Chinese sign for breath";
    let N be the number of things on the paten;
    if N is one:
        let T be the first thing held by the paten;
        say ". [A T roomily] rests on the paten";
    if N is greater than one:
        say ". Resting on the paten are [a list of things *in the paten roomily]";
    instead say "."
 
Report taking the paten:
    instead say "You pick up the porcelain paten."
 
Check inserting something into the paten:
    instead try putting the noun on the paten.
 
Check putting something on the paten when the player carries the paten:
    instead say "That's an awkward balancing act, since the paten doesn't have a lip. Put it down first."
 
Rule for implicitly taking the paten when something is on the paten:
    instead say "It's awkward to pick up the paten while anything is on it."
 
 
The labyrinth-tile is a mineralish takeable-supporter. The printed name is "labyrinth tile".
Understand "labyrinth", "maze", "clay", "tile", "figure" as the labyrinth-tile.
 
Check examining the labyrinth-tile:
    say "This is a small clay tile, embossed with a labyrinth figure";
    let N be the number of things on the labyrinth-tile;
    if N is one:
        let T be the first thing held by the labyrinth-tile;
        say ". [A T roomily] rests on the tile";
    if N is greater than one:
        say ". Resting on the tile are [a list of things *in the labyrinth-tile roomily]";
    instead say "."
 
Report taking the labyrinth-tile:
    instead say "You pick up the labyrinth tile."
 
Check inserting something into the labyrinth-tile:
    instead try putting the noun on the labyrinth-tile.
 
Check putting something on the labyrinth-tile when the player carries the labyrinth-tile:
    instead say "That's an awkward balancing act, since the tile doesn't have a lip. Put it down first."
 
Rule for implicitly taking the labyrinth-tile when something is on the labyrinth-tile:
    instead say "It's awkward to pick up the tile while anything is on it."
 
Check inspecting the labyrinth-tile with the oculus:
    instead say "Through the oculus, the tile's maze is redoubled into a infinite regression of forking paths."
 
 
The baros-key is a mineralish takeable-thing. The printed name is "flint key".
Understand "key", "flint", "banded", "bands" as the baros-key.
Understand "barosy key", "baros key" as the baros-key.
The description is "This long-barrelled key unlocks the Barosy; it was symbolically chipped from a single lump of flint. The wards are crudely shaped, but banded with delicate colors."
The lens-view is "the Earth".
 
 
Section - Musical Instruments
 
The miasma-gong is a recallable metallic scenery thing. The printed name is "miasma gong".
The description is "The gong is a bronze disk, no larger than a dinner plate, but thick as your thumb. It is suspended in a frame on the wall. You're told that its sound helps drive away the evil miasmas that cause infection; at least, any time you've been in here, an attendant has struck the gong regularly."
The miasma-gong has a number called the ring-time.
The miasma-gong can be uncharged or charged. [the cloud-suppressing property; resettable]
Understand "miasma", "gong", "heavy", "bronze", "disk", "disc", "frame" as the miasma-gong.
 
The lens-view is "Venus and Jupiter".
 
Check attacking the miasma-gong:
    instead try touching the noun.
 
Check touching the miasma-gong:
    if the ring-time of the miasma-gong is zero:
        say "You strike the gong with your knuckles. A deep reverberation fills the room[first time]. You're not sure if it's making you healthier, but it's certainly pleasant[only]. However, the sense of malice around the door doesn't shift at all";
    else:
        say "You strike the gong again, renewing the reverberation";
    now the ring-time of the miasma-gong is 5;
    instead say ".";
 
Check taking the miasma-gong:
    instead say "The gong is fastened to the wall."
 
Check inspecting the miasma-gong with the oculus:
    instead say "Through the oculus, the gong shows traces of health and vitality."
 
Every turn when the ring-time of the miasma-gong is not zero:
    decrement the ring-time of the miasma-gong;
    let spoken be false;
    if the location is the location of the miasma-gong:
        let spoken be true;
        if the ring-time of the miasma-gong is:
            -- 4:
                say "The gong continues to resonate.";
            -- 3:
                say "The gong continues to resonate.";
            -- 2:
                say "The sound of the gong is fading.";
            -- 1:
                say "The sound of the gong is faint now.";
            -- 0:
                say "The reverberation dies away entirely.";
    if the ring-time of the miasma-gong is zero:
        if the miasma-gong is charged:
            now the miasma-gong is uncharged;
            if near-aura-cloud:
                if spoken is true:
                    say line break;
                say "The aching tang of the aura cloud comes rushing back together."
 
 
A chime is a kind of inscribable.
A chime has some text called the short-description.
The printed name of a chime is "[short-description] chime".
A chime has a number called the ring-time. [Only used for metallic chimes: glass/alum pass/shatter.]
Understand "chime" as a chime.
Understand "chimes" as the plural of chime.
 
Rule for initially listing contents:
    initially group chimes together.
Before grouping together chimes:
    say "[listing group size in words cap cap-class-group] chimes (".
After grouping together chimes:
    say ")".
Rule for printing the name of a chime when grouping together:
    say "[short-description]";
 
Check examining a chime:
    say description of noun;
    if the noun is inscribed:
        say " A tiny symbol shines on the chime: the alchemical sign for [symbol-type of noun].";
    else:
        say line break;
    let flag be false;
    if the noun is part of something (called P):
        if P is glassy:
            say "[line break]The chime is suspended within [the P]";
        else:
            say "[line break]The chime is lying at the far end of the slab";
        now flag is true;
    if the ring-time of the noun is not zero:
        if flag is false:
            say line break;
            now flag is true;
        else:
            say ". ";
        if the atmosphere of the location is not vacuum-atm:
            say "The chime is vibrating steadily";
        else:
            say "You can see the chime's vibration, although of course you hear nothing";
        now flag is true;
    if flag is true:
        say ".";
    stop the action.
 
Check listening to a chime when the ring-time of the noun is not zero:
    if the atmosphere of the location is vacuum-atm:
        instead say "You hear nothing, although you can see [the noun] vibrating.";
    instead say "[The noun] emits a sustained hum, which fades only slightly as the moments pass.";
 
Check listening to a chime:
    instead say "[The noun] is currently silent."
 
Check attacking a chime:
    instead try touching the noun.
 
Check touching a chime when the symbol-type of the noun is attraction-symbol:
    [Higher priority than the "general" rules below, which is a minor nuisance but better than the alternative.]
    if the noun is not carried:
        instead say "[The noun] can't ring freely unless you're holding it.";
    if the atmosphere of the location is water-atm:
        instead say "You hear only a water-muffled [em]tap[/em].";
    uninscribe the noun;
    say "[The noun]";
    if the atmosphere of the location is vacuum-atm:
        say " thrums eagerly against your fingers";
    else:
        say " emits a sharp, eager thrum";
    if the noun is not B-chime:
        instead say ". Nothing nearby responds, however, and the [attraction-symbol] symbol fades away.";
    let loc be the location of the F-sharp-chime;
    if loc is not the location:
        say ". [run paragraph on]";
        follow the locale-magnetization rules;
        stop the action;
    say ".[para]";
    follow the magnetization rules for the F-sharp-chime;
    if rule succeeded:
        now the player carries the F-sharp-chime;
    stop the action.
 
Check touching a chime when the symbol-type of the noun is some-chime-symbol:
    [Higher priority than the "general" rules below, which is a minor nuisance but better than the alternative.]
    [Already-ringing should already be covered.]
    if the noun is H-chime or the noun is G-flat-chime:
        instead say "(BUG) [The noun] should not have permeability/decoherence, because it is glass.";
    if the noun is not carried:
        instead say "[The noun] can't ring freely unless you're holding it.";
    if the atmosphere of the location is water-atm:
        instead say "You hear only a water-muffled [em]tap[/em].";
    now the ring-time of the noun is 3;
    if the atmosphere of the location is vacuum-atm:
        instead say "You tap [the noun]. Its soundless vibration runs through your fingers.";
    else:
        instead say "You tap [the noun]. Its bright resonances fill the room -- and then shift to a steady, sustained hum."
 
Check touching a chime when the ring-time of the noun is not zero:
    instead say "[The noun] is already ringing."
 
Check touching a chime when the location is airless:
    say "You hit the chime";
    if the atmosphere of the location is water-atm:
        instead say ", but hear only a water-muffled [em]tap[/em].";
    instead say ", but hear nothing, of course."
 
Check touching a chime when the noun is not carried and the location is not airless:
    if the ring-time of the noun is not zero:
        continue the action;
    if rstate is active and the noun is in the bound of rstate:
        continue the action;
    instead say "The chime [if the descriptor-type of the noun is glass-descriptor]goes [em]tink[/em][else]clanks[end if]. It can't ring freely unless you're holding it."
 
Check touching a chime when rstate is active:
    instead try rit-ringing the noun.
 
Check touching a chime:
    instead say "The chime rings [if the descriptor-type of the noun is glass-descriptor]sweetly[else]brightly[end if], filling the room with its note[first time]. And just in tune, at that[only]."
 
Check tapping the B-chime on the miasma-gong when the B-chime symbol-matches attraction-symbol:
    uninscribe the noun;
    instead say "You tap [the noun] against the gong. There is a bright [em]clink[/em] of mutual attraction and the chime's symbol fades."
 
Check tapping a chime on the miasma-gong:
    instead say "You tap [the noun] against the gong. The chime's hum wavers against the gong's reverberation; both sounds soon die away."
 
Check tapping the F-sharp-chime on a glassy thing when the ring-time of the F-sharp-chime is not zero:
    now the ring-time of the F-sharp-chime is zero;
    instead say "You press the chime against [the second noun]. You feel the bronze almost slip in, but it skates off the irregular glass. The vibration mutes and dies."
 
Check tapping the B-chime on the dispersal-brush when the ring-time of the B-chime is not zero:
    let N be the symbol-type of the B-chime;
    now the ring-time of the B-chime is zero;
    uninscribe the B-chime;
    instead say "You brush the feather across the chime. Its sound instantly mutes, and the [N] symbol blurs and fades away."
 
Check tapping the F-sharp-chime on the dispersal-brush when the ring-time of the F-sharp-chime is not zero:
    let N be the symbol-type of the B-chime;
    now the ring-time of the F-sharp-chime is zero;
    uninscribe the F-sharp-chime;
    say "You brush the feather across the chime. Its sound instantly mutes, and the [N] symbol blurs and fades away";
    if the F-sharp-chime is part of something:
        now the player carries the F-sharp-chime;
        say ".[para]The chime pops out of the glass into your hand";
    instead say "."
 
Check taking the F-sharp-chime when the noun is part of something (this is the generic F-sharp-taking-part rule):
    [Can only occur with the glass-pass chime]
    now the player carries the F-sharp-chime;
    uninscribe the F-sharp-chime;
    now the ring-time of the F-sharp-chime is zero;
    instead say "The chime goes dead as you pull it from the glass, and its symbol dissipates."
 
Check freeing the F-sharp-chime when the noun is part of something:
    [Can only occur with the glass-pass chime]
    instead try taking the F-sharp-chime.
 
Every turn when the ring-time of the B-chime is not zero:
    [Aluminum-pass/break, never used]
    decrement the ring-time of the B-chime;
    if the location of the B-chime is the location of the player:
        let sense be "sound";
        if the atmosphere of the location is vacuum-atm:
            now sense is "vibration";
        if the ring-time of the B-chime is:
            -- 1: say "The [sense] of [the B-chime] begins to fade.";
            -- 0: say "The [sense] of [the B-chime] ceases.".
 
Every turn when the ring-time of the F-sharp-chime is not zero:
    [Glass-pass/break; lasts forever when part of a glass "window" (door)]
    decrement the ring-time of the F-sharp-chime;
    let sense be "sound";
    if the atmosphere of the location is vacuum-atm:
        now sense is "vibration";
    if the F-sharp-chime is part of something:
        if the ring-time of the F-sharp-chime is zero:
            now the ring-time of the F-sharp-chime is 3;
            if the location of the F-sharp-chime is the location of the player:
                say "The [sense] of [the F-sharp-chime] continues.";
    else:
        if the location of the F-sharp-chime is the location of the player:
            if the ring-time of the F-sharp-chime is:
                -- 1: say "The [sense] of [the F-sharp-chime] begins to fade.";
                -- 0: say "The [sense] of [the F-sharp-chime] ceases.".
 
The F-sharp-chime is a metallic chime. The short-description is "bronze F-sharp".
The descriptor-type of F-sharp-chime is bronze-descriptor.
The description is "It's a regulation Naval ritual chime -- bronze, F sharp."
The lens-view is "Venus and Jupiter".
Understand "f", "sharp", "f-sharp", "bronze", "metal" as the F-sharp-chime.
 
The B-chime is a metallic chime. The short-description is "bronze B".
The descriptor-type of B-chime is bronze-descriptor.
The description is "It's a regulation Naval ritual chime -- bronze, B natural."
The lens-view is "Venus and Jupiter".
Understand "b", "natural", "b-natural", "bronze", "metal" as the B-chime.
 
The G-flat-chime is a glassy chime. The short-description is "glass G-flat".
The descriptor-type of G-flat-chime is glass-descriptor.
The description is "It's a regulation Naval ritual chime -- glass, G flat."
Understand "g", "flat", "g-flat", "glass" as the G-flat-chime.
 
The H-chime is a glassy chime. The short-description is "glass H".
The descriptor-type of H-chime is glass-descriptor.
The description is "It's a regulation Naval ritual chime -- glass, H. (Technically H is the same as B natural, but there's some symbolic distinction that the Navy picked up from Austrian [em]Uhraufziehzauberer[/em] lore, so you're stuck with it.)"
Understand "h", "glass" as the H-chime.
 
[Could include tonic associations with the descriptions, but only after you've found the pitch-table-fact... messy, forget it.]
 
 
Section - Metals
 
The mercury is a metallic takeable-thing. The printed name is "droplet of mercury".
Understand "drop of", "droplet", "droplet of", "small", "puddle", "puddle of", "quicksilver" as the mercury.
Understand "broken", "saucer" as the mercury.
The description is "A small puddle of mercury, no larger than your thumbnail[if the mercury is not in the retort], rolling in a broken bit of saucer[end if]."
The lens-view is "Mercury (obviously)".
 
Check examining the mercury when the mercury is not handled:
    instead say "The mercury is a quicksilver droplet, lying untarnished in the dust. It must have spilled from some part of the wreck, though you have no idea where."
 
Report taking the mercury when the mercury is not handled:
    instead say "You glance around for a container, and settle on a broken saucer-shaped bit of ceramic. You gently scoop up the mercury droplet."
 
Check eating the mercury:
    instead say "It is toxic, you know. No worse than half the other substances an alchemist plays with in a week, but still."
Check tasting the mercury:
    instead try eating the mercury.
 
Check touching the mercury:
    instead say "You dabble your finger in the mercury, and watch the silvery surface ripple."
 
Check smashing the mercury:
    instead say "Smashing a liquid? What would that even mean?"
 
Check repairing the mercury:
    instead say "The mercury isn't broken[if the mercury is handled and the mercury is not in the retort]. The saucer is broken, but repairing it isn't high on your list of priorities[end if]."
 
Check shaking the mercury:
    instead say "It would spill."
Check waving the mercury:
    instead say "It would spill."
 
Instead of tapping a metal-rod-or-wire on the mercury:
    instead try tapping the second noun on the noun.
 
Instead of inserting something into the mercury:
    instead try tapping the second noun on the noun.
Instead of putting something on the mercury:
    instead try tapping the second noun on the noun.
Instead of inserting the mercury into a metal-rod-or-wire:
    instead try tapping the noun on the second noun.
Instead of putting the mercury on something not sessile:
    instead try tapping the noun on the second noun.
 
Check emptying the mercury:
    instead say "If you need to pour the mercury onto something, you can."
 
Check putting the mercury on the player:
    instead try tapping the noun on the second noun.
 
Check inserting the mercury into a chime:
    instead try tapping the noun on the second noun.
Check tapping mercury on a chime:
    instead say "Filling the chime with mercury would change its sonic profile, but you have no idea how. Better not."
Check tapping mercury on a clay-mold:
    instead say "The mercury is a liquid. Trying to mold it is absurd."
 
Check tapping mercury on the gold-rod:
    retire the second noun by transformation into the gold-amalgam;
    retire the mercury by transformation into the gold-amalgam;
    now the player carries the gold-amalgam;
    set pronouns from the gold-amalgam;
    instead say "Tilting the saucer, you dip [the second noun] into the mercury. The mercury coats the metal, forming a silvery amalgam. You twirl the gold through the droplet until all the mercury is absorbed."
 
Check tapping mercury on the lead-rod:
    retire the second noun by transformation into the white-amalgam;
    retire the mercury by transformation into the white-amalgam;
    now the player carries the white-amalgam;
    set pronouns from the white-amalgam;
    instead say "Tilting the saucer, you dip [the second noun] into the mercury. The mercury coats the metal, forming a white amalgam. You twirl the lead through the droplet until all the mercury is absorbed, and the rod is entirely white."
 
Check tapping mercury on the orichalcum:
    retire the second noun by transformation into the red-amalgam;
    retire the mercury by transformation into the red-amalgam;
    now the player carries the red-amalgam;
    set pronouns from the red-amalgam;
    instead say "Tilting the saucer, you dip [the second noun] into the mercury. The mercury coats the metal, forming a red amalgam. You twirl the orichalcum through the droplet until all the mercury is absorbed, and the rod is entirely red."
 
Check tapping mercury on phlo-gold:
    instead say "Tilting the saucer, you dip [the second noun] into the mercury. The rod comes out clean. Apparently phlogisticated gold is not as absorptive as the common stuff."
 
Check tapping mercury on a metal-rod:
    instead say "Tilting the saucer, you dip [the second noun] into the mercury. The rod comes out clean; the mercury does not cling."
 
Check tapping mercury on the gold-wire:
    retire the second noun by transformation into the gold-amalgam-wire;
    retire the mercury by transformation into the gold-amalgam-wire;
    now the player carries the gold-amalgam-wire;
    set pronouns from the gold-amalgam-wire;
    instead say "Tilting the saucer, you dip an end of the wire into the mercury. The mercury coats the metal, forming a silvery amalgam. You reel the gold wire through the droplet until it is entirely coated and all the mercury is absorbed."
 
Check tapping mercury on the lead-wire:
    retire the second noun by transformation into the white-amalgam-wire;
    retire the mercury by transformation into the white-amalgam-wire;
    now the player carries the white-amalgam-wire;
    set pronouns from the white-amalgam-wire;
    instead say "Tilting the saucer, you dip an end of the wire into the mercury. The mercury coats the metal, forming a white amalgam. You reel the lead wire through the droplet until it is entirely coated and all the mercury is absorbed."
 
Check tapping mercury on a metal-wire:
    instead say "Tilting the saucer, you dip an end of the [short-description of the second noun] wire into the mercury. The wire comes out clean; the mercury does not cling."
 
The iron-bead is a metallic takeable-thing. The printed name is "iron bead".
Understand "iron", "ordinary", "bead", "bead of", "metal" as the iron-bead.
Understand "metals" as the plural of iron-bead.
The description is "A bead of ordinary iron."
The lens-view is "Mars".
 
A metal-wire is a kind of takeable-thing.
A metal-wire has some text called the short-description.
The printed name of a metal-wire is usually "length of [short-description] wire".
A metal-wire is usually mass-named.
A metal-wire is usually metallic.
Understand "wire", "metal", "length", "length of", "coil", "coil of" as a metal-wire.
Understand "wires", "metals", "coils", "lengths" as the plural of metal-wire.
 
Rule for initially listing contents:
    initially group metal-wires together.
Rule for grouping together metal-wires when listing tersely:
    say "[listing group size in words cap cap-class-group] lengths of wire".
Before grouping together metal-wires when not listing tersely:
    say "[listing group size in words cap cap-class-group] lengths of wire (".
After grouping together metal-wires when not listing tersely:
    say ")".
Rule for printing the name of a metal-wire when grouping together:
    say "[short-description]";
 
Definition: a metal-wire is low-melting-wire if it is lead-wire or it is gold-amalgam-wire or it is white-amalgam-wire.
 
Check igniting a low-melting-wire metal-wire with el-fire:
    say general-contact-ignite;
    if the noun is on a clay-mold:
        instead say ". The end of the [short-description of the noun] vanishes in the elemental flame. But the heat is too concentrated to evenly melt the metal into the mold.";
    instead say ". The end of the [short-description of the noun] vanishes in the elemental flame."
 
Check igniting a low-melting-wire metal-wire with:
    say general-contact-ignite;
    if the flame-point of the second noun < 15:
        instead say ". The [short-description of the noun] doesn't soften noticeably in the flame.";
    if the noun is on a clay-mold:
        instead say ".  The [short-description of the noun] goes soft at the end. But it's not enough overall heat to melt the metal into the mold.";
    instead say ". The [short-description of the noun] goes soft at the end, but it hardens when you remove it from the flame."
 
Check igniting the electrum-wire with el-fire:
    instead say "[The noun] is unaffected by the elemental flame. (Unphlogisticated electrum isn't nearly as reactive as the charged stuff, it seems.)"
 
Check igniting the gold-wire with el-fire:
    instead say "The [short-description of the noun] wire goes soft at the end, but it hardens when you remove it from the elemental flame. (Unphlogisticated gold isn't nearly as reactive as the charged stuff.)"
 
Check igniting a metal-wire with el-fire:
    say general-contact-ignite;
    instead say ". The [short-description of the noun] goes soft at the end, but it hardens when you remove it from the elemental flame."
 
Check igniting a metal-wire with:
    instead say "[The noun] is unaffected by the flame."
 
Check tapping a pebble on the lead-wire when the symbol-type of the noun is ponderosity-symbol:
    uninscribe the noun;
    instead say "You carefully lay the [ponderosity-symbol] symbol against the lead wire. It discharges, but the symbol does not transfer to the wire -- the wire must be too narrow to carry it.";
Check tapping a pebble on the lead-wire when the symbol-type of the noun is gossamerity-symbol:
    uninscribe the noun;
    instead say "You carefully lay the [gossamerity-symbol] symbol against the lead wire. It discharges, but the symbol does not transfer to the wire -- the wire must be too narrow to carry it.";
 
The lead-wire is a metal-wire. The short-description is "lead".
Understand "lead", "dull", "grey", "gray" as the lead-wire.
The description is "Plain, dull grey lead."
The lens-view is "Saturn".
 
The gold-wire is a metal-wire. The short-description is "gold".
Understand "pure", "gold", "golden" as the gold-wire.
The description is "Pure gold wire."
The lens-view is "the Sun".
 
The electrum-wire is a metal-wire. The short-description is "electrum regium".
Understand "royal", "regium", "electrum" as the electrum-wire.
The description is "Wire of royal electrum."
The lens-view is "a lunar eclipse".
 
The platinum-wire is a metal-wire. The short-description is "platinum".
Understand "platinum", "heavy" as the platinum-wire.
Understand "silvery" as the platinum-wire when the action-to-be is not notional.
The description is "Platinum metal wire."
The lens-view is "a solar eclipse".
 
The nickel-wire is a metal-wire. The short-description is "nickel".
Understand "nickel", "pale", "pale-gold", "pale gold" as the nickel-wire.
The description is "A length of nickel wire, pale-gold in hue."
The lens-view is "Ceres".
 
The moon-metal-wire is a metal-wire. The short-description is "moon-metal".
Understand "moon", "moon-metal", "moonmetal", "moon-wire", "silvery-white" as the moon-metal-wire.
Understand "white", "silvery" as the moon-metal-wire when the action-to-be is not notional.
The description is "Wire made of silvery-white moon-metal."
The lens-view is "the Moon".
 
The gold-amalgam-wire is a metal-wire. The short-description is "gold amalgam".
Understand "amalgam", "silvery", "alloy", "gold amalgam" as the gold-amalgam-wire.
Understand "gold", "mercury" as the gold-amalgam-wire when the action-to-be is not notional.
The description is "A length of silvery wire, an amalgam of mercury and gold."
The lens-view is "Mercury and the Sun".
 
The white-amalgam-wire is a metal-wire. The short-description is "white amalgam".
Understand "white", "bright", "amalgam", "alloy" as the white-amalgam-wire.
Understand "lead", "mercury" as the white-amalgam-wire when the action-to-be is not notional.
The description is "A length of white metal wire, an amalgam of mercury and lead."
The lens-view is "Mercury and Saturn".
 
The whitgold-wire is a metal-wire. The short-description is "whitgold".
Understand "whitgold", "alloy" as the whitgold-wire.
Understand "white", "gold", "platinum" as the whitgold-wire when the action-to-be is not notional.
The description is "A length of whitgold wire, a white alloy of gold and platinum."
The lens-view is "a partial eclipse".
 
The moongold-wire is a metal-wire. The short-description is "moongold".
Understand "moongold", "alloy" as the moongold-wire.
Understand "white", "gold", "moon", "moonmetal", "moon-metal" as the moongold-wire when the action-to-be is not notional.
The description is "A length of moongold wire, a white alloy of gold and moon-metal."
The lens-view is "the Moon and the Sun".
 
 
A metal-rod is a kind of takeable-thing.
A metal-rod has some text called the short-description.
The printed name of a metal-rod is usually "[short-description] rod".
The remote-name of a metal-rod is usually "the [short-description] rod".
A metal-rod is usually metallic.
Understand "rod", "rod of", "metal", "small" as a metal-rod.
Understand "rods", "metals" as the plural of metal-rod.
 
Rule for initially listing contents:
    initially group metal-rods together.
Rule for grouping together metal-rods when listing tersely:
    say "[listing group size in words cap cap-class-group] metal rods".
Before grouping together metal-rods when not listing tersely:
    say "[listing group size in words cap cap-class-group] metal rods (".
After grouping together metal-rods when not listing tersely:
    say ")".
Rule for printing the name of a metal-rod when grouping together:
    say "[short-description][if alight] (with elemental fire)[end if]";
 
Definition: a metal-rod is low-melting-rod if it is lead-rod or it is gold-amalgam or it is white-amalgam or it is red-amalgam.
 
Check igniting a low-melting-rod metal-rod with el-fire:
    say general-contact-ignite;
    if the noun is on a clay-mold:
        instead say ". The [short-description of the noun] goes a bit drippy where the elemental flame touches it, but the heat is too concentrated to evenly melt the metal into the mold.";
    instead say ". The end of the [short-description of the noun] melts away in the elemental flame."
 
Check igniting a low-melting-rod metal-rod with:
    say general-contact-ignite;
    if the flame-point of the second noun < 15:
        instead say ". The [short-description of the noun] doesn't soften noticeably in the flame.";
    if the noun is on a clay-mold:
        instead say ". The [short-description of the noun] goes a bit drippy where the flame touches it, but it's not enough overall heat to melt the metal into the mold.";
    instead say ". The [short-description of the noun] goes a bit drippy at the end, but it hardens when you remove it from the flame."
 
Check igniting the electrum with el-fire:
    instead say "[The noun] is unaffected by the elemental flame. (Unphlogisticated electrum isn't nearly as reactive as the charged stuff, it seems.)"
 
Check igniting a metal-rod with el-fire:
    say general-contact-ignite;
    instead say ". The [short-description of the noun] goes a bit drippy at the end, but it hardens when you remove it from the elemental flame."
 
Check igniting a metal-rod with:
    instead say "[The noun] is unaffected by the flame."
 
Check tapping a pebble on the lead-rod when the symbol-type of the noun is ponderosity-symbol:
    uninscribe the noun;
    say "You carefully lay the [ponderosity-symbol] symbol against the lead";
    if the symbol-type of the lead-rod is ponderosity-symbol:
        instead say ". It discharges, but the rod becomes no heavier.";
    now the symbol-type of the lead-rod is ponderosity-symbol;
    say ". The symbol flares brightly and transfers to the rod";
    if the player carries the lead-rod:
        say ", which feels abruptly heavier in your hand";
    instead say "."
Check tapping a pebble on the lead-rod when the symbol-type of the noun is gossamerity-symbol:
    uninscribe the noun;
    say "You carefully lay the [gossamerity-symbol] symbol against the lead";
    if the symbol-type of the lead-rod is gossamerity-symbol:
        instead say ". It discharges, but the rod becomes no lighter.";
    now the symbol-type of the lead-rod is gossamerity-symbol;
    say ". The symbol flares brightly and transfers to the rod";
    if the player carries the lead-rod:
        say ", which feels abruptly lighter in your hand";
    instead say "."
 
Check tapping the dispersal-brush on the lead-rod when the symbol-type of the lead-rod is not no-symbol:
    say "You brush the feather across the lead rod. The [symbol-type of the lead-rod] symbol blurs and fades away";
    now the symbol-type of the lead-rod is no-symbol;
    if the player carries the lead-rod:
        say ". The rod's weight returns to normal";
    instead say "."
 
Instead of tapping the lead-rod on the dispersal-brush when the symbol-type of the lead-rod is not no-symbol:
    instead try tapping the second noun on the noun.
 
Instead of putting the dispersal-brush on the lead-rod when the symbol-type of the lead-rod is not no-symbol:
    instead try tapping the noun on the second noun.
 
 
The lead-rod is a metal-rod. The short-description is "lead".
[The lead-rod has a symbol-type.] [Symbol-type doesn't exist yet; will declare this later.]
Understand "lead", "dull", "grey", "gray" as the lead-rod.
The lens-view is "Saturn".
 
Check examining the lead-rod:
    say "A small rod of plain, dull grey lead";
    if symbol-type of the lead-rod is not no-symbol:
        say ". A [symbol-type of the lead-rod] symbol glows on the rod's surface";
        if the player carries the lead-rod:
            say ", and the metal feels oddly [if symbol-type of the lead-rod is ponderosity-symbol]heavy[else]light[end if]";
    instead say ".";
 
Report taking the lead-rod when the symbol-type of the lead-rod is ponderosity-symbol:
    instead say "Taken. The rod is heavier than you'd expect, even for lead."
Report taking the lead-rod when the symbol-type of the lead-rod is gossamerity-symbol:
    instead say "Taken. The rod is lighter than you'd expect lead to be."
 
The platinum-rod is a metal-rod. The short-description is "platinum".
Understand "platinum", "heavy" as the platinum-rod.
Understand "silvery" as the platinum-rod when the action-to-be is not notional.
The description is "A small rod of heavy, silvery platinum metal."
The lens-view is "a solar eclipse".
 
The nickel-rod is a metal-rod. The short-description is "nickel".
Understand "nickel", "pale", "pale-gold", "pale gold" as the nickel-rod.
The description is "A small rod of nickel, a pale-gold metal."
The lens-view is "Ceres".
 
The moon-metal-rod is a metal-rod. The short-description is "moon-metal".
Understand "moon", "moon-metal", "moonmetal", "moon-rod", "silvery-white" as the moon-metal-rod.
Understand "white", "silvery" as the moon-metal-rod when the action-to-be is not notional.
The description is "A small rod of silvery-white moon-metal. It feels a little heavier than ordinary silver."
The lens-view is "the Moon".
 
The gold-amalgam is a metal-rod. The short-description is "gold amalgam".
Understand "amalgam", "silvery", "alloy", "gold amalgam" as the gold-amalgam.
Understand "gold", "mercury" as the gold-amalgam when the action-to-be is not notional.
The description is "A small rod of gold amalgam -- gold which has absorbed mercury, forming a silvery alloy."
The lens-view is "Mercury and the Sun".
 
The white-amalgam is a metal-rod. The short-description is "white amalgam".
Understand "white", "bright", "amalgam", "alloy" as the white-amalgam.
Understand "lead", "mercury" as the white-amalgam when the action-to-be is not notional.
The description is "A small rod of bright white metal, an amalgam of mercury and lead."
The lens-view is "Mercury and Saturn".
 
The red-amalgam is a metal-rod. The short-description is "red amalgam".
Understand "red", "bright", "amalgam", "alloy" as the red-amalgam.
Understand "orichalcum", "mercury" as the red-amalgam when the action-to-be is not notional.
The description is "A small rod of bright red metal, an amalgam of mercury and orichalcum."
The lens-view is "Mercury and Vulcan".
 
The ring-gold-rod is a metal-rod. The short-description is "ring-gold".
Understand "ringgold", "whitish", "alloy" as the ring-gold-rod.
Understand "white", "gold", "nickel" as the ring-gold-rod when the action-to-be is not notional.
The description is "A small rod of ring-gold, a hard whitish alloy of gold and nickel."
The lens-view is "Ceres and the Sun".
 
The whitgold-rod is a metal-rod. The short-description is "whitgold".
Understand "whitgold", "alloy" as the whitgold-rod.
Understand "white", "gold", "platinum" as the whitgold-rod when the action-to-be is not notional.
The description is "A small rod of whitgold, a white alloy of gold and platinum."
The lens-view is "a partial eclipse".
 
The moongold-rod is a metal-rod. The short-description is "moongold".
Understand "moongold", "alloy" as the moongold-rod.
Understand "white", "gold", "moon", "moonmetal", "moon-metal" as the moongold-rod when the action-to-be is not notional.
The description is "A small rod of moongold, a white alloy of gold and moon-metal."
The lens-view is "the Moon and the Sun".
 
The orichalcum is a metal-rod. The short-description is "orichalcum".
The description is "Orichalcum, or quickcopper, is a brittle metal with a fiery, rose-pink luster. It's one of the rarer alchemical metals; this rod is half the length of your finger, but it's still more of the stuff than you've ever handled before."
Understand "orichalc", "quickcopper", "quick-copper" as the orichalcum.
The lens-view is "Vulcan".
 
The gold-rod is a metal-rod. The short-description is "gold".
The printed name is "plain [short-description] rod".
The remote-name is "the plain [short-description] rod".
The description is "It's no longer phlogisticated, but it's still gold."
Understand "gold", "golden", "plain", "unphlogisticated" as the gold-rod.
The lens-view is "the Sun".
 
The electrum is a metal-rod. The short-description is "electrum regium".
The electrum can be ever-used. [not resettable]
The description is "It's a small rod of royal electrum, a heavy metal with a pale silvery gleam[if ever-used]. The electrum is not phlogisticated[end if]."
The printed name is "[if ever-used]plain [end if][short-description] rod".
The remote-name is "the [if ever-used]plain [end if][short-description] rod".
Understand "royal", "regium", "plain", "unphlogisticated", "elec-rod", "electrum-rod" as the electrum.
The lens-view is "a lunar eclipse".
 
The phlo-electrum is a metal-rod. The short-description is "phlogisticated electrum".
The phlo-electrum has some text called the base-description. The base-description is "electrum".
The flame-point is 40.
Understand "royal", "regium", "phlogisticated", "electrum" as the phlo-electrum.
Understand "fire", "flame", "flaming", "burning", "element", "elemental", "incandescence" as the phlo-electrum when the item described is alight.
 
Rule for printing the name of alight phlo-electrum:
    if listing details:
        say printed name;
        say " (with elemental fire)";
    else:
        say "flaming ";
        say printed name.
 
Check examining the phlo-electrum:
    say "It's a small rod of phlogisticated royal electrum";
    if the phlo-electrum is alight:
        if the atmosphere of the location is water-atm:
            say ". One end crackles with the deep golden incandescence of elemental fire; bubbles stream from it";
        else:
            say ". One end burns with the deep golden incandescence of elemental fire";
    instead say "."
 
Check inspecting the phlo-electrum with the planetary-lens:
    if the phlo-electrum is alight:
        instead say "The lens only shows you a glare of elemental fire.";
    instead say "You peer at [the noun] through the lens. You perceive an eclipse, with a shimmering corona."
 
Check touching the not alight phlo-electrum:
    instead say "The phlogisticated metal is not warm to the touch, but you can sense the energy whirling within."
 
Check extinguishing the alight phlo-electrum when the atmosphere of the location is water-atm:
    instead say "Extinguish the electrum? You're already holding it underwater, and that hasn't slowed it down."
Check blowing on the alight phlo-electrum:
    instead say "You blow on the electrum rod. The elemental fire eddies -- slowly, more like liquid than flame."
 
Check waving the alight phlo-electrum:
    instead say "The elemental fire eddies -- slowly, more like liquid than flame."
Check shaking the alight phlo-electrum:
    instead try waving the noun.
 
Check igniting the phlo-electrum with alight phlo-gold:
    say general-contact-ignite;
    if the phlo-electrum is alight:
        instead say ". The two flames merge for a moment, but are not otherwise affected.";
    now the phlo-electrum is alight;
    update fire consumption;
    mark the electrum-ignition as done;
    instead say ". The electrum begins to glow -- not the dull red of heating metal, but with an inner lucence. The golden light seems to throb, and unfurl, and expand, all at once. Heat presses against your face as you peer into the flame.[para]You pull the gold and electrum rods apart. Golden elemental flames now burn steadily on each of them."
 
Check igniting the phlo-electrum with:
    say general-contact-ignite;
    instead say ", but the electrum remains inert. Elemental fire is devilishly difficult to ignite."
 
The phlo-gold is a metal-rod. The short-description is "phlogisticated gold".
The phlo-gold has some text called the base-description. The base-description is "gold".
The flame-point is 40.
Understand "phlogisticated", "gold", "golden" as the phlo-gold.
Understand "fire", "flame", "flaming", "burning", "element", "elemental", "incandescence" as the phlo-gold when the item described is alight.
 
Rule for printing the name of alight phlo-gold:
    if listing details:
        say printed name;
        say " (with elemental fire)";
    else:
        say "flaming ";
        say printed name.
 
Check examining the phlo-gold:
    say "[one of]You inspect it with some awe. Gold is lovely, of course, but [em]phlogisticated[/em][or]Phlogisticated[stopping] gold is a rare alchemical resource. This rod is half the length of your finger";
    if the phlo-gold is not alight:
        say ", with a lustrous yellow gleam brighter and sharper than any natural metal";
    else:
        if the atmosphere of the location is water-atm:
            say ". One end crackles with the deep golden incandescence of elemental fire; bubbles stream from it";
        else:
            say ". One end burns with the deep golden incandescence of elemental fire";
    instead say "."
 
Check inspecting the phlo-gold with the planetary-lens:
    if the phlo-gold is alight:
        instead say "The lens only shows you a glare of elemental fire.";
    instead say "You peer at [the noun] through the lens. You perceive the Sun, with a coruscating halo."
 
Check touching the not alight phlo-gold:
    instead say "The phlogisticated metal is not warm to the touch, but you can sense the energy whirling within."
 
Check extinguishing the alight phlo-gold when the atmosphere of the location is water-atm:
    instead say "Extinguish the gold? You're already holding it underwater, and that hasn't slowed it down."
Check blowing on the alight phlo-gold:
    instead say "You blow on the gold rod. The elemental fire eddies -- slowly, more like liquid than flame."
 
Check waving the alight phlo-gold:
    instead say "The elemental fire eddies -- slowly, more like liquid than flame."
Check shaking the alight phlo-gold:
    instead try waving the noun.
 
Check igniting the phlo-gold with alight phlo-electrum:
    say general-contact-ignite;
    if the phlo-gold is alight:
        instead say ". The two flames merge for a moment, but are not otherwise affected.";
    now the phlo-gold is alight;
    update fire consumption;
    mark the electrum-ignition as done;  [why not]
    instead say ". The gold begins to glow -- not the dull red of heating metal, but with an inner lucence. The golden light seems to throb, and unfurl, and expand, all at once. Heat presses against your face as you peer into the flame.[para]You pull the gold and electrum rods apart. Golden elemental flames now burn steadily on each of them."
 
Check igniting the phlo-gold with:
    say general-contact-ignite;
    instead say ", but the gold remains inert. Elemental fire is devilishly difficult to ignite."
 
 
Section - Wood
 
A wood-splint is a kind of takeable-thing.
A wood-splint has some text called the short-description.
A wood-splint has some text called the flame-color. The flame-color of a wood-splint is usually "yellow".
A wood-splint has a number called the ignition-point.
A wood-splint has a number called the vaporization-point.
The flame-point of a wood-splint is usually 10.
The ignition-point of a wood-splint is usually 5.
The vaporization-point of a wood-splint is usually 15.
The remote-name of a wood-splint is usually "the [short-description] splinter".
Understand "wood", "wooden", "splint", "splinter", "splinter of" as a wood-splint.
Understand "splints", "splinters" as the plural of wood-splint.
Understand "fire", "flame", "flaming", "burning" as a wood-splint when the item described is alight.
 
Rule for printing the name of a wood-splint:
    if the grouping together activity is not going on:
        if listing details:
            say "splinter of [short-description]";
            if alight:
                say " (alight)";
        else:
            if alight:
                say "burning ";
            say "splinter of [short-description]";
    else:
        say short-description;
        if alight:
            if listing details:
                say " (alight)".
 
Rule for writing a paragraph about an alight wood-splint:
    say "A splinter of [short-description] lies here";
    let C be the flame-color of the item described;
    if C is "barely visible":
        [the swamp-pith requires a grammar tweak]
        say ", a barely-visible flame";
    else:
        say ", burning [C]";
    say " at one end."
 
Rule for initially listing contents:
    initially group wood-splints together.
Rule for grouping together wood-splints when listing tersely:
    say "[listing group size in words cap cap-class-group] wooden splints";
Before grouping together wood-splints when not listing tersely:
    say "[listing group size in words cap cap-class-group] wooden splints (".
After grouping together wood-splints when not listing tersely:
    say ")".
 
Check touching a wood-splint:
    instead say "It feels like wood."
 
Check blowing on an alight wood-splint:
    if the atmosphere of the location is fire-atm:
        instead say "You can't blow out the flame when you're standing in a fire!";
    now the noun is not alight;
    update fire consumption;
    instead say "You blow on [the noun] until the flame goes out."
 
Check waving an alight wood-splint:
    instead say "You wave the [short-description of noun], and watch its flame eddy."
Check shaking an alight wood-splint:
    instead try waving the noun.
 
Check igniting something alight with an alight wood-splint when the flame-point of the noun > the flame-point of the second noun:
    instead try igniting the second noun with the noun.
 
Check igniting a wood-splint with something (this is the wood-burning rule):
    say general-contact-ignite;
    let T be the flame-point of the second noun;
    if T >= the vaporization-point of the noun:
        say ". The [short-description of the noun]";
        if the noun is alight:
            say ", though already alight,";
        retire the noun by burning in the second noun;
        now the noun is not alight;
        update fire consumption;
        instead say " goes up in a bright flare; you snatch your hand away. Within instants, the [short-description of noun] has been entirely devoured, and its flame winks out.";
    if the noun is alight:
        instead say ". The two flames merge for a moment, but are not otherwise affected.";
    if T >= the ignition-point of the noun:
        now the noun is alight;
        if the burn-life of the noun is less than 2:
            now the burn-life of the noun is 2;
        update fire consumption;
        instead say ". The [short-description of the noun] catches quickly, and burns with a [flame-color of the noun] flame.";
    instead say ". But the [short-description of noun] [one of]refuses to catch light[or]stubbornly resists catching light[purely at random]."
 
The wood-burning rule is listed before the generic already-alight rule in the check igniting it with rulebook.
 
To say splinter length of (T - wood-splint):
    let N be the burn-life of T;
    let MN be the max-burn-life of T;
    if N > (MN / 2):
        say "thin, thumb-length";
        stop;
    if N > 6:
        say "shortening";
        stop;
    if N > 3:
        say "stumpy";
        stop;
    say "tiny fragment of a";
 
The el-wood is a wood-splint. The short-description is "elemental wood". The flame-color is "yellow".
The flame-point is 16. The ignition-point is 10. The vaporization-point is 17.
The max-burn-life is 40.
The description is "A [splinter length of the item described] splinter of elemental wood[if not alight] -- not wood from any particular tree, but a difficult-to-cultivate abstraction of all woods[else]. One ends burns with a lovely yellow flame[end if].[if alight] (Not elemental fire, mind you. That's different. This is just fire.)[end if]".
Understand "element", "elemental" as the el-wood.
 
The cedar is a wood-splint. The short-description is "cedar". The flame-color is "dull orange".
The flame-point is 10. The ignition-point is 10. The vaporization-point is 20.
The max-burn-life is 30.
The description is "A [splinter length of the item described] splinter of yellowish wood[if alight]. It burns with a dull orange flame[end if]."
Understand "yellowish" as the cedar.
 
Check touching the not alight cedar:
    instead say "The cedar wood is slightly sticky."
 
Check smelling the cedar:
    instead say "It smells a bit sappy."
 
The maple is a wood-splint. The short-description is "maple". The flame-color is "yellow".
The flame-point is 16. The ignition-point is 15. The vaporization-point is 22.
The max-burn-life is 20.
The description is "A [splinter length of the item described] splinter of striated wood[if alight]. It burns with a bright yellow flame[end if]."
Understand "striated" as the maple.
 
The winter-oak is a wood-splint. The short-description is "winter-oak". The flame-color is "yellow-white".
The flame-point is 18. The ignition-point is 12. The vaporization-point is 30.
The max-burn-life is 15.
The description is "A [splinter length of the item described] splinter of pale grey wood[if alight]. It burns with an intense yellow-white flame[end if]."
Understand "winter", "oak", "winteroak", "pale", "grey", "gray" as the winter-oak.
 
The blackwood is a wood-splint. The short-description is "blackwood". The flame-color is "star-blue".
The flame-point is 25. The ignition-point is 18. The vaporization-point is 30.
The max-burn-life is 20.
The description is "A [splinter length of the item described] splinter of [if alight]glossy wood. The flame on the end is a tiny blue-white star, too bright to look at[else]glossy wood. Despite the name, it's not quite black[end if]."
Understand "black", "glossy" as the blackwood.
 
The linden is a wood-splint. The short-description is "green linden". The flame-color is "dim red".
The flame-point is 5. The ignition-point is 5. The vaporization-point is 14.
The max-burn-life is 35.
The description is "A [splinter length of the item described] splinter of greenish wood[if alight]. It burns with a dim red flame[else]. It's rather light for its size[end if]."
Understand "green", "greenish" as the linden.
 
Check touching the not alight linden:
    instead say "The linden wood is light and rather soft."
 
The swamp-pith is a wood-splint. The short-description is "swamp pith". The flame-color is "barely visible".
The flame-point is 3. The ignition-point is 2. The vaporization-point is 6.
The max-burn-life is 16.
The description is "A [splinter length of the item described] splinter of spongy pith[if alight]. A flame dances on the end, but it's barely visible -- just a ripple of heat[else]. It's very light for its size[end if]."
Understand "swamp", "reed", "pith", "spongy" as the swamp-pith.
Understand "ripple", "heat" as the swamp-pith when the swamp-pith is alight.
 
Check touching the not alight swamp-pith:
    instead say "The pith is soft, yielding easily to the pressure of your finger."
 
Check smelling the swamp-pith:
    instead say "The pith has an odd waxy odor."
 
 
Section - Herbs and Spices
 
Definition: a thing is dried-vegetable if it is the rosemary or it is the pinecone or it is the honeysuckle or it is the mushroom or it is the mustard or it is the zafranum.
 
The rosemary is a takeable-thing. The printed name is "[if not listing tersely]sprig of [end if]rosemary".
The description is "It's a long twig of pale green rosemary needles."
The rosemary is mass-named.
Understand "sprig", "sprig of", "twig", "pale", "green", "needles" as the rosemary.
 
Check smelling the rosemary:
    instead say "The sprig retains its piney, resinous scent."
 
Check eating the rosemary (this is the rosemary-eating rule):
    instead say "You pull off a rosemary needle, stick it in your mouth, and chew contemplatively. Yes, that's fresh rosemary. Then you spit it out, because needles are tough."
The rosemary-eating rule is listed after the can't eat what's not held rule in the check eating rulebook.
 
Check tasting the rosemary:
    instead try eating the rosemary.
 
Check waving the rosemary when the location is not aroma-proof:
    if rstate is not active:
        tutor tut-step-rosemary;
        instead say "You waft the scent of rosemary around.";
    instead try rit-wafting the rosemary.
 
Check shaking the rosemary when the location is not aroma-proof:
    instead try waving the rosemary.
 
Check igniting the rosemary with when rstate is active and the rosemary is in the bound of rstate:
    instead try rit-igniting the noun with the second noun.
Check igniting the rosemary with:
    if the player carries the rosemary:
        say "You drop the rosemary as it";
    else:
        say "The rosemary";
    retire the rosemary by burning in the second noun;
    instead say " goes up in a burst of resinous flame. It's consumed almost instantly[first time]. Whoops[only]."
 
The pinecone is a takeable-thing.
The description is "This cone was collected from the rare bristlecone pine. It's rather old and [if moist]damp[else]dusty[end if]."
The pinecone can be moist.
Understand "pine", "cone", "pine-cone", "bristle", "bristle-cone", "bristlecone", "old", "dusty" as the pinecone.
 
Check smelling the pinecone:
    instead say "The cone has a faint resinous aroma."
 
Check waving the pinecone when the location is not aroma-proof:
    instead say "You wave the pinecone, but it's not very aromatic.";
Check shaking the pinecone when the location is not aroma-proof:
    instead say "You wave the pinecone, but it's not very aromatic.";
 
Check squeezing the pinecone:
    if rstate is not active:
        retire the pinecone by manual destruction;
        instead say "The old pinecone crumbles into dusty flakes, which sift from your fingers[if the location is not aroma-proof]. A sharp, resinous aroma bursts into the air[end if].";
    retire the pinecone by ritual;
    instead try rit-wafting the pinecone.
 
Check smashing the pinecone:
    instead try squeezing the pinecone.
 
Check igniting the pinecone with when rstate is active and the pinecone is in the bound of rstate:
    instead try rit-igniting the noun with the second noun.
Check igniting the pinecone with:
    if the player carries the pinecone:
        say "You drop the pinecone as it";
    else:
        say "The pinecone";
    retire the pinecone by burning in the second noun;
    instead say " goes up in a burst of resinous flame. It's consumed almost instantly[first time]. Whoops[only]."
 
The honeysuckle is a takeable-thing. The printed name is "[if not listing tersely]sprig of [end if]honeysuckle".
The description is "It's a sprig of dried[if moist] (albeit damp)[end if], pale yellow honeysuckle flowers."
The honeysuckle can be moist.
Understand "sprig", "sprig of", "twig", "honey", "suckle", "pale", "yellow", "dried", "flower", "flowers" as the honeysuckle.
The honeysuckle is mass-named.
Understand "damp" as the honeysuckle when the honeysuckle is moist.
 
Check smelling the honeysuckle:
    instead say "The honeysuckle retains a bit of its sweet aroma."
 
Check eating the honeysuckle (this is the honeysuckle-eating rule):
    instead say "You pull off a dried honeysuckle petal and chew meditatively. It's [one of]more bitter than you expected[or]bitter[stopping]."
The honeysuckle-eating rule is listed after the can't eat what's not held rule in the check eating rulebook.
 
Check tasting the honeysuckle:
    instead try eating the honeysuckle.
 
Check tasting the rosemary:
    instead try eating the rosemary.
 
Check waving the honeysuckle when the location is not aroma-proof:
    instead say "You wave the honeysuckle, but it's not very aromatic.";
Check shaking the honeysuckle when the location is not aroma-proof:
    instead say "You wave the honeysuckle, but it's not very aromatic.";
 
Check squeezing the honeysuckle:
    if rstate is not active:
        retire the honeysuckle by manual destruction;
        instead say "The dried flowers crumble and sift from your fingers[if the location is not aroma-proof], releasing a burst of honey-sweetness into the air[end if].";
    retire the honeysuckle by ritual;
    instead try rit-wafting the honeysuckle.
 
Check smashing the honeysuckle:
    instead try squeezing the honeysuckle.
 
Check igniting the honeysuckle with when rstate is active and the honeysuckle is in the bound of rstate:
    instead try rit-igniting the noun with the second noun.
Check igniting the honeysuckle with:
    if the player carries the honeysuckle:
        say "You drop the honeysuckle as it";
    else:
        say "The honeysuckle";
    retire the honeysuckle by burning in the second noun;
    instead say " goes up in a burst of sickly-sweet flame. It's consumed almost instantly."
 
The mushroom is a takeable-thing. The printed name is "dried mushroom".
The description is "A shrivelly [if not moist]dry brown mushroom[else]brown mushroom, now a little damp[end if][one of]. You have no idea what species -- one dried mushroom looks a lot like another[or], of some species or another[stopping]."
The mushroom can be moist.
Understand "fungus", "brown", "shriveled", "shrivelly", "dry", "dried" as the mushroom.
Understand "damp" as the mushroom when the mushroom is moist.
 
Check eating the mushroom:
    instead say "There's no reason for an arbitrary mushroom in the alchemical stores to be poisonous, but you're just nervous enough to skip trying."
Check tasting the mushroom:
    instead try eating the mushroom.
 
Check smelling the mushroom:
    instead say "It smells like musty dirt."
 
The coral is a takeable-thing. The printed name is "chunk of coral".
The description is "It's a wrinkled chunk of yellow coral. (At least, it came from that outcropping that looked like coral.) It's light and somewhat yielding, rather like cork."
Understand "yellow", "wrinkled", "chunk", "chunk of", "small" as the coral.
 
The lens-view is "some planet you don't recognize".
 
Check eating the coral:
    instead say "It didn't grow on Earth. Even if it's from a Gaian land, it can't be nourishing for people."
 
Check smelling the coral:
    instead say "It smells faintly garlicky."
Check tasting the coral:
    instead say "It tastes faintly garlicky."
 
Check squeezing the coral:
    instead say "The coral gives slightly, more like cork than solid wood."
 
Check rubbing the coral:
    instead say "Bits of yellow dust rub off the coral."
 
The mustard is a takeable-thing. The printed name is "[if not listing tersely]pinch of [end if]mustard seed".
The description is "You've found some mustard seeds."
The mustard is mass-named.
Understand "seed", "seeds", "pinch", "pinch of" as the mustard.
 
Check eating the mustard (this is the mustard-eating rule):
    instead say "You select a mustard seed and pop it into your mouth. It's got some sting to it."
The mustard-eating rule is listed after the can't eat what's not held rule in the check eating rulebook.
 
Check tasting the mustard:
    instead try eating the mustard.
 
Check igniting the mustard with when rstate is active and the mustard is in the bound of rstate:
    instead try rit-igniting the noun with the second noun.
Check igniting the mustard with:
    if the player carries the mustard:
        say "You toss the mustard seed into the flame";
    else:
        say "You wave the flame over the mustard seed";
    retire the mustard by burning in the second noun;
    instead say ". It doesn't burn well, but eventually goes up in a small waft of choking smoke."
 
Check smelling the mustard:
    instead say "The mustard seed doesn't have much aroma."
 
The zafranum is a takeable-thing. The printed name is "[if not listing tersely]pinch of [end if]zafranum".
The description is "A few threads of rare orange zafranum. The spice is used in a few obscure rituals -- and expensive dishes."
The zafranum is mass-named.
Understand "thread", "threads", "rare", "orange", "saffron", "pinch", "pinch of" as the zafranum.
 
Check smelling the zafranum:
    instead say "The zafranum has a powerful, pungent aroma."
 
Check waving the zafranum when the location is not aroma-proof:
    if rstate is not active:
        instead say "You waft the aromatic zafranum all around.";
    instead try rit-wafting the zafranum.
 
Check shaking the zafranum when the location is not aroma-proof:
    instead try waving the zafranum.
 
Check eating the zafranum:
    instead say "The zafranum would certainly taste good, but you're not sure where you could find any more. So you'd better not."
Check tasting the zafranum:
    instead try eating the zafranum.
 
Check igniting the zafranum with when rstate is active and the zafranum is in the bound of rstate:
    instead try rit-igniting the noun with the second noun.
Check igniting the zafranum with:
    retire the zafranum by burning in the second noun;
    instead say "The zafranum threads flare up and vanish in a puff of pungent yellow smoke."
 
Definition: a thing is feather-or-feather if it is the feather or it is the dispersal-brush.
 
The feather is a takeable-thing. The printed name is "[if dispersal-brush is ever-seen]plain [end if]white feather".
The description is "It's a smallish quill feather. Not particularly resplendent, but it's white."
Understand "plain", "white", "quill" as the feather.
 
Check touching the feather:
    instead say "Soft and slightly scratchy."
 
Check tapping the feather on the player:
    instead say "Tee hee."
 
The camphrost is a takeable-thing. The printed name is "lump of camphrost".
The description is "Camphrost is a waxy blue substance. It sublimes rapidly when in contact with air; you can see the vapor streaming off this piece."
Understand "lump", "lump of", "piece", "piece of", "bit", "bit of", "waxy", "blue" as the camphrost.
The camphrost has a number called the vapor-life.
 
Check smelling the camphrost:
    instead say "The camphrost smells like toothache and mothballs."
 
 
Section - Chemicals
 
A chem-source is a kind of takeable-thing.
A chem-source has some text called the short-description. The short-description is usually "(BUG)".
A chem-source has a substance-type called the substance.
A chem-source has some text called the sprinkle-word. The sprinkle-word is usually "drip".
A chem-source can be topical or nontopical. A chem-source is usually nontopical. [typically poured on things; putting-on is converted to topically-applying action, and tapping-on is converted to putting-on.]
A chem-source can be irritant or nonirritant. A chem-source is usually irritant. [never ever want to touch it]
A chem-source is usually mass-named.
A chem-source is usually glassy.
Rule for printing the name of a chem-source:
    say short-description;
 
A chem-vial is a kind of chem-source.
Understand "chymic", "vial", "vial of" as a chem-vial.
Understand "vials" as the plural of chem-vial.
The sprinkle-word of a chem-vial is usually "pour".
Rule for printing the name of a chem-vial when not grouping together:
    say "vial of [short-description]";
 
A chem-flask is a kind of chem-source.
Understand "chymic", "flask", "flask of" as a chem-flask.
Understand "flasks" as the plural of chem-flask.
Rule for printing the name of a chem-flask when not grouping together:
    say "flask of [short-description]";
 
Rule for initially listing contents:
    initially group chem-vials together;
    initially group potion-vials together;
    initially group chem-flasks together.
Rule for grouping together non-potiony chem-vials when listing tersely:
    say "[listing group size in words cap cap-class-group] chymic vials".
Before grouping together non-potiony chem-vials when not listing tersely:
    say "[listing group size in words cap cap-class-group] chymic vials (".
After grouping together non-potiony chem-vials when not listing tersely:
    say ")".
Rule for grouping together potion-vials when listing tersely:
    say "[listing group size in words cap cap-class-group] potion bottles".
Before grouping together potion-vials when not listing tersely:
    say "[listing group size in words cap cap-class-group] potion bottles (".
After grouping together potion-vials when not listing tersely:
    say ")".
Rule for grouping together chem-flasks when listing tersely:
    say "[listing group size in words cap cap-class-group] chymic flasks".
Before grouping together chem-flasks when not listing tersely:
    say "[listing group size in words cap cap-class-group] chymic flasks (".
After grouping together chem-flasks when not listing tersely:
    say ")".
 
Check opening a chem-flask:
    instead say "A Navy chymic flask is always closed when not in use. Just decant what you need, and don't worry about the lid."
Check opening a chem-vial:
    instead say "A Navy chymic vial is always closed when not in use. Just decant what you need, and don't worry about the lid."
Check closing a chem-source:
    instead try opening the noun.
 
Check reading a chem-vial:
    instead say "You haven't labelled [the noun], but you know what's in it."
 
Check emptying a chem-source:
    instead say "You don't want to just dump the [short-description of the noun] out; you'll want to pour it into something."
Check emptying a potion-vial:
    if the noun is topical:
        instead say "You don't want to just dump the [short-description of the noun] out. You might want to pour it onto something.";
    else:
        instead say "You don't want to just dump out the [short-description of the noun] potion."
 
Check searching a chem-source:
    instead try examining the noun.
 
Check reading a chem-source:
    instead say "[The noun] is correctly labelled."
 
Check inserting something into a chem-source:
    if the noun is the second noun:
        instead say "You can't put [the noun] inside itself.";
    instead say "Years of training (and instructors['] shouting) have convinced you to mix chymic reagents only in the bounds of a ritual -- never in their original containers."
 
Check smelling a chem-source:
    instead say "The [short-description] is odorless."
 
Check eating a chem-source:
    instead say "Don't eat the chymical substances[first time]. You don't know where they've been, but you [em]do[/em] have a good idea what they'll do to your insides[only]."
Check tasting a chem-source:
    instead try eating the noun.
 
Check touching an irritant chem-source:
    instead say "It wouldn't be good for your skin."
Check touching a chem-source:
    instead say "You don't want to contaminate the [if the item described is a chem-flask]flask[else]vial[end if]."
Check putting an irritant chem-source on the player:
    instead say "It wouldn't be good for your skin."
Check putting a nonirritant chem-source on the player:
    instead say "You don't need to bathe in [short-description of the item described]."
 
Check igniting a chem-source with:
    instead say "If you set fire to all your chymic reagents, where will you get any more?"
 
Check putting a chem-source on something not sessile (this is the check putting a chem-source on rule):
    if the second noun is in a ritual-bound (called B) and rstate is active:
        instead try inserting the noun into B;
    if the noun is nontopical:
        instead say "You don't want to go applying random chymic substances outside the bounds of a ritual."
 
Check putting a topical chem-source on something (this is the convert putting a topical chem-source on to inserting rule):
    if the second noun is a container or the second noun is a supporter:
        continue the action;
    instead try inserting the noun into the second noun.
 
Check inserting a topical chem-source into something:
    if the second noun is not a container and the second noun is not a supporter:
        retire the noun by applying to the second noun;
        instead try topically-applying the noun to the second noun;
 
The saline is a nonirritant chem-flask. The substance is saline-subst. The short-description is "saline".
The description is "Saline is a dilute salt solution, often used as a base for potions."
Understand "solution" as the saline.
Understand "saline", "solution" as the saline-subst.
 
Check eating the saline:
    instead say "True, the saline is non-toxic, but there must be a better use for it."
 
The alcohol is a nonirritant chem-flask. The substance is alcohol-subst. The short-description is "rubbing alcohol".
The description is "You are tediously familiar with this alcohol solution; you've scrubbed enough things with it."
Understand "rubbing" as the alcohol.
Understand "rubbing", "alcohol" as the alcohol-subst.
 
Check smelling the alcohol:
    instead say "The alcohol fumes burn your nose."
Check eating the alcohol:
    instead say "It's not the drinkable sort of alcohol. It's the cleaning sort, and, if you're too stupid to read labels, the puking and going-blind sort."
 
The mineral-oil is a nonirritant chem-flask. The substance is mineral-oil-subst. The short-description is "mineral oil".
The description is "Mineral oil is clear and inert."
Understand "mineral", "oil" as the mineral-oil.
Understand "mineral", "oil" as the mineral-oil-subst.
 
The muriatic acid is a chem-flask. The substance is muriatic-subst. The short-description is "muriatic acid".
The description is "Muriatic acid is a strong acid produced from salt."
Understand "muriatic" as the muriatic-subst. [omit "acid"]
 
Check smelling the muriatic acid:
    instead say "You do not intend to snort the acid vapors."
 
The vitriolic acid is a chem-flask. The substance is vitriolic-subst. The short-description is "vitriolic acid".
The description is "Vitriolic acid is a strong acid produced from sulphur."
Understand "vitriol", "sulphuric", "sulfuric" as the vitriolic acid.
Understand "vitriol", "sulphuric", "sulfuric", "vitriolic" as the vitriolic-subst. [omit "acid"]
 
Check smelling the vitriolic acid:
    instead say "You do not intend to snort the acid vapors."
 
The vinegar is a chem-flask. The substance is vinegar-subst. The short-description is "vinegar".
The description is "Common vinegar, albeit purified and concentrated to alchemical standards."
Understand "acid" as the vinegar.
Understand "vinegar" as the vinegar-subst.
 
Check smelling the vinegar:
    instead say "The vinegar smells bitingly acrid."
 
The lubanja is a chem-flask. The substance is lubanja-subst. The short-description is "lubanja".
Understand "java", "spirit", "essence", "benjoin", "benzoin" as lubanja.
Understand "java", "spirit", "essence", "benjoin", "benzoin", "lubanja" as lubanja-subst.
The description is "Lubanja, or Java spirit, is an essence distilled from the resin of certain Indonesian trees. It is an excellent solvent of substances which resist water."
 
Check smelling the lubanja:
    instead say "The lubanja smells faintly sweet."
 
The alum is a chem-flask. The substance is alum-subst. The short-description is "alum". The sprinkle-word is "sprinkle".
Understand "white", "astringent", "powder" as alum.
Understand "alum" as alum-subst.
The description is "Alum is a white, astringent powder."
 
The sand is a nonirritant chem-flask. The substance is sand-subst. The short-description is "sand". The sprinkle-word is "sprinkle".
Understand "white", "silicate", "coarse", "crystals" as sand.
The description is "This is a flask of coarse white silicate crystals -- which is to say, sand."
The lens-view is "the Earth".
 
Check eating the sand:
    instead say "Sand isn't nice to eat."
 
The sublime is a chem-vial. The substance is sublime-subst.The short-description is "sublime spirit".
The description is "Sublime spirit is the eighth distilled essence of mineral oil. It is a good solvent of substances which resist water."
Understand "spirit", "essence" as sublime.
 
Check smelling the sublime:
    instead say "The sublime spirit has sweet-acrid stink to it."
 
The percalcinate is a chem-vial. The substance is percalcinate-subst. The short-description is "copper percalcinate".
The description is "Copper percalcinate is a vivid green powder with golden highlights."
Understand "copper", "green", "green-gold", "powder" as percalcinate.
 
The bamuriatic acid is a chem-vial. The substance is bamuriatic-subst. The short-description is "bamuriatic acid".
The description is "Bamuriatic acid is powerful enough to dissolve stone and corrode glass. You've made only a tiny amount, and it's contained in wax-coated vial, but you're still wary of it."
 
Check smelling the bamuriatic acid:
    instead say "It would probably melt your nose off[first time]. You're fond of your nose[only]."
Check touching the bamuriatic acid:
    instead say "Not for all the orichalcum in New Wales."
Check putting the bamuriatic acid on the player:
    instead say "Not for all the orichalcum in New Wales."
Check eating the bamuriatic acid:
    instead say "Not for all the orichalcum in New Wales."
 
Check putting the bamuriatic on something glassy:
    [Bamuriatic is not topical, so we have to trigger topically-applying manually.]
    retire the noun by applying to the second noun;
    instead try topically-applying the noun to the second noun.
Check tapping the bamuriatic on something glassy:
    retire the noun by applying to the second noun;
    instead try topically-applying the noun to the second noun.
 
Report topically-applying the bamuriatic to something glassy:
    instead say "You dribble the powerful acid over [the second noun]. It etches frosty tracks into the surface, but does not penetrate."
 
The Gaian-precip is a chem-vial. The substance is gaian-subst. The short-description is "Gaian precipitate".
The description is "This vial contains a small quantity of Gaian precipitate -- an impalpable dust in a odd shade of purple-grey."
Understand "gaian", "gaiain", "gaiaian", "precipitate", "impalpable", "dust", "purple", "grey", "gray", "mauve" as the Gaian-precip.
The lens-view is "the depths of the Earth".
 
The counter-Gaian-precip is a chem-vial. The substance is counter-gaian-subst. The short-description is "counter-Gaian precipitate".
The description is "This vial contains a small quantity of counter-Gaian precipitate -- an impalpable dust of an improbable indigo-blue shade."
Understand "counter", "counter-gaian", "countergaian", "precipitate", "impalpable", "dust", "blue", "indigo" as the counter-Gaian-precip.
The lens-view is "the heights of the skies".
 
The anti-Tellurian-dist is a readable chem-vial. The substance is anti-tellurian-subst. The short-description is "anti-Tellurian distillate".
The description is "This vial contains a small quantity of anti-Tellurian distillate -- a thin fluid of an improbable indigo-blue shade."
Understand "anti", "anti-tellurian", "antitellurian", "distillate", "liquid", "fluid", "blue", "indigo" as the anti-Tellurian-dist.
The lens-view is "the heights of the skies".
 
The brun-oil is a chem-vial. The substance is brun-oil-subst. The short-description is "yang oil".
The description is "This vial contains a few drops of orange-tinted oil."
Understand "yang", "orange", "oil", "schepler", "schepler's", "scheplers" as the brun-oil.
 
Check shaking the brun-oil:
    instead say "The oil flows thickly in its vial, leaving an odd greenish sheen on the glass."
Check waving the brun-oil:
    instead try shaking the brun-oil.
 
The perfect-mud is a chem-vial. The substance is perfect-mud-subst. The short-description is "perfect mud".
The description is "This vial contains a bit of thick, richly-brown sediment."
Understand "perfect", "mud", "silt", "silky", "sediment", "brown", "jackson", "jackson-mud" as the perfect-mud.
 
Check shaking the perfect-mud:
    instead say "The mud oozes back and forth in its vial."
Check waving the perfect-mud:
    instead try shaking the perfect-mud.
 
Check touching the perfect-mud:
    instead try putting the perfect-mud on the player.
Check putting the perfect-mud on the player:
    instead say "The mud would be great for your skin, or so you hear, but you don't want to waste it."
 
The highlime is a readable chem-vial. The substance is highlime-subst. The short-description is "highlime".
The description is "This vial contains a small quantity of highlime, a bone-white, crystalline powder."
Understand "lime", "white", "bone", "bone-white", "crystalline", "powder" as the highlime.
 
The nickel-filings is a readable nonirritant chem-vial. The substance is nickel-subst. The short-description is "shaved nickel".
The description is "This vial contains pale-gold nickel, shaved into coarse filings."
The lens-view is "Ceres".
Understand "nickel", "coarse", "pale", "pale-gold", "pale gold", "filed", "filing", "filings", "shaved", "shaving", "shavings" as the nickel-filings.
 
The viridigris is a chem-vial. The substance is viridigris-subst. The short-description is "viridigris".
The description is "Viridigris is a dull turquoise powder, an oxide of orichalcum."
Understand "verdigris", "dull", "turquoise", "powder" as the viridigris.
 
 
A potion-vial is a kind of chem-vial. The substance of a potion-vial is usually potion-subst.
A potion-vial has some text called the base-description. The base-description of a potion-vial is usually "".
Understand "potion", "potion of", "bottle", "bottle of" as a potion-vial.
Understand "potions" as the plural of potion-vial.
Understand "bottles" as the plural of potion-vial.
Rule for printing the name of a potion-vial when not grouping together:
    say "potion of [short-description]";
 
Definition: a chem-vial is non-potiony if it is not a potion-vial.
 
Check tasting a potion-vial:
    instead say "You've made a full dose of the stuff, and you should drink it down as a single dose. No sipping."
Check eating a potion-vial:
    retire the noun by drinking;
    instead try ingesting the noun.
 
Check inserting a potion-vial into the player:
    instead say "It would be more dignified to just drink [the noun]."
 
To say generic potion ingestion of (T - potion-vial):
    if the atmosphere of the location is not water-atm:
        say "You swallow the[if base-description of T is non-empty] [base-description of T][end if] potion";
    else:
        say "You bring the vial to your lips, and manage to get the potion into your mouth without spilling much into the surrounding water";
 
The vacuum-protection is a potion-vial. The short-description is "vacuum protection". The base-description is "clear".
The description is "Drinking this clear potion will protect your flesh and blood from the ruinous effects of the airless void. The effect should last for some hours."
Understand "vacuum", "resistance", "protection", "clear", "liquid", "muldoon", "muldoon's" as the vacuum-protection.
 
Check ingesting the vacuum-protection:
    say generic potion ingestion of the noun;
    say ". The liquid feels waxy and thick in your mouth";
    say ". After a moment, your skin itches furiously, all over -- but only for a few seconds";
    now vacuum-potion-remaining is 1; [no timer]
    instead say "."
 
The breath-holding is a potion-vial. The short-description is "breath holding". The base-description is "clear".
The description is "Drinking this clear potion will allow you to hold your breath comfortably for several minutes."
Understand "breath", "holding", "clear", "liquid" as the breath-holding.
 
Check ingesting the breath-holding:
    say generic potion ingestion of the noun;
    say ". The liquid burns icily down your throat";
    if breath-potion-remaining is zero:
        if the atmosphere of the location is not water-atm:
            say ", and then settles as a cold heaviness in your lungs";
        else:
            say "; then the incipient urgency of breath in your lungs fades, replaced by a cold heaviness";
    else:
        say "; the heavy sensation in your lungs redoubles";
    now breath-potion-remaining is 20;
    instead say "."
 
The fire-resistance is a potion-vial. The short-description is "fire resistance". The base-description is "cloudy".
The description is "When drunk, this cloudy liquid should enable your flesh to resist even the most intense heat, albeit only for a few moments."
Understand "fire", "resistance", "protection", "cloudy", "liquid" as the fire-resistance.
 
Check ingesting the fire-resistance:
    say generic potion ingestion of the noun;
    if the fire-potion-remaining is greater than zero:
        say ". The chilly prickle in your hands is redoubled";
    else:
        say ". The liquid leaves your mouth feeling slightly numb. Within moments, you feel a prickle in your skin; your hands go cold and stiff, like a long walk on a chilly autumn day";
    now the fire-potion-remaining is ten;
    instead say "."
 
The aither-protection is a potion-vial. The short-description is "aither resistance". The base-description is "indigo".
The description is "This indigo liquid, when drunk, will support your body's life processes even in hostile aitheric environments."
Understand "aither", "ether", "foreign", "hostile", "indigo", "resistance", "aither-resistance", "protection", "liquid" as the aither-protection.
 
Check ingesting the aither-protection:
    say generic potion ingestion of the noun;
    if the atmosphere of the location is not vacuum-atm:
        say ". The liquid seems to turn to vapor as it hits the back of your throat";
    else:
        say ". The liquid seems to boil in the back of your throat";
    if alien aither nearby:
        say ". Your vision hazes blue, and the ache in your bones fades to a chilly numbness";
    else:
        say ". Your vision hazes blue, and you feel somewhat distant from your feet";
    now aither-potion-remaining is 1; [no timer]
    instead say "."
 
The clock-tincture is a topical potion-vial. The short-description is "clock tincture".
The description is "This is a dark tincture flecked with minute, gleaming particles of brass. When poured into a clockwork mechanism, it will bring it into alignment or proper working order."
Understand "clock", "clockwork", "tincture", "winfield", "winfield's" as the clock-tincture.
 
Rule for printing the name of the clock-tincture when not grouping together:
    say "bottle of [short-description]";
 
Check tasting the clock-tincture:
    instead try eating the clock-tincture.
Check eating the clock-tincture:
    instead say "Your insides are not clockwork, so the tincture would do them no good at all."
 
Check inserting the clock-tincture into the player:
    instead try eating the clock-tincture.
Check putting the clock-tincture on the player:
    instead say "Your outsides are not clockwork, so the tincture would do them no good at all."
 
Check unlocking a lockable door with the clock-tincture:
    instead try putting the clock-tincture on the noun.
 
Report topically-applying the clock-tincture to a lockable door:
    instead say "You tip the tincture into the keyhole of [the second noun]. But the lock must be too modern, or not brassy enough; the tincture has no effect."
 
Report topically-applying the clock-tincture to something:
    instead say "You carefully dribble the tincture over [the second noun]. It soaks in, leaving a slight brassy glitter, but there is no other effect."
 
 
The fungicide is a topical nonirritant potion-vial. The short-description is "fungicide".
The description is "This is a purple liquid, which appears to be fuming slightly in its bottle. It should be instant death to mold, lichen, and fungus."
Understand "purple", "liquid" as the fungicide.
 
Rule for printing the name of the fungicide when not grouping together:
    say "bottle of [short-description]";
 
Check smelling the fungicide:
    instead say "You crack open the bottle of fungicide. Yes, the purple fumes still smell awful."
 
Check tasting the fungicide:
    instead try eating the fungicide.
Check eating the fungicide:
    instead say "You are not a mushroom, but that doesn't mean this stuff is [em]good[/em] for you."
 
Check putting the fungicide on the player:
    retire the fungicide by applying to the player;
    instead try topically-applying the fungicide to the player.
 
Report topically-applying the fungicide to the player:
    instead say "You splatter the fungicide over yourself. It fumes away in a vile purple cloud, leaving an unpleasant itchy sensation. If you had ringworm, you suppose, that would have cured it."
 
Report topically-applying the fungicide to something:
    instead say "You carefully drip the fungicide over [the second noun]. It fumes away in a vile purple cloud, leaving no trace."
 
 
The coralicide is a topical potion-vial. The short-description is "coralicide".
The description is "This is a pink liquid, which appears to be fuming slightly in its bottle."
Understand "pink", "liquid" as the coralicide.
 
Rule for printing the name of the coralicide when not grouping together:
    say "bottle of [short-description]";
 
Check smelling the coralicide:
    instead say "You crack open the bottle of coralicide. The pink fumes are chokingly bitter."
 
Check tasting the coralicide:
    instead try eating the coralicide.
Check eating the coralicide:
    instead say "In theory, this stuff should be harmless to everything except alien yellow coral. In real life, only an idiot would drink it."
 
Report topically-applying the coralicide to something:
    instead say "You carefully drip the coralicide over [the second noun]. It fumes away in a bitter pink haze, leaving no trace."
 
 
The fire-sucker is a topical nonirritant potion-vial. The short-description is "fire devourer".
The description is "This is an opaque crimson liquid. When poured into a flame, it will consume and extinguish it instantly -- even the most enormous conflagration."
Understand "red", "crimson", "liquid", "opaque", "fire", "devour", "devourer", "fire-devourer" as the fire-sucker.
 
Rule for printing the name of the fire-sucker when not grouping together:
    say "bottle of [short-description]";
 
Check putting the fire-sucker on the player:
    instead try eating the fire-sucker.
Check tasting the fire-sucker:
    instead try eating the fire-sucker.
Check eating the fire-sucker:
    instead say "You are not on fire. Your flesh does contain a form of slow fire -- as does all life -- but it's probably not a good idea to test whether the potion will extinguish it."
 
Check igniting the fire-sucker with:
    retire the fire-sucker by applying to the second noun;
    instead try topically-applying the fire-sucker to the second noun.
 
Check putting the fire-sucker on the kiln:
    instead try inserting the fire-sucker into the kiln.
 
Report topically-applying the fire-sucker to the kiln-burner:
    instead say "You pour the crimson liquid under the kiln. The gas flames go dark with a [em]whoomph[/em] -- and then immediately rekindle, as the gas continues to flow. (Better than the alternative, really.)"
 
Report topically-applying the fire-sucker to the alight burner:
    instead say "You pour the crimson liquid into the gas burner. The flames go dark with a [em]pop[/em] -- and then immediately rekindle, as the gas continues to flow. (Better than the alternative, really.)"
 
Report topically-applying the fire-sucker to an alight wood-splint:
    say "You pour the crimson fire-devourer over [the second noun]";
    now the second noun is not alight;
    update fire consumption;
    instead say ". The flame winks out."
 
Report topically-applying the fire-sucker to el-fire:
    instead say "You pour the crimson fire-devourer over [the second noun]. The elemental fire chokes and sputters, but then rallies and boils the liquid away in a furious gout of steam."
 
Report topically-applying the fire-sucker to:
    instead say "You pour the crimson fire-devourer over [the second noun], to no apparent effect."
 
 
The polar-oil is a topical nonirritant potion-vial. The short-description is "polar oil".
The description is "This elongated vial contains an opaque black oily substance, which seems to quiver of its own accord. Something in the back of your mind tells you that it is polar, like a liquid magnet."
Understand "black", "oily", "oil", "polar", "opaque", "magnet", "magnetic", "elongated" as the polar-oil.
 
The lens-view is "some planet you don't recognize".
 
Rule for printing the name of the polar-oil when not grouping together:
    say "vial of [short-description]";
 
Check shaking the polar-oil:
    instead say "The black oil flows back and forth, rippling slightly, as if in unseen currents."
Check waving the polar-oil:
    instead try shaking the polar-oil.
 
Check tasting the polar-oil:
    instead try eating the polar-oil.
Check eating the polar-oil:
    instead say "Consuming alien reagents is probably stupid."
 
Check inspecting the polar-oil with the oculus:
    instead say "[The noun] has a distinct nature when viewed through the oculus. But that nature makes no sense to you; it's outside your frame of reference."
 
Report topically-applying the polar-oil to something:
    instead say "You carefully pour the polar oil over [the second noun]. It runs off, leaving no trace."
 
 
Stone-solvent is a kind of potion-vial. The short-description is "[mineral] solvent".
A stone-solvent is usually topical.
A stone-solvent has some text called the mineral.
The description is "This is an inky liquid which should corrode [mineral] -- no other mineral, just [mineral] -- like it was sugar in hot tea."
Understand "stone", "mineral", "solvent", "black", "inky", "liquid", "tucker", "tucker's" as a stone-solvent.
 
Rule for printing the name of a stone-solvent when not grouping together:
    say "bottle of [mineral] solvent";
 
To decide what thing is the solvent form of (obj - thing):
    let T be no-thing;
    if obj is:
        -- granite-pebble: now T is slate-solvent;
        -- sandstone-pebble: now T is malachite-solvent;
        -- basalt-pebble: now T is soapstone-solvent;
        -- flint-pebble: now T is chalk-solvent;
        -- baros-key: now T is chalk-solvent;
        -- marble-pebble: now T is obsidian-solvent;
        -- obsidian-pebble: now T is marble-solvent;
    if obj is a quartz-prism:
        now T is porphyry-solvent;
    decide on T.
 
To decide what text is the opposite mineral of (M - text):
    if M is:
        -- "marble": decide on "obsidian";
        -- "obsidian": decide on "marble";
        -- "chalk": decide on "flint";
        -- "slate": decide on "granite";
        -- "malachite": decide on "sandstone";
        -- "porphyry": decide on "quartz";
        -- "soapstone": decide on "basalt";
        -- otherwise: decide on "???"
 
Check tasting a stone-solvent:
    instead try eating the noun.
Check eating a stone-solvent:
    instead say "If it dissolves rocks, you're not drinking it. You've followed that rule for years."
 
Check smelling a stone-solvent:
    instead say "The solvent has a slight, sharp aroma."
 
Report topically-applying a stone-solvent to:
    say "You dribble the Tucker's Solvent over [the second noun]";
    say ". But [if the second noun is singular-named]that isn't[else]those aren't[end if] [mineral of the noun]";
    if the second noun is not mineralish:
        say ", or even mineral";
    instead say ", so the black liquid just drips off.";
 
The marble-solvent is a stone-solvent. The mineral is "marble".
Understand "marble" as the marble-solvent.
The obsidian-solvent is a stone-solvent. The mineral is "obsidian".
Understand "obsidian" as the obsidian-solvent.
The chalk-solvent is a stone-solvent. The mineral is "chalk".
Understand "chalk" as the chalk-solvent.
The slate-solvent is a stone-solvent. The mineral is "slate".
Understand "slate" as the slate-solvent.
The malachite-solvent is a stone-solvent. The mineral is "malachite".
Understand "malachite" as the malachite-solvent.
The porphyry-solvent is a stone-solvent. The mineral is "porphyry".
Understand "porphyry" as the porphyry-solvent.
The soapstone-solvent is a stone-solvent. The mineral is "soapstone".
Understand "soapstone" as the soapstone-solvent.
 
Report topically-applying the marble-solvent to the marble-pebble:
    retire the marble-pebble by dissolution in marble-solvent;
    instead say "You pour the Tucker's Solvent out over the chip of marble. The marble dissolves away, neatly and completely."
 
Report topically-applying the obsidian-solvent to the obsidian-pebble:
    retire the obsidian-pebble by dissolution in obsidian-solvent;
    instead say "You pour the Tucker's Solvent out over the chip of obsidian. The obsidian dissolves away, neatly and completely."
 
 
Section - Stinks and Impets
 
An odor is a kind of value.
The odors are no-odor, many-odor, ginger, peppermint, citronelle, kelp, eucalyptus.
Understand "citron" as citronelle. Understand "mint", "pepper" as peppermint. Understand "eucalypt" as eucalyptus. Understand "seaweed" as kelp.
 
To say long description of (O - odor):
    if O is:
        -- no-odor:
            say "no scent";
        -- many-odor:
            say "a blurry combination of scents";
        -- ginger:
            say "a tinglingly sharp ginger scent";
        -- peppermint:
            say "an icily eye-watering peppermint scent";
        -- citronelle:
            say "a cloying citronelle scent";
        -- eucalyptus:
            say "a bitter, soapy eucalyptus scent";
        -- kelp:
            say "the heavy, sea-wrack scent of kelp";
 
An impet is a kind of takeable-thing.
An impet can be open or closed. An impet is usually closed.
An impet has an odor.
The printed name of an impet is "impet of [odor] oil".
Understand "impet", "impet of", "aromatic", "essential", "oil" as an impet.
Understand "impets" as the plural of impet.
Understand "open", "opened" as an impet when the item described is open.
Understand "closed" as an impet when the item described is closed.
Understand the odor property as describing an impet.
 
For printing room description details of an open impet:
    say " (open)".
For printing inventory details of an open impet:
    say " (open)".
 
Rule for printing the name of an impet (called item) while grouping together:
    say odor of item.
 
Rule for initially listing contents:
    initially group impets together.
Before grouping together impets:
    say "[listing group size in words cap cap-class-group] impets of essential oil (".
After grouping together impets:
    say ")".
 
Check examining an impet (called T):
    tutor tut-examine-impet with T;
    say "It's a standard Navy alchemical aromatic impet";
    if T is closed:
        instead say ", designed to fill a lab with odor without spilling essential oils all over the place. The [odor of T] impet is closed.";
    say ". The impet is open";
    if the atmosphere of the location is fire-atm:
        instead say ", although you can't smell anything amid the smoke.";
    if the atmosphere of the location is water-atm:
        instead say ". Fortunately, the opening is small enough that water isn't ruining the contents.";
    if the atmosphere of the location is normal-atm:
        instead say ", suffusing the air with [long description of odor of T].";
    instead say "."
 
Check searching an impet:
    instead try examining the noun.
 
Check reading an impet:
    instead say "[The noun] is correctly labelled."
 
Check igniting an impet with:
    instead say "The essential oils are for smelling, not burning."
 
Check inserting something into an impet:
    instead say "An aromatic impet has only a tiny opening. The contents aren't supposed to leave or enter, just smell up the place."
 
Check waving an open impet when the location is not aroma-proof:
    instead say "You waft the scent of [odor of noun] around the room."
 
Check shaking an open impet:
    instead say "The impet is supposed to be spill-proof, but you'd rather not test that while it's open."
 
Check smelling a closed impet:
    instead say "The impet has no residual odor while it's sealed."
 
Check smelling an impet:
    let O be the odor of the noun;
    say "You take a snort from the impet";
    if O is:
        -- ginger: say ". Ginger fire flares in your sinuses[first time]. That'll clear your head, possibly for the rest of the week[only]";
        -- peppermint: say ". The intense peppermint aroma makes your head hurt";
        -- citronelle: say ". It's like inhaling lemon liqueur";
        -- kelp: say ". The aroma of the sea crashes over you";
        -- eucalyptus: say ". A reek of herbal soap overwhelms you";
    instead say "."
 
Check opening an impet:
    let O be the odor of the noun;
    if the noun is open:
        instead say "The [O] impet is already open.";
    let orig-odor be the aroma of the location;
    now the noun is open;
    tutor tut-open-impet with the noun;
    tutor tut-step-impet with the noun; [phase 2 only]
    if the location is aroma-proof:
        instead say "You pop open the [O] impet.";
    say "You pop open the impet, and the [O] aroma rolls out";
    if O is:
        -- ginger: say ", stinging your nose";
        -- peppermint: say ", making your nose ache";
        -- citronelle: say ", cloying-sweet";
        -- kelp: say ", salty and faintly rotten";
        -- eucalyptus: say ", soapy and bitter";
    if orig-odor is not no-odor and orig-odor is not O:
        if orig-odor is many-odor:
            say ".[para]The aroma of the room grows more muddled";
        else:
            say ".[para]The new aroma clashes unpleasantly with the [orig-odor]";
    instead say "."
 
Check closing an impet:
    let O be the odor of the noun;
    if the noun is closed:
        instead say "The [O] impet is already closed.";
    let orig-odor be the aroma of the location;
    now the noun is closed;
    if the location is aroma-proof:
        instead say "You snap the [O] impet closed.";
    let new-odor be the aroma of the location;
    say "You snap the [O] impet closed. Its aroma fades";
    if orig-odor is many-odor and new-odor is not no-odor:
        if new-odor is many-odor:
            say ".[para]The mix of aromas clarifies a little";
        else:
            say ".[para]The mix of aromas clarifies, leaving the room smelling of [new-odor]";
    instead say "."
 
Check inspecting an impet with the oculus:
    let O be the odor of the noun;
    [parallel to the env-influence effect]
    let E be no-env;
    if O is:
        -- ginger: now E is fiery-env;
        -- peppermint: now E is arctic-env;
        -- kelp: now E is exhilarant-env;
    if E is not no-env:
        instead say "When viewed through the oculus, [the noun] displays [a E] nature."
 
The ginger-impet is an impet. The odor of the ginger-impet is ginger.
The peppermint-impet is an impet. The odor of the peppermint-impet is peppermint.
The citronelle-impet is an impet. The odor of the citronelle-impet is citronelle.
The kelp-impet is an impet. The odor of the kelp-impet is kelp.
The eucalyptus-impet is an impet. The odor of the eucalyptus-impet is eucalyptus.
 
A room has text called the aroma-description. The aroma-description of a room is usually "".
 
To decide what odor is the aroma of (R - room):
    if R is aroma-proof:
        decide on no-odor;
    let O be no-odor;
    repeat with T running through impets:
        if T is open and T is enclosed by R:
            if O is not no-odor:
                decide on many-odor;
            now O is the odor of T;
    decide on O.
 
The desc-aroma is an odor that varies.
 
To say clear-desc-aroma:
    now desc-aroma is no-odor.
 
To say aroma-addendum:
    if desc-aroma is not no-odor:
        say ", overlaid with a strong aroma of [desc-aroma]";
        now desc-aroma is no-odor.
 
Check smelling when the atmosphere of the location is fire-atm:
    instead say "You can smell nothing but smoke."
 
Check smelling when the location is aroma-proof:
    instead say "You can't smell anything right now."
 
Check smelling a room (called R):
    let O be the aroma of R;
    if O is many-odor:
        instead say "The air is a jarring mix of aromas.";
    let T be the aroma-description of R;
    if T is "":
        if O is no-odor:
            instead say "You smell nothing unusual.";
        else:
            instead say "The air is filled with the aroma of [O].";
    else:
        now desc-aroma is O;
        say T;
        if desc-aroma is not no-odor:
            say ". The air is overlaid with a strong aroma of [desc-aroma]";
            now desc-aroma is no-odor;
        instead say "."
 
Check blowing on when the location is airless:
    instead say "There's no air to blow."
 
Section - Constructed Tools
 
The torch-lighter is a takeable-thing.
The flame-point is 12.
[Secretly this is always alight, unless you soak it.]
The description is "[if alight]You've lit things with lighters all your life; nothing unusual here. It's a ceramic oval the length of your little finger. When you squeeze it, a little flame shoots out of the end[else if the atmosphere of the location is water-atm]It's a ceramic oval the length of your little finger. It doesn't work underwater, though[else]It's a ceramic oval the length of your little finger. It doesn't seem to work now, though[end if]."
Understand "torch", "lighter", "ceramic", "oval" as the torch-lighter.
Understand "fire", "flame", "flaming", "burning" as the torch-lighter when the torch-lighter is alight and the action-to-be is not notional.
 
Check squeezing the torch-lighter:
    if the torch-lighter is not alight:
        instead say "The lighter doesn't work. It must have been ruined when you soaked it.";
    instead say "You squeeze the lighter. As expected, it emits a small yellow-orange flame."
 
Check switching on the torch-lighter:
    instead try squeezing the torch-lighter.
 
Check switching off the torch-lighter:
    if the torch-lighter is not alight:
        instead say "The lighter doesn't work at all now.";
    instead say "The lighter only lights when you need it."
 
Check pushing the torch-lighter:
    instead try squeezing the torch-lighter.
 
Check smelling the torch-lighter:
    instead say "You smell a faint whiff of the fourth distilled essence of mineral oil."
 
Check shaking the not alight torch-lighter when the atmosphere of the location is normal-atm:
    now the torch-lighter is alight;
    instead say "You shake the lighter vigorously; a few drops of water fly out. Then you give it a squeeze, and it lights up the way it's supposed to. Good job."
 
Check repairing the not alight torch-lighter:
    instead try shaking the torch-lighter.
 
Check igniting the not alight torch-lighter with something:
    instead say "You can't fix the lighter by setting it on fire."
 
Check extinguishing the torch-lighter:
    instead try switching off the torch-lighter.
 
Check inserting the torch-lighter into a ritual-bound:
    instead say "[The noun] is a tool, not an ingredient."
 
The scalpel is a metallic inscribable. The printed name is "[if clean]clean[else]crusty[end if] scalpel".
The description is "[if dirty]It's a discarded alloy scalpel, never cleaned after whatever no-doubt-revolting dissection last employed it. Unnamable substances are crusted on the blade[else]It's an alloy scalpel, polished clean if not exactly sharp[end if][if scalpel is inscribed]. A tiny symbol shines from the blade: the alchemical sign for [symbol-type][end if]."
The scalpel can be clean or dirty. The scalpel is dirty. [resettable]
The descriptor-type of the scalpel is spiritual-descriptor.
Understand "alloy", "blade", "knife", "metal" as the scalpel.
Understand "clean", "polished" as the scalpel when the scalpel is clean.
Understand "crusty", "crusted", "dirty", "filthy", "gunk", "guck" as the scalpel when the scalpel is dirty.
 
Check touching the uninscribed scalpel:
    instead say "It's middling sharp. Not the sharpest scalpel in the cupboard (as your father used to say of you, thank you for remembering that)."
 
Check tasting the scalpel:
    if the scalpel is dirty:
        instead say "Bleah, no thank you.";
    else:
        instead say "Licking a scalpel blade is an apprentice's trick. (You turn it around, see, as you put it in your mouth, so you lick the back of the blade. Then everyone who doesn't know the trick screams. Then you turn fifteen.)"
 
Check rubbing the dirty scalpel:
    instead say "[one of]You scrub at the scalpel. Whatever's on there is stuck on there pretty tight[or]You continue scrubbing the scalpel blade, but you just get guck under your fingernails[or]This isn't getting the scalpel any cleaner[stopping]."
 
Check freeing the dirty scalpel:
    instead try rubbing the scalpel.
 
Check tapping something on the dirty scalpel:
    instead say "That won't get the gunk off."
Check tapping the dirty scalpel on something:
    instead say "That won't get the gunk off."
 
Check putting a chem-flask on the dirty scalpel:
    let M be the substance of the noun;
    instead say "You [if M is powdery]dust[else]sprinkle[end if] some [M] on the scalpel. It doesn't seem to loosen the crusted gunk at all."
 
Check repairing the dirty scalpel:
    instead say "The question is, how."
 
Check waving the clean scalpel when the symbol-type of the scalpel is prophylaxis-symbol:
    if the location is the location of the miasma-gong and the ring-time of the miasma-gong is not zero:
        if the miasma-gong is charged:
            instead say "You wave the scalpel again, evoking another roil of pressure in the room.";
        now the miasma-gong is charged;
        increment the ring-time of the miasma-gong;
        instead say "You wave the scalpel.[para]The air [em]ripples[/em] -- the gong's resonance beats like sea-waves in your ears as the motion of the scalpel roils around you. The cloud of malice shivers, shrinks, and fades, leaving only a trace of impotent hatred in the air.";
    if near-aura-cloud:
        instead say "You wave the scalpel around. The aura cloud doesn't seem to be perturbed at all.";
    instead say "You wave the scalpel around."
 
Check shaking the clean scalpel when the symbol-type of the scalpel is prophylaxis-symbol:
    instead try waving the scalpel.
 
The dispersal-brush is a takeable-thing. The printed name is "dispersal brush".
Understand "dispersal", "brush", "white", "feather", "quill" as the dispersal-brush.
The description is "The brush is a white feather with an icy sheen."
 
Check rubbing the dispersal-brush:
    instead say "Perhaps you want to brush something [em]with[/em] the dispersal brush."
 
Check touching the dispersal-brush:
    instead say "Perhaps you want to touch something [em]with[/em] the dispersal brush."
 
Check tapping the dispersal-brush on the player:
    instead say "You brush the feather across the back of your hand. It emits a peculiar crackle. You yank it away. A human being [em]shouldn't[/em] be erasable, but you've seen enough alchemical laws broken today..."
 
Check inspecting the dispersal-brush with the oculus:
    instead say "When viewed through the oculus, [the dispersal-brush] displays an alignment with renewal and cleansing."
 
The oculus is a glassy takeable-thing. The printed name is "resonant oculus".
The oculus can be ever-self-examined. [not resettable]
Understand "working", "resonant", "pearly", "sheen", "glass", "loop", "ring", "circle", "thread", "o-lens" as the oculus.
The description is "[tutor tut-monocle-action with the oculus]The oculus is a circular thread of glass, about an inch across, with a pearly sheen."
 
Check squeezing the oculus:
    instead try smashing the oculus.
 
Check wearing the oculus:
    instead say "Wearing the thing like a monocle might be useful, but more likely you'd walk into a wall. Anyway, there's no way to do it."
 
Check searching the oculus:
    [The customized rule about local-memspark is in hadean.ni.]
    mark the location as spark-checked;
    instead say "[tutor tut-monocle-action with the oculus]You peer through the oculus. Everything acquires a colorful, hazy fringe of symbolic association."
 
Check inspecting the player with the oculus:
    instead say "You peer through the oculus at your hand. Your aura is a recurving, symmetrical mesh of fire, water, earth, and air. Lovely -- but perplexing. You know from your lectures that human bodies are indeed a balanced meld of the elements -- in the Greek model, at least. But this pattern is far more intricate than old Lieutenant Shoftig's diagrams[examine-self-gloss oculus]".
 
Check inspecting something inscribed with the oculus (this is the inscribed-symbol oculus viewing rule):
    instead say "The oculus magnifies the [symbol-type of the noun] symbol, but [the noun] is otherwise unchanged."
 
Check inspecting something with the oculus (this is the default oc-view oculus viewing rule):
    let E be the isolated ritual influence of the noun;
    if E is not no-env and E is not bad-env:
        instead say "When viewed through the oculus, [the noun] [if the noun is singular-named]displays[else]display[end if] [a E] nature.";
    instead say "[if the noun is singular-named][The noun] acquires a colorful fringe when viewed through the oculus, but its[else][The noun] acquire a colorful fringe, when viewed through the oculus, but their[end if] symbolic associations are not strong enough to visualize clearly."
 
The planetary-lens is a glassy takeable-thing. The printed name is "planetary lens".
The planetary-lens can be ever-self-examined. [not resettable]
Understand "glass", "lens", "opalescent", "opal", "planetary", "association", "p-lens" as the planetary-lens.
The description is "[tutor tut-monocle-action with the planetary-lens]A lens of opalescent glass, about an inch and a half wide."
 
Check wearing the planetary-lens:
    instead say "Wearing the thing like a monocle might be useful, but more likely you'd walk into a wall. Anyway, there's no way to do it."
 
Check searching the planetary-lens:
    instead say "[tutor tut-monocle-action with the planetary-lens]You peer through the planetary association lens. The world is misted with a haze of celestial symbolism."
 
Check inspecting the planetary-lens with the oculus:
    instead say "When viewed through the oculus, the planetary lens shines with insight."
 
Check inspecting the player with the planetary-lens:
    instead say "You peer at your hand through the lens. Okay, that's not what you looked like the last time you played with this sort of lens. The human body is Gaian, or it should be -- you don't recognize [em]these[/em] associations at all[examine-self-gloss planetary-lens]".
 
Check inspecting something with the planetary-lens (this is the default lens-view lens viewing rule):
    if the noun provides lens-view and the lens-view of the noun is not "":
        instead say "You peer at [the noun] through the lens, and perceive an association with [the lens-view of the noun].";
    instead say "When viewed through the lens, [if the noun is singular-named][the noun] is surrounded by faint planetary echoes, but[else][the noun] are surrounded by faint planetary echoes, but[end if] the associations are not strong enough to visualize clearly."
 
To say examine-self-gloss (T - thing):
    let T2 be the player;
    let name be a text;
    if T is the oculus:
        let name be "oculus";
        now T2 is the planetary-lens;
    else if T is the planetary-lens:
        let name be "lens";
        now T2 is the oculus;
    else:
        say ". (BUG) examine-self-gloss [T].";
        stop;
    if T is ever-self-examined and T2 is ever-self-examined:
        say ".";
        stop;
    if T is ever-self-examined:
        say ". Something about the crash must have affected the [name]'s vision.";
        stop;
    now T is ever-self-examined;
    if T2 is not ever-self-examined:
        say ". Something about the crash must have affected the [name]'s vision. (Or... yourself. You hope not.)";
    else:
        say ". Something about the crash must have affected the [name]'s vision. (Just like [the T2]? Maybe it [em]is[/em] you, after all.)"
 
The purity-lodestone is a metallic takeable-thing. The printed name is "lodestone of purity".
The purity-lodestone can be ever-tried. [resettable]
Understand "lodestone", "lodestone of", "pendulum", "purity", "knot" as the purity-lodestone.
Understand "length", "length of", "fine", "silver", "chain" as the purity-lodestone.
Understand "lavelle", "lavelle's" as the purity-lodestone.
The description is "The lodestone of purity is a length of silver chain with a tiny knot at one end. When swinging, it will be attracted to the presence of pure elemental substances."
The lens-view is "moonlight".
 
Check opening the purity-lodestone when the player does not carry the noun:
    if interrupted carrying out the implicitly taking activity with the noun:
        stop the action;
    issue miscellaneous library message number 26 for the noun;
    silently try the actor taking the noun;
    if the actor is not carrying the noun, stop the action.
 
Check opening the purity-lodestone:
    retire the purity-lodestone by transformation into the silver-chain;
    now the player carries the silver-chain;
    set pronouns from the silver-chain;
    instead say "You undo the knot in the silver chain, and allow the elemental binding to dissipate."
 
Check freeing the purity-lodestone:
    instead try opening the purity-lodestone.
 
Check waving the purity-lodestone:
    if the purity-lodestone is not ever-tried:
        say "You hold the chain by one end, and set the knot";
        now the purity-lodestone is ever-tried;
    else:
        say "You set the silver chain";
    unless an elemental takeable-thing (called T) is enclosed by the location:
        instead say " swinging gently back and forth. The arc rotates slowly, without direction.";
    let N be the number of elemental takeable-things enclosed by the location;
    if N is greater than 1:
        instead say " swinging. But it seems to be tugged in [N in words] different directions, and winds up pointing nowhere.";
    if T is el-earth and el-earth is part of something:
        instead uncover the el-earth; [defined in the game code]
    instead say " swinging. The arc angles sharply towards [the T]."
 
Check shaking the purity-lodestone:
    instead try waving the purity-lodestone.
Check pushing the purity-lodestone:
    instead try waving the purity-lodestone.
Check pulling the purity-lodestone:
    instead try waving the purity-lodestone.
 
Check inspecting the purity-lodestone with the oculus:
    instead say "When viewed through the oculus, [the purity-lodestone] displays a clear alignment with pure elements."
 
The centrality-lodestone is a takeable-thing. The printed name is "lodestone of centrality".
The centrality-lodestone can be ever-tried. [resettable]
Understand "lodestone", "lodestone of", "pendulum", "centrality", "misuba", "misuba's" as the centrality-lodestone.
Understand "earth", "white", "stone" as the centrality-lodestone.
Understand "length", "length of", "raw", "silk", "cord" as the centrality-lodestone.
The description is "The lodestone of centrality is a length of silk cord with a white stone fastened to one end. When swinging, it will align itself with the path to the center of a labyrinth."
 
Check waving the centrality-lodestone:
    if the centrality-lodestone is not ever-tried:
        say "You hold the silk cord by one end, and set the stone";
        now the centrality-lodestone is ever-tried;
    else:
        say "You set the silk cord";
    instead say " swinging gently back and forth. The arc rotates slowly, without direction."
 
Check shaking the centrality-lodestone:
    instead try waving the centrality-lodestone.
Check pushing the centrality-lodestone:
    instead try waving the centrality-lodestone.
Check pulling the centrality-lodestone:
    instead try waving the centrality-lodestone.
 
Check inspecting the centrality-lodestone with the oculus:
    instead say "When viewed through the oculus, [the centrality-lodestone] displays a clear alignment with the hearts of things."
 
 
Section - Molds and Seals
 
A seal-file is a kind of value.
The seal-files are no-file, medical-file, alchemy-file, aithery-file, venture-file.
 
Understand "unranked" as no-file.
Understand "medic", "medical" as medical-file.
Understand "alchemic", "alchemical", "alchemy" as alchemy-file.
Understand "aithery" as aithery-file. [Not "aither", as that conflicts with the potion.]
Understand "venture" as venture-file.
 
To say (F - seal-file):
    if F is:
        -- no-file: say "unranked";
        -- medical-file: say "Medical";
        -- alchemy-file: say "Alchemy";
        -- aithery-file: say "Aithery";
        -- venture-file: say "Venture";
        -- otherwise: say "(BUG) unknown"
 
To say symbol-assoc of (F - seal-file):
    if F is:
        -- medical-file: say "the care of the crew";
        -- alchemy-file: say "the subtleties of ritual";
        -- aithery-file: say "guidance through the Higher Spheres";
        -- venture-file: say "exploration of unknown lands";
        -- otherwise: say "(BUG) unknown"
 
To decide whether (T1 - metal-seal) matches (T2 - clay-mold):
    if the file of T1 is the file of T2:
        decide yes.
 
A seal-metal is a kind of value.
The seal-metals are no-smetal, lead-smetal, gold-amalgam-smetal, red-amalgam-smetal, white-amalgam-smetal, rutilum-smetal.
 
Definition: a seal-metal is mercury-containing if it is gold-amalgam-smetal or it is red-amalgam-smetal or it is white-amalgam-smetal.
 
To say (M - seal-metal):
    if M is:
        -- lead-smetal: say "lead";
        -- gold-amalgam-smetal: say "amalgam";
        -- red-amalgam-smetal: say "red amalgam";
        -- white-amalgam-smetal: say "white amalgam";
        -- rutilum-smetal: say "rutilum";
        -- otherwise: say "(BUG) unknown"
 
A clay-mold is a kind of takeable-supporter.
A clay-mold has a seal-file called the file.
The printed name of a clay-mold is usually "[file] File clay mold".
A clay-mold is always portable.
A clay-mold is usually mineralish.
Understand "clay", "mold", "mould", "file", "disc", "disk", "reverse", "impression", "small" as a clay-mold.
Understand "molds", "moulds" as the plural of clay-mold.
Understand the file property as describing a clay-mold.
 
The lens-view of a clay-mold is usually "the [Retort] itself".
 
Rule for initially listing contents:
    initially group clay-molds together.
Before grouping together clay-molds:
    say "[listing group size in words cap cap-class-group] clay molds (for ".
After grouping together clay-molds:
    say " Files)".
Rule for printing the name of a clay-mold when grouping together:
    say "[file]";
 
Rule for writing a paragraph about a non-empty clay-mold (called T):
    say "The [file of T] File clay mold lies here, with [a list of things *in T] resting on it."
 
Check examining a clay-mold:
    say "A thumb-sized clay disk with a reverse impression of a Marcher [file] File badge";
    let N be the number of things on the noun;
    if N is one:
        let T be the first thing held by the noun;
        if T is a low-melting-seal metal-seal and T matches the noun:
            instead say ". The mold is filled with [smetal of T].";
        say ". [A T] rests on the mold";
    if N is greater than one:
        say ". Resting on the mold are [a list of things *in the noun]";
    instead say "."
 
Report taking a clay-mold:
    instead say "You pick up [the noun]."
 
Check inserting something into a clay-mold:
    instead try putting the noun on the second noun.
 
Check putting the fungicide on a clay-mold:
    instead say "You're thinking of the other definition of mold."
 
Check putting something on a clay-mold when a metal-seal (called T) is on the second noun and T matches the second noun:
    instead say "[The second noun] is full of [smetal of T], so putting anything else on it is awkward."
 
Check putting something on a clay-mold when the player carries the second noun:
    if the noun is a metal-rod-or-wire and the location is the location of the kiln:
        instead say "That's an awkward balancing act. It will be easier if you put the clay mold in the kiln, and then add the [short-description of the noun].";
    instead say "That's an awkward balancing act. Put the mold down first."
 
Report putting a metal-wire on a clay-mold:
    if the noun is low-melting-wire:
        instead say "You try to push [the noun] into [the second noun]. While [short-description of noun] is soft, it's not [em]that[/em] soft. You just wind up with a coil of wire sitting on the mold.";
    instead say "You coil up [the noun] on top of [the second noun]."
 
Report putting a metal-seal on a clay-mold when the noun matches the second noun:
    instead say "You fit [the noun] back into its impression in [the second noun]."
 
Check inspecting a clay-mold with the oculus:
    let F be the file of the noun;
    instead say "Through the oculus, you perceive the symbolism of the [F] File: [symbol-assoc of F]."
 
Rule for implicitly taking a clay-mold when something is on the noun:
    instead say "It's awkward to pick up the mold while anything is on it."
 
The medical-mold is a clay-mold. The file is medical-file.
The alchemy-mold is a clay-mold. The file is alchemy-file.
The aithery-mold is a clay-mold. The file is aithery-file.
The venture-mold is a clay-mold. The file is venture-file.
 
A metal-seal is a kind of takeable-thing.
A metal-seal has a seal-file called the file.
A metal-seal has a seal-metal called the smetal.
The printed name of a metal-seal is usually "[smetal] [file] File seal".
A metal-seal is usually metallic.
Understand "seal", "badge", "insignia", "file" as a metal-seal.
Understand "seals", "badges" as the plural of metal-seal.
Understand the file property as describing a metal-seal.
[The smetal is not parsed as a property -- too many synonyms. Handled below.]
 
Rule for initially listing contents:
    initially group metal-seals together.
Before grouping together metal-seals:
    say "[listing group size in words cap cap-class-group] seals (".
After grouping together metal-seals:
    say ")".
Rule for printing the name of a metal-seals when grouping together:
    say "[smetal] [file]";
 
The description of a metal-seal is usually "This seal is cast of [smetal] and imprinted with the [file] File insignia."
[### special case when it's inside the matching mold. (Maybe also melted.)]
 
The lens-view of a metal-seal is usually "the [Retort] itself".
 
Check taking a low-melting-seal metal-seal when the noun is on a clay-mold (called T) and T is in the kiln:
    instead try taking T.
 
Check inspecting a metal-seal with the oculus:
    let F be the file of the noun;
    let E be the isolated ritual influence of the noun;
    if E is not no-env and E is not bad-env:
        instead say "[The noun] displays [a E] nature, overlaid with the symbolism of the [F] File: [symbol-assoc of F].";
    instead say "Through the oculus, you perceive the symbolism of the [F] File: [symbol-assoc of F]."
 
Understand "lead", "dull", "grey", "gray" as a metal-seal when the smetal of the item described is lead-smetal.
 
Understand "silvery", "gold" as a metal-seal when the smetal of the item described is gold-amalgam-smetal.
 
Understand "white", "bright" as a metal-seal when the smetal of the item described is white-amalgam-smetal.
Understand "lead" as a metal-seal when the smetal of the item described is white-amalgam-smetal and the action-to-be is not notional.
 
Understand "red", "bright" as a metal-seal when the smetal of the item described is red-amalgam-smetal.
Understand "orichalcum" as a metal-seal when the smetal of the item described is red-amalgam-smetal and the action-to-be is not notional.
 
Understand "amalgam", "alloy" as a metal-seal when the smetal of the item described is mercury-containing.
Understand "mercury" as a metal-seal when the smetal of the item described is mercury-containing and the action-to-be is not notional.
 
The med-lead-seal is a metal-seal. The smetal is lead-smetal. The file is medical-file.
The alc-lead-seal is a metal-seal. The smetal is lead-smetal. The file is alchemy-file.
The aith-lead-seal is a metal-seal. The smetal is lead-smetal. The file is aithery-file.
The vent-lead-seal is a metal-seal. The smetal is lead-smetal. The file is venture-file.
The med-gold-seal is a metal-seal. The smetal is gold-amalgam-smetal. The file is medical-file.
The alc-gold-seal is a metal-seal. The smetal is gold-amalgam-smetal. The file is alchemy-file.
The aith-gold-seal is a metal-seal. The smetal is gold-amalgam-smetal. The file is aithery-file.
The vent-gold-seal is a metal-seal. The smetal is gold-amalgam-smetal. The file is venture-file.
The med-whit-seal is a metal-seal. The smetal is white-amalgam-smetal. The file is medical-file.
The alc-whit-seal is a metal-seal. The smetal is white-amalgam-smetal. The file is alchemy-file.
The aith-whit-seal is a metal-seal. The smetal is white-amalgam-smetal. The file is aithery-file.
The vent-whit-seal is a metal-seal. The smetal is white-amalgam-smetal. The file is venture-file.
The med-red-seal is a metal-seal. The smetal is red-amalgam-smetal. The file is medical-file.
The alc-red-seal is a metal-seal. The smetal is red-amalgam-smetal. The file is alchemy-file.
The aith-red-seal is a metal-seal. The smetal is red-amalgam-smetal. The file is aithery-file.
The vent-red-seal is a metal-seal. The smetal is red-amalgam-smetal. The file is venture-file.
 
The rutilum-seal is a metal-seal. The smetal is rutilum-smetal. The file is alchemy-file.
Understand "rutilum", "silvery", "bright", "silvery-bright" as the rutilum-seal.
 
The description of the rutilum-seal is "This is a seal of silvery-bright rutilum, cast with the insignia of the Alchemy File. High-ranking Alchemy officers carry such badges. Someday you will be granted one... but right now, this one will be awfully handy."
 
Definition: a metal-seal is low-melting-seal if it is not the rutilum-seal.
 
 
To decide what seal-metal is the seal-metal associated with (T - thing):
    if T is a metal-seal:
        decide on the smetal of T;
    if T is:
        -- lead-rod: decide on lead-smetal;
        -- lead-wire: decide on lead-smetal;
        -- gold-amalgam: decide on gold-amalgam-smetal;
        -- gold-amalgam-wire: decide on gold-amalgam-smetal;
        -- white-amalgam: decide on white-amalgam-smetal;
        -- white-amalgam-wire: decide on white-amalgam-smetal;
        -- red-amalgam: decide on red-amalgam-smetal;
        -- otherwise: decide on no-smetal.
 
To decide what thing is the seal form of (M - seal-metal) with (F - seal-file):
    if M is no-smetal:
        decide on no-thing;
    if F is no-file:
        decide on no-thing;
    repeat with T running through metal-seals:
        if the smetal of T is M and the file of T is F:
            decide on T;
    decide on no-thing.
 
Check tapping mercury on a metal-seal when the smetal of the second noun is lead-smetal:
    let F be the file of the second noun;
    let T be the seal form of white-amalgam-smetal with F;
    if T is no-thing:
        instead say "(BUG) No white seal matches [the second noun]";
    retire the second noun by transformation into T;
    retire the mercury by transformation into T;
    now the player carries T;
    set pronouns from T;
    instead say "Tilting the saucer, you dip the lead seal into the mercury. The mercury coats the metal, forming a white amalgam. The seal's irregular shape is awkward, but eventually all the mercury is absorbed and the [F] File seal is entirely white."
 
Check tapping a pebble on a metal-seal when the smetal of the second noun is lead-smetal and the symbol-type of the noun is ponderosity-symbol:
    uninscribe the noun;
    instead say "You carefully lay the [ponderosity-symbol] symbol against [the second noun]. It discharges, but the symbol does not transfer to the seal. The seal's design probably excludes alchemical alterations of meaning.";
Check tapping a pebble on a metal-seal when the smetal of the second noun is lead-smetal and the symbol-type of the noun is gossamerity-symbol:
    uninscribe the noun;
    instead say "You carefully lay the [gossamerity-symbol] symbol against [the second noun]. It discharges, but the symbol does not transfer to the seal. The seal's design probably excludes alchemical alterations of meaning.";
 
 
Section - Supply Objects
 
The mustard-supply is a scenery thing. The printed name is "supply of mustard seed".
The description is "A small bin of mustard seeds rests on the shelf."
The mustard-supply can be ever-used. [resettable]
Understand "mustard", "small", "supply", "supply of", "bin", "bin of", "from" as the mustard-supply.
Understand "seed", "seeds" as the mustard-supply when the mustard is off-stage.
 
Check taking the mustard-supply when the mustard is off-stage:
    now the player carries the mustard;
    set pronouns from the mustard;
    instead say "You take [if the mustard-supply is not ever-used]a[now-ever-used mustard-supply][else]another[end if] pinch of mustard seed from the bin."
 
Check taking the mustard-supply:
    say "You've already taken some mustard seed.";
    if player does not carry the mustard:
        instead try recalling the mustard;
    stop the action.
 
Check emptying the mustard-supply:
    instead try taking the mustard-supply.
 
Check inspecting the mustard-supply with the oculus:
    instead say "When viewed through the oculus, [the noun] displays a fiery nature."
 
The cedar-supply is a scenery thing. The printed name is "supply of cedar".
The description is "A small jar of cedar splinters rests on the table. Cedar burns well, so these are handy for setting things on fire."
The cedar-supply can be ever-used. [resettable]
Understand "cedar", "supply", "supply of", "jar", "jar of", "from" as the cedar-supply.
Understand "splinter", "splinters", "splint", "splints" as the cedar-supply when the cedar is off-stage.
 
Check taking the cedar-supply when the cedar is off-stage:
    now the cedar is not alight;
    now the burn-life of the cedar is the max-burn-life of the cedar;
    now the player carries the cedar;
    set pronouns from the cedar;
    instead say "You take [if the cedar-supply is not ever-used]a[now-ever-used cedar-supply][else]another[end if] splinter of cedar from the jar."
 
Check taking the cedar-supply:
    say "You've already taken a cedar splinter. You don't need a tree's worth.";
    if player does not carry the cedar:
        instead try recalling the cedar;
    stop the action.
 
Check emptying the cedar-supply:
    instead try taking the cedar-supply.
 
Check igniting the cedar-supply with:
    instead say "You don't want to set the whole jar on fire! Take one splinter first."
 
Check inspecting the cedar-supply with the oculus:
    instead say "When viewed through the oculus, [the noun] displays a fiery nature."
 
The camphrost-supply is a scenery thing. The printed name is "supply of camphrost".
The description is "A small jar of camphrost rests on a rack. It has a turned-down neck, to conserve the volatile substance."
The camphrost-supply can be ever-used. [resettable]
Understand "camphrost", "supply", "supply of", "jar", "jar of", "from" as the camphrost-supply.
Understand "lump", "lumps" as the camphrost-supply when the camphrost is off-stage.
 
Check taking the camphrost-supply when the camphrost is off-stage:
    now the vapor-life of the camphrost is 10;
    now the player carries the camphrost;
    set pronouns from the camphrost;
    instead say "You shake [if the camphrost-supply is not ever-used]a[now-ever-used camphrost-supply][else]another[end if] lump of camphrost from the jar."
 
Check taking the camphrost-supply:
    say "You've already taken a bit of camphrost. You don't need the whole jar.";
    if player does not carry the camphrost:
        instead try recalling the camphrost;
    stop the action.
 
Check emptying the camphrost-supply:
    instead try taking the camphrost-supply.
Check shaking the camphrost-supply:
    instead try taking the camphrost-supply.
 
Check smelling the camphrost-supply:
    instead say "You catch a faint whiff of mothballs, but the jar doesn't leak much."
 
 
Chapter - Inscribed Symbols
 
Symbol-type is a kind of value.
The symbol-types are no-symbol, saturation-symbol, supersaturation-symbol, gensaturation-symbol, invisibility-symbol, imitation-symbol, impermeability-symbol, ponderosity-symbol, gossamerity-symbol, permeability-symbol, decoherence-symbol, prophylaxis-symbol, attraction-symbol, leverage-symbol, fixation-symbol, fake-symbol.
 
[Definitions are at the top:]
[Descriptor-type is a kind of value.]
[The descriptor-types are no-descriptor, brass-descriptor, steel-descriptor, ....]
 
Definition: a symbol-type is some-saturation-symbol if it is saturation-symbol or it is supersaturation-symbol or it is gensaturation-symbol.
Definition: a symbol-type is some-chime-symbol if it is permeability-symbol or it is decoherence-symbol.
 
To say (ST - symbol-type):
    if ST is:
        -- no-symbol: say "null";
        -- saturation-symbol: say "basic saturation";
        -- supersaturation-symbol: say "redoubled saturation";
        -- gensaturation-symbol: say "universal saturation";
        -- invisibility-symbol: say "invisibility";
        -- imitation-symbol: say "imitation";
        -- impermeability-symbol: say "impermeability";
        -- ponderosity-symbol: say "ponderosity";
        -- gossamerity-symbol: say "gossamerity";
        -- permeability-symbol: say "permeability";
        -- decoherence-symbol: say "decoherence";
        -- prophylaxis-symbol: say "prophylaxis";
        -- attraction-symbol: say "attraction";
        -- leverage-symbol: say "leverage";
        -- fixation-symbol: say "fixation";
        -- fake-symbol: say "fake";
        -- otherwise: say "(BUG)".
 
Understand "basic", "saturate" as saturation-symbol.
Understand "redoubled", "doubled", "double" as supersaturation-symbol. [omit "saturate", "saturation" for collision reasons]
Understand "universal" as gensaturation-symbol. [omit "saturate", "saturation" for collision reasons]
Understand "invisible" as invisibility-symbol.
Understand "ponderous" as the ponderosity-symbol.
Understand "gossamer" as the gossamerity-symbol.
Understand "prophylactic" as the prophylaxis-symbol.
Understand "leverage" as the leverage-symbol.
Understand "fixation" as the fixation-symbol.
Understand "fake" as fake-symbol.
 
To say (DT - descriptor-type):
    if DT is:
        -- no-descriptor: say "generic";
        -- brass-descriptor: say "brassy";
        -- steel-descriptor: say "steely";
        -- bronze-descriptor: say "bronzed";
        -- glass-descriptor: say "glassy";
        -- earthy-descriptor: say "earthy";
        -- wood-descriptor: say "woody";
        -- spiritual-descriptor: say "spiritual";
        -- otherwise: say "(BUG)".
 
Understand "generic" as no-descriptor.
Understand "brass", "brassy", "tiny" as brass-descriptor.
Understand "steel", "steely", "small" as steel-descriptor.
Understand "bronze" as the bronze-descriptor.
Understand "glass" as the glass-descriptor.
Understand "earth", "earthy" as the earthy-descriptor.
Understand "wood", "woody", "wooden" as the wood-descriptor.
Understand "spiritual", "tiny" as spiritual-descriptor.
 
A symbol is a kind of thing.
The printed name of a symbol is "[descriptor-type] [symbol-type] symbol".
Understand "symbol", "inscription", "inscribed", "sign" as a symbol.
A symbol is always fixed in place.
A symbol has a symbol-type.
A symbol has a descriptor-type.
Understand the symbol-type property as describing a symbol.
Understand the descriptor-type property as describing a symbol.
 
The verb to symbol-match (it symbol-matches, they symbol-match, it is symbol-matching) implies the symbol-type property.
 
Check examining a symbol:
    if the noun is part of a thing (called T):
        say "[The T] is charged with";
    else:
        say "The (BUG) is charged with";
    if the symbol-type of the noun is:
        -- saturation-symbol: say " the alchemical sign for basic phlogistical saturation";
        -- supersaturation-symbol: say " the alchemical sign for redoubled phlogistical saturation";
        -- gensaturation-symbol: say " the alchemical sign for universal phlogistical saturation";
        -- invisibility-symbol: say " the alchemical sign for invisibility";
        -- imitation-symbol: say " the alchemical sign for imitation";
        -- impermeability-symbol: say " the alchemical sign for impermeability";
        -- gossamerity-symbol: say " the alchemical sign for gossamerity";
        -- ponderosity-symbol: say " the alchemical sign for ponderosity";
        -- permeability-symbol: say " the alchemical sign for permeability";
        -- decoherence-symbol: say " the alchemical sign for decoherence";
        -- prophylaxis-symbol: say " the alchemical sign for prophylaxis";
        -- attraction-symbol: say " the alchemical sign for attraction";
        -- leverage-symbol: say " the alchemical sign for leverage";
        -- fixation-symbol: say " the alchemical sign for fixation";
        -- fake-symbol: say " the alchemical sign for a red herring";
        -- otherwise: say "(BUG)";
    say ". When you touch it to something, the symbol will discharge";
    instead say "."
 
The symbol-repository is a thing.
Twelve symbols are part of the symbol-repository. [Twelve should be enough.]
 
An inscribable has a symbol-type. The symbol-type of an inscribable is usually no-symbol.
An inscribable has a persona. The persona of an inscribable is usually no-persona.
[Defined at top:] [An inscribable has a descriptor-type. The descriptor-type of an inscribable is usually no-descriptor.]
 
To inscribe (T - thing) with (ST - symbol-type):
    uninscribe T;
    if a symbol (called Y) is part of the symbol-repository:
        now Y is off-stage;
        now the symbol-type of Y is ST;
        now the symbol-type of T is ST;
        now the persona of T is no-persona;
        now the descriptor-type of Y is the descriptor-type of T;
        now Y is part of T;
    else:
        say "(BUG) No more symbols left in the repository."
 
To uninscribe (T - thing):
    now the symbol-type of T is no-symbol;
    now the persona of T is no-persona;
    if a symbol (called Y) is part of T:
        now Y is off-stage;
        now the symbol-type of Y is no-symbol;
        now the descriptor-type of Y is no-descriptor;
        now Y is part of the symbol-repository.
 
Definition: a thing is inscribed if it is inscribable and its symbol-type is not no-symbol.
Definition: a thing is uninscribed if it is not inscribable or its symbol-type is no-symbol.
 
For printing inventory details of an inscribed inscribable (called T):
    say " (inscribed with the [symbol-type of T] symbol)";
For printing room description details of an inscribed inscribable (called T):
    let Y be the symbol-type of T;
    say " (with [Y] symbol";
    if Y is leverage-symbol and T is a pebble and the fulcrum-inscription is lit:
        say " and glowing";
    if Y is fixation-symbol and T is the brass-pin and the fixit-brass-inscription is lit:
        say " and glowing";
    say ")";
 
Report taking an inscribed inscribable:
    instead say "You pick up [the noun], careful of its inscribed [symbol-type of noun] symbol."
 
Check touching an inscribed inscribable:
    if the noun is a chime:
        continue the action; [allow ringing]
    let X be the noun;
    if X is a symbol:
        if X is part of a thing (called T):
            now X is T;
        else:
            instead say "(BUG) Symbol [X] is not a part.";
    instead try tapping X on the player.
 
Check rubbing an inscribed inscribable:
    let X be the noun;
    if X is a symbol:
        if X is part of a thing (called T):
            now X is T;
        else:
            instead say "(BUG) Symbol [X] is not a part.";
    instead try tapping X on the player.
 
Instead of tapping an uninscribed thing on an inscribed inscribable:
    instead try tapping the second noun on the noun.
 
Instead of putting an inscribed inscribable on something when the second noun is not a supporter:
    instead try tapping the noun on the second noun.
 
Instead of tapping something on something when the noun is a symbol or the second noun is a symbol:
    let X be the noun;
    if X is a symbol:
        if X is part of a thing (called T):
            now X is T;
        else:
            instead say "(BUG) Symbol [X] is not a part.";
    let Y be the second noun;
    if Y is a symbol:
        if Y is part of a thing (called T):
            now Y is T;
        else:
            instead say "(BUG) Symbol [Y] is not a part.";
    [say "(DEBUG) convert 'tap [noun] on [second noun]' to 'tap [X] on [Y]'.";]
    instead try tapping X on Y.
 
Check touching a symbol:
    if the noun is part of a thing (called T):
        instead try tapping the noun on the player;
    else:
        instead say "(BUG) [The T] is not part of any inscribable."
 
Check tasting a symbol:
    instead say "Do not lick the alchemical energies."
 
Check pushing a symbol:
    instead say "That makes no sense."
Check pulling a symbol:
    instead say "That makes no sense."
Check turning a symbol:
    instead say "That makes no sense."
 
Rule for implicitly taking a symbol (called X) when X is a part of a thing (called T):
    instead say "The symbol is part of [the T]."
 
Check inspecting a symbol with the oculus:
    instead say "The structure of [the noun] is clearly visible through the oculus."
 
 
Section - General Symbol Reactions
 
The lead-rod has a symbol-type. [Should have been declared earlier]
 
Check tapping the brass-pin on the player when the symbol-type of the brass-pin is some-saturation-symbol:
    instead say "You [one of]experimentally[or]idly[stopping] press the [symbol-type of the brass-pin] symbol against your own skin. Nothing happens[one of], however. (If you were made of brass, the effect would no doubt have been salutary, or perhaps fatal.)[or].[stopping]"
 
Check tapping the steel-bolt on the player when the symbol-type of the steel-bolt is some-saturation-symbol:
    instead say "You [one of]experimentally[or]idly[stopping] press the [symbol-type of the steel-bolt] symbol against your own skin. Nothing happens[one of], however. (If you were made of steel, the effect would no doubt have been salutary, or perhaps fatal.)[or].[stopping]"
 
Check tapping the brass-pin on the dirty scalpel when the symbol-type of the brass-pin is gensaturation-symbol:
    say "You carefully lay the [symbol-type of the noun] symbol against [the second noun]";
    uninscribe the brass-pin;
    instead say ". The symbol discharges, but the scalpel is no cleaner than before. Apparently dried-on gunk is not the same thing as tarnish."
 
Check tapping the steel-bolt on the dirty scalpel when the symbol-type of the steel-bolt is gensaturation-symbol:
    say "You carefully lay the [symbol-type of the noun] symbol against [the second noun]";
    uninscribe the steel-bolt;
    instead say ". The symbol discharges, but the scalpel is no cleaner than before. Apparently dried-on gunk is not the same thing as tarnish."
 
Check tapping the brass-pin on B-chime when the symbol-type of the brass-pin is saturation-symbol or the symbol-type of the brass-pin is supersaturation-symbol:
    say "You carefully lay the [symbol-type of the noun] symbol against [the second noun]";
    instead say ", but the symbol does not discharge. Bronze is not the same metal as brass, alchemically speaking."
 
Check tapping the brass-pin on F-sharp-chime when the symbol-type of the brass-pin is saturation-symbol or the symbol-type of the brass-pin is supersaturation-symbol:
    say "You carefully lay the [symbol-type of the noun] symbol against [the second noun]";
    instead say ", but the symbol does not discharge. Bronze is not the same metal as brass, alchemically speaking."
 
Check tapping the brass-pin on something metallic when the symbol-type of the brass-pin is gensaturation-symbol:
    say "You carefully lay the [symbol-type of the noun] symbol against [the second noun]";
    uninscribe the brass-pin;
    instead say ". The symbol discharges, but you see no other change."
 
Check tapping the steel-bolt on something metallic when the symbol-type of the steel-bolt is gensaturation-symbol:
    say "You carefully lay the [symbol-type of the noun] symbol against [the second noun]";
    uninscribe the steel-bolt;
    instead say ". The symbol discharges, but you see no other change."
 
Check tapping the scalpel on the player when the symbol-type of the scalpel is prophylaxis-symbol:
    instead say "You [one of]experimentally[or]idly[stopping] press the [symbol-type of the scalpel] symbol against your own skin. You feel a faint warmth, but the symbol does not discharge -- apparently you're not the sort of evil influence that it's meant to drive away."
 
Check tapping an inscribed inscribable on the dispersal-brush:
    let Y be the symbol-type of the noun;
    uninscribe the noun;
    instead say "You brush the feather across [the noun]. The [Y] symbol blurs and fades away."
 
Check tapping an inscribed inscribable on:
    if the symbol-type of the noun is saturation-symbol:
        tutor tut-does-not-discharge with the second noun;
    instead say "You carefully lay the [symbol-type of the noun] symbol against [the second noun]. Nothing happens; the symbol does not discharge."
 
Section - The Player's Aura
 
The aura-mod-type is a symbol-type that varies.
The aura-mod-time is a number that varies.
The aura-mod-persona is a persona that varies.
 
To say subjective (ST - symbol-type):
    if ST is:
        -- invisibility-symbol: say "distance";
        -- impermeability-symbol: say "detachment";
        -- imitation-symbol: say "estrangement";
        -- otherwise: say "(BUG) subjective [ST]";
    stop.
 
Check tapping a quartz-prism on the player when the symbol-type of the noun is invisibility-symbol:
    say "You press [the noun] against your hand. The [symbol-type of the noun] symbol discharges with a nerve-grating whine";
    uninscribe the noun;
    if the aura-mod-type is no-symbol:
        say ".[para]You feel a sudden sense of distance, as if you were a very long way behind your own eyes. The world seems colorless and still";
    else if the aura-mod-type is invisibility-symbol:
        say ".[para]The sense of [subjective aura-mod-type] intensifies";
    else:
        say ".[para]Your sense of [subjective aura-mod-type] wavers and changes to a colorless distance";
    now aura-mod-type is invisibility-symbol;
    now aura-mod-time is four;
    instead say "."
 
Check tapping a quartz-prism on the player when the symbol-type of the noun is impermeability-symbol:
    say "You press [the noun] against your hand. The [symbol-type of the noun] symbol discharges with a bone-vibrating hum";
    uninscribe the noun;
    if the aura-mod-type is no-symbol:
        say ".[para]You feel a sudden wave of uncaring, a calm detachment, as if all trouble and pain were a story told to someone else";
    else if the aura-mod-type is impermeability-symbol:
        say ".[para]The sense of [subjective aura-mod-type] returns at full strength";
    else:
        say ".[para]Your sense of [subjective aura-mod-type] wavers and changes to a calm detachment. You consider the distinction dispassionately";
    now aura-mod-type is impermeability-symbol;
    now aura-mod-time is four;
    instead say "."
 
Check tapping a quartz-or-jade on the player when the symbol-type of the noun is imitation-symbol:
    say "You press [the noun] against your hand";
    if the persona of the noun is no-persona:
        if the aura-mod-type is not no-symbol:
            instead say ", and wait a long moment, but nothing happens. The symbol doesn't seem to be able to get hold of your imprint.";
        now the persona of the noun is Ensign;
        instead say ". You feel nothing, but the symbol contorts, absorbing the imprint of your aura.";
    let P be the persona of the noun;
    if P is Ensign:
        say ". The [symbol-type of the noun] symbol discharges with a thrum";
        uninscribe the noun;
        instead say ", leaving you feeling... exactly the same as before.";
    say ". The [symbol-type of the noun] symbol discharges with a thrum";
    uninscribe the noun;
    if the aura-mod-type is no-symbol:
        say ".[para]You feel a sudden dissociation, an estrangement, as though your thoughts belonged to someone else";
    else if the aura-mod-type is imitation-symbol:
        say ".[para]The sense of [subjective aura-mod-type] returns at full strength";
        if P is not aura-mod-persona:
            say ", although with a different flavor";
    else:
        say ".[para]Your sense of [subjective aura-mod-type] wavers and changes to a dissociated estrangement";
    now aura-mod-type is imitation-symbol;
    now aura-mod-time is four;
    now aura-mod-persona is P;
    instead say "."
 
Every turn when aura-mod-type is not no-symbol (this is the aura-mod daemon rule):
    if aura-mod-time is zero:
        say "(BUG) aura-mod-time is zero when aura-mod-type is [aura-mod-type].[br]";
    else:
        decrement aura-mod-time;
    if aura-mod-time is zero:
        say "The sense of [subjective aura-mod-type] fades away. The reality of the world reasserts itself.";
        now the aura-mod-type is no-symbol;
        now the aura-mod-persona is no-persona;
    else if aura-mod-time is one:
        say "The sense of [subjective aura-mod-type] is rapidly diminishing."
 
Section - Auras of Characters
 
A character can be aura-damped. [Resettable. Occurs if the player experiments with aura-manipulating a character. Does not decay over time, because characters are in stasis.]
 
Check tapping a quartz-prism on a character (called C) when the symbol-type of the noun is invisibility-symbol:
    if C is fracture-blocked:
        instead say "You can't reach [the C].";
    if C is shadowy:
        instead say "The shadow is intangible.";
    say "You press [the noun] against [the C]. The [symbol-type of the noun] symbol discharges with a nerve-grating whine";
    uninscribe the noun;
    now C is aura-damped;
    instead say ".[para]You're not sure how [he-she C] was affected, though."
 
Check tapping a quartz-prism on a character (called C) when the symbol-type of the noun is impermeability-symbol:
    if C is fracture-blocked:
        instead say "You can't reach [the C].";
    if C is shadowy:
        instead say "The shadow is intangible.";
    say "You press [the noun] against [the C]. The [symbol-type of the noun] symbol discharges with a bone-vibrating hum";
    uninscribe the noun;
    now C is aura-damped;
    instead say ".[para]You're not sure how [he-she C] was affected, though."
 
Check tapping a quartz-or-jade on a character (called C) when the symbol-type of the noun is imitation-symbol:
    if C is fracture-blocked:
        instead say "You can't reach [the C].";
    if C is shadowy:
        instead say "The shadow is intangible.";
    say "You press [the noun] against [the C]";
    if the persona of the noun is no-persona:
        if C is aura-damped:
            instead say ", and wait a long moment, but nothing happens. The symbol doesn't seem to be able to get hold of [his-her C] imprint.";
        now the persona of the noun is the persona of C;
        instead say ". You feel nothing, but the symbol distorts, absorbing the imprint of [his-her C] aura.";
    let P be the persona of the noun;
    say ". The [symbol-type of the noun] symbol discharges with a thrum";
    uninscribe the noun;
    if P is not the persona of C:
        now C is aura-damped;
    instead say ".[para]You're not sure how [he-she C] was affected, though."
 
 
Chapter - Resetting the World
 
A reset-room is a kind of room. The printed name of a reset-room is always "Void".
A reset-room has a room called the near-room. [The room with the door in.]
[The "reset when in the void" rule is in Game Locs, but we define the class out here.]
 
When play begins (this is the initial awakening banner rule):
    say epigraph 0;
    say "[br][br]";
    end the story saying "You have awakened";
    print the obituary line condensed;
    force-clear deadflag.
 
When play begins (this is the initial world reset rule):
    follow the reset rules;
    [Make sure handled/ever-seen are set properly on the very first turn. Okay, this is probably only important in the test framework, but it's cheap in the game.]
    follow the note object acquisitions rule.
 
To invoke reset, involuntarily:
    if involuntarily:
        increment the forced-reset-counter;
    if not post-game:
        end the story saying "You awaken again";
    else:
        end the story saying "You had awakened".
 
To force-clear deadflag: (- deadflag=0; -).
 
To print the obituary line condensed: (-
    print "^    ";
    VM_Style(ALERT_VMSTY);
    print "***";
    if (deadflag ~= 0 or 1 or 2 or 3)  {
        print " ";
        if (deadflag ofclass String) print (string) deadflag;
        print " ";
    }
    print "***";
    VM_Style(NORMAL_VMSTY);
    print "^^^";
-).
 
The reset-counter is a number that varies.
The forced-reset-counter is a number that varies.
 
The reset rules are a rulebook.
 
When play ends (this is the perform-reset-and-look rule):
    if story has not ended finally:
        print the obituary line condensed;
        increment the reset-counter;
        follow the reset rules;
        try looking;
        recite post-reset text;
        resume the story;
        [deadflag is still set at this point; a following rule will reset it.]
 
First reset rule (this is the stash the player somewhere reset rule):
    move the player to Abstraction Layer, without printing a room description.
 
Reset rule (this is the reset alchemy rule):
    shut down the retort;
    shut down the ritual state;
    discard the beaker;
 
Reset rule (this is the reset gen stuff rule):
    [...characters...]
    now all characters are not aura-damped;
    [...status globals...]
    now the fire-potion-remaining is zero;
    now the vacuum-potion-remaining is zero;
    now the aither-potion-remaining is zero;
    now the breath-potion-remaining is zero;
    now the breath-remaining is zero;
    now the aura-mod-type is no-symbol;
    now the aura-mod-persona is no-persona;
    now the aura-mod-time is zero;
    now the ring-time of the miasma-gong is zero;
    now the miasma-gong is uncharged;
    now the ring-time of the B-chime is zero;
    now the ring-time of the F-sharp-chime is zero; [the other two chimes never get ring-time]
    [...moisture...]
    [now every moist takeable-thing is not moist;]
    now the pinecone is not moist;
    now the mushroom is not moist;
    now the honeysuckle is not moist;
    now the rock-salt is not moist;
    [...ever-used flags...]
    now the mustard-supply is not ever-used;
    now the cedar-supply is not ever-used;
    now the camphrost-supply is not ever-used;
    now the aeroclave is not ever-used;
    [not the retort burner; that's informational]
    now the purity-lodestone is not ever-tried;
    now the centrality-lodestone is not ever-tried;
    [...things on fire...]
    now torch-lighter is alight;
    now the phlo-gold is not alight;
    now the phlo-electrum is not alight;
    repeat with T running through all fire-consumable wood-splints:
        now the burn-life of T is the max-burn-life of T;
        now T is not alight;
    now the fire-consumption count is zero;
    [...misc...]
    repeat with T running through inscribables:
        uninscribe T;
    now the symbol-type of the lead-rod is no-symbol;
    now the glyph-used of fulcrum-inscription is no-word;
    now the pebble-used of fulcrum-inscription is no-thing;
    now the sequence-used of fulcrum-inscription is no-word;
    now the senility of fulcrum-inscription is zero;
    now the fulcrum-inscription is unlit;
    now the fixit-brass-inscription is unlit;
    now all bubbles are uncharged;
    now the scalpel is dirty;
    now all impets are closed;
    now the crock is open;
    now the crock is not shifted;
    now the vapor-pressure of the crock is zero;
    now the camphrost is off-stage;
    now the vapor-life of the camphrost is zero;
    now the aeroclave is open;
 
Last reset rule (this is the reset visited and handled rule):
    [All object locations must have already been reset. The player must be in the Abstraction Layer.]
    now all rooms are unvisited-this-cycle;
    now all takeable-things are not handled;
    now all takeable-supporters are not handled;
    [special case for the beaker]
    now the beaker is handled;
    now the beaker was retired to text-fate;
    now the fate-text of the beaker is "Beakers are plentiful on the [Retort]. You'll pull one out the next time you need one for a ritual";
 
HL Mechanism ends here.