the-infocom-files / cutthroats

Cutthroats
3 stars 3 forks source link

You can bypass container functions with implicit taking #34

Open eriktorbjorn opened 4 years ago

eriktorbjorn commented 4 years ago

JOHNNY-F has this container function:

           (<==? .RARG ,M-CONT>
        <COND (<AND <VERB? TAKE>
                <FSET? ,PRSO ,TAKEBIT>>
               <TELL
"Johnny glares down at you. \"Get your hands off of that!\"" CR>
               <RTRUE>)
              (<AND <EQUAL? ,KNIFE ,PRSO ,PRSI>
                <AND <NOT <VERB? EXAMINE FIND ASK-ABOUT>>
                 <NOT <VERB? ASK-CONTEXT-ABOUT>>>>
               <TELL
"Johnny pulls it back. \"I'm not gonna let you give this to " D ,WEASEL ".\""
CR>
               <RTRUE>)
              (T <RFALSE>)>)>

The knife has TRYTAKEBIT, as does the treasures he shows you. So the only object where implicit taking can screw up (that I've been able to find) is the envelope you give him:

>TAKE ENVELOPE
Johnny glares down at you. "Get your hands off of that!"

>FILL ENVELOPE WITH ME
(taking the envelope first)
You can't do that.

>INVENTORY
You are carrying:
  An envelope
  The envelope contains:
    A Merchant Seaman's card
  A wrist watch (being worn)
You have $136 in your pocket.

Maybe the envelope should simply be given TRYTAKEBIT?

eriktorbjorn commented 4 years ago

As long as the envelope is open, you can also mess with its contents:

>TAKE ENVELOPE
Johnny glares down at you. "Get your hands off of that!"

>EMPTY ENVELOPE
The envelope is now empty.

>TAKE CARD
Taken.
eriktorbjorn commented 4 years ago

Same thing with WEASEL-F:

>TAKE PASSBOOK
The Weasel glares at you. "I ain't gonna give that to ya!"

>FILL PASSBOOK WITH ME
(taking the Mariners' Trust passbook first)
You can't do that.

I don't know if the passbook is the only thing that can cause problems here. Since stealing it from him this way breaks the game somewhat (he won't show up to the meeting if he steals enough money from you), perhaps the passbook should have TRYTAKEBIT too?

eriktorbjorn commented 4 years ago

Presumably the same thing happens with PETE-F, but I don't think he ever picks up anything in the game.

eriktorbjorn commented 4 years ago

You can also use this trick to retrieve the envelope from The Weasel, if he steals it during the night. But I've already suggested setting TRYTAKEBIT on the envelope, so...

eriktorbjorn commented 4 years ago

MCGINTY-F has the same problem. You can use this to steal the Merchant Seaman's card from him.

eriktorbjorn commented 4 years ago

Interestingly, I can't reproduce the same kind of problem with MAGNET-F. I'm not sure why, but the magnet isn't an ordinary container. That much I can see.

Also, it seems that some of these problems may have been at least considered, because ITAKE has a special case for the envelope to keep you from taking it while McGinty is nearby.