the-infocom-files / deadline

Deadline
4 stars 3 forks source link

"ANALYZE <object> FOR FINGERPRINTS" doesn't work as advertised #55

Open eriktorbjorn opened 5 years ago

eriktorbjorn commented 5 years ago

According to the game's manual, "FINGERPRINT (something) - This is the same as ANALYZE (something) FOR FINGERPRINTS." But that doesn't seem to be the case:

>ANALYZE SAUCER FOR FINGERPRINTS
Sergeant Duffy walks up as quietly as a mouse. He takes the saucer from you.
"I'll return soon with the results," he says, and leaves as silently as he
entered.

>WAIT FOR DUFFY
Time passes...
Sergeant Duffy seems to arrive from nowhere, holding the saucer in his hands.
"The saucer analysis yielded nothing useful." With that, he leaves, handing you
the saucer as he whisks away.
It is now 9:44 am.

>FINGERPRINT SAUCER
You look at the saucer closely. It appears to have good fingerprints on it, so
you call for Sergeant Duffy.
Sergeant Duffy walks up as quietly as a mouse. He takes the saucer from you.
"I'll return soon with the results," he says, and leaves as silently as he
entered.

>WAIT FOR DUFFY
Time passes...
Sergeant Duffy returns with the saucer. For a moment you muse on his almost
magical entrances. "The fingerprints," he begins, "belong to Mr. Robner and Ms.
Dunbar." With that, he leaves, handing you the saucer as he whisks away.
It is now 10:05 am.

The reason for this seems to be that while it tries to change "ANALYZE FOR FINGERPRINTS" into "FINGERPRINT ", it does so in V-ANALYZE where it's too late for any object that handles the action itself:

<ROUTINE V-ANALYZE ()
     <COND (<==? ,PRSI ,GLOBAL-FINGERPRINTS>
        <PERFORM ,V?FINGERPRINT ,PRSO>
        <RTRUE>)

To fix this, we could probably add a PRE-ANALYZE routine, like so:

<SYNTAX ANALYZE OBJECT FOR OBJECT = V-ANALYZE PRE-ANALYZE>
<SYNTAX ANALYZE OBJECT = V-ANALYZE PRE-ANALYZE>
<SYNTAX ANALYZE OFF OBJECT = V-ANALYZE PRE-ANALYZE>

<ROUTINE PRE-ANALYZE ()
     <COND (<==? ,PRSI ,GLOBAL-FINGERPRINTS>
            <PERFORM ,V?FINGERPRINT ,PRSO>
        <RTRUE>)>>

(Of course, the SYNTAX to modify is in syntax.zil, while the routine should be in verbs.zil. And that code in V-ANALYZE could probably be dropped.)