the-infocom-files / hitchhiker

The Hitchhiker’s Guide to the Galaxy
20 stars 4 forks source link

You can find the objects under the seat several times #17

Open eriktorbjorn opened 4 years ago

eriktorbjorn commented 4 years ago
>EXAMINE LIGHT
The light resolves itself into the bright orange Sun of Damogran.

The pain at the back of your eyes is from partying until very late last night,
and both your heads are suffering the worst hangover you've ever experienced.
You remember formulating a plan to steal the Heart of Gold, but you can't for
the life of you remember any details.

Presidential Speedboat, in the pilot seat
You are piloting the speedboat, which features very simple controls, toward the
island of France (Footnote 3), where the dedication ceremonies for the Heart of
Gold will occur. You are currently steering the boat toward a narrow channel
between towering cliffs and a rocky spire.
There is a tool box here. (outside the pilot seat)

>LOOK UNDER SEAT
You discover and pick up a small key and a piece of fluff under the seat
cushion.

You continue to steer toward the narrow channel.

>LOOK UNDER SEAT
There is nothing but dust there.

You continue to steer toward the narrow channel.

>PUT KEY IN WATER
Glub...

You continue to steer toward the narrow channel.

>LOOK UNDER SEAT
You discover and pick up a small key and a piece of fluff under the seat
cushion.

You continue to steer toward the narrow channel.

That's because PILOT-SEAT-F checks if the key is in LOCAL-GLOBALS to determine if it's under the seat:

           (<AND <VERB? LOOK-UNDER RAISE SEARCH TAKE>
             <IN? ,KEY ,LOCAL-GLOBALS>>
        <MOVE ,CUSHION-FLUFF ,PROTAGONIST>
        <MOVE ,KEY ,PROTAGONIST>
        <TELL
"You discover and pick up a small key and a piece of fluff under the
seat cushion." CR>)

And WATER-PSEUDO moves things to LOCAL-GLOBALS when you put things in the water:

<ROUTINE WATER-PSEUDO ()
     <COND (<VERB? THROUGH BOARD>
        <TELL ,DONT-MIX CR>)
           (<AND <VERB? PUT THROW>
             <PRSI? ,PSEUDO-OBJECT>>
        <MOVE ,PRSO ,LOCAL-GLOBALS>
        <TELL "Glub..." CR>)>>

Perhaps it would be better to use the key's TOUCHBIT as the indicator instead? (I don't think it gets set at the moment, but that's easily fixed.)

eriktorbjorn commented 4 years ago

Though if you start messing with TOUCHBIT that could mess up if you get yourself killed and then return to the scene.

Currently the key and fluff are restored to their initial state in the Zaphod case of JIGS-UP:

              (<EQUAL? ,IDENTITY-FLAG ,ZAPHOD>
               <SETG BOAT-DOCKED <>>
               <SETG BOAT-COUNTER 0>
               <SETG CRASH-COUNTER 0>
               <SETG DAIS-COUNTER 0>
               <MOVE ,GUARDS ,LOCAL-GLOBALS>
               <MOVE ,BLASTER ,LOCAL-GLOBALS>
               <MOVE ,RIFLES ,LOCAL-GLOBALS>
               <FCLEAR ,SPEEDBOAT ,TOUCHBIT>
               <FSET ,RIFLES ,NDESCBIT>
               <DISABLE <INT I-GUARDS>>
               <DISABLE <INT I-SPEEDBOAT>>
               <COND (<NOT <FSET? ,SPEEDBOAT ,REVISITBIT>>
                  <MOVE ,TOOLBOX ,SPEEDBOAT>
                  <MOVE ,CUSHION-FLUFF ,LOCAL-GLOBALS>
                  <MOVE ,KEY ,LOCAL-GLOBALS>)>
               <ROB ,PROTAGONIST ,LOCAL-GLOBALS>)

So whatever mechanism we use to flag that the key has already been found, this is probably where it should be reset.