Using adv3Lite v0.8, I have created a new verb rule for “answer”. Superficially, it appears to work. When the player character enters “answer the phone” the response displayed is “Hello?” which is almost, but not quite, what I expected from how I wrote the new action.
There are problems.
I also specified a precondition that the object (the phone) must be held, which is being ignored.
There is a cell phone (a Thing) on the table. Harry answers the phone without first picking it up. I expected the precondition would cause the system to say something like first picking the phone up though I’d settle for just Harry doesn’t have a phone on him. But it does neither and Harry’s inventory remains empty after the screen text has indicated that he answered the phone.
Also, the response() text specified in the modification to Thing is never displayed, only the execAction(Answer) text defined in DefineTAction(Answer).
The main problem here is that you’ve overridden the execAction() method of the Answer action, which (normally) you should only ever do for an IAction, TopicAction or LiteralAction (but never for a TAction or TIAction). By doing that you’ve effectively obliterated the normal action processing for this verb, which is why it’s ignoring everything you’ve defined on Thing; you’ve overridden the code that would consult the precondition and the report() method with your own version of execAction(), so of course nothing works as it should.
What you need to do is remove your execAction() method from your definition of the Answer method.
Besides that, there are several places where your code isn’t quite right. It should read;