Is there a way to stop/abort a turn in e.g. a verify()
in an object’s dobjFor()
or in a verb’s verifyAction()
? Specifically to get the result to be like what you’d get if the player entered an unknown word, attempted to examine an object that’s not present, or that kind of thing.
Here’s the simple example:
#charset "us-ascii"
#include <adv3.h>
#include <en_us.h>
DefineIAction(Foozle)
verifyAction() {
defaultReport('Foozle? That doesn\'t even make sense. ');
exit;
}
;
VerbRule(Foozle)
'foozle'
: FoozleAction
verbPhrase = 'foozle/foozling'
;
startRoom: Room 'Void'
"This is a featureless void. "
roomDaemon() {
"<.p>The room daemon<<one of>>
twiddles its thumbs.
<<or>>
shuffles its feet.
<<or>>
immanentizes the eschaton.
<<shuffled>> ";
}
;
tree: Thing 'tree' 'tree'
"If a tree falls in the nil, can any actor eXamine it? "
location = nil
;
me: Actor
location = startRoom
;
versionInfo: GameID
name = 'sample'
byline = 'nobody'
authorEmail = 'nobody <foo@bar.com>'
desc = '[This space intentionally left blank]'
version = '1.0'
IFID = '12345'
;
gameMain: GameMainDef
initialPlayerChar = me
;
The “game” implements a verb “foozle” that doesn’t do anything, and it also contains a tree that’s not in the starting room (or any other room).
If you type, for example x tree
, you get:
>x tree
You see no tree here.
>
…the turn counter does not advance and the room daemon doesn’t run. On the other hand if you type foozle:
>foozle
Foozle? That doesn't even make sense.
The room daemon twiddles its thumbs.
>
…the turn counter advances and the room daemon runs.
What I want is to do something in foozle’s verifyAction()
to make it behave the way x tree
on the non-present tree behaves.