the-infocom-files / zork1

Zork I: The Great Underground Empire
10 stars 3 forks source link

Double message when talking to the spirits #16

Open eriktorbjorn opened 5 years ago

eriktorbjorn commented 5 years ago

At the Entrance to Hades:

>SPIRITS, HELLO
The spirits jeer loudly and ignore you.
The number of ghosts pauses for a moment, perhaps thinking that you should
reread the manual.

I think this is because GHOSTS-F returns false in that case:

     <COND (<VERB? TELL>
        <TELL "The spirits jeer loudly and ignore you." CR>
        <SETG P-CONT <>>)

Returning true suppresses the second message.

On the other hand V-TELL only prints the message about rereading the manual when P-CONT is false. Could it be deliberate? It seems unlikely to me, but I'm not sure where that message is shown by itself...

The TELL verb is handled in the following places, as far as I can see:

eriktorbjorn commented 5 years ago

Having debugged other issues in Zork II, it seems that actors work something like this when tying "ACTOR, DO SOMETHING":

First the action routine is called with the player as the WINNER and "TELL" as the verb. At this point you can easily intercept any attempt at talking to it, as is done in GHOST-F.

If you don't want the player to order the actor around, you set P-CONT to false. But you should also return true, or it continues with the default V-TELL action routine.

In V-TELL, if P-CONT is still true it changes the WINNER to the actor, and continues with the next action. Otherwise it prints a default message.

So you could probably fix it just by changing the order of the rows

<COND (<VERB? TELL>
       <SETG P-CONT <>>
       <TELL "The spirits jeer loudly and ignore you." CR>)

Which should make the routine return true.