the-infocom-files / amfv

A Mind Forever Voyaging
5 stars 2 forks source link

"person, GIVE ME object" works, but "person, GIVE object TO ME" doesn't #86

Open eriktorbjorn opened 4 years ago

eriktorbjorn commented 4 years ago
>BARTENDER, GIVE BEER TO ME
Looking confused, the bartender says, "I don't see any beer here!"

>BARTENDER, GIVE ME A BEER
You give your card to the bartender. After a moment, the bartender returns your
card, informing you that your account has been debited for $8 and that your new
balance is $592. He gives you a tall, foamy mug of beer.

It's handled by this part of SPEAR-CARRIER-F:

              (<AND <VERB? SGIVE>
                <PRSO? ,ME>>
               <SETG WINNER ,PLAYER>
               <PERFORM ,V?BUY ,PRSI>
               <SETG WINNER ,SPEAR-CARRIER>
               <RTRUE>)

I assume it also has to check for the GIVE action, similar to how it earlier checks both SHOW and SSHOW:

              (<OR <AND <VERB? SHOW>
                <PRSO? ,GUN>
                <PRSI? ,ME>>
               <AND <VERB? SSHOW>
                    <PRSO? ,ME>
                    <PRSI? ,GUN>>>
               <SETG WINNER ,PLAYER>
               <PERFORM ,V?BUY ,GUN>
               <SETG WINNER ,SPEAR-CARRIER>
               <RTRUE>)
HappyMacXL commented 3 years ago

This is a really interesting one (at least to me, geek that I am!)

I can see what Meretzky has done, and it will have been done due to file size limits. Essentially this is similar to the Pirate in Adventure by which I mean that there actually is NO Pirate in Adventure :D The Pirate is just a description in a routine that runs when activated, whereas the Thief in Zork is an actual object.

Same here. Meretzky has actually combined a number of "NPCs" including Bartender, Clerk, Librarian etc and also combined a number of locations including Ezzi's Bar, Bar and Burger Meister into single routines which are then called at the appropriate time. It doesn't make for good/easy reading but it makes sense if you need to limit the number of objects etc