the-infocom-files / zork2

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

Unimplemented feature (?): The demon opening the wizard's trophy cabinet #57

Open eriktorbjorn opened 4 years ago

eriktorbjorn commented 4 years ago

There are several indications that at some point, the demon was supposed to be able to open the wizard's trophy cabinet for you:

The argument against it is that when the demon smashes the case, it says "The demon smashes the case into smithereens. Everything in it smashes as well." You wouldn't be able to see that from the pentagram room.

So... probably not fix, but document somewhere as game trivia?

eriktorbjorn commented 4 years ago

The code in WIZARD-CASE-FCN that's supposed to handle it:

     <COND (<EQUAL? ,WINNER ,GENIE>
        <COND (<VERB? MUNG OPEN>
               <REMOVE ,WIZARD-CASE>
               <MOVE ,BROKEN-CASE ,TROPHY-ROOM>
               <TELL
"The demon smashes the case into smithereens. Everything in it smashes
as well." CR>)>)

Interestingly, there is similar code in WIZARD-FCN that I can't trigger either:

     <COND (<EQUAL? ,WINNER ,WIZARD>
        <COND (<VERB? GIVE> <TELL
"The Wizard replies \"Foolishment!\"" CR>)
              (T
               <TELL
"The Wizard considers your statement carefully. His expression indicates
he regards it as fanciful." CR>)>)

This code in WAND-FCN, on the other hand, I can trigger:

     <COND (<AND <VERB? TAKE PUT GIVE> <IN? ,WAND ,WIZARD>>
        <COND (<EQUAL? ,WINNER ,ADVENTURER>
               <TELL "The Wizard snatches it away." CR>)
              (<EQUAL? ,WINNER ,ROBOT>
               <JIGS-UP
"The Wizard snatches the wand away, muttering the word \"Float\" at the
robot. Unfortunately he has no floating-point processor and dies in a
vain attempt to divide 4.85 by 3.62.">)>)

So I'm not quite sure what's going on here...

eriktorbjorn commented 4 years ago

I checked the case in WIZARD-FCN. When you type "WIZARD, GIVE WAND TO ME" the WINNER is still the player, and the verb is "TELL".

(This is then caught by the <HELLO? ,WIZARD> case. If you return false from that it apparently continues to V-TELL.)

My unsubstantiated guess is that at this point, it's still handling the "WIZARD" part of "WIZARD, DO SOMETHING". It's the player who's ordering the wizard to do something. When you order the demon to do something, his action routine is called twice: Once with the player as the WINNER and "TELL" as the verb, and once with the demon as the WINNER.

So why didn't it go to V-TELL for the demon? There are some things I still don't quite understand...

eriktorbjorn commented 4 years ago

Ah, I see. To make an actor that you can't order around, you have to set P-CONT to false. For actors, you can see that the game does this in:

The game has the following actors: GLOBAL-UNICORN, UNICORN, DRAGON, GLOBAL-PRINCESS, PRINCESS, CERBERUS, SERPENT, GNOME, ROBOT, GNOME-OF-ZURICH, GENIE, and WIZARD.

GLOBAL-PRINCESS and PRINCESS use the same action function.

So that presumably leaves GLOBAL-UNICORN, SERPENT, ROBOT and GENIE as actors that you can order around. The robot and the demon are expected, but I wonder what bugs may lurk in the sea-serpent and the global unicorn...

eriktorbjorn commented 4 years ago

The sea-serpent is fine. Anything you try to order it, it only stares hungrily at you:

<ROUTINE SERPENT-FCN ()
     <COND (<EQUAL? ,SERPENT ,WINNER>
        <TELL
"The serpent only stares hungrily at you." CR>)
eriktorbjorn commented 4 years ago

Getting back to the original issue, the reason the demon won't break the case is that GENIE-FCN has the catch-all case:

             (T
              <TELL
"\"Apologies, oh master, but even for such a one as I this is not possible.\"
He seems somewhat chagrined to have to admit this." CR>
              <RTRUE>)>)

If you disable that, he will destroy the trophy case if you ask him.

I guess that's why all the actions he does handle are in GENIE-FCN rather than the individual object action routines. Though it would be interesting to know if there is any released version where he will break the case for you...