the-infocom-files / leathergoddesses

Leather Goddesses of Phobos
4 stars 3 forks source link

You can barter with the salesman even after he's gone #48

Open eriktorbjorn opened 3 years ago

eriktorbjorn commented 3 years ago
>GIVE FLASHLIGHT TO SALESMAN
Eagerly, the salesman accepts the flashlight, mentioning that he knows a
Plutonian plutocrat who'll trade his life fortune for one, and drops an odd
machine at your feet. "It's a TEE remover," he explains. You ponder what it
removes -- tea stains, hallway T-intersections -- even TV star Mr. T crosses
your mind, until you recall that it's only 1936. But before you have a chance to
ask the salesman, he points the flashlight upwards and a giant Venusian MegaMoth
swoops down and carries him off. The other salesmen scatter like frightened
salesmen.

>EXAMINE SALESMAN
You can't see any salesman here!

>BARTER FOR ODD MACHINE
Just give him something!

>BARTER BLANKET FOR ODD MACHINE
"That model went out of style before I was born! Offer me something else."

That's because ODD-MACHINE-F doesn't check if the salesman still has the machine:

           (<VERB? BARTER-FOR>
        <COND (<PRSI? ,ODD-MACHINE>
               <PERFORM ,V?GIVE ,PRSO ,SALESMAN>
               <RTRUE>)
              (T
               <PERFORM ,V?BARTER-WITH ,SALESMAN>
               <RTRUE>)>)

This is how it checks if you try to buy the machine:

     <COND (<AND <VERB? BUY>
             <IN? ,ODD-MACHINE ,SALESMAN>>
        <QUEUE I-SALESMAN 2>
        <TELL
"\"I wouldn't part with this baby for a hundred marsmids!\"" CR>)

So adding <IN? ,ODD-MACHINE ,SALESMAN> as a condition to the BARTER-FOR action would probably be the sensible thing to do.