1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-16 22:14:23 +03:00
inform7/resources/Documentation/Examples/Cloves.txt

63 lines
4 KiB
Plaintext
Raw Normal View History

Example: ** Cloves
Location: Reading a command
RecipeLocation: Alternatives To Standard Parsing
Index: Adverbs used in commands
Description: Accepting adverbs anywhere in a command, registering what the player typed but then cutting them out before interpreting the command.
For: Z-Machine
2019-02-05 02:44:07 +02:00
It has sometimes been suggested that IF should allow for the player to use adverbs, so that doing something "carefully" will have a different effect from doing it "quickly". There are several inherent challenges here: it's a good idea to make very sure the player knows all their adverb options, and the list of possibilities should probably not be too long.
2019-02-05 02:44:07 +02:00
Another trick is that adverbs complicate understanding commands, because they can occur anywhere: one might type >GO WEST CAREFULLY or >CAREFULLY GO WEST, and ideally the game should understand both. After reading a command is the best point to do this sort of thing, because we can find adverbs, interpret them, and remove them from the command stream. So:
{*}"Cloves"
Manner is a kind of value. The manners are insouciantly, sheepishly, and defiantly.
2019-02-05 02:44:07 +02:00
Now we have, automatically, a value called manner understood to be used whenever parsing manners, and we can use this even during the "after reading a command" stage, so:
2019-02-05 02:44:07 +02:00
{**}After reading a command:
if the player's command includes "[manner]":
cut the matched text;
otherwise:
say "But how, my dear boy, how? You simply can't do something without a pose. Thus far you have mastered doing things [list of manners].";
reject the player's command.
2019-02-05 02:44:07 +02:00
When play begins:
now the left hand status line is "Behaving [manner understood]";
now the right hand status line is "[location]";
now the manner understood is insouciantly.
2019-02-05 02:44:07 +02:00
The Poseur Club is a room. "Lady Mary is laid out on a sofa, her wrists bandaged importantly[if the manner understood is insouciantly] -- and she looks all the more depressed by your indifference to her state[end if]; Salvatore is at the gaming table, clutching his hair with both hands[if the manner understood is defiantly] -- though he looks up long enough to snarl in response to that expression of yours[end if]; Frackenbush is muttering lines from another of his works in progress, as though poetry has nearly made him mad[if the manner understood is sheepishly]. But he spares you a reassuring smile. He's not a bad fellow, Frackenbush[end if].
The usual people, in short."
Instead of doing something other than waiting or looking:
say "Dear. No. That would smack of effort."
2019-02-05 02:44:07 +02:00
Instead of waiting when the manner understood is sheepishly:
say "You scuff your foot against the ground for a moment, and allow a seemly blush to creep over your cheek. It's quite effective, you are sure, though you can't look up and see how it is going."
2019-02-05 02:44:07 +02:00
Instead of waiting when the manner understood is insouciantly:
say "Thrusting your hands into your pockets, you whistle a jaunty tune.
2019-02-05 02:44:07 +02:00
'Do shut up,' says a Melancholy Poseur from over by the window."
Instead of waiting when the manner understood is defiantly:
say "You raise your chin and give a pointed glance around the room as though to say that you are waiting for someone; you are unembarrassed about waiting for her; you have by no means been stood up; and the first person to comment will receive a poke in the eye."
2019-02-05 02:44:07 +02:00
Before looking when the manner understood is sheepishly:
say "You gaze up from under your brows..."
2019-02-05 02:44:07 +02:00
Before looking when the manner understood is defiantly:
say "You cast a withering gaze over the room."
2019-02-05 02:44:07 +02:00
Before looking when the manner understood is insouciantly:
if turn count > 1,
say "You turn an eye to your surroundings, looking faintly-- just faintly-- amused."
2019-02-05 02:44:07 +02:00
Test me with "wait / wait insouciantly / sheepishly look / defiantly look / look insouciantly".
The qualification about turn count is to prevent this before message from occurring when the player first looks around the room (automatically) at the start of play.
2023-05-14 05:51:20 +03:00
Note that to test this example, one must type INSOUCIANTLY TEST ME, and not simply TEST ME: a poseur's work is never done.