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;
|
Global thing_to_examine = "";
|
||||||
objectloop (direction in real_location) {
|
|
||||||
if (
|
|
||||||
direction ofclass Object &&
|
|
||||||
direction has scenery
|
|
||||||
) {
|
|
||||||
examine_verb_direction = direction;
|
|
||||||
return 'examine.verb';
|
|
||||||
}
|
|
||||||
rfalse;
|
|
||||||
}
|
|
||||||
rfalse;
|
|
||||||
];
|
|
||||||
|
|
||||||
[ Examine_VerbSub;
|
[ ExamineScope thing;
|
||||||
if (examine_verb_direction ofclass String)
|
print thing_to_examine, " - ", thing, ": ", (a) thing, "^";
|
||||||
print_ret (string) examine_verb_direction;
|
if (thing == thing_to_examine) {
|
||||||
<<Examine examine_verb_direction>>;
|
buffer->0 = 'examine';
|
||||||
];
|
buffer->1 = thing_to_examine;
|
||||||
Verb 'examine.verb' * -> Examine_Verb;
|
Tokenise__(buffer, parse);
|
||||||
|
|
||||||
! 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);
|
|
||||||
}
|
|
||||||
rtrue;
|
rtrue;
|
||||||
}
|
}
|
||||||
rfalse;
|
];
|
||||||
|
|
||||||
|
[ BeforeParsing;
|
||||||
|
if (num_words > 1) {
|
||||||
|
rfalse;
|
||||||
|
}
|
||||||
|
thing_to_examine = NextWord();
|
||||||
|
|
||||||
|
! WARNING: will catch compass directions
|
||||||
|
LoopOverScope(ExamineScope);
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue