===============
The ``marketplace`` room is unremarkable, and the ``tree`` growing there
-has only one feature of interest::
+has only one feature of interest:
+
+.. include:: /config/typethis.rst
+
+::
Room marketplace "Marketplace near the square"
with description
a message. We don't know exactly *which* object is to be checked, so we
need to write our routine in a generalised way, capable of checking any
object which we choose; that is, we'll supply the object to be checked as
-an argument. Here's the routine::
+an argument. Here's the routine:
+
+.. include:: /config/typethis.rst
+
+::
[ BowOrArrow o;
if (o == bow or nothing || o ofclass Arrow) return true;
Gessler the governor
====================
-There's nothing in Gessler's definition that we haven't already encountered::
+There's nothing in Gessler's definition that we haven't already
+encountered:
+
+.. include:: /config/typethis.rst
+
+::
NPC governor "governor" marketplace
with name 'governor' 'vogt' 'Hermann' 'Gessler',
====================
Since he's been with you throughout, it's really about time we defined
-Walter::
+Walter:
+
+.. include:: /config/typethis.rst
+
+::
NPC son "your son"
with name 'son' 'your' 'boy' 'lad' 'Walter',
The apple's moment of glory has arrived! Its :prop:`before` property
responds to the :act:`FireAt` action by setting :var:`deadflag` to 2. When
-that happens, the game is over; the player has won. ::
+that happens, the game is over; the player has won.
+
+.. include:: /config/typethis.rst
+
+::
Object apple "apple"
with name 'apple',
before, anticipating the improbable is part of the craft of IF. For this,
and for all new actions, two things are required. We need a grammar
definition, spelling out the structure of the English sentences which we're
-prepared to accept::
+prepared to accept:
+
+.. include:: /config/typethis.rst
+
+::
Verb 'untie' 'unfasten' 'unfix' 'free' 'release'
* noun -> Untie;
and we need a routine to handle the action in the default situation (where
-the action isn't intercepted by an object's :prop:`before` property). ::
+the action isn't intercepted by an object's :prop:`before` property).
+
+.. include:: /config/typethis.rst
+
+::
[ UntieSub; print_ret "You really shouldn't try that."; ];
pair: Salute; library action
The next action is :act:`Salute`, provided in case Wilhelm chooses to defer
-to the hat on the pole. Here's the default action handler::
+to the hat on the pole. Here's the default action handler:
+
+.. include:: /config/typethis.rst
+
+::
[ SaluteSub;
if (noun has animate) print_ret (The) noun, " acknowledges you.";
handler, since it produces different responses depending on whether the
object being saluted -- stored in the :var:`noun` variable -- is
:attr:`animate` or not. But it's basically doing the same job. And here's
-the grammar::
+the grammar:
+
+.. include:: /config/typethis.rst
+
+::
Verb 'bow' 'nod' 'kowtow' 'genuflect'
* 'at'/'to'/'towards' noun -> Salute;
definition. The wrong solution: edit ``Grammar.h`` to *physically* add
lines to the existing definitions (it's almost never a good idea to make
changes to the standard library files). The right solution: use ``Extend``
-to *logically* add those lines. If we write this in our source file::
+to *logically* add those lines. If we write this in our source file:
+
+.. include:: /config/typethis.rst
+
+::
Extend 'give'
* 'homage' 'to' noun -> Salute;
.. rubric:: FireAt
-As usual, we'll first show you the default handler for this action::
+As usual, we'll first show you the default handler for this action:
+
+.. include:: /config/typethis.rst
+
+::
[ FireAtSub;
if (noun == nothing)
design practice to reword the message as a statement rather than a
question.
-Here is the associated grammar::
+Here is the associated grammar:
+
+.. include:: /config/typethis.rst
+
+::
Verb 'fire' 'shoot' 'aim'
* -> FireAt
pair: FireAt; library action
Before leaving the :act:`FireAt` action, we'll add one more piece of
-grammar::
+grammar:
+
+.. include:: /config/typethis.rst
+
+::
Extend 'attack' replace
* noun -> FireAt;
all three checks succeed then ``TalkSub`` need do nothing more; if one
or more of them fails then ``TalkSub`` simply...
-#. Displays a general "nothing to say" refusal to talk. ::
+#. Displays a general "nothing to say" refusal to talk.
+
+ .. include:: /config/typethis.rst
+
+ ::
[ TalkSub;
if (noun == player) print_ret "Nothing you hear surprises you.";