the-infocom-files / zork2

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

Window glitches #45

Open eriktorbjorn opened 4 years ago

eriktorbjorn commented 4 years ago
>LOOK THROUGH WINDOW
Dreary Room
This is a small and rather dreary room, eerily illuminated by a red glow
emanating from a crack in one wall. The light falls upon a dusty wooden table in
the center of the room.
>

There should be a line break before the prompt. In superbrief mode, the prompt doesn't even get its own line. It's printed after "center of the room." instead.

This is what it looks like if the sphere is on the table, and hasn't been touched yet:

>LOOK THROUGH WINDOW
Dreary Room
This is a small and rather dreary room, eerily illuminated by a red glow
emanating from a crack in one wall. The light falls upon a dusty wooden table in
the center of the room. In the center of the table sits a blue crystal sphere.

If you enter the room, the contents on the table is on a separate line:

>NORTH
Dreary Room
This is a small and rather dreary room, eerily illuminated by a red glow
emanating from a crack in one wall. The light falls upon a dusty wooden table in
the center of the room. On the south side of the room is a massive wooden door,
which has a small window barred with iron. A formidable bolt lock is set within
the door frame. A keyhole lies within the lock.
In the center of the table sits a blue crystal sphere.

They probably wanted the sphere description to appear on the same line as the "in the center of the room." part of the room description, because in DREARY-ROOM-FCN the description ends with a space, not a CR. But it does cause problems if the table is empty.

eriktorbjorn commented 4 years ago

Looking through the window on the other side has its own issues:

>LOOK THROUGH WINDOW
Tiny Room
This is a tiny room carved out of the wall of the ravine. There is an exit down
a precarious climb. On the north side of the room is a massive wooden door,
which has a small window barred with iron. A formidable bolt lock is set within
the door frame. A keyhole lies within the lock.

How can you see the door, when you're looking through a window on the other side of it?

Also, the Tiny Room isn't lit. The dreary room is lit, so we can turn off the lamp without any danger.

>TURN OFF LAMP
The lamp is now off.

>LOOK THROUGH WINDOW
It is pitch black. You are likely to be eaten by a grue.

No, I'm not! I'm in a lit room. :-)

eriktorbjorn commented 4 years ago

You can look through the windows even when they're closed, but I don't consider that a bug since they are described as "barred". So I guess you can look through the bars either way.

eriktorbjorn commented 4 years ago

On second thought, they probably left a space at the end of the message so that P-DOOR could append to the description.

eriktorbjorn commented 4 years ago

Looking through window into the Tiny Room actually shouldn't show the door description, because it's printed by P-DOOR and that one only prints the description if PLOOK-FLAG is false.

So why doesn't it work here?

The flag is cleared whenever PCHECK is called. It's called from both TINY-ROOM-FCN and DREARY-ROOM-FCN, but not quite the same way:

TINY-ROOM-FCN:

      (<NOT <VERB? LOOK>> <PCHECK> <RFALSE>)>>

DREARY-ROOM-FCN:

          (T <PCHECK> <RFALSE>)>>

Changing both to do the same thing seems to fix this glitch.

eriktorbjorn commented 4 years ago

So my suggestion for fixing the bug, then, is:

This is what it looks like in action:

Looking in the Tiny Room:

>LOOK
Tiny Room
This is a tiny room carved out of the wall of the ravine. There is an exit down
a precarious climb. On the north side of the room is a massive wooden door,
which has a small window barred with iron. A formidable bolt lock is set within
the door frame. A keyhole covered by a thin metal lid lies within the lock.

Looking into the Dreary Room:

>LOOK THROUGH WINDOW
Dreary Room
This is a small and rather dreary room, eerily illuminated by a red glow
emanating from a crack in one wall. The light falls upon a dusty wooden table in
the center of the room.
In the center of the table sits a blue crystal sphere.

Looking in the Dreary Room:

Dreary Room
This is a small and rather dreary room, eerily illuminated by a red glow
emanating from a crack in one wall. The light falls upon a dusty wooden table in
the center of the room. On the south side of the room is a massive wooden door,
which has a small window barred with iron. A formidable bolt lock is set within
the door frame. A keyhole lies within the lock.
In the center of the table sits a blue crystal sphere.

Looking into the Tiny Room:

>LOOK THROUGH WINDOW
Tiny Room
This is a tiny room carved out of the wall of the ravine. There is an exit down
a precarious climb.
There is a place mat here.