Suppose the password is `foo'. Then you can get the first to work using
something like:
[ FooSub;
if (location ~= Rodent_Factory)
"Nothing happens.";
if (Rodent_Door has open) "The door is already open.";
give Rodent_Door open;
StartDaemon(Rodents);
"The door opens.";
];
Verb "foo" * -> Foo;
To make the third form work, try the following piece of magic:
[ Quote;
if (buffer->(parse->(wn*4+1)) == '"') { wn ++; return 0; }
return -1;
];
[ SaySub;
if (special_word == 'foo') <<Foo>>;
"Nothing happens.";
];
Extend "say"
* Quote special Quote -> Say;
To make the fourth form work, note that if you type `object, thing not
understood', then the object's `life' routine is called with `action'
set to `##Answer' and `verb_wordnum' set to the first word in the `thing
not understood'. So you can try the following:
Object Door "door" Rodent_Factory
has door scenery talkable lockable openable locked
with ...
life [;
Answer:
wn = verb_wordnum;
if (NextWord() == 'foo') <<Foo>>;
"~That isn't the right password,~ says the door.";
],
...
-- Gareth Rees