the-infocom-files / ballyhoo

Ballyhoo
5 stars 4 forks source link

APE-ENTER should set P-IT-OBJECT #14

Open eriktorbjorn opened 4 years ago

eriktorbjorn commented 4 years ago

One feature I really like about Infocom games is that they (usually) make sure that "it" refers to something sensible. For instance, if the game tells you that the door you just tried to go through is closed, it usually sets "it" to mean the door.

For ordinary door exits, this would be handled by V-WALK itself:

                  <RFATAL>)>)
              (<EQUAL? .PTS ,DEXIT>
               <COND (<FSET? <SET OBJ <GETB .PT ,DEXITOBJ>> ,OPENBIT>
                  <GOTO <GETB .PT ,REXIT>>)
                 (<SET STR <GET .PT ,DEXITSTR>>
                  <TELL .STR CR>
                  <SETG P-IT-OBJECT .OBJ>
                  <RFATAL>)
                 (T
                  <TELL "The " D .OBJ " is closed." CR>
                  <SETG P-IT-OBJECT .OBJ>
                  <RFATAL>)>)>)

(For some reason, this game does not have any THIS-IS-IT routine, so it sets P-IT-OBJECT directly.)

But for Mahler's cage, this doesn't work:

>EXAMINE CHEESE
You see nothing unusual about the cheese morsel.

>WEST
The cage door is closed.

>OPEN IT
You can't open a cheese morsel.

That's because APE-ENTER doesn't set P-IT-OBJECT:

           (T
        <TELL "The " D ,APE-DOOR " is ">
        <OPEN-CLOSED ,APE-DOOR>
        <TELL ,PERIOD>
        <RFALSE>)>>
eriktorbjorn commented 4 years ago

Same thing with BLUE-DOOR-ENTER:

           (<NOT <FSET? ,BLUE-DOOR ,OPENBIT>>
        <TELL "The " D ,BLUE-DOOR " is closed." CR>
        <RFALSE>)
eriktorbjorn commented 4 years ago

Same thing with EXIT-CLOWN-ALLEY:

     <COND (<NOT <FSET? ,WARPED-DOOR ,OPENBIT>>
        <TELL "The " D ,WARPED-DOOR " is closed." CR>
        <RFALSE>)