the-infocom-files / deadline

Deadline
4 stars 3 forks source link

Sometimes misleading message when opening containers with one item inside #30

Open eriktorbjorn opened 5 years ago

eriktorbjorn commented 5 years ago

V-OPEN has a special case for when you open a container with only one object inside:

                 (<AND <SET F <FIRST? ,PRSO>>
                   <NOT <NEXT? .F>>
                   <SET STR <GETP .F ,P?FDESC>>>
                  <TELL "The " D ,PRSO " opens." CR>
                  <TELL .STR CR>)

Usually, this prints reasonable messages:

>OPEN MEDICINE CABINET
Opening the cabinet reveals a bottle of LoBlo, a bottle of cough medicine, and a
bottle of aspirin.

>GET ALL FROM CABINET EXCEPT ASPIRIN
bottle of LoBlo: Taken.
bottle of cough medicine: Taken.

>CLOSE CABINET
Closed.

>OPEN CABINET
The cabinet opens.
On the top shelf, among various toilet items, is a bottle of aspirin.

So far, it works just as intended. Let's mess with it!

>GET ASPIRIN
Taken.

>PUT NOTE PAD IN CABINET
Done.

>CLOSE CABINET
Closed.

>OPEN CABINET
The cabinet opens.
Lying atop the desk is a pad of white note paper.

That's not so good. The desk is, of course, in the other end of the house. I guess we could add a check if the object in the container has TOUCHBIT or not?