the-infocom-files / zork3

Zork III: The Dungeon Master
5 stars 3 forks source link

The game gets confused about which mirror is broken #65

Open eriktorbjorn opened 5 years ago

eriktorbjorn commented 5 years ago

You can tell which mirror is mirror 1 and which is mirror 2 by pushing them. Starting at mirror 1, with both mirrors unbroken:

>PUSH MIRROR
The mirror is mounted on a wooden panel which moves slightly inward as you push,
and back out when you let go. It feels fragile.

>BREAK MIRROR WITH SWORD
The mirror breaks, revealing a wooden panel behind it. The glistening fragments
of mirror quietly sparkle into nonexistence.

>LOOK IN MIRROR
A disheveled adventurer stares back at you.

The problem is in MIRROR-FUNCTION:

           (<VERB? LOOK-INSIDE>
            <COND (<OR <AND <==? .MIRROR 1> ,MR1-FLAG> ,MR2-FLAG>
               <COND (,INVIS
                  <TELL
"Amazingly, you have no reflection!" CR>)
                 (T
                  <TELL
"A disheveled adventurer stares back at you." CR>)>)
              (T
               <TELL
"You have destroyed the mirror, or have you forgotten?" CR>)>)

So mirror 1 registers as unbroken because mirror 2 is still whole. There's a similar error in the "catch all" case:

           (<OR <AND <==? .MIRROR 1> <NOT ,MR1-FLAG>> <NOT ,MR2-FLAG>>
            <TELL
"There's no mirror left." CR>)

Starting at mirror 2, with both mirrors unbroken:

>PUSH MIRROR
The mirror is unyielding, but seems fragile.

>BREAK MIRROR WITH SWORD
The mirror breaks, revealing a wooden panel behind it. The glistening fragments
of mirror quietly sparkle into nonexistence.

>SOUTH
Hallway
This is a part of the long hallway. The east and west walls are dressed stone.
In the center of the hall is a shallow stone channel. In the center of the room
the channel widens into a large hole around which is engraved a compass rose.
The hallway continues to the south.
The north side of the room is divided by a wooden wall into small hallways to
the northeast and northwest.

>NW
Narrow Room
You are in a narrow room, whose east wall is a large mirror.
The opposite wall is solid rock.
To the north and south are large hallways.

>KICK MIRROR
There's no mirror left.

It registers mirror 1 as broken, even though you only broke mirror 2. I think those are the only bugs here.