Conditions
Conditions appear after while, after when, in refuse when, and in
blocked exits. The combinators are and, or, and not, in the usual
precedence (not binds tightest, or loosest) with parentheses to
override; one chance in N rolls dice.
on the player petting
phrase cat-tolerates when the cat is dozing
phrase cat-glare when the cat is alert and not one chance in 4
phrase cat-purr when (the cat is alert and one chance in 4) or the cat wears the ribbon
change the cat to alert when the cat is dozing
end on
The predicates test what an author would point at:
on the player examining
phrase barrow-contents when the barrow holds the apple
phrase barrow-visible when the player can see the barrow
phrase barrow-in-gate when the barrow is in the Orchard Gate
phrase barrow-is-thing when the barrow is a container
end on
In full: is a/is an tests kind or trait, is in tests location,
is here tests whether an entity shares the player's location, plain
is compares against a state, a state adjective, or a value, has,
holds, and wears test possession, and can see / can reach test
scope. Every predicate takes not after is, or not in front.
Subjects and values are written the way you name anything: it, the player, an entity name, its <field>, or a possessive like the player's location. A multi-word name simply runs until the next
structural word (is, has, holds, wears, can, and, or,
then, to, while, with), so name your entities around those.
is in also takes a region: the barrow is in the Grounds is a
membership test — true in any member room, through nested regions — and
needs no landing line. A timer reads two
ways: is names its current turn (while search is lingering) and
has reads its lifecycle (has started, has not started, has expired; is expired is rejected). Under use chapters,
during <name>, before <name>, and after <name> test the current
chapter.
State words resolve against their subject: when the cat is dozing works
because the cat declares dozing. The closed catalog of platform state
adjectives (open, closed, locked, unlocked, on, off,
worn, lit) reads trait state the same way. An unknown word is a
load error with a nearest-valid suggestion, not a silent false.
A named condition whose it is left
free is an open
condition: a test any entity might pass. any and no quantify over
one:
define condition gathered-tomato: it is a tomato and it is in the harvest basket
define condition vine-tomato: it is a tomato and it is not in the harvest basket
on the player examining
phrase basket-empty when no gathered-tomato
phrase basket-laden when any gathered-tomato
end on
Quantifiers demand an open condition; any over a closed one (no free
it, like the story is dusk) is analysis.closed-condition-selection.
Inside an open condition, keep to predicates the analyzer can check for
an arbitrary subject: kind, placement, and possession tests. A state
test on it (it is ripe) is rejected as an unknown value, because no
one subject owns the state word there.