Tick some things off the TODO list.
[ibg.git] / chapters / 06.rst
index c93c887fdd482ea7e96088cd6f0e5d8e692a5c36..495b8d4b973a4b183b4f03e53809c770ef6055a7 100644 (file)
@@ -2,23 +2,19 @@
  William Tell: a tale is born
 ==============================
 
-.. highlight:: inform6
+.. highlight:: inform
 
 .. epigraph::
 
-   | *K was King William, once governed the land;*
-   | *L was a lady, who had a white hand.*
+   | |CENTER| *K was King William, once governed the land;*
+   | |CENTER| *L was a lady, who had a white hand.*
 
 .. only:: html
 
    .. image:: /images/picK.png
       :align: left
 
-.. raw:: latex
-
-   \dropcap{k}
-
-eeping up the momentum, this chapter (and the three which follow) works
+|K|\eeping up the momentum, this chapter (and the three which follow) works
 steadily through the design of the "William Tell" game that we encountered
 right at the start of this guide. Many of the principles are the same as
 the ones we explained when designing Heidi and her forest, so we'll not
@@ -204,7 +200,7 @@ The game won't compile in this state, because it contains references to
 objects which we haven't yet defined.  In any case, we don't intend to
 build up the game in layers as we did last time, but rather to talk about
 it in logically related chunks.  To see (and if you wish, to type) the
-complete source, go to "William Tell" story on page 219.
+complete source, go to :doc:`/appendices/c`.
 
 Object classes
 ==============
@@ -223,7 +219,7 @@ like this::
                 A track heads to the northeast.",
       has  light;
 
-   ...
+   ...
 
 and we explained that just about *every* room needs that ``light``
 attribute, or else the player would be literally in the dark.  It's a bit
@@ -245,7 +241,7 @@ write this::
                 A track heads to the northeast.",
      has  ;
 
-    ...
+    ...
 
 We've done four things:
 
@@ -267,14 +263,14 @@ We've done four things:
 #. We don't need to explicitly include the ``light`` attribute each time;
    every ``Room`` object has it automatically.
 
-A **class** is a family of closely related objects, all of which behave in
-the same way.  Any properties defined for the class, and any attributes
+A :term:`class` is a family of closely related objects, all of which behave
+in the same way.  Any properties defined for the class, and any attributes
 defined for the class, are automatically given to objects which you specify
 as belonging to that class; this process of acquisition just by being a
-member of a class is called **inheritance**.  In our example, we've defined
-a ``Room`` class with a ``light`` attribute, and then we've specified four
-objects each of which is a member of that class, and each of which gets
-given a ``light`` attribute as a result of that membership.
+member of a class is called :term:`inheritance`.  In our example, we've
+defined a ``Room`` class with a ``light`` attribute, and then we've
+specified four objects each of which is a member of that class, and each of
+which gets given a ``light`` attribute as a result of that membership.
 
 Why have we gone to this trouble?  Three main reasons:
 
@@ -333,13 +329,16 @@ and here is how we could have used it in "Heidi"::
                "Through the dense foliage, you glimpse a building to the west.
                 A track heads to the northeast.";
 
-   ...
+   ...
 
 You'll notice that, if an object has no block of attributes, the semicolon
 which terminates its definition simply moves to the end of its last
 property.
 
-.. rubric:: A class for props
+.. _props-class:
+
+A class for props
+-----------------
 
 We use the ``Room`` class in "William Tell", and a few other classes
 besides.  Here's a ``Prop`` class (that's "Prop" in the sense of a
@@ -408,7 +407,8 @@ The interesting things that this statement demonstrates are:
   nest", ``(a) nest`` would display "a bird's nest", ``(A) nest`` would
   display "A bird's nest" and ``(name) nest`` would display just "bird's
   nest".  This use of a word in parentheses, telling the interpreter how to
-  display the following object's internal ID, is called a **print rule**.
+  display the following object's internal ID, is called a :term:`print
+  rule`.
 
 * There's a library variable ``self`` which always contains the internal ID
   of the current object, and is really convenient when using a ``Class``.
@@ -421,7 +421,7 @@ Let's see an example of this in action; here's a ``Prop`` object from
    Prop    "south gate" street
      with  name 'south' 'southern' 'wooden' 'gate',
           description "The large wooden gate in the town walls is wide open.",
-          ...
+          ...
 
 If players type EXAMINE GATE, they'll see "The large wooden gate..."; if
 they type CLOSE GATE then the gate's ``before`` property will step in and
@@ -433,7 +433,8 @@ object like Heidi's ``tree`` and ``cottage``, is to support EXAMINE for
 increased realism, while clearly hinting to players that trying other verbs
 would be a waste of time.
 
-.. rubric:: A class for furniture
+A class for furniture
+---------------------
 
 The last class for now -- we'll talk about the ``Arrow`` and ``NPC``
 classes in the next chapter -- is for furniture-like objects.  If you label
@@ -474,6 +475,6 @@ probably reuse them in your next game.
 Now that most of our class definitions are in place, we can get on with
 defining some real rooms and objects.  First, though, if you're typing in
 the "William Tell" game as you read through the guide, you'd probably like
-to check that what you've entered so far is correct; "Compile-as-you-go" on
-page 233 explains how to compile the game in its current -- incomplete --
-state.
+to check that what you've entered so far is correct;
+:ref:`compile-as-you-go` explains how to compile the game in its current --
+incomplete -- state.