Hadean Lands: HL Gen Goals

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 Gen Goals by Andrew Plotkin begins here.
 
Use authorial modesty.
 
 
Chapter - Encyclopedia of Action-Goals
 
A synthesis-action-goal is a kind of action-goal.
Understand "recipe", "synthesis" as a synthesis-action-goal.
A pot-synthesis-action-goal is a kind of action-goal.
Understand "recipe", "synthesis", "potion" as a pot-synthesis-action-goal.
A symbol-action-goal is a kind of action-goal.
Understand "inscribe", "inscription", "conjuration", "symbol", "sign" as a symbol-action-goal.
 
To decide what takeable-thing is the more available of (T1 - takeable-thing) and (T2 - takeable-thing):
    [We could check for ever-seen-ness here, but this function is only used for the quartz prisms, which are in the same place.]
    if T1 is off-stage:
        decide on T2;
    if T2 is off-stage:
        decide on T1;
    if T1 is inscribable and a symbol is part of T1:
        decide on T2;
    if T2 is inscribable and a symbol is part of T2:
        decide on T1;
    if the player carries T1:
        decide on T1;
    if the player carries T2:
        decide on T2;
    if T1 is in the location:
        decide on T1;
    if T2 is in the location:
        decide on T2;
    let ZP be the current zone;
    if ZP is not no-zone:
        let Z1 be the containing zone of T1;
        let Z2 be the containing zone of T2;
        if Z1 is ZP:
            decide on T1;
        if Z2 is ZP:
            decide on T2;
    decide on T1.
 
To decide what pebble is the most available pebble:
    if the player carries an uninscribed pebble (called T):
        decide on T;
    if an uninscribed pebble (called T) is in the location:
        decide on T;
    if there is an uninscribed on-stage ever-seen pebble (called T):
        decide on T;
    if the player carries a pebble (called T):
        decide on T;
    if a pebble (called T) is in the location:
        decide on T;
    if there is an on-stage ever-seen pebble (called T):
        decide on T;
    if there is an ever-seen pebble (called T):
        decide on T;
    say "(BUG) There are no pebbles.";
    decide on sandstone-pebble.
 
The aither-survival-goal is an action-goal. The short-description is "survive alien aither".
 
Goal prereqs rule for aither-survival-goal:
    require-or-fail the aither-protection;
    if goalstate is not hypothetical:
        say "You drink [the aither-protection].";
        retire the aither-protection by drinking;
        now the aither-potion-remaining is one; [permanent]
    rule succeeds.
 
The ignite-goal is an ever-done action-goal. The short-description is "set something on fire".
 
The kiln-reach-goal is an action-goal. The short-description is "become fireproof for the kiln".
 
Goal prereqs rule for kiln-reach-goal:
    require-or-fail the fire-resistance;
    if goalstate is not hypothetical:
        say "You drink [the fire-resistance].";
        retire the fire-resistance by drinking;
        now the fire-potion-remaining is one;   [short duration]
    [does not leave you *at* the kiln; caller must do that.]
    rule succeeds.
 
The gold-ignition is a recallable action-goal. The short-description is "ignite the phlogisticated gold".
The printed name is "gold ignition".
[No creation-action, because there's no target object.]
Understand "gold", "ignition", "igniting" as gold-ignition.
 
Goal prereqs rule for gold-ignition:
    require-or-fail the phlo-gold;
    if the phlo-gold is alight:
        if goalstate is not hypothetical:
            say "The phlogisticated gold is already alight.";
        rule succeeds;
    require-or-fail the blackwood noting had-blackwood;
    require-or-fail the winter-oak noting had-winter-oak;
    [take camphrost for granted, since the supply is fixed]
    require-or-fail the location of the crock;
    if goalstate is not hypothetical:
        if the blackwood is not alight:
            say "You ignite the blackwood splint from the winter-oak.";
        say "You place the phlogisticated gold in the vapor crock with camphrost, and ignite them with the blackwood splint.";
        now the winter-oak is not alight;
        now the blackwood is not alight;
        now the crock is open;
        repeat with T in raw contents of the crock:
            now T is in the location of the crock;
        now the vapor-pressure of the crock is zero;
        now the crock is not shifted;
        retire the camphrost by ritual;
        now the phlo-gold is alight;
        auto-drop the winter-oak unless had-winter-oak;
        auto-drop the blackwood unless had-blackwood;
    rule succeeds.
 
The electrum-ignition is an action-goal. The short-description is "ignite the phlogisticated electrum".
[Not recallable!]
 
Goal prereqs rule for electrum-ignition:
    require-or-fail the phlo-electrum;
    if the phlo-electrum is alight:
        if goalstate is not hypothetical:
            say "The phlogisticated electrum is already alight.";
        rule succeeds;
    require-or-fail the phlo-gold;
    if the phlo-gold is not alight:
        require-or-fail the gold-ignition;
    if goalstate is not hypothetical:
        say "You light the electrum off the gold rod.";
        now the phlo-electrum is alight;
        [no auto-drop, because the point is to "double" the alight gold.]
    rule succeeds.
 
[Utility function for goals that need el-fire. This performs the requirements, and returns phlo-gold, phlo-electrum, or nothing on failure. (Note that we don't use the require-or-fail macro.)
If the player has created el-fire manually, use it. Otherwise use whichever metal the player last used for this ritual.]
To decide what thing is the el-fire-source for (G - action-goal):
    if phlo-electrum is on-stage and phlo-electrum is alight:
        require phlo-electrum;
        if goalstate is latest-req-failed, really decide on nothing;
        now the fire-source-used of G is phlo-electrum;
        decide on phlo-electrum;
    if phlo-gold is on-stage and phlo-gold is alight:
        require phlo-gold;
        if goalstate is latest-req-failed, really decide on nothing;
        now the fire-source-used of G is phlo-gold;
        decide on phlo-gold;
    let T be the fire-source-used of G;
    if T is phlo-gold:
        if gold-ignition is not ever-done:
            say "You have no elemental fire.";
            really decide on nothing;
        require phlo-gold;
        if goalstate is latest-req-failed, really decide on nothing;
        if phlo-gold is not alight:
            require the gold-ignition;
            if goalstate is latest-req-failed, really decide on nothing;
        decide on phlo-gold;
    else if T is phlo-electrum:
        if electrum-ignition is not ever-done:
            say "You have no elemental fire.";
            really decide on nothing;
        require phlo-electrum;
        if goalstate is latest-req-failed, really decide on nothing;
        if phlo-electrum is not alight:
            require the electrum-ignition;
            if goalstate is latest-req-failed, really decide on nothing;
        decide on phlo-electrum;
    else:
        say "(BUG) The fire-source-used for [G] is [T].";
        really decide on nothing.
 
The el-air-goal is an action-goal. The short-description is "capture elemental air".
The el-air-goal has a thing called the air-source-used. [a bubble]
The el-air-goal can be double-bubble-known.
 
Goal prereqs rule for el-air-goal:
    [On success, air-source-used is which bubble got used up. Invoke "resolve the el-air-goal" to discharge it.]
    now the air-source-used of el-air-goal is no-thing;
    if the scratched-bubble is on-stage and the scratched-bubble is charged:
        now the air-source-used of el-air-goal is scratched-bubble;
        require-or-fail scratched-bubble;
        rule succeeds;
    if the dusty-bubble is on-stage and the dusty-bubble is charged:
        now the air-source-used of el-air-goal is dusty-bubble;
        require-or-fail dusty-bubble;
        rule succeeds;
    [Go get some air. This code will fail if you're already in med-wing without the dusty bubble, but I don't think that's likely.]
    if el-air-goal is double-bubble-known:
        require-or-fail the dusty-bubble;
    require-or-fail the scratched-bubble;
    require-or-fail the location of the air-tank;
    if goalstate is not hypothetical:
        if el-air-goal is not double-bubble-known:
            now the scratched-bubble is charged;
            say "You fill the scratched bubble.";
        else:
            now the scratched-bubble is charged;
            now the dusty-bubble is charged;
            say "You fill both bubbles.";
    now the air-source-used of el-air-goal is scratched-bubble;
    rule succeeds.
 
To resolve the el-air-goal, auto-dropping:
    let T be the air-source-used of el-air-goal;
    if T is not a bubble:
        say "(BUG) air-source-used of el-air-goal is [T].";
    else if T is uncharged:
        say "(BUG) air-source-used of el-air-goal is [T], which is uncharged.";
    else:
        now T is uncharged;
        if auto-dropping:
            auto-drop T.
 
A supply-action-goal is a kind of action-goal.
A supply-action-goal has a thing called the creation-target.
The creation-target of a supply-action-goal is usually no-thing.
 
The cedar-creation is an ever-done supply-action-goal. The short-description is "acquire a cedar splint".
The creation-target is the cedar-supply.
The creation-action of the cedar is cedar-creation.
 
Goal prereqs rule for cedar-creation:
    require-or-fail the location of the cedar-supply;
    if goalstate is not hypothetical:
        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;
        say "You take a cedar splint.";
    rule succeeds.
 
The mustard-creation is an ever-done supply-action-goal. The short-description is "acquire a pinch of mustard seed".
The creation-target is the mustard-supply.
The creation-action of the mustard is mustard-creation.
 
Goal prereqs rule for mustard-creation:
    require-or-fail the location of the mustard-supply;
    if goalstate is not hypothetical:
        now the player carries the mustard;
        set pronouns from the mustard;
        say "You take a pinch of mustard seed.";
    rule succeeds.
 
The camphrost-creation is an ever-done supply-action-goal. The short-description is "acquire some camphrost".
The creation-target is the camphrost-supply.
The creation-action of the camphrost is camphrost-creation.
 
Goal prereqs rule for camphrost-creation:
    require-or-fail the location of the camphrost-supply;
    if goalstate is not hypothetical:
        now the vapor-life of the camphrost is 10;
        now the player carries the camphrost;
        set pronouns from the camphrost;
        say "You take a lump of camphrost.";
    rule succeeds.
 
 
A metal-wire-action-goal is a kind of action-goal.
A metal-wire-action-goal has a thing called the creation-target.
The creation-target of a metal-wire-action-goal is usually no-thing.
A metal-wire-action-goal is usually ever-done.
The short-description of a metal-wire-action-goal is usually "draw [short-description of creation-target of item described] wire".
 
The lead-wire-goal is a metal-wire-action-goal. The creation-target is lead-wire.
The creation-action of lead-wire is lead-wire-goal.
The platinum-wire-goal is a metal-wire-action-goal. The creation-target is platinum-wire.
The creation-action of platinum-wire is platinum-wire-goal.
The nickel-wire-goal is a metal-wire-action-goal. The creation-target is nickel-wire.
The creation-action of nickel-wire is nickel-wire-goal.
The moon-metal-wire-goal is a metal-wire-action-goal. The creation-target is moon-metal-wire.
The creation-action of moon-metal-wire is moon-metal-wire-goal.
The whitgold-wire-goal is a metal-wire-action-goal. The creation-target is whitgold-wire.
The creation-action of whitgold-wire is whitgold-wire-goal.
The moongold-wire-goal is a metal-wire-action-goal. The creation-target is moongold-wire.
The creation-action of moongold-wire is moongold-wire-goal.
The gold-wire-goal is a metal-wire-action-goal. The creation-target is gold-wire.
The creation-action of gold-wire is gold-wire-goal.
The electrum-wire-goal is a metal-wire-action-goal. The creation-target is electrum-wire.
The creation-action of electrum-wire is electrum-wire-goal.
 
An amalgam-wire-action-goal is a kind of metal-wire-action-goal.
The short-description of a amalgam-wire-action-goal is usually "create [short-description of creation-target of item described] wire".
 
The white-amalgam-wire-goal is an amalgam-wire-action-goal. The creation-target is white-amalgam-wire.
The creation-action of white-amalgam-wire is white-amalgam-wire-goal.
The gold-amalgam-wire-goal is an amalgam-wire-action-goal. The creation-target is gold-amalgam-wire.
The creation-action of gold-amalgam-wire is gold-amalgam-wire-goal.
 
Goal prereqs rule for metal-wire-action-goal (called G):
    let wire be the creation-target of G;
    if wire is no-thing:
        say "(BUG) The [G] has no creation-target.";
        rule fails;
    let rod be the rod form of wire;
    if rod is no-thing:
        if goalstate is not hypothetical:
            say "You do not know what metal to draw.";
        rule fails;
    require-or-fail the rod;
    require-or-fail the current toolshop location;
    if goalstate is not hypothetical:
        substitute the wire for the rod;
        set pronouns from the wire;
        say "You draw [the rod] out into wire.";
    rule succeeds.
 
Goal prereqs rule for amalgam-wire-action-goal (called G):
    [Special cases for white and gold amalgam; can go through the rod or wire-plus-mercury.]
    let wire be the creation-target of G;
    if wire is no-thing:
        say "(BUG) The [G] has no creation-target.";
        rule fails;
    let rod be the rod form of wire;
    if rod is no-thing:
        if goalstate is not hypothetical:
            say "You do not know what metal to draw.";
        rule fails;
    let base-rod be no-thing;
    let base-wire be no-thing;
    if rod is white-amalgam:
        now base-rod is lead-rod;
        now base-wire is lead-wire;
    else if rod is gold-amalgam:
        now base-rod is gold-rod;
        now base-wire is gold-wire;
    else:
        say "(BUG) The [G] has no base metal.";
        rule fails;
    if the mercury is on-stage:
        require-or-fail the mercury;
        if the base-wire is ever-seen:
            require-or-fail the base-wire;
            if goalstate is not hypothetical:
                retire the mercury by transformation into the wire;
                substitute the wire for the base-wire;
                set pronouns from the wire;
                say "You apply the mercury to [the base-wire].";
            rule succeeds;
        else:
            require-or-fail the base-rod;
            if goalstate is not hypothetical:
                retire the mercury by transformation into the rod;
                substitute the rod for the base-rod;
                set pronouns from the rod;
                say "You apply the mercury to [the base-rod].";
            [...fall out to "draw the rod".]
    require-or-fail the rod;
    require-or-fail the current toolshop location;
    if goalstate is not hypothetical:
        substitute the wire for the rod;
        set pronouns from the wire;
        say "You draw [the rod] out into wire.";
    rule succeeds.
 
Goal prereqs rule for gold-wire-goal:
    [Special case: both phlo-gold and gold-rod work. We start with phlo-gold, so the criteria for choosing are a little weird; we only target the gold-rod if the phlo-gold is gone *and* the gold-rod has been seen this cycle.]
    if phlo-gold is on-stage or the gold-rod is never-made-this-cycle:
        require-or-fail the phlo-gold;
        require-or-fail the current toolshop location;
        if goalstate is not hypothetical:
            let waslit be false;
            if the phlo-gold is alight:
                now waslit is true;
                now the phlo-gold is not alight;
            substitute the gold-wire for the phlo-gold;
            set pronouns from the gold-wire;
            say "You draw the gold rod out into wire ([if waslit is true]extinguishing it and [end if]losing its phlogistication).";
        rule succeeds;
    require-or-fail the gold-rod;
    require-or-fail the current toolshop location;
    if goalstate is not hypothetical:
        substitute the gold-wire for the gold-rod;
        set pronouns from the gold-wire;
        say "You draw [the gold-rod] out into wire.";
    rule succeeds.
 
Goal prereqs rule for electrum-wire-goal:
    [Special case: both phlo-electrum and electrum work.]
    if phlo-electrum is on-stage:
        require-or-fail the phlo-electrum;
        require-or-fail the current toolshop location;
        if goalstate is not hypothetical:
            let waslit be false;
            if the phlo-electrum is alight:
                now waslit is true;
                now the phlo-electrum is not alight;
            substitute the electrum-wire for the phlo-electrum;
            set pronouns from the electrum-wire;
            say "You draw the electrum rod out into wire ([if waslit is true]extinguishing it and [end if]losing its phlogistication).";
        rule succeeds;
    require-or-fail the electrum;
    require-or-fail the current toolshop location;
    if goalstate is not hypothetical:
        substitute the electrum-wire for the electrum;
        set pronouns from the electrum-wire;
        say "You draw [the electrum] out into wire.";
    rule succeeds.
 
A metal-rod-action-goal is a kind of action-goal.
A metal-rod-action-goal has a thing called the creation-target.
The creation-target of a metal-rod-action-goal is usually no-thing.
A metal-rod-action-goal is usually ever-done.
The short-description of a metal-rod-action-goal is usually "recreate the [short-description of creation-target of item described] rod".
 
An alloy-rod-action-goal is a kind of action-goal.
An alloy-rod-action-goal has a thing called the creation-target.
The creation-target of an alloy-rod-action-goal is usually no-thing.
The short-description of an alloy-rod-action-goal is usually "create the [short-description of creation-target of item described] rod".
 
An amalgam-rod-action-goal is a kind of action-goal.
An amalgam-rod-action-goal has a thing called the creation-target.
The creation-target of an amalgam-rod-action-goal is usually no-thing.
The short-description of an amalgam-rod-action-goal is usually "create the [short-description of creation-target of item described] rod".
 
The lead-rod-goal is a metal-rod-action-goal. The creation-target is lead-rod.
The creation-action of lead-rod is lead-rod-goal.
The platinum-rod-goal is a metal-rod-action-goal. The creation-target is platinum-rod.
The creation-action of platinum-rod is platinum-rod-goal.
The nickel-rod-goal is a metal-rod-action-goal. The creation-target is nickel-rod.
The creation-action of nickel-rod is nickel-rod-goal.
The moon-metal-rod-goal is a metal-rod-action-goal. The creation-target is moon-metal-rod.
The creation-action of moon-metal-rod is moon-metal-rod-goal.
The gold-rod-goal is a metal-rod-action-goal. The creation-target is gold-rod.
The creation-action of gold-rod is gold-rod-goal.
 
The electrum-rod-goal is an alloy-rod-action-goal. The creation-target is electrum.
The creation-action of electrum is electrum-rod-goal. [By using the general alloy-rod-action-goal, we miss one case: if we have the phlo-electrum, "create plain electrum rod" will fail to find the path through wire and back. I'm not worrying about this, because the plain electrum rod isn't good for anything except phlo-ing.]
The moongold-rod-goal is an alloy-rod-action-goal. The creation-target is moongold-rod.
The creation-action of moongold-rod is moongold-rod-goal.
The whitgold-rod-goal is an alloy-rod-action-goal. The creation-target is whitgold-rod.
The creation-action of whitgold-rod is whitgold-rod-goal.
The ring-gold-rod-goal is an alloy-rod-action-goal. The creation-target is ring-gold-rod.
The creation-action of ring-gold-rod is ring-gold-rod-goal.
 
The gold-amalgam-rod-goal is an amalgam-rod-action-goal. The creation-target is gold-amalgam.
The creation-action of gold-amalgam is gold-amalgam-rod-goal.
The white-amalgam-rod-goal is an amalgam-rod-action-goal. The creation-target is white-amalgam.
The creation-action of white-amalgam is white-amalgam-rod-goal.
The red-amalgam-rod-goal is an amalgam-rod-action-goal. The creation-target is red-amalgam.
The creation-action of red-amalgam is red-amalgam-rod-goal.
 
Goal prereqs rule for metal-rod-action-goal (called G):
    let rod be the creation-target of G;
    if rod is no-thing:
        say "(BUG) The [G] has no creation-target.";
        rule fails;
    let wire be the wire form of rod;
    if wire is no-thing:
        if goalstate is not hypothetical:
            say "You do not know what wire to splice.";
        rule fails;
    if wire is off-stage:
        [Only try to work with the wire if it's available.]
        if goalstate is not hypothetical:
            recall rod at depth zero;
            say ".";
        rule fails;
    require-or-fail the wire;
    require-or-fail the current toolshop location;
    if goalstate is not hypothetical:
        substitute the rod for the wire;
        set pronouns from the rod;
        say "You splice [the wire] into a rod.";
    rule succeeds.
 
Goal prereqs rule for gold-rod-goal:
    [Special case; we might be able to create the gold-wire in order to create the gold-rod. Allow the gold-wire-goal to handle those problems.]
    if gold-wire is off-stage and phlo-gold is off-stage:
        if goalstate is not hypothetical:
            if the gold-rod is ever-made-this-cycle:
                recall gold-rod at depth zero;
            else:
                recall phlo-gold at depth zero;
            say ".";
        rule fails;
    require-or-fail the gold-wire;
    require-or-fail the current toolshop location;
    if goalstate is not hypothetical:
        substitute the gold-rod for the gold-wire;
        set pronouns from the gold-rod;
        say "You splice [the gold-wire] into a rod.";
    rule succeeds.
 
Goal prereqs rule for alloy-rod-action-goal (called G):
    let rod be the creation-target of G;
    if rod is no-thing:
        say "(BUG) The [G] has no creation-target.";
        rule fails;
    let wire be the wire form of rod;
    if wire is not no-thing and wire is on-stage:
        [The single-wire path]
        require-or-fail the wire;
        require-or-fail the current toolshop location;
        if goalstate is not hypothetical:
            substitute the rod for the wire;
            set pronouns from the rod;
            say "You splice [the wire] into a rod.";
        rule succeeds;
    let W1 be the first wire component of rod;
    let W2 be the second wire component of rod;
    if W1 is no-thing or W2 is no-thing:
        if goalstate is not hypothetical:
            say "You do not know which wires to splice.";
        rule fails;
    require-or-fail W1;
    require-or-fail W2;
    require-or-fail the current toolshop location;
    if goalstate is not hypothetical:
        retire W2 by transformation into the rod;
        substitute the rod for W1;
        set pronouns from the rod;
        say "You splice [the W1] and [the W2] into [a rod].";
    rule succeeds.
 
Goal prereqs rule for amalgam-rod-action-goal (called G):
    let rod be the creation-target of G;
    if rod is no-thing:
        say "(BUG) The [G] has no creation-target.";
        rule fails;
    let wire be the wire form of rod; [might be no-thing (the red rod case)]
    if wire is not no-thing and wire is on-stage:
        [The single-wire path]
        require-or-fail the wire;
        require-or-fail the current toolshop location;
        if goalstate is not hypothetical:
            substitute the rod for the wire;
            set pronouns from the rod;
            say "You splice [the wire] into a rod.";
        rule succeeds;
    let base-rod be no-thing;
    if rod is gold-amalgam:
        now base-rod is gold-rod;
    else if rod is white-amalgam:
        now base-rod is lead-rod;
    else if rod is red-amalgam:
        now base-rod is orichalcum;
    else:
        say "(BUG) The [G] has no base metal rod.";
        rule fails;
    require-or-fail mercury;
    require-or-fail base-rod;
    if goalstate is not hypothetical:
        retire mercury by transformation into the rod;
        substitute the rod for base-rod;
        set pronouns from the rod;
        say "You apply the mercury to [the base-rod].";
    rule succeeds.
 
[At present this only handles lead seals.]
A metal-seal-action-goal is a kind of action-goal.
A metal-seal-action-goal has a thing called the creation-target.
The creation-target of a metal-seal-action-goal is usually no-thing.
A metal-seal-action-goal is usually ever-done.
The short-description of a metal-seal-action-goal is usually "cast [the creation-target of item described]".
 
The gs-med-lead-goal is a metal-seal-action-goal. The creation-target is med-lead-seal.
The creation-action of med-lead-seal is gs-med-lead-goal.
The gs-alc-lead-goal is a metal-seal-action-goal. The creation-target is alc-lead-seal.
The creation-action of alc-lead-seal is gs-alc-lead-goal.
The gs-aith-lead-goal is a metal-seal-action-goal. The creation-target is aith-lead-seal.
The creation-action of aith-lead-seal is gs-aith-lead-goal.
The gs-vent-lead-goal is a metal-seal-action-goal. The creation-target is vent-lead-seal.
The creation-action of vent-lead-seal is gs-vent-lead-goal.
 
Goal prereqs rule for metal-seal-action-goal (called G):
    let seal be the creation-target of G;
    if seal is no-thing:
        say "(BUG) The [G] has no creation-target.";
        rule fails;
    let F be the file of seal;
    let M be no-thing;
    if F is:
        -- medical-file: now M is the medical-mold;
        -- alchemy-file: now M is the alchemy-mold;
        -- aithery-file: now M is the aithery-mold;
        -- venture-file: now M is the venture-mold;
    if M is no-thing:
        say "(BUG) Trying to create [seal], which has no file.";
        rule fails;
    let had-mold be whether or not the player carries M; ["noting" doesn't work here for some annoying syntactical reason]
    require-or-fail M;
    let T be no-thing;
    if the lead-rod is on-stage:
        now T is the lead-rod;
    else if the lead-wire is on-stage:
        now T is the lead-wire;
    else if the med-lead-seal is on-stage:
        now T is the med-lead-seal;
    else if the alc-lead-seal is on-stage:
        now T is the alc-lead-seal;
    else if the aith-lead-seal is on-stage:
        now T is the aith-lead-seal;
    else if the vent-lead-seal is on-stage:
        now T is the vent-lead-seal;
    if T is no-thing:
        [the fallback, for sensible failure messages.]
        now T is the lead-rod;
    if T is seal:
        say "(BUG) Trying to create [seal] when it is on-stage.";
        rule fails;
    require-or-fail T;
    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 "Casting requires reaching into the kiln, and you're not fireproof.";
        rule fails;
    require-or-fail the location of the kiln;
    if goalstate is not hypothetical:
        substitute the seal for T;
        set pronouns from the seal;
        say "You melt lead into the mold for [the seal].";
        auto-drop M unless had-mold;
    rule succeeds.
 
To decide whether any-saturation-steel-known:
    if unrust-steel-inscription is known:
        decide yes;
    if super-unrust-steel-inscription is known:
        decide yes;
    if gen-unrust-steel-inscription is known:
        decide yes.
 
To decide whether any-saturation-brass-known:
    if unrust-brass-inscription is known:
        decide yes;
    if super-unrust-brass-inscription is known:
        decide yes;
    if gen-unrust-brass-inscription is known:
        decide yes.
 
To decide what action-goal is the basic-saturation-ritual for (T - thing):
    if T is the brass-pin:
        decide on unrust-brass-inscription;
    if T is the steel-bolt:
        decide on unrust-steel-inscription;
    really decide on nothing.
 
To decide what action-goal is the super-saturation-ritual for (T - thing):
    if T is the brass-pin:
        decide on super-unrust-brass-inscription;
    if T is the steel-bolt:
        decide on super-unrust-steel-inscription;
    really decide on nothing.
 
To decide what action-goal is the gen-saturation-ritual for (T - thing):
    if T is the brass-pin:
        decide on gen-unrust-brass-inscription;
    if T is the steel-bolt:
        decide on gen-unrust-steel-inscription;
    really decide on nothing.
 
The unrust-brass-inscription is a recallable symbol-action-goal.
The printed name is "basic tarnish cleansing inscription[if any-saturation-steel-known] (with the brass pin)[end if]".
The short-description is "create the tarnish cleanser".
[No creation-action, because there's no target object.]
Understand "basic", "tarnish", "cleaner", "cleaning", "cleanser", "cleansing" as unrust-brass-inscription.
Understand "brass", "pin", "using", "with" as unrust-brass-inscription.
 
The unrust-steel-inscription is a recallable symbol-action-goal.
The printed name is "basic rust cleansing inscription[if any-saturation-brass-known] (with the steel bolt)[end if]".
The short-description is "create the rust cleanser".
[No creation-action, because there's no target object.]
Understand "basic", "rust", "cleaner", "cleaning", "cleanser", "cleansing" as unrust-steel-inscription.
Understand "single", "steel", "bolt", "using", "with" as unrust-steel-inscription.
 
Goal prereqs rule for unrust-brass-inscription:
    if the symbol-type of the brass-pin is saturation-symbol:
        if goalstate is not hypothetical:
            say "[The brass-pin] is already inscribed with the [saturation-symbol] symbol.";
        rule succeeds;
    require-or-fail the brass-pin;
    require-or-fail the rosemary noting had-rosemary;
    attain-or-fail environment fiery-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        inscribe brass-pin with saturation-symbol;
        set pronouns from the brass-pin;
        say "You conjure a [saturation-symbol] symbol onto [the brass-pin].";
        auto-drop the rosemary unless had-rosemary;
        auto-drop drop-envtool;
    rule succeeds.
 
Goal prereqs rule for unrust-steel-inscription:
    if the symbol-type of the steel-bolt is saturation-symbol:
        if goalstate is not hypothetical:
            say "[The steel-bolt] is already inscribed with the [saturation-symbol] symbol.";
        rule succeeds;
    require-or-fail the steel-bolt;
    require-or-fail the rosemary noting had-rosemary;
    attain-or-fail environment fiery-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        inscribe steel-bolt with saturation-symbol;
        set pronouns from the steel-bolt;
        say "You conjure a [saturation-symbol] symbol onto [the steel-bolt].";
        auto-drop the rosemary unless had-rosemary;
        auto-drop drop-envtool;
    rule succeeds.
 
The super-unrust-brass-inscription is a recallable symbol-action-goal.
The printed name is "doubled tarnish cleansing inscription[if any-saturation-steel-known] (with the brass pin)[end if]".
The short-description is "create the doubled tarnish cleanser".
[No creation-action, because there's no target object.]
Understand "super", "double", "doubled", "redoubled", "tarnish", "cleaner", "cleaning", "cleanser", "cleansing" as super-unrust-brass-inscription.
Understand "brass", "pin", "using", "with" as super-unrust-brass-inscription.
 
The super-unrust-steel-inscription is a recallable symbol-action-goal.
The printed name is "doubled rust cleansing inscription[if any-saturation-brass-known] (with the steel bolt)[end if]".
The short-description is "create the doubled rust cleanser".
[No creation-action, because there's no target object.]
Understand "super", "double", "doubled", "redoubled", "rust", "cleaner", "cleaning", "cleanser", "cleansing" as super-unrust-steel-inscription.
Understand "single", "steel", "bolt", "using", "with" as super-unrust-steel-inscription.
 
Goal prereqs rule for super-unrust-brass-inscription:
    if the symbol-type of the brass-pin is supersaturation-symbol:
        if goalstate is not hypothetical:
            say "[The brass-pin] is already inscribed with the [supersaturation-symbol] symbol.";
        rule succeeds;
    require-or-fail the brass-pin;
    require-or-fail the pinecone;
    attain-or-fail environment fiery-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the pinecone by ritual;
        inscribe brass-pin with supersaturation-symbol;
        set pronouns from the brass-pin;
        say "You conjure a [supersaturation-symbol] symbol onto [the brass-pin].";
        auto-drop drop-envtool;
    rule succeeds.
 
Goal prereqs rule for super-unrust-steel-inscription:
    if the symbol-type of the steel-bolt is supersaturation-symbol:
        if goalstate is not hypothetical:
            say "[The steel-bolt] is already inscribed with the [supersaturation-symbol] symbol.";
        rule succeeds;
    require-or-fail the steel-bolt;
    require-or-fail the pinecone;
    attain-or-fail environment fiery-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the pinecone by ritual;
        inscribe steel-bolt with supersaturation-symbol;
        set pronouns from the steel-bolt;
        say "You conjure a [supersaturation-symbol] symbol onto [the steel-bolt].";
        auto-drop drop-envtool;
    rule succeeds.
 
The gen-unrust-brass-inscription is a recallable symbol-action-goal.
The printed name is "universal tarnish cleansing inscription[if any-saturation-steel-known] (with the brass pin)[end if]".
The short-description is "create the universal tarnish cleanser".
[No creation-action, because there's no target object.]
Understand "universal", "tarnish", "rust", "cleaner", "cleaning", "cleanser", "cleansing" as gen-unrust-brass-inscription.
Understand "brass", "pin", "using", "with" as gen-unrust-brass-inscription.
 
The gen-unrust-steel-inscription is a recallable symbol-action-goal.
The printed name is "universal tarnish cleansing inscription[if any-saturation-brass-known] (with the steel bolt)[end if]".
The short-description is "create the universal tarnish cleanser".
[No creation-action, because there's no target object.]
Understand "universal", "tarnish", "rust", "cleaner", "cleaning", "cleanser", "cleansing" as gen-unrust-steel-inscription.
Understand "single", "steel", "bolt", "using", "with" as gen-unrust-steel-inscription.
 
Goal prereqs rule for gen-unrust-brass-inscription:
    if the symbol-type of the brass-pin is gensaturation-symbol:
        if goalstate is not hypothetical:
            say "[The brass-pin] is already inscribed with the [gensaturation-symbol] symbol.";
        rule succeeds;
    require-or-fail the brass-pin;
    require-or-fail the lubanja noting had-lubanja;
    attain-or-fail environment catalytic-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        inscribe brass-pin with gensaturation-symbol;
        set pronouns from the brass-pin;
        say "You conjure a [gensaturation-symbol] symbol onto [the brass-pin].";
        auto-drop the lubanja unless had-lubanja;
        auto-drop drop-envtool;
    rule succeeds.
 
Goal prereqs rule for gen-unrust-steel-inscription:
    if the symbol-type of the steel-bolt is gensaturation-symbol:
        if goalstate is not hypothetical:
            say "[The steel-bolt] is already inscribed with the [gensaturation-symbol] symbol.";
        rule succeeds;
    require-or-fail the steel-bolt;
    require-or-fail the lubanja noting had-lubanja;
    attain-or-fail environment catalytic-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        inscribe steel-bolt with gensaturation-symbol;
        set pronouns from the steel-bolt;
        say "You conjure a [gensaturation-symbol] symbol onto [the steel-bolt].";
        auto-drop the lubanja unless had-lubanja;
        auto-drop drop-envtool;
    rule succeeds.
 
The fixit-brass-inscription is a recallable symbol-action-goal.
The printed name is "intensional ballast inscription".
The short-description is "create the intensional ballast".
[No creation-action, because there's no target object.]
Understand "intensional", "intentional", "ballast" as fixit-brass-inscription.
 
The fixit-brass-inscription can be lit or unlit. [Hacky way to store whether the inscribed pin is in a ballast room.]
 
Goal prereqs rule for fixit-brass-inscription:
    if the symbol-type of the brass-pin is fixation-symbol:
        if goalstate is not hypothetical:
            say "[The brass-pin] is already inscribed with the [fixation-symbol] symbol.";
        rule succeeds;
    require-or-fail the brass-pin;
    require-or-fail the lubanja noting had-lubanja;
    require-or-fail the zafranum;
    attain-or-fail environment catalytic-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the zafranum by ritual;
        inscribe brass-pin with fixation-symbol;
        now the fixit-brass-inscription is unlit;
        set pronouns from the brass-pin;
        say "You conjure a [fixation-symbol] symbol onto [the brass-pin].";
        auto-drop the lubanja unless had-lubanja;
        auto-drop drop-envtool;
    rule succeeds.
 
The aura-toughen-inscription is a recallable symbol-action-goal.
The printed name is "aura impermeability inscription".
The short-description is "create the aura impermeability".
[No creation-action, because there's no target object.]
Understand "aura", "spirit", "spiritual", "impermeability", "brodzik", "brodzik's" as aura-toughen-inscription.
 
Goal prereqs rule for aura-toughen-inscription:
    if a quartz-prism (called ET) symbol-matches impermeability-symbol:
        if goalstate is not hypothetical:
            say "[The ET] is already inscribed with the [impermeability-symbol] symbol.";
        rule succeeds;
    let T be the more available of long-quartz and broad-quartz;
    require-or-fail T;
    require-or-fail the citronelle-impet noting had-citronelle;
    require-or-fail the orichalcum;
    attain-or-fail environment spiritual-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the orichalcum by ritual;
        inscribe T with impermeability-symbol;
        set pronouns from T;
        say "You conjure an [impermeability-symbol] symbol onto [the T].";
        auto-drop the citronelle-impet unless had-citronelle;
        auto-drop drop-envtool;
    rule succeeds.
 
The aura-invisibility-inscription is a recallable symbol-action-goal.
The printed name is "aura invisibility inscription".
The short-description is "create the aura invisibility".
[No creation-action, because there's no target object.]
Understand "aura", "spirit", "spiritual", "invisibility", "invisible", "royce", "royce's" as aura-invisibility-inscription.
 
Goal prereqs rule for aura-invisibility-inscription:
    if a quartz-prism (called ET) symbol-matches invisibility-symbol:
        if goalstate is not hypothetical:
            say "[The ET] is already inscribed with the [invisibility-symbol] symbol.";
        rule succeeds;
    let T be the more available of long-quartz and broad-quartz;
    require-or-fail T;
    require-or-fail the percalcinate;
    require-or-fail the sublime;
    attain-or-fail environment spiritual-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the percalcinate by ritual;
        retire the sublime by ritual;
        inscribe T with invisibility-symbol;
        set pronouns from T;
        say "You conjure an [invisibility-symbol] symbol onto [the T].";
        auto-drop drop-envtool;
    rule succeeds.
 
The aura-imi-quartz-inscription is a recallable symbol-action-goal.
The printed name is "aura imitation inscription[if aura-imi-jade-inscription is known] (with quartz)[end if]".
The short-description is "create the aura imitation".
[No creation-action, because there's no target object.]
Understand "aura", "spirit", "spiritual", "imitation", "imitate" as aura-imi-quartz-inscription.
Understand "oehlke", "oehlke's" as aura-imi-quartz-inscription.
Understand "quartz", "using", "with" as aura-imi-quartz-inscription.
Understand "long quartz", "broad quartz" as aura-imi-quartz-inscription. [Accept "perform imitation with long quartz", even though we ignore the adjective and pick the more available quartz.]
 
Goal prereqs rule for aura-imi-quartz-inscription:
    if a quartz-prism (called ET) symbol-matches imitation-symbol:
        if goalstate is not hypothetical:
            say "[The ET] is already inscribed with the [imitation-symbol] symbol.";
        rule succeeds;
    let T be the more available of long-quartz and broad-quartz;
    require-or-fail T;
    require-or-fail the percalcinate;
    require-or-fail the el-water;
    attain-or-fail environment spiritual-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the percalcinate by ritual;
        retire the el-water by ritual;
        inscribe T with imitation-symbol;
        set pronouns from T;
        now the proxy-goal of aura-imi-either-inscription is aura-imi-quartz-inscription;
        say "You conjure an [imitation-symbol] symbol onto [the T].";
        auto-drop drop-envtool;
    rule succeeds.
 
The aura-imi-jade-inscription is a recallable symbol-action-goal.
The printed name is "aura imitation inscription[if aura-imi-quartz-inscription is known] (with jade)[end if]".
The short-description is "create the aura imitation".
[No creation-action, because there's no target object.]
Understand "aura", "spirit", "spiritual", "imitation", "imitate" as aura-imi-jade-inscription.
Understand "riesenzweig", "reisenzweig", "rosenzweig", "yang", "wanli", "wan-li", "hou", "hou's", "lady hou", "lady hou's" as aura-imi-jade-inscription.
Understand "jade", "using", "with" as aura-imi-jade-inscription.
 
Goal prereqs rule for aura-imi-jade-inscription:
    if the jade symbol-matches imitation-symbol:
        if goalstate is not hypothetical:
            say "[The jade] is already inscribed with the [imitation-symbol] symbol.";
        rule succeeds;
    require-or-fail the jade;
    require-or-fail the iron-bead;
    require-or-fail the el-air-goal;
    require-or-fail the ignite-goal;
    let drop-lighter be the auto-drop-lighter of ignite-goal;
    attain-or-fail environment spiritual-env noting drop-envtool;
    require-or-fail the nave-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the iron-bead by ritual;
        resolve the el-air-goal, auto-dropping;
        inscribe jade with imitation-symbol;
        set pronouns from jade;
        now the proxy-goal of aura-imi-either-inscription is aura-imi-jade-inscription;
        say "You conjure an [imitation-symbol] symbol onto [the jade].";
        auto-drop the torch-lighter if drop-lighter;
        auto-drop drop-envtool;
    rule succeeds.
 
The aura-imi-either-inscription is a undescribed action-goal. [Not recallable; proxy for quartz or jade, whichever is more recent.]
The short-description is "create the aura imitation".
The aura-imi-either-inscription has an action-goal called the proxy-goal. The proxy-goal of aura-imi-either-inscription is impossible-goal.
Understand "g-im-either" as the aura-imi-either-inscription.
 
Goal prereqs rule for aura-imi-either-inscription:
    if a quartz-or-jade inscribable (called ET) symbol-matches imitation-symbol:
        if goalstate is not hypothetical:
            say "[The ET] is already inscribed with the [imitation-symbol] symbol.";
        rule succeeds;
    if proxy-goal of aura-imi-either-inscription is impossible-goal:
        if goalstate is not hypothetical:
            say "You're not sure which way to perform the aura imitation inscription.";
        rule fails;
    require-or-fail the proxy-goal of aura-imi-either-inscription;
    rule succeeds.
 
Definition: an inscribable is fully-imitation-charged if it symbol-matches imitation-symbol and the persona of it is not no-persona.
 
The glass-pass-inscription is a recallable symbol-action-goal.
The printed name is "glass permeability inscription".
The short-description is "create the glass bypass".
[No creation-action, because there's no target object.]
Understand "glass", "pass", "bypass", "permeability", "permeable" as glass-pass-inscription.
 
Goal prereqs rule for glass-pass-inscription:
    if the symbol-type of the F-sharp-chime is permeability-symbol:
        if goalstate is not hypothetical:
            say "[The F-sharp-chime] is already inscribed with the [permeability-symbol] symbol.";
        rule succeeds;
    require-or-fail the F-sharp-chime;
    require-or-fail the sand noting had-sand;
    attain-or-fail environment helian-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        inscribe F-sharp-chime with permeability-symbol;
        set pronouns from F-sharp-chime;
        say "You conjure a [permeability-symbol] symbol onto [the F-sharp-chime].";
        auto-drop the sand unless had-sand;
        auto-drop drop-envtool;
    rule succeeds.
 
The alum-pass-inscription is a recallable symbol-action-goal.
The printed name is "aluminum permeability inscription".
The short-description is "create the aluminum bypass".
[No creation-action, because there's no target object.]
Understand "aluminum", "pass", "bypass", "permeability", "permeable" as alum-pass-inscription.
 
Goal prereqs rule for alum-pass-inscription:
    if the symbol-type of the B-chime is permeability-symbol:
        if goalstate is not hypothetical:
            say "[The B-chime] is already inscribed with the [permeability-symbol] symbol.";
        rule succeeds;
    require-or-fail the B-chime;
    require-or-fail the sand noting had-sand;
    attain-or-fail environment helian-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        inscribe B-chime with permeability-symbol;
        set pronouns from B-chime;
        say "You conjure a [permeability-symbol] symbol onto [the B-chime].";
        auto-drop the sand unless had-sand;
        auto-drop drop-envtool;
    rule succeeds.
 
The glass-destroy-inscription is a recallable symbol-action-goal.
The printed name is "glass decoherence inscription".
The short-description is "create the glass breaker".
[No creation-action, because there's no target object.]
Understand "glass", "break", "breaker", "destroy", "destroyer", "decoherence", "decohere" as glass-destroy-inscription.
 
Goal prereqs rule for glass-destroy-inscription:
    if the F-sharp-chime symbol-matches decoherence-symbol:
        if goalstate is not hypothetical:
            say "[The F-sharp-chime] is already inscribed with the [decoherence-symbol] symbol.";
        rule succeeds;
    require-or-fail the F-sharp-chime;
    require-or-fail the sand noting had-sand;
    attain-or-fail environment helian-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        inscribe F-sharp-chime with decoherence-symbol;
        set pronouns from F-sharp-chime;
        say "You conjure a [decoherence-symbol] symbol onto [the F-sharp-chime].";
        auto-drop the sand unless had-sand;
        auto-drop drop-envtool;
    rule succeeds.
 
The alum-destroy-inscription is a recallable symbol-action-goal.
The printed name is "aluminum decoherence inscription".
The short-description is "create the aluminum breaker".
[No creation-action, because there's no target object.]
Understand "aluminum", "break", "breaker", "destroy", "destroyer", "decoherence", "decohere" as alum-destroy-inscription.
 
Goal prereqs rule for alum-destroy-inscription:
    if the B-chime symbol-matches decoherence-symbol:
        if goalstate is not hypothetical:
            say "[The B-chime] is already inscribed with the [decoherence-symbol] symbol.";
        rule succeeds;
    require-or-fail the B-chime;
    require-or-fail the sand noting had-sand;
    attain-or-fail environment helian-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        inscribe B-chime with decoherence-symbol;
        set pronouns from B-chime;
        say "You conjure a [decoherence-symbol] symbol onto [the B-chime].";
        auto-drop the sand unless had-sand;
        auto-drop drop-envtool;
    rule succeeds.
 
The bronze-magnet-inscription is a recallable symbol-action-goal.
The printed name is "metal attractor inscription[if alum-magnet-inscription is known] (for bronze)[end if]".
The short-description is "create the metal attractor".
[No creation-action, because there's no target object.]
Understand "metal", "magnet", "attraction", "attractor" as bronze-magnet-inscription.
Understand "bronze", "for bronze" as bronze-magnet-inscription.
 
Goal prereqs rule for bronze-magnet-inscription:
    if the B-chime symbol-matches attraction-symbol:
        if goalstate is not hypothetical:
            say "[The B-chime] is already inscribed with the [attraction-symbol] symbol.";
        rule succeeds;
    require-or-fail the B-chime;
    require-or-fail the zafranum;
    require-or-fail the ignite-goal;
    let drop-lighter be the auto-drop-lighter of ignite-goal;
    attain-or-fail environment anchor-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the zafranum by ritual;
        inscribe B-chime with attraction-symbol;
        set pronouns from B-chime;
        say "You conjure an [attraction-symbol] symbol onto [the B-chime].";
        auto-drop the torch-lighter if drop-lighter;
        auto-drop drop-envtool;
    rule succeeds.
 
The alum-magnet-inscription is a recallable symbol-action-goal.
The printed name is "metal attractor inscription[if bronze-magnet-inscription is known] (for aluminum)[end if]".
The short-description is "create the metal attractor".
[No creation-action, because there's no target object.]
Understand "metal", "magnet", "attraction", "attractor" as alum-magnet-inscription.
Understand "aluminum", "for aluminum" as alum-magnet-inscription.
 
Goal prereqs rule for alum-magnet-inscription:
    if the F-sharp-chime symbol-matches attraction-symbol:
        if goalstate is not hypothetical:
            say "[The F-sharp-chime] is already inscribed with the [attraction-symbol] symbol.";
        rule succeeds;
    require-or-fail the F-sharp-chime;
    require-or-fail the zafranum;
    require-or-fail the ignite-goal;
    let drop-lighter be the auto-drop-lighter of ignite-goal;
    attain-or-fail environment anchor-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the zafranum by ritual;
        inscribe F-sharp-chime with attraction-symbol;
        set pronouns from F-sharp-chime;
        say "You conjure an [attraction-symbol] symbol onto [the F-sharp-chime].";
        auto-drop the torch-lighter if drop-lighter;
        auto-drop drop-envtool;
    rule succeeds.
 
The lead-heavy-inscription is a recallable symbol-action-goal.
The printed name is "lead weight increase inscription".
The short-description is "create the lead weight increase".
[No creation-action, because there's no target object.]
Understand "lead", "weight", "heavy", "increase", "ponderosity", "ponderous", "troutman", "troutman's" as lead-heavy-inscription.
 
Goal prereqs rule for lead-heavy-inscription:
    if a pebble (called ET) symbol-matches ponderosity-symbol:
        if goalstate is not hypothetical:
            say "[The ET] is already inscribed with the [ponderosity-symbol] symbol.";
        rule succeeds;
    let T be the most available pebble;
    require-or-fail T;
    require-or-fail the rosemary noting had-rosemary;
    require-or-fail the Gaian-precip;
    attain-or-fail environment anchor-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the Gaian-precip by ritual;
        inscribe T with ponderosity-symbol;
        set pronouns from T;
        say "You conjure a [ponderosity-symbol] symbol onto [the T].";
        auto-drop the rosemary unless had-rosemary;
        auto-drop drop-envtool;
    rule succeeds.
 
The lead-light-cg-inscription is a recallable symbol-action-goal.
The printed name is "lead weight decrease inscription[if lead-light-at-inscription is known] (with precipitate)[end if]".
The short-description is "create the lead weight decrease".
[No creation-action, because there's no target object.]
Understand "lead", "weight", "light", "decrease", "gossamerity", "gossamer", "with", "using", "precipitate" as lead-light-cg-inscription.
 
Goal prereqs rule for lead-light-at-inscription:
    if a pebble (called ET) symbol-matches gossamerity-symbol:
        if goalstate is not hypothetical:
            say "[The ET] is already inscribed with the [gossamerity-symbol] symbol.";
        rule succeeds;
    let T be the most available pebble;
    require-or-fail T;
    require-or-fail the rosemary noting had-rosemary;
    require-or-fail the anti-Tellurian-dist;
    attain-or-fail environment anchor-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the anti-Tellurian-dist by ritual;
        inscribe T with gossamerity-symbol;
        set pronouns from T;
        now the proxy-goal of lead-light-either-inscription is lead-light-at-inscription;
        say "You conjure a [gossamerity-symbol] symbol onto [the T].";
        auto-drop the rosemary unless had-rosemary;
        auto-drop drop-envtool;
    rule succeeds.
 
The lead-light-at-inscription is a recallable symbol-action-goal.
The printed name is "lead weight decrease inscription[if lead-light-cg-inscription is known] (with distillate)[end if]".
The short-description is "create the lead weight decrease".
[No creation-action, because there's no target object.]
Understand "lead", "weight", "light", "decrease", "gossamerity", "gossamer", "with", "using", "distillate" as lead-light-at-inscription.
 
Goal prereqs rule for lead-light-cg-inscription:
    if a pebble (called ET) symbol-matches gossamerity-symbol:
        if goalstate is not hypothetical:
            say "[The ET] is already inscribed with the [gossamerity-symbol] symbol.";
        rule succeeds;
    let T be the most available pebble;
    require-or-fail T;
    require-or-fail the rosemary noting had-rosemary;
    require-or-fail the counter-Gaian-precip;
    attain-or-fail environment anchor-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the counter-Gaian-precip by ritual;
        inscribe T with gossamerity-symbol;
        set pronouns from T;
        now the proxy-goal of lead-light-either-inscription is lead-light-cg-inscription;
        say "You conjure a [gossamerity-symbol] symbol onto [the T].";
        auto-drop the rosemary unless had-rosemary;
        auto-drop drop-envtool;
    rule succeeds.
 
The lead-light-either-inscription is a undescribed action-goal. [Not recallable; proxy for lead-light-gt- or lead-light-at, whichever is more recent.]
The short-description is "create the lead weight decrease".
The lead-light-either-inscription has an action-goal called the proxy-goal. The proxy-goal of lead-light-either-inscription is impossible-goal.
Understand "g-ll-either" as the lead-light-either-inscription.
 
Goal prereqs rule for lead-light-either-inscription:
    if a pebble (called ET) symbol-matches gossamerity-symbol:
        if goalstate is not hypothetical:
            say "[The ET] is already inscribed with the [gossamerity-symbol] symbol.";
        rule succeeds;
    if proxy-goal of lead-light-either-inscription is impossible-goal:
        if goalstate is not hypothetical:
            say "You're not sure which way to perform the lead weight decrease inscription.";
        rule fails;
    require-or-fail the proxy-goal of lead-light-either-inscription;
    rule succeeds.
 
The scalpel-inscription is a recallable symbol-action-goal.
The printed name is "prophylactic scalpel inscription".
The short-description is "create the prophylactic scalpel".
[No creation-action, because there's no target object.]
Understand "scalpel", "prophylaxis", "prophylactic", "musante", "musante's" as scalpel-inscription.
 
Goal prereqs rule for scalpel-inscription:
    if the scalpel symbol-matches prophylaxis-symbol:
        if goalstate is not hypothetical:
            say "The scalpel is already inscribed with the [prophylaxis-symbol] symbol.";
        rule succeeds;
    require-or-fail the scalpel;
    if the scalpel is dirty:
        require-or-fail the clean-scalpel-goal;
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        inscribe scalpel with prophylaxis-symbol;
        set pronouns from scalpel;
        say "You conjure a [prophylaxis-symbol] symbol onto [the scalpel].";
    rule succeeds.
 
The fulcrum-inscription is a recallable symbol-action-goal.
The printed name is "dragon fulcrum inscription".
The short-description is "create the dragon fulcrum".
[No creation-action, because there's no target object.]
Understand "dragon", "fulcrum" as the fulcrum-inscription.
 
[The following three properties are set and cleared together. Initially, the glyph-used is no-word and the pebble-used is no-thing.]
The fulcrum-inscription has a formula called the glyph-used. The glyph-used of fulcrum-inscription is usually no-word.
The fulcrum-inscription has a thing called the pebble-used. The pebble-used of fulcrum-inscription is no-thing.
The fulcrum-inscription can be lit or unlit. [Hacky way to store whether the current inscribed pebble is in a nest room.]
[The next two are cleared with the above, but not set until summoning time.]
The fulcrum-inscription has a formula called the sequence-used. The sequence-used of fulcrum-inscription is usually no-word. [Symmetric or antisymmetric.]
The fulcrum-inscription has a number called the senility. [0: not near a dragon. 1: drifting towards a dragon. 2: done.]
 
[Safe, fast way to check the existence of a fulcrum. Returns a leverage-inscribed pebble or no-thing.]
To decide what thing is the current-fulcrum:
    let T be the pebble-used of fulcrum-inscription;
    if T is no-thing or T is not a pebble:
        decide on no-thing;
    if the glyph-used of fulcrum-inscription is no-word:
        decide on no-thing;
    if T does not symbol-match leverage-symbol:
        decide on no-thing;
    decide on T.
 
Goal prereqs rule for fulcrum-inscription:
    if a pebble (called ET) symbol-matches leverage-symbol:
        if goalstate is not hypothetical:
            say "[The ET] is already inscribed with the [leverage-symbol] symbol.";
        rule succeeds;
    unless there is a known unconsumed alien-glyph (called G):
        if goalstate is not hypothetical:
            let N be the number of known alien-glyphs;
            if N is zero:
                say "You do not know any glyphs.";
            else if N is one:
                say "The glyph that you have learned no longer seems to work.";
            else:
                say "The glyphs that you have learned no longer seem to work.";
        rule fails;
    [Preflight the quicksilver-env goal. This is a hack to avoid the case where we pick up vitriolic, run outside, and the vitriolic explodes.]
    attain-or-fail environment quicksilver-env noting drop-envtool;
    let T be the most available pebble;
    require-or-fail T;
    require-or-fail the vitriolic acid noting had-vitriolic;
    attain-or-fail environment quicksilver-env noting drop-envtool2; [again]
    require-or-fail the generic-ritual-location;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        inscribe T with leverage-symbol;
        now the glyph-used of fulcrum-inscription is G;
        now the pebble-used of fulcrum-inscription is T;
        now the sequence-used of fulcrum-inscription is no-word;
        now the senility of fulcrum-inscription is zero;
        now the fulcrum-inscription is unlit;
        set pronouns from T;
        say "You conjure a [leverage-symbol] symbol onto [the T], using [the G].";
        auto-drop the vitriolic acid unless had-vitriolic;
        auto-drop drop-envtool;
        auto-drop drop-envtool2;
    rule succeeds.
 
 
The clean-scalpel-goal is an action-goal. The short-description is "clean the scalpel".
Goal prereqs rule for clean-scalpel-goal:
    require-or-fail the scalpel;
    if the scalpel is dirty:
        require-or-fail the location of the aeroclave;
        if goalstate is not hypothetical:
            say "You aeroclave the scalpel clean.";
            now the scalpel is clean;
    rule succeeds.
 
The dispersal-brush-creation is a recallable action-goal.
The printed name is "dispersal brush creation". The short-description is "enchant the dispersal brush".
The creation-action of the dispersal-brush is the dispersal-brush-creation.
Understand "dispersal", "brush" as the dispersal-brush-creation.
Understand "creation", "enchantment" as the dispersal-brush-creation.
 
Goal prereqs rule for dispersal-brush-creation:
    require-or-fail the feather;
    require-or-fail the alcohol noting had-alcohol;
    require-or-fail the generic-ritual-location;
    if the dispersal-brush is on-stage:
        [shouldn't hit this, since feather is used up]
        say "You've already made [the dispersal-brush]; [recall dispersal-brush briefly].";
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        substitute the dispersal-brush for the feather;
        set pronouns from the dispersal-brush;
        say "You enchant the dispersal brush.";
        auto-drop the alcohol unless had-alcohol;
    rule succeeds.
 
The oculus-creation is a recallable action-goal.
The printed name is "resonant oculus creation". The short-description is "enchant the resonant oculus".
The creation-action of the oculus is the oculus-creation.
Understand "resonant", "oculus" as the oculus-creation.
Understand "creation", "enchantment" as the oculus-creation.
 
Goal prereqs rule for oculus-creation:
    require-or-fail the glass-loop;
    attain-or-fail environment lunar-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if the oculus is on-stage:
        [shouldn't hit this, since glass-loop is used up]
        say "You've already made [the oculus]; [recall oculus briefly].";
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        substitute the oculus for the glass-loop;
        set pronouns from the oculus;
        say "You enchant the resonant oculus.";
        auto-drop drop-envtool;
    rule succeeds.
 
The lens-creation is a recallable action-goal.
The printed name is "planetary lens creation". The short-description is "enchant the planetary lens".
The creation-action of the planetary-lens is the lens-creation.
Understand "planetary", "lens" as the lens-creation.
Understand "creation", "enchantment" as the lens-creation.
 
Goal prereqs rule for lens-creation:
    require-or-fail the convex-lens;
    require-or-fail the concave-lens;
    require-or-fail the lubanja noting had-lubanja;
    attain-or-fail environment lunar-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if the planetary-lens is on-stage:
        [shouldn't hit this, since lenses are used up]
        say "You've already made [the planetary-lens]; [recall planetary-lens briefly].";
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the concave-lens by transformation into the planetary-lens;
        retire the convex-lens by transformation into the planetary-lens;
        now the player carries the planetary-lens;
        set pronouns from the planetary-lens;
        say "You enchant the planetary lens.";
        auto-drop the lubanja unless had-lubanja;
        auto-drop drop-envtool;
    rule succeeds.
 
The purity-creation is a recallable action-goal.
The printed name is "lodestone of purity creation". The short-description is "enchant the lodestone of purity".
The creation-action of the purity-lodestone is the purity-creation.
Understand "purity", "lodestone", "lodestone of", "lavelle", "lavelle's" as the purity-creation.
Understand "creation", "enchantment" as the purity-creation.
 
Goal prereqs rule for purity-creation:
    require-or-fail the silver-chain;
    attain-or-fail environment lunar-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if the purity-lodestone is on-stage:
        [shouldn't hit this, since silver-chain is used up]
        say "You've already made [the purity-lodestone]; [recall purity-lodestone briefly].";
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        substitute the purity-lodestone for the silver-chain;
        set pronouns from the purity-lodestone;
        say "You enchant the lodestone of purity.";
        auto-drop drop-envtool;
    rule succeeds.
 
The centrality-creation is a recallable action-goal.
The printed name is "lodestone of centrality creation". The short-description is "enchant the lodestone of centrality".
The creation-action of the centrality-lodestone is the centrality-creation.
The centrality-creation has a thing called the fire-source-used. The fire-source-used of centrality-creation is the phlo-gold.
Understand "centrality", "lodestone", "lodestone of", "misuba", "misuba's" as the centrality-creation.
Understand "creation", "enchantment" as the centrality-creation.
 
Goal prereqs rule for centrality-creation:
    require-or-fail the silk-cord;
    require-or-fail the H-chime noting had-H-chime;
    require-or-fail the labyrinth-tile noting had-tile;
    require-or-fail the viridigris;
    require-or-fail the el-earth;
    let F be the el-fire-source for centrality-creation;
    if F is nothing:
        rule fails;
    attain-or-fail environment earthy-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if the centrality-lodestone is on-stage:
        [shouldn't hit this, since el-earth is used up]
        say "You've already made [the centrality-lodestone]; [recall centrality-lodestone briefly].";
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire viridigris by ritual;
        retire el-earth by ritual;
        dephlogisticate F, auto-dropping;
        substitute the centrality-lodestone for the silk-cord;
        set pronouns from the centrality-lodestone;
        say "You enchant the lodestone of centrality.";
        auto-drop the H-chime unless had-H-chime;
        auto-drop the labyrinth-tile unless had-tile;
        auto-drop drop-envtool;
    rule succeeds.
 
The el-earth-location is an action-goal. The short-description is "locate the elemental earth".
Goal prereqs rule for el-earth-location:
    require-or-fail the purity-lodestone noting had-purity;
    require-or-fail the location of the el-earth;
    if goalstate is not hypothetical:
        now the player carries the el-earth;
        set pronouns from the el-earth;
        say "You use the purity lodestone to recover the elemental earth.";
        auto-drop the purity-lodestone unless had-purity;
    rule succeeds.
 
The diamond-perfection is a recallable action-goal.
The printed name is "perfect diamond creation". The short-description is "perfect the diamond".
The creation-action of the perfect-diamond is the diamond-perfection.
Understand "perfect", "flawless", "diamond" as the diamond-perfection.
Understand "creation", "enchantment", "perfection" as the diamond-perfection.
 
Goal prereqs rule for diamond-perfection:
    require-or-fail the rough-diamond;
    require-or-fail the el-earth;
    require-or-fail the G-flat-chime noting had-G-flat-chime;
    attain-or-fail environment phlegmatic-env noting drop-envtool; [will be the Phleg-Lab]
    require-or-fail the generic-ritual-location;
    if the perfect-diamond is on-stage:
        [shouldn't hit this, since rough-diamond is used up]
        say "You've already made [the perfect-diamond]; [recall perfect-diamond briefly].";
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        substitute the perfect-diamond for the rough-diamond;
        set pronouns from the perfect-diamond;
        say "You perfect the rough diamond.";
        auto-drop the G-flat-chime unless had-G-flat-chime;
        [don't auto-drop the el-earth, because the point is to "double" it]
        auto-drop drop-envtool;
    rule succeeds.
 
The phlo-electrum-creation is a recallable action-goal.
The printed name is "electrum phlogistication". The short-description is "phlogisticate the electrum".
The creation-action of the phlo-electrum is the phlo-electrum-creation.
Understand "electrum", "regium" as the phlo-electrum-creation.
Understand "creation", "phlogistication" as the phlo-electrum-creation.
 
Goal prereqs rule for phlo-electrum-creation:
    require-or-fail the electrum; [before the catalytic goal, so that platinum is resolved]
    require-or-fail the brun-oil;
    attain-or-fail environment catalytic-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if the phlo-electrum is on-stage:
        [shouldn't hit this, since brun-oil is used up]
        say "You've already made [the phlo-electrum]; [recall phlo-electrum briefly].";
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the brun-oil by ritual;
        substitute the phlo-electrum for the electrum;
        now the electrum is ever-used;
        set pronouns from phlo-electrum;
        say "You phlogisticate the electrum.";
        auto-drop drop-envtool;
    rule succeeds.
 
 
The fungicide-creation is a recallable pot-synthesis-action-goal.
The printed name is "fungicide synthesis". The short-description is "create the fungicide".
The creation-action of the fungicide is fungicide-creation.
 
Goal prereqs rule for fungicide-creation:
    require-or-fail the saline noting had-saline;
    require-or-fail the mushroom noting had-mushroom;
    require-or-fail the mustard;
    require-or-fail the chymic-ritual-location;
    if fungicide is on-stage:
        if goalstate is not hypothetical:
            invoke duplicate-ritual for fungicide;
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        now the mushroom is moist;
        retire the mustard by ritual;
        now the player carries the fungicide;
        set pronouns from the fungicide;
        say "You brew a bottle of fungicide.";
        auto-drop the mushroom unless had-mushroom;
        auto-drop the saline unless had-saline;
    rule succeeds.
 
The coralicide-creation is a recallable pot-synthesis-action-goal.
The printed name is "coralicide synthesis". The short-description is "create the coralicide".
The creation-action of the coralicide is coralicide-creation.
 
Goal prereqs rule for coralicide-creation:
    require-or-fail the saline noting had-saline;
    require-or-fail the coral;
    require-or-fail the mustard;
    require-or-fail the chymic-ritual-location;
    if coralicide is on-stage:
        if goalstate is not hypothetical:
            invoke duplicate-ritual for coralicide;
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the coral by ritual;
        retire the mustard by ritual;
        now the player carries the coralicide;
        set pronouns from the coralicide;
        say "You brew a bottle of coralicide.";
        auto-drop the saline unless had-saline;
    rule succeeds.
 
The fire-resistance-creation is a recallable pot-synthesis-action-goal.
The printed name is "fire-resistance synthesis". The short-description is "create the fire-resistance potion".
The creation-action of the fire-resistance is fire-resistance-creation.
Understand "fire", "resistance", "protection" as fire-resistance-creation.
 
Goal prereqs rule for fire-resistance-creation:
    require-or-fail the saline noting had-saline;
    require-or-fail the ginger-impet noting had-ginger;
    require-or-fail the peppermint-impet noting had-peppermint;
    require-or-fail the generic-ritual-location;
    if fire-resistance is on-stage:
        if goalstate is not hypothetical:
            invoke duplicate-ritual for fire-resistance;
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        now the player carries the fire-resistance;
        set pronouns from the fire-resistance;
        say "You brew a bottle of fire-resistance potion.";
        auto-drop the saline unless had-saline;
        auto-drop the ginger-impet unless had-ginger;
        auto-drop the peppermint-impet unless had-peppermint;
    rule succeeds.
 
The breath-holding-creation is a recallable pot-synthesis-action-goal.
The printed name is "breath-holding synthesis". The short-description is "create the breath-holding potion".
The creation-action of the breath-holding is breath-holding-creation.
Understand "breath", "holding" as breath-holding-creation.
 
Goal prereqs rule for breath-holding-creation:
    require-or-fail the kelp-impet noting had-kelp;
    require-or-fail the saline noting had-saline;
    require-or-fail the paten noting had-paten;
    require-or-fail the el-wood noting had-el-wood;
    require-or-fail the ignite-goal;
    let drop-lighter be the auto-drop-lighter of ignite-goal;
    attain-or-fail environment exhilarant-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if breath-holding is on-stage:
        if goalstate is not hypothetical:
            invoke duplicate-ritual for breath-holding;
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        now the el-wood is not alight;
        update fire consumption;
        now the player carries the breath-holding;
        set pronouns from the breath-holding;
        say "You brew a bottle of breath-holding potion.";
        auto-drop the kelp-impet unless had-kelp;
        auto-drop the saline unless had-saline;
        auto-drop the paten unless had-paten;
        auto-drop the el-wood unless had-el-wood;
        auto-drop the torch-lighter if drop-lighter;
        auto-drop drop-envtool;
    rule succeeds.
 
The fire-sucker-creation is a recallable pot-synthesis-action-goal.
The printed name is "fire-devourer synthesis". The short-description is "create the fire-devourer".
The creation-action of the fire-sucker is fire-sucker-creation.
The fire-sucker-creation has a thing called the fire-source-used. The fire-source-used of fire-sucker-creation is the phlo-gold.
Understand "fire", "devourer", "fire-devour" as fire-sucker-creation.
 
Goal prereqs rule for fire-sucker-creation:
    require-or-fail the alcohol noting had-alcohol;
    require-or-fail the ginger-impet noting had-ginger;
    let F be the el-fire-source for fire-sucker-creation;
    if F is nothing:
        rule fails;
    attain-or-fail environment fierier-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if fire-sucker is on-stage:
        if goalstate is not hypothetical:
            invoke duplicate-ritual for fire-sucker;
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        dephlogisticate F, auto-dropping;
        now the player carries the fire-sucker;
        set pronouns from the fire-sucker;
        say "You brew a bottle of fire devourer.";
        auto-drop the alcohol unless had-alcohol;
        auto-drop the ginger-impet unless had-ginger;
        auto-drop drop-envtool;
    rule succeeds.
 
The vacuum-protection-creation is a recallable pot-synthesis-action-goal.
The printed name is "vacuum-protection synthesis". The short-description is "create the vacuum-protection potion".
The creation-action of the vacuum-protection is vacuum-protection-creation.
Understand "vacuum", "resistance", "protection", "muldoon", "muldoon's" as vacuum-protection-creation.
 
Goal prereqs rule for vacuum-protection-creation:
    require-or-fail the saline noting had-saline;
    require-or-fail the highlime;
    attain-or-fail environment exhilarant-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if vacuum-protection is on-stage:
        if goalstate is not hypothetical:
            invoke duplicate-ritual for vacuum-protection;
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the highlime by ritual;
        now the player carries the vacuum-protection;
        set pronouns from the vacuum-protection;
        say "You brew a bottle of vacuum protection.";
        auto-drop the saline unless had-saline;
        auto-drop drop-envtool;
    rule succeeds.
 
The aither-protection-creation is a recallable pot-synthesis-action-goal.
The printed name is "aither-resistance synthesis". The short-description is "create the aither-resistance potion".
The creation-action of the aither-protection is aither-protection-creation.
Understand "aither", "resistance", "aither-resistance", "protection", "foreign", "hostile" as aither-protection-creation.
 
Goal prereqs rule for aither-protection-creation:
    require-or-fail the saline noting had-saline;
    require-or-fail the kelp-impet noting had-kelp;
    require-or-fail the rock-salt noting had-rock-salt;
    require-or-fail the zafranum;
    require-or-fail the ignite-goal;
    let drop-lighter be the auto-drop-lighter of ignite-goal;
    attain-or-fail environment exhilarant-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if aither-protection is on-stage:
        if goalstate is not hypothetical:
            invoke duplicate-ritual for aither-protection;
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the zafranum by ritual;
        now the player carries the aither-protection;
        set pronouns from the aither-protection;
        say "You brew a bottle of aither resistance.";
        auto-drop the saline unless had-saline;
        auto-drop the kelp-impet unless had-kelp;
        auto-drop the rock-salt unless had-rock-salt;
        auto-drop the torch-lighter if drop-lighter;
        auto-drop drop-envtool;
    rule succeeds.
 
The clock-tincture-creation is a recallable synthesis-action-goal.
The printed name is "clock tincture synthesis". The short-description is "create the clock tincture".
The creation-action of the clock-tincture is clock-tincture-creation.
Understand "clock", "clockwork", "tincture", "winfield", "winfield's" as clock-tincture-creation.
 
Goal prereqs rule for clock-tincture-creation:
    require-or-fail the alum noting had-alum;
    require-or-fail the perfect-mud;
    require-or-fail the sublime;
    require-or-fail the brass-pin; [Check this last, because realistically the mud or sublime is harder to get. We're cheaping out on a brass-object-selection subgoal.]
    attain-or-fail environment orderly-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if clock-tincture is on-stage:
        if goalstate is not hypothetical:
            invoke duplicate-ritual for clock-tincture;
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the brass-pin by ritual;
        retire the perfect-mud by ritual;
        retire the sublime by ritual;
        now the player carries the clock-tincture;
        set pronouns from the clock-tincture;
        say "You brew the clock tincture.";
        auto-drop the alum unless had-alum;
        auto-drop drop-envtool;
    rule succeeds.
 
The brun-oil-creation is a recallable synthesis-action-goal.
The printed name is "yang oil synthesis". The short-description is "create yang oil".
The creation-action of the brun-oil is brun-oil-creation.
Understand "yang", "orange", "oil", "schepler", "schepler's", "scheplers" as brun-oil-creation.
 
Goal prereqs rule for brun-oil-creation:
    require-or-fail the mineral-oil noting had-mineral-oil;
    require-or-fail the honeysuckle;
    require-or-fail the swamp-pith;
    require-or-fail the linden noting had-linden;
    require-or-fail the ignite-goal;
    let drop-lighter be the auto-drop-lighter of ignite-goal;
    attain-or-fail environment catalytic-env noting drop-envtool;
    require-or-fail the generic-ritual-location;
    if brun-oil is on-stage:
        if goalstate is not hypothetical:
            invoke duplicate-ritual for brun-oil;
        rule fails;
    if goalstate is not hypothetical:
        auto-clean ritual location;
        now the linden is not alight;
        now the swamp-pith is not alight;
        retire the swamp-pith by ritual;
        retire the honeysuckle by ritual;
        now the player carries the brun-oil;
        set pronouns from the brun-oil;
        say "You brew a vial of yang oil.";
        auto-drop the mineral-oil unless had-mineral-oil;
        auto-drop the linden unless had-linden;
        auto-drop the torch-lighter if drop-lighter;
        auto-drop drop-envtool;
    rule succeeds.
 
The Gaian-precip-creation is a recallable synthesis-action-goal.
The printed name is "Gaian precipitate synthesis". The short-description is "create Gaian precipitate".
The creation-action of the Gaian-precip is Gaian-precip-creation.
Understand "gaian", "gaiain", "gaiaian", "precipitate" as the Gaian-precip-creation.
 
Goal prereqs rule for Gaian-precip-creation:
    require-or-fail the vitriolic acid noting had-vitriolic;
    require-or-fail the alum noting had-alum;
    require-or-fail the orichalcum;
    require-or-fail the el-earth;
    require-or-fail the chymic-ritual-location;
    [cannot already exist due to prereqs]
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the el-earth by ritual;
        retire the orichalcum by ritual;
        now the player carries the Gaian-precip;
        set pronouns from the Gaian-precip;
        say "You brew a vial of Gaian precipitate.";
        auto-drop the vitriolic acid unless had-vitriolic;
        auto-drop the alum unless had-alum;
    rule succeeds.
 
The counter-Gaian-precip-creation is a recallable synthesis-action-goal.
The printed name is "counter-Gaian precipitate synthesis". The short-description is "create counter-Gaian precipitate".
The creation-action of the counter-Gaian-precip is counter-Gaian-precip-creation.
Understand "counter", "counter-gaian", "countergaian", "precipitate" as the counter-Gaian-precip-creation.
 
Goal prereqs rule for counter-Gaian-precip-creation:
    require-or-fail the vitriolic acid noting had-vitriolic;
    require-or-fail the alum noting had-alum;
    require-or-fail the el-earth;
    require-or-fail the orichalcum;
    require-or-fail the chymic-ritual-location;
    [cannot already exist due to prereqs]
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the el-earth by ritual;
        retire the orichalcum by ritual;
        now the player carries the counter-Gaian-precip;
        set pronouns from the counter-Gaian-precip;
        say "You brew a vial of counter-Gaian precipitate.";
        auto-drop the vitriolic acid unless had-vitriolic;
        auto-drop the alum unless had-alum;
    rule succeeds.
 
The sublime-creation is a recallable synthesis-action-goal.
The printed name is "sublime spirit synthesis". The short-description is "create sublime spirit".
The creation-action of the sublime is sublime-creation.
The sublime-creation has a thing called the fire-source-used. The fire-source-used of sublime-creation is the phlo-gold.
Understand "sublime", "spirit", "essence" as sublime-creation.
 
Goal prereqs rule for sublime-creation:
    require-or-fail the mineral-oil noting had-mineral-oil;
    let N be the nickel-wire;
    if the nickel-filings is ever-seen and the nickel-filings-accessible:
        [We use an ad-hoc accessibility test to rule out the filings when the 3rd-lab is locked up. This doesn't matter for normal play, but trips up "zap-omni" tests.]
        now N is the nickel-filings;
    require-or-fail N;
    let F be the el-fire-source for sublime-creation;
    if F is nothing:
        rule fails;
    require-or-fail the chymic-ritual-location;
    [cannot already exist due to prereqs]
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire N by ritual;
        dephlogisticate F, auto-dropping;
        now the player carries the sublime;
        set pronouns from the sublime;
        say "You brew a vial of sublime spirit[if the nickel-filings is ever-seen] (with [the N])[end if].";
        auto-drop the mineral-oil unless had-mineral-oil;
    rule succeeds.
 
The percalcinate-creation is a recallable synthesis-action-goal.
The printed name is "copper percalcinate synthesis". The short-description is "create copper percalcinate".
The creation-action of the percalcinate is percalcinate-creation.
Understand "copper" as percalcinate-creation.
 
Goal prereqs rule for percalcinate-creation:
    require-or-fail the muriatic acid noting had-muriatic;
    require-or-fail the orichalcum;
    require-or-fail the chymic-ritual-location;
    [cannot already exist due to prereqs]
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the orichalcum by ritual;
        now the player carries the percalcinate;
        set pronouns from the percalcinate;
        say "You brew a vial of copper percalcinate.";
        auto-drop the muriatic acid unless had-muriatic;
    rule succeeds.
 
The bamuriatic-creation is a recallable synthesis-action-goal.
The printed name is "bamuriatic acid synthesis". The short-description is "create bamuriatic acid".
The creation-action of the bamuriatic is bamuriatic-creation.
Understand "acid" as bamuriatic-creation.
 
Goal prereqs rule for bamuriatic-creation:
    require-or-fail the vitriolic acid noting had-vitriolic;
    require-or-fail the fluorite;
    require-or-fail the saline noting had-saline;
    require-or-fail the chymic-ritual-location;
    [cannot already exist due to prereqs]
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the fluorite by ritual;
        now the player carries the bamuriatic;
        set pronouns from the bamuriatic;
        say "You brew a vial of bamuriatic acid.";
        auto-drop the vitriolic acid unless had-vitriolic;
        auto-drop the saline unless had-saline;
    rule succeeds.
 
The viridigris-creation is a recallable synthesis-action-goal.
The printed name is "viridigris synthesis". The short-description is "create viridigris".
The creation-action of the viridigris is viridigris-creation.
Understand "verdigris" as viridigris-creation.
 
Goal prereqs rule for viridigris-creation:
    require-or-fail the vinegar noting had-vinegar;
    require-or-fail the orichalcum;
    require-or-fail the chymic-ritual-location;
    [cannot already exist due to prereqs]
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the orichalcum by ritual;
        now the player carries the viridigris;
        set pronouns from the viridigris;
        say "You brew a vial of viridigris.";
        auto-drop the vinegar unless had-vinegar;
    rule succeeds.
 
The perfect-mud-creation is a recallable synthesis-action-goal.
The printed name is "perfect mud synthesis". The short-description is "create perfect mud".
The creation-action of the perfect-mud is perfect-mud-creation.
Understand "perfect", "mud", "jackson", "jackson-mud" as perfect-mud-creation.
 
Goal prereqs rule for perfect-mud-creation:
    require-or-fail the sand noting had-sand;
    require-or-fail the el-water;
    require-or-fail the el-earth;
    require-or-fail the chymic-ritual-location;
    [cannot already exist due to prereqs]
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the el-water by ritual;
        retire the el-earth by ritual;
        now the player carries the perfect-mud;
        set pronouns from the perfect-mud;
        say "You brew a vial of perfect mud.";
        auto-drop the sand unless had-sand;
    rule succeeds.
 
A solvent-synthesis-action-goal is a kind of synthesis-action-goal.
A solvent-synthesis-action-goal has a thing called the mineral-used.
A solvent-synthesis-action-goal has some text called the mineral.
A solvent-synthesis-action-goal is always recallable.
Understand "stone", "solvent", "tucker", "tucker's" as a solvent-synthesis-action-goal.
 
[Creation-actions of the solvent objects are initially unset. We'll set them as the player performs them.]
 
Definition: a solvent-synthesis-action-goal is rstate-mineral-matching if (the mineral-used of it is the mineral-used of rstate) or (the mineral-used of it is long-quartz and the mineral-used of rstate is broad-quartz) or (the mineral-used of it is flint-pebble and the mineral-used of rstate is baros-key).
 
A diasolvent-synthesis-action-goal is a kind of solvent-synthesis-action-goal.
The printed name of a diasolvent-synthesis-action-goal is always "[mineral of the item described] solvent synthesis[if a earsolvent-synthesis-action-goal is known] (with the perfect diamond)[end if]".
The short-description of a diasolvent-synthesis-action-goal is always "create the [mineral of the item described] solvent".
Understand "with", "using", "perfect", "diamond" as a diasolvent-synthesis-action-goal.
 
A earsolvent-synthesis-action-goal is a kind of solvent-synthesis-action-goal.
The printed name of a earsolvent-synthesis-action-goal is always "[mineral of the item described] solvent synthesis[if a diasolvent-synthesis-action-goal is known] (with the elemental earth)[end if]".
The short-description of a earsolvent-synthesis-action-goal is always "create the [mineral of the item described] solvent".
Understand "with", "using", "elemental", "earth" as a earsolvent-synthesis-action-goal.
 
[This first one can never be performed; it's only for teaching.]
The earsolvent-granite-synthesis is a earsolvent-synthesis-action-goal.
The mineral is "granite". The mineral-used is nonexistent-stone.
Understand "granite" as the earsolvent-granite-synthesis.
 
The diasolvent-slate-synthesis is a diasolvent-synthesis-action-goal.
The mineral is "slate". The mineral-used is granite-pebble.
Understand "slate" as the diasolvent-slate-synthesis.
 
The earsolvent-slate-synthesis is a earsolvent-synthesis-action-goal.
The mineral is "slate". The mineral-used is granite-pebble.
Understand "slate" as the earsolvent-slate-synthesis.
 
The diasolvent-malachite-synthesis is a diasolvent-synthesis-action-goal.
The mineral is "malachite". The mineral-used is sandstone-pebble.
Understand "malachite" as the diasolvent-malachite-synthesis.
 
The earsolvent-malachite-synthesis is a earsolvent-synthesis-action-goal.
The mineral is "malachite". The mineral-used is sandstone-pebble.
Understand "malachite" as the earsolvent-malachite-synthesis.
 
The diasolvent-soapstone-synthesis is a diasolvent-synthesis-action-goal.
The mineral is "soapstone". The mineral-used is basalt-pebble.
Understand "soapstone" as the diasolvent-soapstone-synthesis.
 
The earsolvent-soapstone-synthesis is a earsolvent-synthesis-action-goal.
The mineral is "soapstone". The mineral-used is basalt-pebble.
Understand "soapstone" as the earsolvent-soapstone-synthesis.
 
The diasolvent-chalk-synthesis is a diasolvent-synthesis-action-goal.
The mineral is "chalk". The mineral-used is flint-pebble.
Understand "chalk" as the diasolvent-chalk-synthesis.
 
The earsolvent-chalk-synthesis is a earsolvent-synthesis-action-goal.
The mineral is "chalk". The mineral-used is flint-pebble.
Understand "chalk" as the earsolvent-chalk-synthesis.
 
The diasolvent-obsidian-synthesis is a diasolvent-synthesis-action-goal.
The mineral is "obsidian". The mineral-used is marble-pebble.
Understand "obsidian" as the diasolvent-obsidian-synthesis.
 
The earsolvent-obsidian-synthesis is a earsolvent-synthesis-action-goal.
The mineral is "obsidian". The mineral-used is marble-pebble.
Understand "obsidian" as the earsolvent-obsidian-synthesis.
 
The diasolvent-marble-synthesis is a diasolvent-synthesis-action-goal.
The mineral is "marble". The mineral-used is obsidian-pebble.
Understand "marble" as the diasolvent-marble-synthesis.
 
The earsolvent-marble-synthesis is a earsolvent-synthesis-action-goal.
The mineral is "marble". The mineral-used is obsidian-pebble.
Understand "marble" as the earsolvent-marble-synthesis.
 
The diasolvent-porphyry-synthesis is a diasolvent-synthesis-action-goal.
The mineral is "porphyry". The mineral-used is long-quartz.
Understand "porphyry" as the diasolvent-porphyry-synthesis.
 
The earsolvent-porphyry-synthesis is a earsolvent-synthesis-action-goal.
The mineral is "porphyry". The mineral-used is long-quartz.
Understand "porphyry" as the earsolvent-porphyry-synthesis.
 
Goal prereqs rule for a solvent-synthesis-action-goal (called G):
    let T be the mineral-used of G;
    if T is nonexistent-stone:
        say "(BUG) Solvent form of [T] is nonexistent!";
        rule fails;
    if T is long-quartz:
        now T is the more available of long-quartz and broad-quartz;
    [if T is flint-pebble:
        now T is the more available of flint-pebble and baros-key;] [let's not involve the baros key at all]
    let res be the solvent form of T;
    if res is no-thing:
        say "(BUG) Solvent form of [T] is [res]!";
        rule fails;
    let earthobj be no-thing;
    if G is a diasolvent-synthesis-action-goal:
        now earthobj is perfect-diamond;
    else:
        now earthobj is el-earth;
    require-or-fail the T;
    require-or-fail the muriatic acid noting had-muriatic;
    require-or-fail the bamuriatic;
    require-or-fail the earthobj;
    require-or-fail the chymic-ritual-location;
    [cannot already exist due to prereqs (bamuriatic!)]
    if goalstate is not hypothetical:
        auto-clean ritual location;
        retire the bamuriatic by ritual;
        retire the earthobj by ritual;
        retire the T by ritual;
        now the creation-action of res is G;
        now the player carries the res;
        set pronouns from the res;
        say "You brew [a res]";
        if G is an earsolvent-synthesis-action-goal and a diasolvent-synthesis-action-goal is known:
            say ", using the elemental earth";
        if G is a diasolvent-synthesis-action-goal and an earsolvent-synthesis-action-goal is known:
            say ", using the diamond";
        say ".";
        auto-drop the muriatic acid unless had-muriatic;
    rule succeeds.
 
The great-marriage is a recallable action-goal.
The printed name is "Great Marriage".
The short-description is "perform the Great Marriage".
[No creation-action, because there's no target object.]
The great-marriage can be homunc-done. [Set when chapter 1 is complete and the homunculus has been created.]
Understand "great", "marriage", "homunculus", "homuncula" as great-marriage.
 
Goal prereqs rule for great-marriage:
    if goalstate is not hypothetical:
        say "The Great Marriage requires your full attention; you can't go through it by rote.";
    rule fails.
 
 
HL Gen Goals ends here.