We must not forget a couple of tiny details in the café room:
-.. code-block:: inform6
+.. code-block:: inform
Object food "Benny's snacks" cafe
with name 'food' 'pastry' 'pastries' 'sandwich' 'sandwiches' 'snack'
And a not-so-trivial object:
-.. code-block:: inform6
+.. code-block:: inform
Object coffee "cup of coffee" benny
with name 'cup' 'of' 'coffee' 'steaming' 'cappuccino'
There's not a lot about the toilet room and its contents, though there
will be some tricky side effects:
-.. code-block:: inform6
+.. code-block:: inform
Room toilet "Unisex toilet"
with description
mentioned in the room's description to aid players in their dressing
duties.
-.. code-block:: inform6
+.. code-block:: inform
Appliance light_switch "light switch" toilet
with name 'light' 'switch',
course, set or clear it manually like any other attribute, with the
``give`` statement:
-.. code-block:: inform6
+.. code-block:: inform
give self on;
and check if a ``switchable`` object is on or off with the test:
-.. code-block:: inform6
+.. code-block:: inform
if (light_switch has on) ...
A ``switchable`` object is OFF by default. However, you’ll notice that
the has line of the object definition includes ``~on`` :
-.. code-block:: inform6
+.. code-block:: inform
has switchable ~on;
Surely that’s saying "not-on"? Surely that's what would have happened
anyway if the line hadn't mentioned the attribute at all?
-.. code-block:: inform6
+.. code-block:: inform
has switchable;
object to account for this. A couple of lines in the after property will
suffice:
-.. code-block:: inform6
+.. code-block:: inform
after [ ks;
Unlock:
routines``" of our game -- after the ``Initialise`` routine, for
instance -- include the following lines:
-.. code-block:: inform6
+.. code-block:: inform
[ InScope person;
if (person == player && location == thedark && real_location == toilet) {
So the test:
-.. code-block:: inform6
+.. code-block:: inform
if (person == player && location == thedark && real_location == toilet) ...
have ``moved``. Here is the reworked ``InScope`` routine. There are a
couple of new concepts to look at:
-.. code-block:: inform6
+.. code-block:: inform
[ InScope person item;
if (person == player && location == thedark && real_location == toilet) {
What is the actual :samp:`{statement}` that we'll repeatedly execute?
-.. code-block:: inform6
+.. code-block:: inform
if (item has moved)
PlaceInScope(item);
This leaves us the clothing items themselves, which will require a few
tailored actions. Let's see first the ordinary garments of John Covarth:
-.. code-block:: inform6
+.. code-block:: inform
Object clothes "your clothes"
with name 'ordinary' 'street' 'clothes' 'clothing',
into ordinary clothes. So now we are dealing with a Captain Fate in full
costume:
-.. code-block:: inform6
+.. code-block:: inform
Object costume "your costume"
with name 'captain' 'captain^s' 'fate' 'fate^s' 'costume' 'suit',
lines to the ``Initialise`` routine to make sure that the player does
not start the game naked:
-.. code-block:: inform6
+.. code-block:: inform
[ Initialise;
#Ifdef DEBUG; pname_verify(); #Endif; ! suggested by pname.h
check for errors when using his library, and he tells us how to use it.
So we include the suggested lines into our ``Initialise`` routine:
-.. code-block:: inform6
+.. code-block:: inform
#Ifdef DEBUG; pname_verify(); #Endif;
"William Tell", to write our customised messages and assign them to
``deadflag`` values greater than 2.
-.. code-block:: inform6
+.. code-block:: inform
[ DeathMessage;
if (deadflag == 3) print "Your secret identity has been revealed";
of things. We have already seen that we need a verb CHANGE. We'll make
it really simple:
-.. code-block:: inform6
+.. code-block:: inform
[ ChangeSub;
if (noun has pluralname) print "They're";
``Give`` action in the orders property handles every input not already
specified:
-.. code-block:: inform6
+.. code-block:: inform
orders [;
Give:
Not so. The library grammar that deals with ASK BENNY FOR... is this
(specifically, the last line):
-.. code-block:: inform6
+.. code-block:: inform
Verb 'ask'
* creature 'about' topic -> Ask
undefined input from the player. We need to extend the existing ASK
grammar:
-.. code-block:: inform6
+.. code-block:: inform
Extend 'ask'
* creature 'for' topic -> AskFor;