Trying to hook into BeforeParsing
This commit is contained in:
parent
992dc4f98d
commit
885ff2cbbe
48
examine_en.h
48
examine_en.h
|
@ -1,35 +1,23 @@
|
|||
Global examine_verb_direction;
|
||||
! Alternative way: with BeforeParsing
|
||||
|
||||
[ UnknownVerb direction;
|
||||
objectloop (direction in real_location) {
|
||||
if (
|
||||
direction ofclass Object &&
|
||||
direction has scenery
|
||||
) {
|
||||
examine_verb_direction = direction;
|
||||
return 'examine.verb';
|
||||
}
|
||||
rfalse;
|
||||
}
|
||||
rfalse;
|
||||
];
|
||||
Global thing_to_examine = "";
|
||||
|
||||
[ Examine_VerbSub;
|
||||
if (examine_verb_direction ofclass String)
|
||||
print_ret (string) examine_verb_direction;
|
||||
<<Examine examine_verb_direction>>;
|
||||
];
|
||||
Verb 'examine.verb' * -> Examine_Verb;
|
||||
|
||||
! Fix "I only understood you as far as wanting to examine.verb." message
|
||||
[ PrintVerb word;
|
||||
if (word == 'examine.verb') {
|
||||
if (examine_verb_direction ofclass String) {
|
||||
print "examine something";
|
||||
} else {
|
||||
print "examine", (name) real_location.(examine_verb_direction.name);
|
||||
}
|
||||
[ ExamineScope thing;
|
||||
print thing_to_examine, " - ", thing, ": ", (a) thing, "^";
|
||||
if (thing == thing_to_examine) {
|
||||
buffer->0 = 'examine';
|
||||
buffer->1 = thing_to_examine;
|
||||
Tokenise__(buffer, parse);
|
||||
rtrue;
|
||||
}
|
||||
rfalse;
|
||||
];
|
||||
|
||||
[ BeforeParsing;
|
||||
if (num_words > 1) {
|
||||
rfalse;
|
||||
}
|
||||
thing_to_examine = NextWord();
|
||||
|
||||
! WARNING: will catch compass directions
|
||||
LoopOverScope(ExamineScope);
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue