the-infocom-files / zork1

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

Jumping in the Dome Room doesn't kill you if the rope is tied to the railing #26

Open eriktorbjorn opened 5 years ago

eriktorbjorn commented 5 years ago

Jumping in the Dome Room looks like it should always kill you:

<ROUTINE DOME-ROOM-FCN (RARG)
     <COND (<EQUAL? .RARG ,M-LOOK>
        <TELL
"You are at the periphery of a large dome, which forms the ceiling
of another room below. Protecting you from a precipitous drop is a
wooden railing which circles the dome." CR>
        <COND (,DOME-FLAG
               <TELL
"Hanging down from the railing is a rope which ends about ten feet
from the floor below." CR>)>)
           (<EQUAL? .RARG ,M-ENTER>
        <COND (,DEAD
               <TELL
"As you enter the dome you feel a strong pull as if from a wind
drawing you over the railing and down." CR>
               <MOVE ,WINNER ,TORCH-ROOM>
               <SETG HERE ,TORCH-ROOM>
               <RTRUE>)
              (<VERB? LEAP>
               <JIGS-UP
"I'm afraid that the leap you attempted has done you in.">)>)>>

But it doesn't since the "LEAP" handler is in the M-ENTER case of the action routine. So it only kills you by default (probably in V-LEAP) if the rope isn't tied to the railing. It should presumably be checked for in the M-BEG case, like so:

<ROUTINE DOME-ROOM-FCN (RARG)
     <COND (<EQUAL? .RARG ,M-LOOK>
        <TELL
"You are at the periphery of a large dome, which forms the ceiling
of another room below. Protecting you from a precipitous drop is a
wooden railing which circles the dome." CR>
        <COND (,DOME-FLAG
               <TELL
"Hanging down from the railing is a rope which ends about ten feet
from the floor below." CR>)>)
           (<EQUAL? .RARG ,M-ENTER>
        <COND (,DEAD
               <TELL
"As you enter the dome you feel a strong pull as if from a wind
drawing you over the railing and down." CR>
               <MOVE ,WINNER ,TORCH-ROOM>
               <SETG HERE ,TORCH-ROOM>
               <RTRUE>)>)
           (<EQUAL? .RARG ,M-BEG>
        <COND (<VERB? LEAP>
               <JIGS-UP
"I'm afraid that the leap you attempted has done you in.">)>)>>

Some other oddities I noticed when I looked for "LEAP" handlers:

eriktorbjorn commented 5 years ago

Looking closer at the TREE-ROOM routine, it looks like it only checks for the "LEAP" verb if it's already established that it's handling the "DROP" verb. Weird.

Also, couldn't the special case for "LEAP" be moved from V-LEAP to TREE-ROOM? I should file a separate bug report...

eriktorbjorn commented 5 years ago

And that new bug report is https://github.com/the-infocom-files/zork1/issues/27