the-infocom-files / zork2

Zork II: The Wizard of Frobozz
8 stars 4 forks source link

You can lock/unlock the oak door from a distance #74

Open eriktorbjorn opened 3 years ago

eriktorbjorn commented 3 years ago

I thought for sure that I had already filed this bug, but I can't find it now.

PKEY-FCN lets you lock and unlock PDOOR ("door made of oak") by turning the key, though you probably have to "TURN KEY WITH object" for it to work.

However, it doesn't check if the key is in the keyhole, so as long as you are carrying the key (and nothing else prevents you from locking/unlocking the door, e.g. the letter opener is still in the lock), you can do it from anywhere:

<ROUTINE PKEY-FCN ()
    <COND (<VERB? TURN>
       <COND (,PUNLOCK-FLAG
          <PERFORM ,V?LOCK ,PDOOR ,PRSO>)
         (T
          <PERFORM ,V?UNLOCK ,PDOOR ,PRSO>)>)>>
>LOOK
Room 8
This is a small chamber carved out of the rock at the end of a short crawl. On
the wall is crudely chiseled the number "8".

>TURN RUSTY IRON KEY WITH SWORD
The door is locked.

>TURN RUSTY IRON KEY WITH SWORD
The door is now unlocked.